ocs init
This commit is contained in:
39
plat/xapp/src/capp/cap_coding.h
Normal file
39
plat/xapp/src/capp/cap_coding.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* CAP message coding/decoding head file */
|
||||
/* Written by Liu Zhiguo 2003-08-26 */
|
||||
/* Version 1.0 */
|
||||
/* ------------------------------------- */
|
||||
|
||||
#ifndef _CAP_CODING
|
||||
#define _CAP_CODING
|
||||
|
||||
#ifndef _SRF_RELEVANT
|
||||
#define _SRF_RELEVANT
|
||||
#endif
|
||||
|
||||
int encSubscriberState(u_char sel, char *tagprefix, CapSubscriberState arg, ASN_BUF * asnbuf);
|
||||
int decSubscriberState(char *tagprefix, CapSubscriberState * parg, ASN_BUF * asnbuf);
|
||||
int encExt_BasicServiceCode(u_char sel, char *tagprefix, CapExt_BasicServiceCode arg, ASN_BUF * asnbuf);
|
||||
int decExt_BasicServiceCode(char *tagprefix, CapExt_BasicServiceCode * parg, ASN_BUF * asnbuf);
|
||||
int encLocationInformation(char *tagprefix, CapLocationInformation arg, ASN_BUF * asnbuf);
|
||||
int decLocationInformation(char *tagprefix, CapLocationInformation * parg, ASN_BUF * asnbuf);
|
||||
int encACBCC(struct CapACBCC arg, char *msgbuf, int maxlen);
|
||||
int decACBCC(char *msgbuf, int msglen, CapACBCC * parg);
|
||||
int encLegID(u_char sel, char *tagprefix, CapLegID arg, ASN_BUF * asnbuf);
|
||||
int decLegID(char *tagprefix, CapLegID * parg, ASN_BUF * asnbuf);
|
||||
int encESIBCSM(char *tagprefix, CapESIBCSM arg, ASN_BUF * asnbuf);
|
||||
int decESIBCSM(char *tagprefix, CapESIBCSM * parg, ASN_BUF * asnbuf);
|
||||
int encLocationInformationGPRS(char *tagprefix, CapLocationInformationGPRS arg, ASN_BUF * asnbuf);
|
||||
int decLocationInformationGPRS(char *tagprefix, CapLocationInformationGPRS * parg, ASN_BUF * asnbuf);
|
||||
int encESISMS(char *tagprefix, CapESISMS arg, ASN_BUF * asnbuf);
|
||||
int decESISMS(char *tagprefix, CapESISMS * parg, ASN_BUF * asnbuf);
|
||||
|
||||
#ifdef _SRF_RELEVANT
|
||||
int encServiceInteractionIndicatorsTwo(char *tagprefix, CapServiceInteractionIndicatorsTwo arg, ASN_BUF * asnbuf);
|
||||
int decServiceInteractionIndicatorsTwo(char *tagprefix, CapServiceInteractionIndicatorsTwo * parg, ASN_BUF * asnbuf);
|
||||
int encInformationToSend(char *tagprefix, CapInformationToSend arg, ASN_BUF * asnbuf);
|
||||
int decInformationToSend(char *tagprefix, CapInformationToSend * parg, ASN_BUF * asnbuf);
|
||||
int encCollectedInfo(char *tagprefix, CapCollectedInfo arg, ASN_BUF * asnbuf);
|
||||
int decCollectedInfo(char *tagprefix, CapCollectedInfo * parg, ASN_BUF * asnbuf);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
151
plat/xapp/src/capp/cap_head.h
Normal file
151
plat/xapp/src/capp/cap_head.h
Normal file
@@ -0,0 +1,151 @@
|
||||
#ifndef _CAP_HEAD
|
||||
#define _CAP_HEAD
|
||||
|
||||
#ifndef _SRF_RELEVANT
|
||||
#define _SRF_RELEVANT
|
||||
#endif
|
||||
|
||||
#define CAP_FLAG 0x8a
|
||||
|
||||
#ifndef MAX_ACN_LEN
|
||||
#define MAX_ACN_LEN TCAP_ACN_LEN
|
||||
#endif
|
||||
|
||||
#define TV_SSF 100
|
||||
#define TV_Wait_Open TV_SSF//1s
|
||||
#define TV_Wait_Continue (TV_SSF * 5)//5s
|
||||
#define TV_Wait_Request (TV_SSF * 10)//10s
|
||||
#define TV_Non_User_Interaction (TV_SSF * 30)//30s
|
||||
#define TV_Reset TV_SSF
|
||||
#define TV_Interaction (TV_SSF * 10)//10s
|
||||
#define TV_TCE 12*(TV_SSF*10)
|
||||
#define TV_Pending (TV_SSF * 1/2)
|
||||
|
||||
#define ONE_SECOND_TICKS TV_SSF
|
||||
#define WTRESPONSE_TIMER (10*ONE_SECOND_TICKS) // 10s
|
||||
#define WTSSF_TIMER (11*ONE_SECOND_TICKS) // 11s
|
||||
|
||||
#define minAChBillingChargingLength 5
|
||||
#define maxAChBillingChargingLength 177
|
||||
#define minAttributesLength 2
|
||||
#define maxAttributesLength 10
|
||||
#define maxBearerCapabilityLength 11
|
||||
#define minCallResultLength 12
|
||||
#define maxCallResultLength 24
|
||||
#define minCalledPartyBCDNumberLength 1
|
||||
#define maxCalledPartyBCDNumberLength 41
|
||||
#define minCalledPartyNumberLength 3
|
||||
#define maxCalledPartyNumberLength 12
|
||||
#define minCallingPartyNumberLength 2
|
||||
#define maxCallingPartyNumberLength 10
|
||||
#define minCauseLength 2
|
||||
#define maxCauseLength 2
|
||||
#define minDigitsLength 2
|
||||
#define maxDigitsLength 16
|
||||
#define minFCIBillingChargingDataLength 1
|
||||
#define maxFCIBillingChargingDataLength 40
|
||||
#define minFCIBillingChargingLength 5
|
||||
#define maxFCIBillingChargingLength 49
|
||||
#define minGenericNumberLength 3
|
||||
#define maxGenericNumberLength 11
|
||||
#define minIPSSPCapabilitiesLength 1
|
||||
#define maxIPSSPCapabilitiesLength 4
|
||||
#define minLocationNumberLength 2
|
||||
#define maxLocationNumberLength 10
|
||||
#define minMessageContentLength 1
|
||||
#define maxMessageContentLength 127
|
||||
#define minOriginalCalledPartyIDLength 2
|
||||
#define maxOriginalCalledPartyIDLength 10
|
||||
#define minRedirectingPartyIDLength 2
|
||||
#define maxRedirectingPartyIDLength 10
|
||||
#define minScfIDLength 2
|
||||
#define maxScfIDLength 10
|
||||
#define minSCIBillingChargingLength 4
|
||||
#define maxSCIBillingChargingLength 69
|
||||
#define minTimeAndTimezoneLength 8
|
||||
#define maxTimeAndTimezoneLength 8
|
||||
#define numOfBCSMEvents 10
|
||||
#define numOfExtensions 10
|
||||
#define numOfGenericNumbers 5
|
||||
#define numOfInfoItems 4
|
||||
#define numOfMessageIDs 5
|
||||
|
||||
#define maxIMSILength 8
|
||||
#define maxISDNAddressLength 9
|
||||
#define maxcallReferenceNumberLength 8
|
||||
#define numOfSMSEvents 10
|
||||
#define MAX_EDP_NUM (18+1)
|
||||
#define MAX_DP_NUM 32
|
||||
#define CAP_CONTENT_LEN 256
|
||||
|
||||
//Operation Code
|
||||
#define CAP_MSG_TYPE CAP_FLAG
|
||||
|
||||
#define CAP_O_OPEN 0xff
|
||||
#define CAP_O_END 0xfe
|
||||
#define CAP_O_UABORT 0xfd
|
||||
#define CAP_O_PABORT 0xfc
|
||||
#define CAP_O_NOTICE 0xfb
|
||||
#define CAP_O_DELIMETER 0xfa
|
||||
#define CAP_O_ERROR 0xf0
|
||||
#define CAP_O_LINK 0xef
|
||||
#define CAP_O_REFUSE_AC 0xE0
|
||||
#define CAP_O_AC_ERROR 0xE1
|
||||
#define CAP_OC_Release 0xfe
|
||||
#define CAP_OC_Error 0xf0
|
||||
|
||||
#define CAP_OC_InitialDP 0
|
||||
#define CAP_OC_AssistRequestInstructions 16
|
||||
#define CAP_OC_EstablishTemporaryConnection 17
|
||||
#define CAP_OC_DisconnectForwardConnection 18
|
||||
#define CAP_OC_ConnectToResource 19
|
||||
#define CAP_OC_Connect 20
|
||||
#define CAP_OC_ReleaseCall 22
|
||||
#define CAP_OC_RequestReportBCSMEvent 23
|
||||
#define CAP_OC_EventReportBCSM 24
|
||||
#define CAP_OC_Continue 31
|
||||
#define CAP_OC_ResetTimer 33
|
||||
#define CAP_OC_FurnishChargingInformation 34
|
||||
#define CAP_OC_ApplyCharging 35
|
||||
#define CAP_OC_ApplyChargingReport 36
|
||||
#define CAP_OC_CallInformationReport 44
|
||||
#define CAP_OC_CallInformationRequest 45
|
||||
#define CAP_OC_SendChargingInformation 46
|
||||
#define CAP_OC_PlayAnnouncement 47
|
||||
#define CAP_OC_PromptAndCollectUserInformation 48
|
||||
#define CAP_OC_SpecializedResourceReport 49
|
||||
#define CAP_OC_Cancel 53
|
||||
#define CAP_OC_ActivityTest 55
|
||||
#define CAP_OC_ApplyWarningTone 128 //self define
|
||||
#define CAP_OC_CCF_Continue 129 //self define
|
||||
|
||||
#define CAP_OC_InitialDPSMS 60
|
||||
#define CAP_OC_FurnishChargingInformationSMS 61
|
||||
#define CAP_OC_ConnectSMS 62
|
||||
#define CAP_OC_RequestReportSMSEvent 63
|
||||
#define CAP_OC_EventReportSMS 64
|
||||
#define CAP_OC_ContinueSMS 65
|
||||
#define CAP_OC_ReleaseSMS 66
|
||||
#define CAP_OC_ResetTimerSMS 67
|
||||
|
||||
#ifdef _SRF_RELEVANT
|
||||
//CAP Operation Type
|
||||
#define CAP_REQUEST 0x01
|
||||
#define CAP_INDICATE 0x02
|
||||
#define CAP_RESPONSE 0x03
|
||||
#define CAP_CONFIRM 0x04
|
||||
#endif
|
||||
|
||||
/* defined for VPS interface */
|
||||
#define CAP_OC_VPSOprRequest 0xb0
|
||||
#ifndef _SRF_RELEVANT
|
||||
#define CAP_OC_PlayAnnouncement 0xb1
|
||||
#endif
|
||||
|
||||
#define maxVPSCallingLen 8
|
||||
#define maxVPSCalledLen 16
|
||||
#define maxVPSInfoLen 64
|
||||
|
||||
#define CAP_ACN_VPSREQUEST 0x80
|
||||
|
||||
#endif
|
||||
1520
plat/xapp/src/capp/cap_msg.c
Normal file
1520
plat/xapp/src/capp/cap_msg.c
Normal file
File diff suppressed because it is too large
Load Diff
876
plat/xapp/src/capp/cap_msg.h
Normal file
876
plat/xapp/src/capp/cap_msg.h
Normal file
@@ -0,0 +1,876 @@
|
||||
|
||||
/************************************************/
|
||||
/*Title: smsmsg.h */
|
||||
/*Descr: CAP-DataTypes(ETSI TS 101046 6.3) */
|
||||
/*Author: Liang Hanxi */
|
||||
/*Create: 2002-9-11 */
|
||||
/*Modify: */
|
||||
|
||||
/************************************************/
|
||||
|
||||
#ifndef _CAP_MESSAGE
|
||||
#define _CAP_MESSAGE
|
||||
|
||||
#ifndef _SRF_RELEVANT
|
||||
#define _SRF_RELEVANT
|
||||
#endif
|
||||
|
||||
#define check_bit(flag,pos) ((flag & (1<<pos))==(1<<pos))
|
||||
#define set_bit(flag,pos) (flag=flag | (1<<pos))
|
||||
|
||||
enum _CAP_ERROR
|
||||
{
|
||||
CAP_ERR_TIMEOUT = 0x80,
|
||||
CAP_ERR_CANCELED = 0,
|
||||
CAP_ERR_CANCEL_FAILED = 1,
|
||||
CAP_ERR_ETC_FAILED = 3,
|
||||
CAP_ERR_IMPROPER_CALLER_RESPONSE = 4,
|
||||
CAP_ERR_MISSING_CUSTOMER_RECORD = 6,
|
||||
CAP_ERR_MISSING_PARAMETER = 7,
|
||||
CAP_ERR_PARAMETER_OUT_OF_RANGE = 8,
|
||||
CAP_ERR_REQUESTED_INFO_ERROR = 10,
|
||||
CAP_ERR_SYSTEM_FAILURE = 11,
|
||||
CAP_ERR_TASK_REFUSED = 12,
|
||||
CAP_ERR_UNAVAILABLE_RESOURCE = 13,
|
||||
CAP_ERR_UNEXPECTED_COMPONENT_SEQ = 14,
|
||||
CAP_ERR_UNEXPECTED_DATA_VALUE = 15,
|
||||
CAP_ERR_UNEXPECTED_PARAMETER = 16,
|
||||
CAP_ERR_UNKNOWN_LEGID = 17,
|
||||
};
|
||||
//CAP_ERROR;
|
||||
|
||||
enum _CAP_CAUSE
|
||||
{
|
||||
UNALLOCATED_NUMBER = 0x8081,
|
||||
NO_ROUTE = 0x8083,
|
||||
NORMAL_CLEARING = 0x8090,
|
||||
USER_BUSY = 0x8091,
|
||||
NO_USER_RESPONDING = 0x8092,
|
||||
NO_ANSWER = 0x8093,
|
||||
CALL_REJECTED = 0x8095,
|
||||
NUMBER_CHANGED = 0x8096,
|
||||
DESTINATION_OUT_OF_ORDER = 0x809B,
|
||||
ADDRESS_INCOMPLETE = 0x809C,
|
||||
FACILITY_REJECTED = 0x809D,
|
||||
NORMAL_UNSPECIFIED = 0x809F,
|
||||
NO_CIRCUIT_AVAILABLE = 0x80A2,
|
||||
NETWORK_OUT_OF_ORDER = 0x80A6,
|
||||
TEMPORARY_FAILURE = 0x80A9,
|
||||
SWITCHING_EQUIPMENT_CONGESTION = 0x80AA,
|
||||
REQUESTED_CHANNEL_NOT_AVAILBALE = 0x80AC,
|
||||
RESOURCE_UNAVAILABLE = 0x80AF,
|
||||
INCOMING_CALLS_BARRED = 0x80B3,
|
||||
BEARER_CAPABILITY_NOT_AUTHORIZED = 0x80B5,
|
||||
BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE = 0x80B6,
|
||||
SERVICE_NOT_AVAILABLE = 0x80BF,
|
||||
BEARER_CAPABILITY_NOT_IMPLEMENTED = 0x80C1,
|
||||
SERVICE_NOT_IMPLEMENTED = 0x80CF,
|
||||
USER_NOT_MEMBER_OF_CUG = 0x80D3,
|
||||
IMCOMPATIBLE_DESTINATION = 0x80D4,
|
||||
INVALID_MESSAGE = 0x80DF,
|
||||
RECOVERY_ON_TIMER_EXPIRY = 0x80E6,
|
||||
PROTOCOL_ERROR = 0x80EF,
|
||||
INTERWORKING_UNSPECIFIED = 0x80FF,
|
||||
};
|
||||
//CAP_CAUSE;
|
||||
|
||||
/*************************************/
|
||||
/*InitialDP-------------------------> */
|
||||
|
||||
/*************************************/
|
||||
typedef enum CapEventTypeBCSM
|
||||
{
|
||||
capp_collectedInfo = 2,
|
||||
capp_routeSelectFailure = 4,
|
||||
capp_oBusy = 5,
|
||||
capp_oCalledPartyBusy = 5,
|
||||
capp_oNoAnswer = 6,
|
||||
capp_oAnswer = 7,
|
||||
capp_oDisconnect = 9,
|
||||
capp_oAbandon = 10,
|
||||
capp_termAttemptAuthorized = 12,
|
||||
capp_tBusy = 13,
|
||||
capp_tNoAnswer = 14,
|
||||
capp_tAnswer = 15,
|
||||
capp_tDisconnect = 17,
|
||||
capp_tAbandon = 18,
|
||||
//self define==>
|
||||
Int_Rel = 24,
|
||||
capp_activetest = 25,
|
||||
Int_TCE = 26,
|
||||
Int_ETC_Failed = 27,
|
||||
Int_TC_Released = 28,
|
||||
Int_SRFConnected = 29,
|
||||
Int_CTR_Failed = 30,
|
||||
Int_SRFReleased = 31
|
||||
}
|
||||
CapEventTypeBCSM;
|
||||
|
||||
typedef enum CapNotReachableReason
|
||||
{
|
||||
capp_msPurged = 0,
|
||||
capp_imsiDetached = 1,
|
||||
capp_restrictedArea = 2,
|
||||
capp_notRegistered = 3
|
||||
}
|
||||
CapNotReachableReason;
|
||||
|
||||
typedef enum CapCriticalityType
|
||||
{
|
||||
capp_ignore = 0,
|
||||
capp_abort = 1
|
||||
}
|
||||
CapCriticalityType;
|
||||
|
||||
typedef union CapBearerCapability
|
||||
{ //CAP-DataTypes
|
||||
u8 bearerCap[maxBearerCapabilityLength + 1];
|
||||
}
|
||||
CapBearerCapability;
|
||||
|
||||
typedef struct CapExtensionField
|
||||
{ //CAP-DataTypes
|
||||
u32 type;
|
||||
CapCriticalityType criticality;
|
||||
u8 *value;
|
||||
}
|
||||
CapExtensionField;
|
||||
|
||||
typedef union CapSubscriberState
|
||||
{ //MAP-MS-DataTypes
|
||||
u8 assumedIdle;
|
||||
u8 camelBusy;
|
||||
CapNotReachableReason netDetNotReachable;
|
||||
u8 notProvidedFromVLR;
|
||||
}
|
||||
CapSubscriberState;
|
||||
|
||||
typedef union CapCellIdOrLAI
|
||||
{ //MAP-CH-DataTypes
|
||||
u8 cellIdFixedLength[7 + 1];
|
||||
u8 laiFixedLength[5 + 1];
|
||||
}
|
||||
CapCellIdOrLAI;
|
||||
|
||||
typedef struct CapLocationInformation
|
||||
{ //MAP-MS-DataTypes
|
||||
u32 optional_flag;
|
||||
int ageOfLocationInformation;
|
||||
u8 geographicalInformation[8 + 1];
|
||||
u8 vlr_number[maxISDNAddressLength + 1];
|
||||
u8 locationNumber[maxLocationNumberLength + 1];
|
||||
u8 cellIdOrLAI_ch;
|
||||
CapCellIdOrLAI cellIdOrLAI;
|
||||
}
|
||||
CapLocationInformation;
|
||||
|
||||
typedef union CapExt_BasicServiceCode
|
||||
{ //MAP-CommonDataTypes
|
||||
u8 ext_BearerService[5 + 1];
|
||||
u8 ext_Teleservice[5 + 1];
|
||||
}
|
||||
CapExt_BasicServiceCode;
|
||||
|
||||
typedef struct CapNACarrierInformation
|
||||
{ //CAP-DataTypes
|
||||
u8 naCarrierId[3 + 1];
|
||||
u8 naCICSelectionType;
|
||||
}
|
||||
CapNACarrierInformation;
|
||||
|
||||
typedef struct CapInitialDPArgExtension
|
||||
{
|
||||
u32 optional_flag;
|
||||
CapNACarrierInformation naCarrierInformation;
|
||||
u8 gmscAddress[9 + 1];
|
||||
}
|
||||
CapInitialDPArgExtension;
|
||||
|
||||
typedef struct CapInitialDP //V1 GSM 09.78 18 TS 101 046 V5.0.1 Page 19 //GSM 09.78 version 7.1.0 (2000-07) Page 37
|
||||
{
|
||||
int serviceKey; /*tag 0 */
|
||||
u32 optional_flag;
|
||||
u8 calledPartyNumber[maxCalledPartyNumberLength + 1]; /*Version 1 0[0x01],2 *//*Version 2 *//*0 */
|
||||
u8 callingPartyNumber[maxCallingPartyNumberLength + 1]; /*Version 1 1[0x02],3 *//*Version 2 *//*1 */
|
||||
u8 callingPartysCategory; /*Version 1 2[0x04],5 *//*Version 2 *//*2 */
|
||||
u8 iPSSPCapabilities[maxIPSSPCapabilitiesLength + 1]; /*Version 2 *//*3 */
|
||||
u8 locationNumber[maxLocationNumberLength + 1]; /*Version 1 3[0x08],10 *//*Version 2 *//*4 */
|
||||
u8 originalCalledPartyID[maxOriginalCalledPartyIDLength + 1]; /*Version 1 4[0x10],12 *//*Version 2 *//*5 */
|
||||
// CapExtensionField extensions[numOfExtensions]; /*Version 1 5[0x20],15*/ /*Version 2*//*6*/
|
||||
u8 highLayerCompatibility[2 + 1]; /*Version 1 6[0x40],23 *//*Version 2 *//*7 */
|
||||
u8 additionalCallingPartyNumber[maxDigitsLength + 1]; /*Version 1 7[0x80],25 *//*Version 2 *//*8 */
|
||||
CapBearerCapability bearerCapability; /*Version 1 8[0x100],27 *//*Version 2 *//*9 */
|
||||
CapEventTypeBCSM eventTypeBCSM; /*Version 1 9[0x200],28 *//*Version 2 *//*10 */
|
||||
u8 redirectingPartyID[maxRedirectingPartyIDLength + 1]; /*Version 1 10[0x400],29 *//*Version 2 *//*11 */
|
||||
u8 redirectionInformation[2 + 1]; /*Version 1 11[0x800],30 *//*Version 2 *//*12 */
|
||||
u8 iMSI[maxIMSILength + 1]; /*Version 1 12[0x1000],50 *//*Version 2 *//*13 */
|
||||
u8 subscriberState_ch;
|
||||
CapSubscriberState subscriberState; /*Version 1 13[0x2000],51 *//*Version 2 *//*14 */
|
||||
CapLocationInformation locationInformation; /*Version 1 14[0x4000],52 *//*Version 2 *//*15 */
|
||||
u8 ext_basicServiceCode_ch;
|
||||
CapExt_BasicServiceCode ext_basicServiceCode; /*Version 1 15[0x8000],53 *//*Version 2 *//*16 */
|
||||
u8 callReferenceNumber[maxcallReferenceNumberLength + 1]; /*Version 1 16[0x10000],54 *//*Version 2 *//*17 */
|
||||
|
||||
u8 mscAddress[maxISDNAddressLength + 1]; /*Version 2 *//*18 */
|
||||
u8 calledPartyBCDNumber[maxCalledPartyBCDNumberLength + 1]; /*Version 2 *//*19 */
|
||||
u8 timeAndTimezone[maxTimeAndTimezoneLength + 1]; /*Version 2 *//*20 */
|
||||
u8 gsm_ForwardingPending; /*Version 2 *//*21 */
|
||||
CapInitialDPArgExtension initialDPArgExtension; /*Version 2 *//*22 */
|
||||
}
|
||||
CapInitialDP, *PCapInitialDP;
|
||||
|
||||
/*++++++++++++++++++++++++++ */
|
||||
/*Cancel--------------> */
|
||||
/*++++++++++++++++++++++++++ */
|
||||
typedef struct CapCancel
|
||||
{
|
||||
u8 ch; //ch=0:invokeID;ch=1:allRequest
|
||||
u8 invokeID; //ch=0
|
||||
u8 allRequest; //ch=1
|
||||
}
|
||||
CapCancel, *PCapCancel;
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++ */
|
||||
/*ApplyCharging--------------> */
|
||||
/*++++++++++++++++++++++++++++++++++++++ */
|
||||
typedef struct CapReleaseIfDurationExceeded
|
||||
{
|
||||
u8 tone;
|
||||
}
|
||||
CapReleaseIfDurationExceeded;
|
||||
|
||||
typedef struct CapACBCC
|
||||
{ //aChbillingChargingCharacteristics
|
||||
int maxCallPeriodDuration;
|
||||
u32 optional_flag;
|
||||
CapReleaseIfDurationExceeded releaseIfdurationExceeded; /*0 */
|
||||
int tariffSwitchInterval; /*1 */
|
||||
}
|
||||
CapACBCC;
|
||||
|
||||
typedef struct CapApplyCharging
|
||||
{
|
||||
u8 partyToCharge;
|
||||
CapACBCC ACBCC;
|
||||
}
|
||||
CapApplyCharging, *PCapApplyCharging;
|
||||
|
||||
/*************************************/
|
||||
/*Apply Charging Report-------------> */
|
||||
|
||||
/*************************************/
|
||||
typedef struct CapTimeIfTariffSwitch
|
||||
{
|
||||
int timeSinceTariffSwitch;
|
||||
int tariffSwitchInterval;
|
||||
}
|
||||
CapTimeIfTariffSwitch;
|
||||
|
||||
typedef union CAP_TimeInformation
|
||||
{
|
||||
int timeIfNoTariffSwitch;
|
||||
CapTimeIfTariffSwitch timeIfTariffSwitch;
|
||||
}
|
||||
CapTimeInformation;
|
||||
|
||||
typedef struct CAMEL_CallResult
|
||||
{
|
||||
u8 partyToCharge;
|
||||
u8 timeInformation_ch;
|
||||
CapTimeInformation timeInformation;
|
||||
u8 callActive;
|
||||
}
|
||||
CAMEL_CallResult;
|
||||
|
||||
typedef CAMEL_CallResult CapApplyChargingReport;
|
||||
typedef CAMEL_CallResult *PCapApplyChargingReport;
|
||||
|
||||
/*************************************/
|
||||
/*Request Report BCSM Event---------> */
|
||||
|
||||
/*************************************/
|
||||
typedef enum CapMonitorMode
|
||||
{
|
||||
capp_interrupted = 0,
|
||||
capp_notifyAndContinue = 1,
|
||||
capp_transparent = 2
|
||||
}
|
||||
CapMonitorMode;
|
||||
|
||||
typedef union CapLegID
|
||||
{
|
||||
u8 sendingSideID;
|
||||
u8 receivingSideID;
|
||||
}
|
||||
CapLegID;
|
||||
|
||||
typedef union CapDPSpecificCriteria
|
||||
{
|
||||
int applicationTimer;
|
||||
}
|
||||
CapDPSpecificCriteria;
|
||||
|
||||
typedef struct CapBCSMEvent
|
||||
{
|
||||
CapEventTypeBCSM eventTypeBCSM;
|
||||
CapMonitorMode monitorMode;
|
||||
u32 optional_flag;
|
||||
u8 legID_ch;
|
||||
CapLegID legID;
|
||||
CapDPSpecificCriteria dPSpecificCriteria;
|
||||
}
|
||||
CapBCSMEvent;
|
||||
|
||||
typedef struct CapRequestReportBCSMEvent
|
||||
{
|
||||
u8 bcsmEvents_num;
|
||||
CapBCSMEvent bcsmEvents[numOfBCSMEvents];
|
||||
// ExtensionField extensions[numOfExtensions];
|
||||
}
|
||||
CapRequestReportBCSMEvent, *PCapRequestReportBCSMEvent;
|
||||
|
||||
/*************************************/
|
||||
/*Event Report BCSM-----------------> */
|
||||
|
||||
/*************************************/
|
||||
typedef struct CapESIBCSM
|
||||
{ //EventSpecificInformationBCSM
|
||||
u8 infotype;
|
||||
//2:route select failure
|
||||
//3:oCalledPartyBusy
|
||||
//4:oNoAnswer
|
||||
//5:oAnswer
|
||||
//7:oDisconnect
|
||||
//8:tBusy
|
||||
//9:tNoAnswer
|
||||
//10:tAnswer
|
||||
//12:tDisconnect
|
||||
u8 cause[maxCauseLength + 1];
|
||||
//cause[0] as length,if no cause is provided,cause[0]=0,or cause[0]=maxCauseLength(2)
|
||||
u8 callForwarded;
|
||||
//Boolean value(1/0)
|
||||
}
|
||||
CapESIBCSM;
|
||||
|
||||
typedef union CapMiscCallInfo
|
||||
{
|
||||
enum
|
||||
{
|
||||
capp_request = 0,
|
||||
capp_notification = 1
|
||||
}
|
||||
messageType;
|
||||
}
|
||||
CapMiscCallInfo;
|
||||
|
||||
typedef struct CapEventReportBCSM
|
||||
{
|
||||
CapEventTypeBCSM eventTypeBCSM;
|
||||
u_int optional_flag;
|
||||
u8 legID; /*0 */
|
||||
CapESIBCSM eventSpecificInformationBCSM; /*1 */
|
||||
CapMiscCallInfo miscCallInfo; /*2 */
|
||||
}
|
||||
CapEventReportBCSM, *PCapEventReportBCSM;
|
||||
|
||||
/*************************************/
|
||||
/*Furnish Charging Information------> */
|
||||
|
||||
/*************************************/
|
||||
//FCIBCC<==>FCIBillingChargingCharacteristics
|
||||
typedef struct CAP_CAMEL_FCIBCC
|
||||
{
|
||||
u8 freeFormatData[maxFCIBillingChargingDataLength];
|
||||
u8 partyToCharge;
|
||||
}
|
||||
CAMEL_FCIBCC;
|
||||
|
||||
//CAMEL_FCIBCC FurnishChargingInformationArg;
|
||||
|
||||
/*************************************/
|
||||
/*ReleaseCall-----------------------> */
|
||||
|
||||
/*************************************/
|
||||
typedef struct CapReleaseCall
|
||||
{
|
||||
u8 cause[maxCauseLength + 1];
|
||||
}
|
||||
CapReleaseCall, *PCapReleaseCall;
|
||||
|
||||
/*************************************/
|
||||
/*InitialDPSMS----------------------> */
|
||||
|
||||
/*************************************/
|
||||
typedef enum CapEventTypeSMS
|
||||
{
|
||||
capp_smsCollectedInfo = 1,
|
||||
capp_osmsFailure = 2,
|
||||
capp_osmsSubmitted = 3,
|
||||
}
|
||||
CapEventTypeSMS;
|
||||
|
||||
typedef struct CapLocationInformationGPRS
|
||||
{ //MAP-MS-DataTypes
|
||||
u32 optional_flag;
|
||||
u8 cellGlobalIdOrServiceAreaIdOrLAI[7 + 1];
|
||||
u8 routeingAreaIdentity[7 + 1];
|
||||
u8 geographicalInformation[8 + 1];
|
||||
u8 sgsn_Number[maxISDNAddressLength + 1];
|
||||
u8 selectedLSAIdentity[3 + 1];
|
||||
u8 sai_Present;
|
||||
}
|
||||
CapLocationInformationGPRS;
|
||||
|
||||
typedef struct CapInitialDPSMS
|
||||
{
|
||||
int serviceKey;
|
||||
u32 optional_flag;
|
||||
u8 destinationSubscriberNumber[maxCalledPartyBCDNumberLength + 1]; /*0 */
|
||||
u8 callingPartyNumber[maxISDNAddressLength + 1]; /*1 */
|
||||
CapEventTypeSMS eventTypeSMS; /*2 */
|
||||
u8 iMSI[maxIMSILength + 1]; /*3 */
|
||||
CapLocationInformation locationInformation; /*4 */
|
||||
CapLocationInformationGPRS locationInformationGPRS; /*5 */
|
||||
u8 sMSCAddress[maxISDNAddressLength + 1]; /*6 */
|
||||
u8 timeAndTimezone[maxTimeAndTimezoneLength + 1]; /*7 */
|
||||
u8 tPShortMessageSubmissionInfo; /*8 */
|
||||
u8 tPProtocolIdentifier; /*9 */
|
||||
u8 tPDataCodingScheme; /*10 */
|
||||
u8 tPValidityPeriod[7 + 1]; /*11 */
|
||||
}
|
||||
CapInitialDPSMS, *PCapInitialDPSMS;
|
||||
|
||||
/*************************************/
|
||||
/*Request Report SMS Event---------> */
|
||||
|
||||
/*************************************/
|
||||
typedef struct CapSMSEvent
|
||||
{
|
||||
CapEventTypeSMS eventTypeSMS;
|
||||
CapMonitorMode monitorMode;
|
||||
}
|
||||
CapSMSEvent;
|
||||
|
||||
typedef struct CapRequestReportSMSEvent
|
||||
{
|
||||
u8 sMSEvents_num;
|
||||
CapSMSEvent sMSEvents[numOfSMSEvents];
|
||||
}
|
||||
CapRequestReportSMSEvent, *PCapRequestReportSMSEvent;
|
||||
|
||||
/*************************************/
|
||||
/*Event Report SMS------------------> */
|
||||
|
||||
/*************************************/
|
||||
typedef enum CapSMSCause
|
||||
{
|
||||
capp_systemFailure = 0,
|
||||
capp_unexpectedDataValue = 1,
|
||||
capp_facilityNotSupported = 2,
|
||||
capp_sMDeliveryFailure = 3,
|
||||
releaseFromRadioInterface = 4,
|
||||
}
|
||||
CapSMSCause;
|
||||
|
||||
typedef struct CapESISMS
|
||||
{ //EventSpecificInformationSMS
|
||||
u8 infotype; //0:o-smsFailureSpecificInfo 1:o-smsSubmittedSpecificInfo
|
||||
u8 cause_flag;
|
||||
CapSMSCause cause;
|
||||
}
|
||||
CapESISMS;
|
||||
|
||||
typedef struct CapEventReportSMS
|
||||
{
|
||||
CapEventTypeSMS eventTypeSMS;
|
||||
u32 optional_flag;
|
||||
CapESISMS eventSpecificInformationSMS; /*0 */
|
||||
CapMiscCallInfo miscCallInfo; /*1 */
|
||||
}
|
||||
CapEventReportSMS, *PCapEventReportSMS;
|
||||
|
||||
/*************************************/
|
||||
/*ReleaseSMS------------------------> */
|
||||
|
||||
/*************************************/
|
||||
typedef struct CapReleaseSMS
|
||||
{
|
||||
u8 cause;
|
||||
}
|
||||
CapReleaseSMS, *PCapReleaseSMS;
|
||||
|
||||
/*************************************/
|
||||
/*ResetTimerSMS------> */
|
||||
|
||||
/*************************************/
|
||||
typedef enum CapTimerID
|
||||
{
|
||||
Cap_Tssf = 0,
|
||||
}
|
||||
CapTimerID;
|
||||
|
||||
typedef struct CapResetTimerSMS
|
||||
{
|
||||
CapTimerID timerID;
|
||||
u_int timerValue;
|
||||
}
|
||||
CapResetTimerSMS;
|
||||
|
||||
typedef struct CapVPSRequest
|
||||
{
|
||||
u8 calling_num[maxVPSCallingLen];
|
||||
u8 called_num[maxVPSCalledLen];
|
||||
}
|
||||
CapVPSRequest;
|
||||
|
||||
typedef struct CapVPSPlayAnnounce
|
||||
{
|
||||
u8 info_len;
|
||||
u8 send_info[maxVPSInfoLen];
|
||||
}
|
||||
CapVPSPlayAnnounce;
|
||||
|
||||
/******************************************/
|
||||
|
||||
/************** SRF Relevant **************/
|
||||
|
||||
/******************************************/
|
||||
#ifdef _SRF_RELEVANT
|
||||
|
||||
/************************/
|
||||
|
||||
/** Common Data Type **/
|
||||
|
||||
/************************/
|
||||
#if 0
|
||||
typedef struct CapNACarrierInformation
|
||||
{
|
||||
u32 optional_flag;
|
||||
u8 naCarrierId[3]; /*0 */
|
||||
u8 naCICSelectionType; /*1 */
|
||||
}
|
||||
CapNACarrierInformation;
|
||||
|
||||
typedef struct CapNA_Info
|
||||
{
|
||||
u32 optional_flag;
|
||||
CapNACarrierInformation naCarrierInformation; /*0 */
|
||||
u8 naOliInfo; /*1 */
|
||||
u8 naChargeNumber[7 + 1]; /*2 */
|
||||
}
|
||||
CapNA_Info;
|
||||
|
||||
typedef struct CapResourceAddress
|
||||
{
|
||||
u8 choice_id;
|
||||
u8 ipRoutingAddress[maxCalledPartyNumberLength + 1]; /*0,0 */
|
||||
u8 none; /*1,3 */
|
||||
}
|
||||
CapResourceAddress;
|
||||
#endif
|
||||
|
||||
typedef struct CapServiceInteractionIndicatorsTwo
|
||||
{
|
||||
u32 optional_flag;
|
||||
u8 bothwayThroughConnectionInd; /*0,2 */
|
||||
}
|
||||
CapServiceInteractionIndicatorsTwo;
|
||||
|
||||
typedef struct CapVariablePart
|
||||
{
|
||||
u32 choice_id;
|
||||
u32 integer; /*0,0 */
|
||||
u8 number[maxDigitsLength + 1]; /*1,1 */
|
||||
u8 time[2]; /*2,2 */
|
||||
u8 date[4]; /*3,3 */
|
||||
u8 price[4]; /*4,4 */
|
||||
u8 signSymbol; /*5,,5*/
|
||||
}
|
||||
CapVariablePart;
|
||||
|
||||
#define MAX_VAR_NUMS 10
|
||||
|
||||
typedef struct CapMessageID
|
||||
{
|
||||
u8 choice_id;
|
||||
u32 elementaryMessageID; /*0,0 */
|
||||
// text /*1,1*/
|
||||
struct CapElementaryMessageIDs
|
||||
{
|
||||
u8 num;
|
||||
u32 elementaryMessageID[numOfMessageIDs];
|
||||
}
|
||||
elementaryMessageIDs; /*2,29 */
|
||||
struct CapVariableMessage
|
||||
{
|
||||
|
||||
u32 elementaryMessageID; /*-,0*/
|
||||
struct CapVariableParts
|
||||
{
|
||||
u8 num;
|
||||
CapVariablePart variablePart[MAX_VAR_NUMS];
|
||||
}
|
||||
|
||||
variableParts; /*-,1*/
|
||||
}
|
||||
variableMessage; /*3,30 */
|
||||
}
|
||||
CapMessageID;
|
||||
|
||||
typedef struct CapInbandInfo
|
||||
{
|
||||
|
||||
CapMessageID messageID; /*-,0*/
|
||||
u32 optional_flag;
|
||||
int numberOfRepetitions; /*0,1 */
|
||||
int duration; /*1,2 */
|
||||
int interval; /*2,3 */
|
||||
}
|
||||
CapInbandInfo;
|
||||
|
||||
typedef struct CapTone
|
||||
{
|
||||
|
||||
u32 toneID; /*-,0*/
|
||||
u32 optional_flag;
|
||||
u32 duration; /*0,1 */
|
||||
}
|
||||
CapTone;
|
||||
|
||||
typedef struct CapInformationToSend
|
||||
{
|
||||
u8 choice_id;
|
||||
CapInbandInfo inbandInfo; /*0,0 */
|
||||
CapTone tone; /*1,1 */
|
||||
}
|
||||
CapInformationToSend;
|
||||
|
||||
typedef enum CapErrorTreatment
|
||||
{
|
||||
stdErrorAndInfo = 0,
|
||||
help = 1,
|
||||
repeatPrompt = 2,
|
||||
}
|
||||
CapErrorTreatment;
|
||||
|
||||
typedef struct CapCollectedDigits
|
||||
{
|
||||
|
||||
u8 minimumNbOfDigits; /*-,0*/
|
||||
|
||||
u8 maximumNbOfDigits; /*-,1*/
|
||||
u32 optional_flag;
|
||||
u8 endOfReplyDigit[2 + 1]; /*0,2 */
|
||||
u8 cancelDigit[2 + 1]; /*1,3 */
|
||||
u8 startDigit[2 + 1]; /*2,4 */
|
||||
u8 firstDigitTimeOut; /*3,5 */
|
||||
u8 interDigitTimeOut; /*4,6 */
|
||||
CapErrorTreatment errorTreatment; /*5,7 */
|
||||
u8 interruptableAnnInd; /*6,8 */
|
||||
u8 voiceInformation; /*7,9 */
|
||||
u8 voiceBack; /*8,10 */
|
||||
}
|
||||
CapCollectedDigits;
|
||||
|
||||
typedef struct CapCollectedInfo
|
||||
{
|
||||
u8 choice_id;
|
||||
CapCollectedDigits collectedDigits; /*0,0 */
|
||||
}
|
||||
CapCollectedInfo;
|
||||
|
||||
/************************/
|
||||
|
||||
/** Argument Data Type **/
|
||||
|
||||
/************************/
|
||||
typedef struct CapAssistRequestInstructions
|
||||
{
|
||||
|
||||
u8 correlationID[maxDigitsLength + 1]; /*-,0*/
|
||||
|
||||
u8 iPSSPCapabilities[maxIPSSPCapabilitiesLength + 1]; /*-,2*/
|
||||
}
|
||||
CapAssistRequestInstructions, *PCapAssistRequestInstructions;
|
||||
|
||||
typedef struct CapConnect
|
||||
{
|
||||
u8 destinationRoutingAddress[maxCalledPartyNumberLength + 1]; /*-,0*/
|
||||
u32 optional_flag;
|
||||
u8 alertingPattern[3]; /*Versinon2 0[0x01],1 */
|
||||
u8 originalCalledPartyID[maxOriginalCalledPartyIDLength + 1]; /*Versinon 1 0[0x01],6 *//*Versinon2 1[0x02],6 */
|
||||
// CapExtensionField extensions[numOfExtensions]; /*Versinon 1 1[0x02],10*/ /*Versinon2 2[0x04],10*/
|
||||
u8 callingPartysCategory; /*Versinon 1 4[0x10],28 *//*Versinon2 3[0x08],28 */
|
||||
u8 redirectingPartyID[maxRedirectingPartyIDLength + 1]; /*Versinon 1 5[0x20],29 *//*Versinon2 4[0x10],29 */
|
||||
u8 redirectionInformation[2 + 1]; /*Versinon 1 6[0x40],30 *//*Versinon2 5[0x20],30 */
|
||||
struct
|
||||
{
|
||||
u8 num;
|
||||
u8 genericNumber[numOfGenericNumbers][maxGenericNumberLength + 1];
|
||||
}
|
||||
genericNumbers; /*Versinon2 6[0x40],14 */
|
||||
u8 suppressionOfAnnouncement; /*Versinon 1 7[0x80],55 *//*Versinon2 7[0x80],14 */
|
||||
u8 oCSIApplicable; /*Versinon 1 8[0x100],56 *//*Versinon2 8[0x100],14 */
|
||||
//CapNA_Info na_Info;
|
||||
struct
|
||||
{
|
||||
u8 callingpartyNmuber_len;
|
||||
u8 callingPartyNumber[maxCallingPartyNumberLength]; /*Versinon 1 3[0x08],27 */
|
||||
}
|
||||
callingpartynum; /*Versinon2 9[0x200],57*/
|
||||
}CapConnect, *PCapConnect;
|
||||
|
||||
typedef struct CapConnectToResource
|
||||
{
|
||||
// CapResourceAddress resourceAddress;
|
||||
struct
|
||||
{
|
||||
u8 choice_id;
|
||||
u8 ipRoutingAddress[maxCalledPartyNumberLength + 1]; /*0,0 */
|
||||
u8 none; /*1,3 */
|
||||
}
|
||||
resourceAddress;
|
||||
u32 optional_flag;
|
||||
// CapExtensionField extensions[numOfExtensions]; /*0,4*/
|
||||
CapServiceInteractionIndicatorsTwo serviceInteractionIndicatorsTwo; /*1,7 */
|
||||
}
|
||||
CapConnectToResource, *PCapConnectToResource;
|
||||
|
||||
typedef struct CapDisconnectForwardConnection
|
||||
{
|
||||
}
|
||||
CapDisconnectForwardConnection, *PCapDisconnectForwardConnection;
|
||||
|
||||
typedef struct CapEstablishTemporaryConnection
|
||||
{
|
||||
|
||||
u8 assistingSSPIPRoutingAddress[maxDigitsLength + 1]; /*-,0*/
|
||||
u32 optional_flag;
|
||||
u8 correlationID[maxDigitsLength + 1]; /*0,1 */
|
||||
u8 scfID[maxScfIDLength + 1]; /*1,3 */
|
||||
// CapExtensionField extensions[numOfExtensions]; /*2,4*/
|
||||
CapServiceInteractionIndicatorsTwo serviceInteractionIndicatorsTwo; /*3,7 */
|
||||
// CapNA_Info na_Info; /*4,50*/
|
||||
}
|
||||
CapEstablishTemporaryConnection, *PCapEstablishTemporaryConnection;
|
||||
|
||||
typedef struct CapPlayAnnouncement
|
||||
{
|
||||
|
||||
CapInformationToSend informationToSend; /*-,0*/
|
||||
u32 optional_flag;
|
||||
u8 disconnectFromIPForbidden; /*0,1 */
|
||||
u8 requestAnnouncementComplete; /*1,2 */
|
||||
// CapExtensionField extensions[numOfExtensions]; /*2,3*/
|
||||
}
|
||||
CapPlayAnnouncement, *PCapPlayAnnouncement;
|
||||
|
||||
typedef struct CapPromptAndCollectUserInformation
|
||||
{
|
||||
|
||||
CapCollectedInfo collectedInfo; /*-,0*/
|
||||
u32 optional_flag;
|
||||
u8 disconnectFromIPForbidden; /*0,1 */
|
||||
CapInformationToSend informationToSend; /*1,2 */
|
||||
// CapExtensionField extensions[numOfExtensions]; /*2,3*/
|
||||
|
||||
u8 choice_id;
|
||||
|
||||
u8 digitsResponse[maxDigitsLength + 1]; /*-,0*///CapReceivedInformation
|
||||
}
|
||||
CapPromptAndCollectUserInformation, *PCapPromptAndCollectUserInformation;
|
||||
|
||||
/*typedef union CapReceivedInformation
|
||||
{
|
||||
u8 digitsResponse[maxDigitsLength+1];
|
||||
}CapReceivedInformation; */
|
||||
|
||||
typedef struct CapSpecializedResourceReport
|
||||
{
|
||||
}
|
||||
CapSpecializedResourceReport, *PCapSpecializedResourceReport;
|
||||
|
||||
#endif
|
||||
|
||||
/*************************************/
|
||||
/*Cap Structure---------------------> */
|
||||
|
||||
/*************************************/
|
||||
typedef struct CapArg
|
||||
{
|
||||
u8 ocode;
|
||||
u8 message_flag;
|
||||
u16 port_id;
|
||||
u16 dialogue_id;
|
||||
u8 invoke_id;
|
||||
u8 version;
|
||||
union
|
||||
{
|
||||
CapInitialDP initialDPArg;
|
||||
CapApplyCharging applyChargingArg;
|
||||
CapApplyChargingReport applyChargingReportArg;
|
||||
CapRequestReportBCSMEvent requestReportBCSMEventArg;
|
||||
CapCancel cancelArg;
|
||||
CapEventReportBCSM eventReportBCSMArg;
|
||||
CapReleaseCall releaseCallArg;
|
||||
CapInitialDPSMS initialDPSMSArg;
|
||||
CapRequestReportSMSEvent requestReportSMSEventArg;
|
||||
CapEventReportSMS eventReportSMSArg;
|
||||
CapReleaseSMS releaseSMSArg;
|
||||
CapResetTimerSMS resetTimerArg;
|
||||
CapVPSRequest vpsRequest;
|
||||
CapVPSPlayAnnounce vpsPlayAnnounce;
|
||||
CapAssistRequestInstructions assistRequestInstructionsArg;
|
||||
CapConnect connectArg;
|
||||
//CapConnect_v1 connectArg_v1;
|
||||
CapConnectToResource connectToResourceArg;
|
||||
CapDisconnectForwardConnection disconnectForwardConnectionArg;
|
||||
CapEstablishTemporaryConnection establishTemporaryConnectionArg;
|
||||
CapPlayAnnouncement playAnnouncementArg;
|
||||
CapPromptAndCollectUserInformation promptAndCollectUserInformationArg;
|
||||
//CapReceivedInformation receivedInformationArg; // RR of P&C
|
||||
CapSpecializedResourceReport specializedResourceReportArg;
|
||||
}
|
||||
msg_list;
|
||||
}
|
||||
CapArg, *PCapArg;
|
||||
|
||||
/*
|
||||
typedef struct _CAP_Message
|
||||
{
|
||||
u8 msgLength[2]; // u80 is the higher part
|
||||
u8 msgServiceCode; // fixed as 0xAF
|
||||
u8 port_id[3]; // u8 0 is the higher part,u8 1 is the lower part ,and u8 2 is reserved
|
||||
u8 dialogue_id[3];
|
||||
u8 msgOperaCode; // message type code ,e.g , InitialDP = 0x00
|
||||
u8 msgOperaType; // 1/2/3/4 = request, indicate, response, confirm
|
||||
u8 msgContent[CAP_CONTENT_LEN];
|
||||
// if the message if cap operation ,then the first u8 of msgContent is invoke id
|
||||
}CAP_Message, *PCAP_Message;
|
||||
|
||||
typedef struct DestCriteria
|
||||
{
|
||||
u8 DestNumber[maxISDNAddressLength+1];
|
||||
u8 Type; //0:unknown 1:enable 2:inhibit
|
||||
}DestCriteria;
|
||||
|
||||
typedef struct CapCSI
|
||||
{
|
||||
int ServiceKey;
|
||||
u8 SCFAddress[maxISDNAddressLength+1];
|
||||
u8 DefaultHandle; //The Default Call Handling indicates whether the call shall be released or
|
||||
//continued as requested in case of error in the gsmSSF to gsmSCF dialogue.
|
||||
//0:release 1:continue
|
||||
CapEventTypeBCSM TDP; //TDP_R
|
||||
//O-CSI:capp_collectedInfo = 2,
|
||||
//T-CSI:capp_termAttemptAuthorized = 12,
|
||||
u8 DstNum;
|
||||
DestCriteria DstList[10]; //The DP criteria indicate whether the gsmSSF shall request the gsmSCF for instructions.
|
||||
u8 BSNum;
|
||||
u32 BSCode[5]; //Basic service triggering criteria
|
||||
u8 FWCriteria; //Forwarding triggering criteria
|
||||
//1:enabling 0:inhibiting
|
||||
}CapCSI;
|
||||
*/
|
||||
|
||||
#endif
|
||||
1073
plat/xapp/src/capp/cap_msgtype.c
Normal file
1073
plat/xapp/src/capp/cap_msgtype.c
Normal file
File diff suppressed because it is too large
Load Diff
497
plat/xapp/src/capp/cap_public.c
Normal file
497
plat/xapp/src/capp/cap_public.c
Normal file
@@ -0,0 +1,497 @@
|
||||
/* CAP public function c file */
|
||||
/* Written by Liu Zhiguo 2003-08-26 */
|
||||
/* Version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#include "../../../public/src/include/pub_include.h"
|
||||
#include "../../../sccp/src/include/sccp.h"
|
||||
#include "../mapp/map_const.h"
|
||||
#include "../mapp/map_code.h"
|
||||
#include "../mapp/map_struct.h"
|
||||
#include "cap_head.h"
|
||||
|
||||
void cap_get_sccpadd(struct SCCP_ADDRESS *add_ptr, u8 * data)
|
||||
{
|
||||
u8 temp_len;
|
||||
|
||||
add_ptr->ip = (data[0] << 24) + (data[1] << 16) + (data[2] << 8) + data[3];
|
||||
add_ptr->DPC = (data[4] << 24) + (data[5] << 16) + (data[6] << 8) + data[7];
|
||||
add_ptr->NetID = data[8];
|
||||
add_ptr->SSN = data[9];
|
||||
add_ptr->RI = data[10];
|
||||
add_ptr->GTI = data[11];
|
||||
add_ptr->TT = data[12];
|
||||
add_ptr->NP = data[13];
|
||||
add_ptr->ES = data[14];
|
||||
add_ptr->NAI = data[15];
|
||||
add_ptr->len = data[16];
|
||||
temp_len = (data[16] + 1) / 2;
|
||||
memcpy(add_ptr->GTAI, data + 17, temp_len);
|
||||
}
|
||||
|
||||
void cap_set_sccpadd(struct SCCP_ADDRESS *add_ptr, u8 * data)
|
||||
{
|
||||
u8 temp_len;
|
||||
|
||||
data[0] = add_ptr->ip >> 24;
|
||||
data[1] = add_ptr->ip >> 16;
|
||||
data[2] = add_ptr->ip >> 8;
|
||||
data[3] = add_ptr->ip;
|
||||
data[4] = add_ptr->DPC >> 24;
|
||||
data[5] = add_ptr->DPC >> 16;
|
||||
data[6] = add_ptr->DPC >> 8;
|
||||
data[7] = add_ptr->DPC;
|
||||
data[8] = add_ptr->NetID;
|
||||
data[9] = add_ptr->SSN;
|
||||
data[10] = add_ptr->RI;
|
||||
data[11] = add_ptr->GTI;
|
||||
data[12] = add_ptr->TT;
|
||||
data[13] = add_ptr->NP;
|
||||
data[14] = add_ptr->ES;
|
||||
data[15] = add_ptr->NAI;
|
||||
data[16] = add_ptr->len;
|
||||
temp_len = (add_ptr->len + 1) / 2;
|
||||
memcpy(data + 17, add_ptr->GTAI, temp_len);
|
||||
}
|
||||
|
||||
u8 cap_com_ftos(struct MapComSrv_struct *map_com, u8 * data_flow)
|
||||
{ // common service data flow to structure
|
||||
u32 aa;
|
||||
u32 len;
|
||||
u8 ii;
|
||||
u8 delimiter_flag = 0;
|
||||
struct MapOpen_Arg *open_arg;
|
||||
struct MapOpen_Res *open_res;
|
||||
struct MapClose_Arg *close_ptr;
|
||||
struct MapUAbort_Arg *uabrt_ptr;
|
||||
struct MapPAbort_Arg *pabrt_ptr;
|
||||
|
||||
len = (data_flow[0] << 8) + data_flow[1];
|
||||
if(len < 9) // data flow is too short
|
||||
return 0;
|
||||
if(data_flow[2] != CAP_FLAG)
|
||||
return 0;
|
||||
map_com->port_id = (data_flow[3] << 8) + data_flow[4];
|
||||
map_com->dialogue_id = (data_flow[6] << 8) + data_flow[7];
|
||||
map_com->message_type = data_flow[9];
|
||||
map_com->message_flag = data_flow[10];
|
||||
switch (map_com->message_type)
|
||||
{
|
||||
case MAP_OPEN:
|
||||
if(map_com->message_flag == MAP_REQUEST || map_com->message_flag == MAP_INDICATE)
|
||||
{
|
||||
open_arg = (MapOpen_Arg *) & map_com->dlg_list.open_arg;
|
||||
open_arg->acn_data.acn = data_flow[11];
|
||||
open_arg->acn_data.acn_ver = data_flow[12];
|
||||
cap_get_sccpadd(&open_arg->peer_add, data_flow + 13);
|
||||
cap_get_sccpadd(&open_arg->local_add, data_flow + 41);
|
||||
open_arg->param_flag = 0x0b;
|
||||
aa = 70;
|
||||
for(ii = 0; ii < 3; ii++)
|
||||
{
|
||||
if(data_flow[aa] == 0x00)
|
||||
break;
|
||||
else if(data_flow[aa] == 0x01) // peer reference
|
||||
{
|
||||
len = data_flow[aa + 1];
|
||||
if(len > ISDN_LEN)
|
||||
return 0;
|
||||
open_arg->peerref_len = len;
|
||||
memcpy(open_arg->peer_reference, &data_flow[aa + 2], len);
|
||||
aa += len + 2;
|
||||
open_arg->param_flag |= 0x04;
|
||||
}
|
||||
else if(data_flow[aa] == 0x02) // local reference
|
||||
{
|
||||
len = data_flow[aa + 1];
|
||||
if(len > ISDN_LEN)
|
||||
return 0;
|
||||
open_arg->localref_len = len;
|
||||
memcpy(open_arg->local_reference, &data_flow[aa + 2], len);
|
||||
aa += len + 2;
|
||||
open_arg->param_flag |= 0x10;
|
||||
}
|
||||
else if(data_flow[aa] == 0x03) // specific info
|
||||
{
|
||||
len = data_flow[aa + 1];
|
||||
if(len >= MAX_SPCINFO_LEN)
|
||||
return 0;
|
||||
open_arg->specific_info.info_len = len;
|
||||
memcpy(open_arg->specific_info.info_data, &data_flow[aa + 2], len);
|
||||
open_arg->param_flag |= 0x20;
|
||||
aa += 2 + len;
|
||||
}
|
||||
else if(data_flow[aa] == 0x10)
|
||||
{
|
||||
delimiter_flag = 1;
|
||||
aa += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(map_com->message_flag == MAP_RESPONSE || map_com->message_flag == MAP_CONFIRM)
|
||||
{
|
||||
open_res = (MapOpen_Res *) & map_com->dlg_list.open_res;
|
||||
open_res->result = data_flow[11];
|
||||
open_res->param_flag = 0x08;
|
||||
aa = 13;
|
||||
for(ii = 0; ii < 4; ii++)
|
||||
{
|
||||
if(data_flow[aa] == 0x00)
|
||||
break;
|
||||
else if(data_flow[aa] == 0x01) // acn
|
||||
{
|
||||
open_res->acn_data.acn = data_flow[aa + 2];
|
||||
open_res->acn_data.acn_ver = data_flow[aa + 3];
|
||||
aa += 4;
|
||||
open_res->param_flag |= 0x01;
|
||||
}
|
||||
else if(data_flow[aa] == 0x02) // specific info
|
||||
{
|
||||
len = data_flow[aa + 1];
|
||||
if(len >= MAX_SPCINFO_LEN)
|
||||
return 0;
|
||||
open_res->specific_info.info_len = len;
|
||||
memcpy(open_res->specific_info.info_data, &data_flow[aa + 2], len);
|
||||
open_res->param_flag |= 0x02;
|
||||
aa += 2 + len;
|
||||
}
|
||||
else if(data_flow[aa] == 0x03) // refuse reason
|
||||
{
|
||||
open_res->refuse_reason = data_flow[aa + 2];
|
||||
open_res->param_flag |= 0x10;
|
||||
aa += 3;
|
||||
}
|
||||
else if(data_flow[aa] == 0x04) // provider error
|
||||
{
|
||||
open_res->provider_error = data_flow[aa + 2];
|
||||
open_res->param_flag |= 0x20;
|
||||
aa += 3;
|
||||
}
|
||||
else if(data_flow[aa] == 0x10)
|
||||
{
|
||||
delimiter_flag = 1;
|
||||
aa += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
case MAP_CLOSE:
|
||||
close_ptr = (MapClose_Arg *) & map_com->dlg_list.close_arg;
|
||||
close_ptr->release_method = data_flow[11];
|
||||
close_ptr->param_flag = 0x01;
|
||||
if(data_flow[13] == 0x01)
|
||||
{
|
||||
len = data_flow[14];
|
||||
if(len >= MAX_SPCINFO_LEN)
|
||||
return 0;
|
||||
close_ptr->specific_info.info_len = len;
|
||||
memcpy(close_ptr->specific_info.info_data, &data_flow[15], len);
|
||||
close_ptr->param_flag |= 0x02;
|
||||
}
|
||||
break;
|
||||
case MAP_U_ABORT:
|
||||
uabrt_ptr = (MapUAbort_Arg *) & map_com->dlg_list.uabort_arg;
|
||||
uabrt_ptr->user_reason = data_flow[11];
|
||||
uabrt_ptr->param_flag = 0x01;
|
||||
aa = 13;
|
||||
for(ii = 0; ii < 2; ii++)
|
||||
{
|
||||
if(data_flow[aa] == 0)
|
||||
break;
|
||||
else if(data_flow[aa] == 0x01) // diagnostic flag
|
||||
{
|
||||
uabrt_ptr->diag_info = data_flow[aa + 2];
|
||||
uabrt_ptr->param_flag |= 0x02;
|
||||
aa += 3;
|
||||
}
|
||||
else if(data_flow[aa] == 0x02) // specific info
|
||||
{
|
||||
len = data_flow[aa + 1];
|
||||
if(len >= MAX_SPCINFO_LEN)
|
||||
return 0;
|
||||
uabrt_ptr->specific_info.info_len = len;
|
||||
memcpy(uabrt_ptr->specific_info.info_data, &data_flow[aa + 2], len);
|
||||
uabrt_ptr->param_flag |= 0x04;
|
||||
aa += 2 + len;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MAP_P_ABORT:
|
||||
pabrt_ptr = (MapPAbort_Arg *) & map_com->dlg_list.pabort_arg;
|
||||
pabrt_ptr->provider_reason = data_flow[11];
|
||||
pabrt_ptr->source = data_flow[12];
|
||||
pabrt_ptr->param_flag = 0x03;
|
||||
break;
|
||||
case MAP_NOTICE:
|
||||
map_com->dlg_list.notice_arg.problem = data_flow[11];
|
||||
map_com->dlg_list.notice_arg.param_flag = 0x01;
|
||||
break;
|
||||
case MAP_DELIMITER:
|
||||
case MAP_LINK:
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
if(delimiter_flag == 1)
|
||||
return 2;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
void cap_com_stof(struct MapComSrv_struct *com_ptr, u8 * data_flow, u8 delimiter_flag)
|
||||
{ // transfer common structure to data flow
|
||||
u32 ii;
|
||||
u32 len;
|
||||
struct MapOpen_Arg *open_arg;
|
||||
struct MapOpen_Res *open_res;
|
||||
struct MapClose_Arg *close_arg;
|
||||
struct MapUAbort_Arg *uabrt_arg;
|
||||
|
||||
data_flow[2] = CAP_FLAG;
|
||||
data_flow[3] = com_ptr->port_id >> 8;
|
||||
data_flow[4] = com_ptr->port_id;
|
||||
data_flow[6] = com_ptr->dialogue_id >> 8;
|
||||
data_flow[7] = com_ptr->dialogue_id;
|
||||
data_flow[9] = com_ptr->message_type;
|
||||
data_flow[10] = com_ptr->message_flag;
|
||||
ii = 11;
|
||||
switch (com_ptr->message_type)
|
||||
{
|
||||
case MAP_OPEN:
|
||||
if(com_ptr->message_flag == MAP_INDICATE || com_ptr->message_flag == MAP_REQUEST)
|
||||
{
|
||||
open_arg = (MapOpen_Arg *) & com_ptr->dlg_list.open_arg;
|
||||
data_flow[ii++] = open_arg->acn_data.acn;
|
||||
data_flow[ii++] = open_arg->acn_data.acn_ver;
|
||||
cap_set_sccpadd(&open_arg->peer_add, data_flow + ii);
|
||||
ii += 28;
|
||||
cap_set_sccpadd(&open_arg->local_add, data_flow + ii);
|
||||
ii += 28;
|
||||
data_flow[ii++] = 1; // optional point
|
||||
if((open_arg->param_flag & 0x04)) // has peer reference address
|
||||
{
|
||||
data_flow[ii++] = 0x01;
|
||||
len = open_arg->peerref_len;
|
||||
data_flow[ii++] = len;
|
||||
memcpy(data_flow + ii, open_arg->peer_reference, len);
|
||||
ii += len;
|
||||
}
|
||||
if((open_arg->param_flag & 0x10)) // has local reference address
|
||||
{
|
||||
data_flow[ii++] = 0x02;
|
||||
len = open_arg->localref_len;
|
||||
data_flow[ii++] = len;
|
||||
memcpy(data_flow + ii, open_arg->local_reference, len);
|
||||
ii += len;
|
||||
}
|
||||
if((open_arg->param_flag & 0x20))
|
||||
{
|
||||
data_flow[ii++] = 0x03;
|
||||
len = open_arg->specific_info.info_len;
|
||||
data_flow[ii++] = len;
|
||||
memcpy(data_flow + ii, open_arg->specific_info.info_data, len);
|
||||
ii += len;
|
||||
}
|
||||
if(delimiter_flag == 1)
|
||||
{
|
||||
data_flow[ii++] = 0x10;
|
||||
data_flow[ii++] = 0x00;
|
||||
}
|
||||
data_flow[ii++] = 0x00;
|
||||
}
|
||||
else if(com_ptr->message_flag == MAP_RESPONSE || com_ptr->message_flag == MAP_CONFIRM)
|
||||
{
|
||||
open_res = (MapOpen_Res *) & com_ptr->dlg_list.open_res;
|
||||
data_flow[ii++] = open_res->result;
|
||||
data_flow[ii++] = 0x01; // optional point
|
||||
if((open_res->param_flag & 0x01)) // has ACN
|
||||
{
|
||||
data_flow[ii++] = 0x01;
|
||||
data_flow[ii++] = 2;
|
||||
data_flow[ii++] = open_res->acn_data.acn;
|
||||
data_flow[ii++] = open_res->acn_data.acn_ver;
|
||||
}
|
||||
if((open_res->param_flag & 0x02)) // has specific info
|
||||
{
|
||||
data_flow[ii++] = 0x02;
|
||||
len = open_res->specific_info.info_len;
|
||||
data_flow[ii++] = len;
|
||||
memcpy(data_flow + ii, open_res->specific_info.info_data, len);
|
||||
ii += len;
|
||||
}
|
||||
if((open_res->param_flag & 0x10)) // has refuse reason
|
||||
{
|
||||
data_flow[ii++] = 0x03;
|
||||
data_flow[ii++] = 1;
|
||||
data_flow[ii++] = open_res->refuse_reason;
|
||||
}
|
||||
if((open_res->param_flag & 0x20)) // has provider error
|
||||
{
|
||||
data_flow[ii++] = 0x04;
|
||||
data_flow[ii++] = 1;
|
||||
data_flow[ii++] = open_res->provider_error;
|
||||
}
|
||||
if(delimiter_flag == 1)
|
||||
{
|
||||
data_flow[ii++] = 0x10;
|
||||
data_flow[ii++] = 0x00;
|
||||
}
|
||||
data_flow[ii++] = 0x00;
|
||||
}
|
||||
break;
|
||||
case MAP_CLOSE:
|
||||
close_arg = (MapClose_Arg *) & com_ptr->dlg_list.close_arg;
|
||||
data_flow[ii++] = close_arg->release_method;
|
||||
data_flow[ii++] = 0x01; // optional point
|
||||
if((close_arg->param_flag & 0x02)) // has specific info
|
||||
{
|
||||
data_flow[ii++] = 0x01;
|
||||
len = close_arg->specific_info.info_len;
|
||||
data_flow[ii++] = len;
|
||||
memcpy(data_flow + ii, close_arg->specific_info.info_data, len);
|
||||
ii += len;
|
||||
}
|
||||
data_flow[ii++] = 0x00;
|
||||
break;
|
||||
case MAP_U_ABORT:
|
||||
uabrt_arg = (MapUAbort_Arg *) & com_ptr->dlg_list.uabort_arg;
|
||||
data_flow[ii++] = uabrt_arg->user_reason;
|
||||
data_flow[ii++] = 0x01; // optional point
|
||||
if((uabrt_arg->param_flag & 0x02))
|
||||
{
|
||||
data_flow[ii++] = 0x01;
|
||||
data_flow[ii++] = 1;
|
||||
data_flow[ii++] = uabrt_arg->diag_info;
|
||||
}
|
||||
if((uabrt_arg->param_flag & 0x04)) // has specific info
|
||||
{
|
||||
data_flow[ii++] = 0x02;
|
||||
len = uabrt_arg->specific_info.info_len;
|
||||
data_flow[ii++] = len;
|
||||
memcpy(data_flow + ii, uabrt_arg->specific_info.info_data, len);
|
||||
ii += len;
|
||||
}
|
||||
data_flow[ii++] = 0x00;
|
||||
break;
|
||||
case MAP_P_ABORT:
|
||||
data_flow[ii++] = com_ptr->dlg_list.pabort_arg.provider_reason;
|
||||
data_flow[ii++] = com_ptr->dlg_list.pabort_arg.source;
|
||||
break;
|
||||
case MAP_NOTICE:
|
||||
data_flow[ii++] = com_ptr->dlg_list.notice_arg.problem;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ii -= 2;
|
||||
data_flow[0] = ii >> 8;
|
||||
data_flow[1] = ii;
|
||||
}
|
||||
|
||||
u8 cap_opr_ftos(struct MapOprData_struct *opr_ptr, u8 * data_flow)
|
||||
{ // transfer opration data flow to structure
|
||||
u32 aa;
|
||||
u32 len;
|
||||
u8 ii;
|
||||
u8 delimiter_flag = 0;
|
||||
|
||||
len = (data_flow[0] << 8) + data_flow[1];
|
||||
if(len < 10)
|
||||
return 0;
|
||||
if(data_flow[2] != CAP_FLAG)
|
||||
return 0;
|
||||
opr_ptr->port_id = (data_flow[3] << 8) + data_flow[4];
|
||||
opr_ptr->dialogue_id = (data_flow[6] << 8) + data_flow[7];
|
||||
opr_ptr->message_type = data_flow[9];
|
||||
opr_ptr->message_flag = data_flow[10];
|
||||
opr_ptr->invoke_id = data_flow[11];
|
||||
opr_ptr->param_flag = 0x1f;
|
||||
opr_ptr->param_len = 0;
|
||||
aa = 13;
|
||||
for(ii = 0; ii < 2; ii++)
|
||||
{
|
||||
if(data_flow[aa] == 0x00)
|
||||
break;
|
||||
else if(data_flow[aa] == 0x01) // parameter
|
||||
{
|
||||
len = (data_flow[aa + 1] << 8) + data_flow[aa + 2];
|
||||
if(len > MAX_MAPPOPR_LEN)
|
||||
return 0;
|
||||
opr_ptr->param_len = len;
|
||||
memcpy(opr_ptr->param, &data_flow[aa + 3], len);
|
||||
aa += len + 3;
|
||||
opr_ptr->param_flag |= 0x20;
|
||||
}
|
||||
else if(data_flow[aa] == 0x02) // user error
|
||||
{
|
||||
opr_ptr->user_error = data_flow[aa + 2];
|
||||
opr_ptr->param_flag |= 0x40;
|
||||
aa += 3;
|
||||
}
|
||||
else if(data_flow[aa] == 0x03) // provider error
|
||||
{
|
||||
opr_ptr->provider_error = data_flow[aa + 2];
|
||||
opr_ptr->param_flag |= 0x80;
|
||||
aa += 3;
|
||||
}
|
||||
else if(data_flow[aa] == 0x10)
|
||||
{
|
||||
delimiter_flag = 1;
|
||||
aa += 2;
|
||||
}
|
||||
}
|
||||
if(delimiter_flag == 1)
|
||||
return 2;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
void cap_opr_stof(struct MapOprData_struct *opr_ptr, u8 * data_flow, u8 delimiter_flag)
|
||||
{ // transfer opration structure to data flow
|
||||
u32 ii;
|
||||
u32 len;
|
||||
|
||||
data_flow[2] = CAP_FLAG;
|
||||
data_flow[3] = opr_ptr->port_id >> 8;
|
||||
data_flow[4] = opr_ptr->port_id;
|
||||
data_flow[6] = opr_ptr->dialogue_id >> 8;
|
||||
data_flow[7] = opr_ptr->dialogue_id;
|
||||
data_flow[9] = opr_ptr->message_type;
|
||||
data_flow[10] = opr_ptr->message_flag;
|
||||
data_flow[11] = opr_ptr->invoke_id;
|
||||
data_flow[12] = 1;
|
||||
ii = 13;
|
||||
if((opr_ptr->param_flag & 0x20)) // has component
|
||||
{
|
||||
data_flow[ii++] = 0x01;
|
||||
len = opr_ptr->param_len;
|
||||
data_flow[ii++] = len >> 8;
|
||||
data_flow[ii++] = len;
|
||||
memcpy(data_flow + ii, opr_ptr->param, len);
|
||||
ii += len;
|
||||
}
|
||||
if((opr_ptr->param_flag & 0x40)) // has user error
|
||||
{
|
||||
data_flow[ii++] = 0x02;
|
||||
data_flow[ii++] = 1;
|
||||
data_flow[ii++] = opr_ptr->user_error;
|
||||
}
|
||||
if((opr_ptr->param_flag & 0x80)) // has provider error
|
||||
{
|
||||
data_flow[ii++] = 0x03;
|
||||
data_flow[ii++] = 1;
|
||||
data_flow[ii++] = opr_ptr->provider_error;
|
||||
}
|
||||
if(delimiter_flag == 1)
|
||||
{
|
||||
data_flow[ii++] = 0x10;
|
||||
data_flow[ii++] = 0x00;
|
||||
}
|
||||
data_flow[ii++] = 0;
|
||||
ii -= 2;
|
||||
data_flow[0] = ii >> 8;
|
||||
data_flow[1] = ii;
|
||||
}
|
||||
14
plat/xapp/src/capp/cap_public.h
Normal file
14
plat/xapp/src/capp/cap_public.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/* CAP public function head file */
|
||||
/* Written by Liu Zhiguo 2003-08-26 */
|
||||
/* Version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#ifndef _CAP_PUBLIC
|
||||
#define _CAP_PUBLIC
|
||||
|
||||
u8 cap_com_ftos(struct MapComSrv_struct *map_com, u8 * data_flow);
|
||||
void cap_com_stof(struct MapComSrv_struct *com_ptr, u8 * data_flow, u8 delimiter_flag);
|
||||
u8 cap_opr_ftos(struct MapOprData_struct *opr_ptr, u8 * data_flow);
|
||||
void cap_opr_stof(struct MapOprData_struct *opr_ptr, u8 * data_flow, u8 delimiter_flag);
|
||||
|
||||
#endif
|
||||
20
plat/xapp/src/capp/icap.h
Normal file
20
plat/xapp/src/capp/icap.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/* CAP message interface head file */
|
||||
/* Written by Liu Zhiguo 2003-08-26 */
|
||||
/* Version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#ifndef _CAP_INTERFACE
|
||||
#define _CAP_INTERFACE
|
||||
|
||||
#include "cap_head.h"
|
||||
#include "cap_msg.h"
|
||||
|
||||
int encode_capmsg(struct CapArg caparg, u8 * msgbuf, u16 maxlen);
|
||||
|
||||
#ifdef _SRF_RELEVANT
|
||||
int decode_capmsg(char *msgbuf, u16 msglen, u8 ocode, u8 otype, struct CapArg *pcaparg);
|
||||
#else
|
||||
int decode_capmsg(char *msgbuf, u16 msglen, u8 ocode, struct CapArg *pcaparg);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
1323
plat/xapp/src/conv_prefix.c
Normal file
1323
plat/xapp/src/conv_prefix.c
Normal file
File diff suppressed because it is too large
Load Diff
91
plat/xapp/src/conv_prefix.h
Normal file
91
plat/xapp/src/conv_prefix.h
Normal file
@@ -0,0 +1,91 @@
|
||||
#ifndef _CONV_PREFIX_H
|
||||
#define _CONV_PREFIX_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define MAX_CONV_PREFIX 128
|
||||
#define MAX_CLI_PREFIX 64
|
||||
#define MAX_PREFIX_LEN 16
|
||||
#define MAX_NAME_LEN 8
|
||||
#define MAX_LOCAL_MSISDN_SEG 32
|
||||
|
||||
#define MAX_PLAT_NAME_LEN 24
|
||||
#define MAX_PLAT_NAME_INSTANCE 256
|
||||
|
||||
typedef struct conv_prefix_record
|
||||
{
|
||||
u_char used_flag;
|
||||
char prefix[MAX_PREFIX_LEN];
|
||||
char delete_length;
|
||||
char add_length;
|
||||
char add_digits[MAX_PREFIX_LEN];
|
||||
u_char valid_length;
|
||||
}_conv_prefix_record;
|
||||
|
||||
typedef struct cli_prefix
|
||||
{
|
||||
u_char in_property;
|
||||
char prefix[MAX_PREFIX_LEN];
|
||||
char delete_length;
|
||||
u_char out_property;
|
||||
char add_length;
|
||||
char add_digits[MAX_PREFIX_LEN-1];
|
||||
u_char used_flag;
|
||||
u_char valid_length;
|
||||
}_cli_prefix;
|
||||
|
||||
typedef struct xapp_group_prefix
|
||||
{
|
||||
char startNumber[MAX_PREFIX_LEN+1];
|
||||
char endNumber[MAX_PREFIX_LEN+1];
|
||||
u_char repStartDigit;
|
||||
u_char repEndDigit;
|
||||
char repDigitWith[MAX_PREFIX_LEN+1];
|
||||
u_char status; /* 0=unlock, 1=lock */
|
||||
u_char used_flag;
|
||||
char cReserved[MAX_PREFIX_LEN-1];
|
||||
}_xapp_group_prefix;
|
||||
|
||||
typedef struct xapp_local_msisdn
|
||||
{
|
||||
char startNumber[MAX_PREFIX_LEN+1];
|
||||
char endNumber[MAX_PREFIX_LEN+1];
|
||||
u_char status; /* 0=unlock, 1=lock */
|
||||
u_char used_flag;
|
||||
char cReserved[MAX_PREFIX_LEN];
|
||||
}_xapp_local_msisdn;
|
||||
|
||||
typedef struct conv_prefix
|
||||
{
|
||||
_conv_prefix_record conv_prefix[MAX_CONV_PREFIX];
|
||||
_cli_prefix cli_prefix[MAX_CLI_PREFIX];
|
||||
char conv_name[MAX_CONV_PREFIX][MAX_NAME_LEN];
|
||||
char cli_name[MAX_CLI_PREFIX][MAX_NAME_LEN];
|
||||
char plat_name[MAX_PLAT_NAME_INSTANCE][MAX_PLAT_NAME_LEN];
|
||||
_xapp_group_prefix group_conv_prefix[MAX_CONV_PREFIX];
|
||||
char msisdn_segment_name[MAX_LOCAL_MSISDN_SEG][MAX_PLAT_NAME_LEN];
|
||||
_xapp_local_msisdn local_msisdn_segment[MAX_LOCAL_MSISDN_SEG];
|
||||
}_conv_prefix;
|
||||
|
||||
int snmpSetConvPrefix(u_char oidlen,u32 *oid,u_char *pdata,u_short datalen);
|
||||
int snmpGetConvPrefix(u_char oidlen,u32 *oid,u_char *pdata,u_char *vartype);
|
||||
int snmpSetCliPrefix(u_char oidlen,u32 *oid,u_char *pdata,u_short datalen);
|
||||
int snmpGetCliPrefix(u_char oidlen,u32 *oid,u_char *pdata,u_char *vartype);
|
||||
int snmpSetPlatName(u_char oidlen,u32 *oid,u_char *pdata,u_short datalen);
|
||||
int snmpGetPlatName(u_char oidlen,u32 *oid,u_char *pdata,u_char *vartype);
|
||||
int msisdnUnkToInt(char *msisdn_unk, char *msisdn_int);
|
||||
int cliUptoCalled(char *caller, char *called);
|
||||
int snmpGetGroupConvPrefix(u_char oidlen,u32 *oid,u_char *pdata,u_char *vartype);
|
||||
int snmpSetGroupConvPrefix(u_char oidlen,u32 *oid,u_char *pdata,u_short datalen);
|
||||
extern int xap_getnext_roaming_rule(u32 *index_id);
|
||||
extern int xap_get_roaming_rule(u32 column, u32 *instance, u_char *pdata, u_char *vartype);
|
||||
extern int xap_set_roaming_rule(u32 column, u32 *instance, u_char *pdata, unsigned short datalen);
|
||||
int saveConvPrefix();
|
||||
|
||||
/* return value:
|
||||
-1 = error length;
|
||||
0 = cannn't find appropriate prefix;
|
||||
1 = conv. succeed
|
||||
*/
|
||||
|
||||
#endif
|
||||
77
plat/xapp/src/ixap.h
Normal file
77
plat/xapp/src/ixap.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* XAP provider interface head file */
|
||||
/* Written by Liu Zhiguo 2003-03-13 */
|
||||
/* Version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#ifndef _XAP_INTERFACE
|
||||
#define _XAP_INTERFACE
|
||||
|
||||
#include "mapp/imap.h"
|
||||
#include "capp/icap.h"
|
||||
|
||||
/* defined in xap_interface.c */
|
||||
void xap_get_mcc(u8 *mcc);
|
||||
void xap_get_mnc(u8 *mnc);
|
||||
void xap_get_cc(u8 *cc);
|
||||
void xap_get_ndc(u8 *ndc);
|
||||
void xap_get_interprefix(u8 *inter_prefix);
|
||||
void xap_get_nationalprefix(u8 *national_prefix);
|
||||
void xap_get_localprefix(u8 *local_prefix);
|
||||
int xap_mscid_to_num(u8 *mscid,u8 ssn, u8 *num);
|
||||
|
||||
int imap_reg_ssn(u8 ssn);
|
||||
u8 map_check_sendcom(u32 did);
|
||||
u8 map_send_comdata(u8 *data_flow); // send map common service data
|
||||
u8 map_check_sendopr(u32 did);
|
||||
u8 map_send_oprdata(u8 *data_flow); // send map operation service data
|
||||
u8 map_get_comdata(u8 *data_flow,u32 did);
|
||||
u8 map_get_open(u8 *data_flow,u8 ssn);
|
||||
u8 map_get_oprdata(u8 *data_flow,u32 did);
|
||||
u32 map_get_dialogueid(u8 ssn);
|
||||
u8 map_get_invokeid(u32 did);
|
||||
u8 map_check_map_flag(u32 did);
|
||||
u8 map_send_oprsrv( MapOprSrv_struct *srv_ptr, u8 DelimiterFlag , u8 *data_flow);
|
||||
u8 map_send_comsrv(MapComSrv_struct *com_ptr,u8 uDelimiterFlag,u8 *data_flow);
|
||||
u8 map_send_open( MapOpenArgParam *pOpenParam , u8 *uDataFlow );
|
||||
u8 map_send_close( u32 pid , u32 did , u8 uCloseReasion );
|
||||
u8 map_extract_param(MapOprSrv_struct *srv_ptr,MapOprData_struct *data_ptr , int ver);
|
||||
u8 map_get_comdata_struct(MapComSrv_struct *map_com,u32 did);
|
||||
u8 map_get_oprdata_struct(MapOprData_struct *map_opr,u32 did);
|
||||
|
||||
u32 is41_get_dialogueid(u8 ssn);
|
||||
|
||||
int icap_reg_ssn(u8 ssn);
|
||||
u8 cap_check_sendcom(u32 did);
|
||||
u8 cap_send_comdata(u8 *data_flow); // send cap common service data
|
||||
u8 cap_check_sendopr(u32 did);
|
||||
u8 cap_send_oprdata(u8 *data_flow); // send cap operation service data
|
||||
u8 cap_get_comdata(u8 *data_flow,u32 did);
|
||||
u8 cap_get_open(u8 *data_flow,u8 ssn);
|
||||
u8 cap_get_oprdata(u8 *data_flow,u32 did);
|
||||
u32 cap_get_dialogueid(u8 ssn);
|
||||
u8 cap_get_invokeid(u32 did);
|
||||
|
||||
/* defined in xap_provider.c */
|
||||
u8 map_get_acnver(SCCP_ADDR *sccp_ptr,u8 acn);
|
||||
u8 map_set_acnver(SCCP_ADDR *sccp_ptr,u8 acn,u8 acn_ver);
|
||||
void xap_init( int grantdid );
|
||||
void xap_fsm();
|
||||
|
||||
int snmpGetCliPrefix(u_char oidlen,u32 *oid,u_char *pdata,u_char *vartype);
|
||||
int snmpSetCliPrefix(u_char oidlen,u32 *oid,u_char *pdata,u_short datalen);
|
||||
int saveConvPrefix();
|
||||
u8 init_mappconst(void);
|
||||
u8 init_cappconst(void);
|
||||
void wxc2_trace_xapp(u32 did);
|
||||
/******AIN*********/
|
||||
u32 ain_get_dialogueid ( u8 ssn );
|
||||
int ain_reg_ssn(u8 ssn);
|
||||
u8 ain_get_invokeid ( u32 did );
|
||||
int ain_send_oprsrv( MapOprSrv_struct *srv_ptr, u8 DelimiterFlag, u8 *data_flow );
|
||||
//int ain_send_rsp(MapOprSrv_struct *srv_ptr, u8 DelimiterFlag, u8 * data_flow );
|
||||
u8 ain_get_oprdata_struct ( MapOprData_struct *map_opr, u32 did);//get query or response data
|
||||
u8 ain_send_open( MapOpenArgParam *pOpenParam, u8 *uDataFlow);//set sccp address
|
||||
u8 ain_send_close ( u32 pid, u32 did, u8 uCloseReasion );
|
||||
u8 ain_get_open(u8 *data_flow, u8 ssn );//get query command
|
||||
/******AIN*********/
|
||||
#endif
|
||||
918
plat/xapp/src/mapp/Map_opr.c
Normal file
918
plat/xapp/src/mapp/Map_opr.c
Normal file
@@ -0,0 +1,918 @@
|
||||
#include "map_includes.h"
|
||||
|
||||
/**************** vlr inquery opr ********************/
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding MapDetermineOprUser Arg argument */
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_MapDetermineOprUserArg(struct MapDetermineOprUser_Arg *dou_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = dou_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,dou_ptr->imsi,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
|
||||
if (flag & 0x02) // has imei
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMEI_LEN,dou_ptr->imei,0x80,&asn_buf);//add imei parameter
|
||||
}
|
||||
|
||||
if (flag & 0x04) //has roamingRestraintFlag
|
||||
{
|
||||
sprintf(tlv1,"2-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&dou_ptr->roamingRestraintFlag,0x80,&asn_buf);
|
||||
}
|
||||
|
||||
dou_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_MapDetermineOprUserArg(struct MapDetermineOprUser_Arg *dou_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
dou_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapDetermineOprUserArg param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(dou_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len == IMEI_LEN) // get imei
|
||||
{
|
||||
flag |= 0x02;
|
||||
memcpy(dou_ptr->imei,temp_buf,len);
|
||||
}
|
||||
|
||||
|
||||
len = get_tlv("2",temp_buf,&asn_buf); //get roamingRestraintFlag
|
||||
if (len == 1)
|
||||
{
|
||||
dou_ptr->roamingRestraintFlag = temp_buf[0];
|
||||
flag |= 0x04;
|
||||
}
|
||||
|
||||
dou_ptr->param_flag = flag;
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding MapDetermineOprUser Response */
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_MapDetermineOprUserRes(struct MapDetermineOprUser_Res *dou_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = dou_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,dou_ptr->imsi,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapDetermineOprUserRes loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
if (flag & 0x02) // has imei
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMEI_LEN,dou_ptr->imei,0x80,&asn_buf);//add imei parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapDetermineOprUserRes loss IMEI");
|
||||
return RER;
|
||||
}
|
||||
if (flag & 0x04) //has oprFlag
|
||||
{
|
||||
sprintf(tlv1,"2-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&dou_ptr->oprflag,0x80,&asn_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapDetermineOprUserRes loss oprFlag");
|
||||
return RER;
|
||||
}
|
||||
if (flag & 0x08) //has msisdn
|
||||
{
|
||||
sprintf(tlv1,"3-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,dou_ptr->msisdn[0],dou_ptr->msisdn+1,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
dou_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_MapDetermineOprUserRes(struct MapDetermineOprUser_Res *dou_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
dou_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapDetermineOprUserRes param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(dou_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapDetermineOprUserRes:loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len == IMEI_LEN) // get imei
|
||||
{
|
||||
flag |= 0x02;
|
||||
memcpy(dou_ptr->imei,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapDetermineOprUserRes:loss IMEI");
|
||||
return RER;
|
||||
}
|
||||
|
||||
len = get_tlv("2",temp_buf,&asn_buf); //get oprflag
|
||||
if (len == 1)
|
||||
{
|
||||
dou_ptr->oprflag = temp_buf[0];
|
||||
flag |= 0x04;
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapDetermineOprUserRes:loss oprflag");
|
||||
return RER;
|
||||
}
|
||||
len = get_tlv("3",temp_buf,&asn_buf); //get msisdn
|
||||
if (len > 1 && len <= ISDN_LEN)
|
||||
{
|
||||
flag |= 0x08;
|
||||
dou_ptr->msisdn[0] = len;
|
||||
memcpy(dou_ptr->msisdn+1,temp_buf,len);
|
||||
}
|
||||
|
||||
dou_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
/**************** opr updataLocation vlr ********************/
|
||||
int assign_MapVlrUpdateLocationArg(struct MapVlrUpdateLocation_Arg *cuwm_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = cuwm_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,cuwm_ptr->imsi,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapVlrUpdateLocationArg loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
if (flag & 0x02) // has oprflag
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&cuwm_ptr->status,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapVlrUpdateLocationArg loss status");
|
||||
return RER;
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
|
||||
int extract_MapVlrUpdateLocationArg(struct MapVlrUpdateLocation_Arg *cuwm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
cuwm_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapVlrUpdateLocationArg param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(cuwm_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapVlrUpdateLocationArg:loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
len = get_tlv("1",temp_buf,&asn_buf);/* get status */
|
||||
if (len == 1)
|
||||
{
|
||||
flag |= 0x02;
|
||||
cuwm_ptr->status = temp_buf[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapVlrUpdateLocationArg:loss status");
|
||||
return RER;
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int assign_MapVlrUpdateLocationRes(struct MapVlrUpdateLocation_Res *cuwm_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = cuwm_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,cuwm_ptr->imsi,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
|
||||
if (flag & 0x02) // has status
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&cuwm_ptr->status,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
|
||||
if (flag & 0x04) //has error
|
||||
{
|
||||
sprintf(tlv1,"2-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&cuwm_ptr->error,0x80,&asn_buf);
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_MapVlrUpdateLocationRes(struct MapVlrUpdateLocation_Res *cuwm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
cuwm_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapVlrUpdateLocationRes param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(cuwm_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len == 1)
|
||||
{
|
||||
flag |= 0x02;
|
||||
cuwm_ptr->status = temp_buf[0];
|
||||
}
|
||||
|
||||
len = get_tlv("2",temp_buf,&asn_buf); //get reult
|
||||
if (len == 1)
|
||||
{
|
||||
cuwm_ptr->error = temp_buf[0];
|
||||
flag |= 0x04;
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
|
||||
/**************** opr create hlr ********************/
|
||||
int assign_MapCreateUserWithMsisdnImsiArg(struct MapCreateUserWithMsisdnImsi_Arg *cuwm_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = cuwm_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,cuwm_ptr->imsi,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapCreateUserWithMsisdnImsiArg loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
if (flag & 0x02) // has msisdn
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,cuwm_ptr->msisdn[0],cuwm_ptr->msisdn+1,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapCreateUserWithMsisdnImsiArg loss MSISDN");
|
||||
return RER;
|
||||
}
|
||||
|
||||
if (flag & 0x04) //has imsiFlag
|
||||
{
|
||||
sprintf(tlv1,"2-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&cuwm_ptr->imsiflag,0x80,&asn_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapCreateUserWithMsisdnImsiArg loss imsiFlag");
|
||||
return RER;
|
||||
}
|
||||
|
||||
if (flag & 0x08) //has camelFlag
|
||||
{
|
||||
sprintf(tlv1,"3-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&cuwm_ptr->camelflag,0x80,&asn_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapCreateUserWithMsisdnImsiArg loss camelflag");
|
||||
return RER;
|
||||
}
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
|
||||
int extract_MapCreateUserWithMsisdnImsiArg(struct MapCreateUserWithMsisdnImsi_Arg *cuwm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
cuwm_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapCreateUserWithMsisdnImsiArg param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(cuwm_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapCreateUserWithMsisdnImsiArg:loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len > 1 && len <= ISDN_LEN)
|
||||
{
|
||||
flag |= 0x02;
|
||||
cuwm_ptr->msisdn[0] = len;
|
||||
memcpy(cuwm_ptr->msisdn+1,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapCreateUserWithMsisdnImsiArg:msisdn length error");
|
||||
return RER;
|
||||
}
|
||||
|
||||
len = get_tlv("2",temp_buf,&asn_buf); //get imsiflag
|
||||
if (len == 1)
|
||||
{
|
||||
cuwm_ptr->imsiflag = temp_buf[0];
|
||||
flag |= 0x04;
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapCreateUserWithMsisdnImsiArg:loss roamingRestraintFlag");
|
||||
return RER;
|
||||
}
|
||||
len = get_tlv("3",temp_buf,&asn_buf); //get camelflag
|
||||
if (len == 1)
|
||||
{
|
||||
cuwm_ptr->camelflag = temp_buf[0];
|
||||
flag |= 0x08;
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapCreateUserWithMsisdnImsiArg:loss camelflag");
|
||||
return RER;
|
||||
}
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int assign_MapCreateUserWithMsisdnImsiRes(struct MapCreateUserWithMsisdnImsi_Res *cuwm_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = cuwm_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,cuwm_ptr->imsi,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
|
||||
if (flag & 0x02) // has msisdn
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,cuwm_ptr->msisdn[0],cuwm_ptr->msisdn+1,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
|
||||
|
||||
if (flag & 0x04) //has result
|
||||
{
|
||||
sprintf(tlv1,"2-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&cuwm_ptr->result,0x80,&asn_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapCreateUserWithMsisdnImsiRes loss result");
|
||||
return RER;
|
||||
}
|
||||
|
||||
if (flag & 0x08) //has cause
|
||||
{
|
||||
sprintf(tlv1,"3-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&cuwm_ptr->cause,0x80,&asn_buf);
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_MapCreateUserWithMsisdnImsiRes(struct MapCreateUserWithMsisdnImsi_Res *cuwm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
cuwm_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapCreateUserWithMsisdnImsiRes param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(cuwm_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len > 1 && len <= ISDN_LEN)
|
||||
{
|
||||
flag |= 0x02;
|
||||
cuwm_ptr->msisdn[0] = len;
|
||||
memcpy(cuwm_ptr->msisdn+1,temp_buf,len);
|
||||
}
|
||||
|
||||
|
||||
len = get_tlv("2",temp_buf,&asn_buf); //get reult
|
||||
if (len == 1)
|
||||
{
|
||||
cuwm_ptr->result = temp_buf[0];
|
||||
flag |= 0x04;
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapCreateUserWithMsisdnImsiArg:loss result");
|
||||
return RER;
|
||||
}
|
||||
|
||||
len = get_tlv("3",temp_buf,&asn_buf); //get cause
|
||||
if (len == 1)
|
||||
{
|
||||
cuwm_ptr->cause = temp_buf[0];
|
||||
flag |= 0x08;
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*********** opr delete hlr ***************************/
|
||||
int assign_MapDeleteOprUserArg(struct MapDeleteOprUser_Arg *dou_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = dou_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,dou_ptr->imsi,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapDeleteOprUserArg loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
|
||||
if (flag & 0x02) // has msisdn
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,dou_ptr->msisdn[0],dou_ptr->msisdn+1,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapDeleteOprUserArg loss MSISDN");
|
||||
return RER;
|
||||
}
|
||||
|
||||
dou_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
|
||||
int extract_MapDeleteOprUserArg(struct MapDeleteOprUser_Arg *dou_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
dou_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapDeleteOprUserArg param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(dou_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapDeleteOprUserArg:loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len > 1 && len <= ISDN_LEN)
|
||||
{
|
||||
flag |= 0x02;
|
||||
dou_ptr->msisdn[0] = len;
|
||||
memcpy(dou_ptr->msisdn+1,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapDeleteOprUserArg:msisdn length error");
|
||||
return RER;
|
||||
}
|
||||
|
||||
dou_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int assign_MapDeleteOprUserRes(struct MapDeleteOprUser_Res *dou_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = dou_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,dou_ptr->imsi,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
|
||||
if (flag & 0x02) // has msisdn
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,dou_ptr->msisdn[0],dou_ptr->msisdn+1,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
|
||||
|
||||
if (flag & 0x04) //has result
|
||||
{
|
||||
sprintf(tlv1,"2-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&dou_ptr->result,0x80,&asn_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapDeleteOprUserRes loss result");
|
||||
return RER;
|
||||
}
|
||||
|
||||
if (flag & 0x08) //has cause
|
||||
{
|
||||
sprintf(tlv1,"3-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&dou_ptr->cause,0x80,&asn_buf);
|
||||
}
|
||||
|
||||
dou_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_MapDeleteOprUserRes(struct MapDeleteOprUser_Res *dou_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
dou_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapDeleteOprUserRes param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(dou_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len > 1 && len <= ISDN_LEN)
|
||||
{
|
||||
flag |= 0x02;
|
||||
dou_ptr->msisdn[0] = len;
|
||||
memcpy(dou_ptr->msisdn+1,temp_buf,len);
|
||||
}
|
||||
|
||||
|
||||
len = get_tlv("2",temp_buf,&asn_buf); //get reult
|
||||
if (len == 1)
|
||||
{
|
||||
dou_ptr->result = temp_buf[0];
|
||||
flag |= 0x04;
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapDeleteOprUserRes:loss result");
|
||||
return RER;
|
||||
}
|
||||
|
||||
len = get_tlv("3",temp_buf,&asn_buf); //get cause
|
||||
if (len == 1)
|
||||
{
|
||||
dou_ptr->cause = temp_buf[0];
|
||||
flag |= 0x08;
|
||||
}
|
||||
|
||||
dou_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
|
||||
int assign_MapVlrEnquiryIMDM_Arg(struct MapVlrEnquiryIMDM_Arg *cuwm_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = cuwm_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,cuwm_ptr->imsi,0x80,&asn_buf);//add imsi parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapVlrEnquiryIMDM_Arg loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
if (flag & 0x02) // has msisdn
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,cuwm_ptr->msisdn[0],cuwm_ptr->msisdn+1,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapCreateUserWithMsisdnImsiArg loss MSISDN");
|
||||
return RER;
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
|
||||
int assign_MapVlrEnquiryIMDM_Res(struct MapVlrEnquiryIMDM_Res *cuwm_ptr,u8 *buf, u8 ver)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u32 flag;
|
||||
int buf_len=0;
|
||||
u8 tag1=1;
|
||||
char tlv1[32];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
flag = cuwm_ptr->param_flag;
|
||||
if (flag & 0x01) // has imsi
|
||||
{
|
||||
sprintf(tlv1,"0-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,cuwm_ptr->imsi,0x80,&asn_buf);//add imsi parameter
|
||||
}
|
||||
|
||||
if (flag & 0x02) // has msisdn
|
||||
{
|
||||
sprintf(tlv1,"1-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,cuwm_ptr->msisdn[0],cuwm_ptr->msisdn+1,0x80,&asn_buf);//add msisdn parameter
|
||||
}
|
||||
|
||||
if (flag & 0x04) // has status
|
||||
{
|
||||
sprintf(tlv1,"2-%d",tag1++);
|
||||
buf_len = add_tlv(tlv1,1,&cuwm_ptr->status,0x80,&asn_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("assign MapVlrEnquiryIMDM_Arg loss staus");
|
||||
return RER;
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
|
||||
int extract_MapVlrEnquiryIMDM_Arg(struct MapVlrEnquiryIMDM_Arg *cuwm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
cuwm_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapVlrEnquiryIMDM_Arg param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(cuwm_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapVlrEnquiryIMDM_Arg:loss IMSI");
|
||||
return RER;
|
||||
}
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len > 1 && len <= ISDN_LEN)
|
||||
{
|
||||
flag |= 0x02;
|
||||
cuwm_ptr->msisdn[0] = len;
|
||||
memcpy(cuwm_ptr->msisdn+1,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapVlrEnquiryIMDM_Arg:msisdn length error");
|
||||
return RER;
|
||||
}
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_MapVlrEnquiryIMDM_Res(struct MapVlrEnquiryIMDM_Res *cuwm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
u32 flag=0;
|
||||
|
||||
cuwm_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("extract_MapVlrEnquiryIMDM_Res param len is:0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf); // get imsi
|
||||
if (len == IMSI_LEN)
|
||||
{
|
||||
flag |= 0x01;
|
||||
memcpy(cuwm_ptr->imsi,temp_buf,len);
|
||||
}
|
||||
|
||||
len = get_tlv("1",temp_buf,&asn_buf);
|
||||
if (len > 1 && len <= ISDN_LEN)
|
||||
{
|
||||
flag |= 0x02;
|
||||
cuwm_ptr->msisdn[0] = len;
|
||||
memcpy(cuwm_ptr->msisdn+1,temp_buf,len);
|
||||
}
|
||||
|
||||
len = get_tlv("2",temp_buf,&asn_buf);/* status */
|
||||
if (len == 1)
|
||||
{
|
||||
flag |= 0x04;
|
||||
cuwm_ptr->status = temp_buf[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("extract MapVlrEnquiryIMDM_Res:status loss");
|
||||
return RER;
|
||||
}
|
||||
|
||||
|
||||
cuwm_ptr->param_flag = flag;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
28
plat/xapp/src/mapp/imap.h
Normal file
28
plat/xapp/src/mapp/imap.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* MAP message interface head file */
|
||||
/* Written by Liu Zhiguo 2003-08-26 */
|
||||
/* Version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#ifndef _MAP_INTERFACE
|
||||
#define _MAP_INTERFACE
|
||||
|
||||
#include "../../../sccp/src/include/sccp.h"
|
||||
#include "map_const.h"
|
||||
#include "map_struct.h"
|
||||
|
||||
int build_mapparam(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
u8 extract_mapparam(struct MapOprSrv_struct *opr_ptr,u8 opr_code,u8 opr_flag,u32 pre_param_len,u8 *pre_param);
|
||||
|
||||
int build_is41param(struct MapOprSrv_struct *opr_ptr,u8 *buf); // build is41 service paramter
|
||||
u8 extract_is41param(struct MapOprSrv_struct *opr_ptr,u8 opr_code,u8 opr_flag,u32 pre_param_len,u8 *pre_param);
|
||||
|
||||
int code_ansitcap_digits(struct _ansiTcapDigits *digits, u8 *outBuf);// return len
|
||||
int decode_ansitcap_digits(struct _ansiTcapDigits *digits, u8 *inBuf);
|
||||
|
||||
int build_ainparam(struct MapOprSrv_struct *opr_ptr,u8 *buf); // build ain service paramter
|
||||
u8 extract_ainparam(struct MapOprSrv_struct *opr_ptr,u8 opr_code,u8 opr_flag,u32 pre_param_len,u8 *pre_param);
|
||||
|
||||
void is41_init();
|
||||
void is41_timer();
|
||||
|
||||
#endif
|
||||
110
plat/xapp/src/mapp/is41_code.h
Normal file
110
plat/xapp/src/mapp/is41_code.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/* IS41 code define */
|
||||
/* Created by daniel on 2005-05-27 */
|
||||
/* Modified by daniel on 2005-05-27 */
|
||||
/* -------------------------------------*/
|
||||
#ifndef _IS41_CODE
|
||||
#define _IS41_CODE
|
||||
|
||||
//Authorization Denied reason
|
||||
#define AUTHDEN_DELINQUENT_ACCOUNT 1
|
||||
#define AUTHDEN_INVALID_SERIAL_NUMBER 2
|
||||
#define AUTHDEN_STOLEN_UNIT 3
|
||||
#define AUTHDEN_DUPLICATE_UNIT 4
|
||||
#define AUTHDEN_UNASSIGNED_DIRECTORY_NUMBER 5
|
||||
#define AUTHDEN_UNSPECIFIED 6
|
||||
#define AUTHDEN_MULTIPLE_ACCESS 7
|
||||
#define AUTHDEN_NOT_AUTHORIZED_FOR_THE_MSC 8
|
||||
#define AUTHDEN_MISSING_AUTHENTICATION_PARAMETERS 9
|
||||
#define AUTHDEN_TERMINALTYPE_MISMATCH 10
|
||||
|
||||
#define WXC_SYSTEM_MY_TYPE_CODE 0
|
||||
|
||||
#define CANTYP_SERVING_SYSTEM_OPTION 1
|
||||
#define CANTYP_REPORTINCALL 2
|
||||
#define CANTYP_DISCONTINUE 3
|
||||
|
||||
//type of digits
|
||||
#define TOD_CALLED_PARTY_NUMBER 1
|
||||
#define TOD_CALLING_PARTY_NUMBER 2
|
||||
#define TOD_CALLER_INTERACTION 3
|
||||
#define TOD_ROUTING_NUMBER 4
|
||||
#define TOD_BILLING_NUMBER 5
|
||||
#define TOD_DESTINATION_NUMBER 6//This is the network address of the called party
|
||||
#define TOD_LATA 7
|
||||
#define TOD_CARRIER 8//In North America the three, four, or five digits represent an interexchange or international carrier
|
||||
|
||||
#define QUALCODE_VALIDATION_ONLY 2
|
||||
#define QUALCODE_VALIDATION_AND_PROFILE 3
|
||||
#define QUALCODE_PROFILE_ONLY 4
|
||||
|
||||
#define ACCDEN_UNASSIGNED_DIRECTORY_NUMBER 1
|
||||
#define ACCDEN_INACTIVE 2
|
||||
#define ACCDEN_BUSY 3
|
||||
#define ACCDEN_TERMINATION_DENIED 4
|
||||
#define ACCDEN_NO_PAGE_RESPONSE 5
|
||||
#define ACCDEN_UNAVAILABLE 6
|
||||
|
||||
//DMH_RedirectionIndicator
|
||||
#define REDIND_CFU 1
|
||||
#define REDIND_CFB 2
|
||||
#define REDIND_CFNA 3
|
||||
#define REDIND_CFO 4
|
||||
#define REDIND_CD_UNSPECIFIED 5
|
||||
#define REDIND_CD_PSTN 6
|
||||
#define REDIND_CD_PRIVATE 7
|
||||
#define REDIND_PSTN_TANDEM 8
|
||||
#define REDIND_PRIVATE_TANDEM 9
|
||||
#define REDIND_BUSY 10
|
||||
#define REDIND_INACTIVE 11
|
||||
#define REDIND_UNASSIGNED 12
|
||||
#define REDIND_TERMINATION_DENIED 13
|
||||
#define REDIND_CD_FAILURE 14
|
||||
#define REDIND_ECT 15
|
||||
#define REDIND_MAH 16
|
||||
#define REDIND_FA 17
|
||||
#define REDIND_ABANDONED_CALL_LEG 18
|
||||
#define REDIND_PCA_CALL_REFUSED 19
|
||||
#define REDIND_SCA_CALL_REFUSED 20
|
||||
#define REDIND_DIALOGUE 21
|
||||
#define REDIND_CFD 22
|
||||
#define REDIND_CD_LOCAL 23
|
||||
#define REDIND_VOICE_MAIL_RETRIEVAL 24
|
||||
|
||||
//RedirectionReason
|
||||
#define REDREASON_BUSY 1
|
||||
#define REDREASON_NO_ANSWER 2
|
||||
#define REDREASON_UNCONDITIONAL 3
|
||||
#define REDREASON_NO_PAGE_RESPONSE 4
|
||||
#define REDREASON_UNAVAILABLE 5
|
||||
#define REDREASON_UNROUTABLE 6
|
||||
#define REDREASON_CALL_ACCEPTED 7
|
||||
#define REDREASON_CALL_REFUSED 8
|
||||
|
||||
#define ORIGIND_Prior_agreement 1
|
||||
#define ORIGIND_Origination_denied 2
|
||||
#define ORIGIND_Local_calls_only 3
|
||||
#define ORIGIND_Selected_ldigits 4
|
||||
#define ORIGIND_Selected_ldigits_and_local_call 5
|
||||
#define ORIGIND_National_long_distance 6
|
||||
#define ORIGIND_International_calls 7
|
||||
#define ORIGIND_Single_directory_number 8
|
||||
|
||||
#define AUTHPER_Per_Call 1
|
||||
#define AUTHPER_Hours 2
|
||||
#define AUTHPER_Days 3
|
||||
#define AUTHPER_Weeks 4
|
||||
#define AUTHPER_Per_Agreement 5
|
||||
#define AUTHPER_Indefinite 6
|
||||
#define AUTHPER_Number_of_calls 7
|
||||
|
||||
|
||||
#define ACCTYPE_FLASHREQ 2
|
||||
#define ACCTYPE_REGISTRATION 3
|
||||
#define ACCTYPE_ORIGINATION 4
|
||||
#define ACCTYPE_TERMINATION 5
|
||||
#define ACCTYPE_NOACCESS 6
|
||||
#define ACCTYPE_POWERDOWN 7
|
||||
#define ACCTYPE_SMS_PAGERESPONSE 8
|
||||
|
||||
|
||||
#endif
|
||||
1345
plat/xapp/src/mapp/is41_code_auc.c
Normal file
1345
plat/xapp/src/mapp/is41_code_auc.c
Normal file
File diff suppressed because it is too large
Load Diff
3968
plat/xapp/src/mapp/is41_code_ms.c
Normal file
3968
plat/xapp/src/mapp/is41_code_ms.c
Normal file
File diff suppressed because it is too large
Load Diff
1134
plat/xapp/src/mapp/is41_code_sms.c
Normal file
1134
plat/xapp/src/mapp/is41_code_sms.c
Normal file
File diff suppressed because it is too large
Load Diff
1871
plat/xapp/src/mapp/is41_code_win.c
Normal file
1871
plat/xapp/src/mapp/is41_code_win.c
Normal file
File diff suppressed because it is too large
Load Diff
490
plat/xapp/src/mapp/is41_coding.c
Normal file
490
plat/xapp/src/mapp/is41_coding.c
Normal file
@@ -0,0 +1,490 @@
|
||||
/* MAP Update Location c file */
|
||||
/* created by daniel zhang 2004-06-17 */
|
||||
/* last modufy by xinyu yan 2006-05-15 */
|
||||
/* ------------------------------------ */
|
||||
|
||||
#include "map_includes.h"
|
||||
#include "map_code.h"
|
||||
|
||||
/* external functions */
|
||||
void is41_debug(DWORD mask, const char *fmt, ...);
|
||||
void is41_showbuf(DWORD mask, BYTE *buf, int len);
|
||||
|
||||
static int (*is41_assign_arg[128]) ();
|
||||
static int (*is41_assign_rsp[128]) ();
|
||||
static int (*is41_extract_arg[128]) ();
|
||||
static int (*is41_extract_rsp[128]) ();
|
||||
static char is41_opr_string[128][48] = {
|
||||
"",
|
||||
"HandoffMeasurementRequest",
|
||||
"FacilitiesDirective",
|
||||
"MobileOnChannel",
|
||||
"HandoffBack",
|
||||
"FacilitiesRelease",
|
||||
"QualificationRequest",
|
||||
"QualificationDirective",
|
||||
"Blocking",
|
||||
"Unblocking",
|
||||
"ResetCircuit",
|
||||
"TrunkTest",
|
||||
"TrunkTestDisconnect",
|
||||
"RegistrationNotification",
|
||||
"RegistrationCancellation",
|
||||
"LocationRequest",
|
||||
"RoutingRequest",
|
||||
"FeatureRequest",
|
||||
"ServiceProfileRequest",
|
||||
"ServiceProfileDirective",
|
||||
"UnreliableRoamerDataDirective",
|
||||
"CallDataREquest",
|
||||
"MSInactive",
|
||||
"TransferToNumberRequest",
|
||||
"RedirectionRequest",
|
||||
"HandoffToThird",
|
||||
"FlashRequest",
|
||||
"AuthenticationDirective",
|
||||
"AuthenticationRequest",
|
||||
"BaseStationChallenge",
|
||||
"AuthenticationFailureReport",
|
||||
"CountRequest",
|
||||
"InterSystemPage",
|
||||
"UnsolicitedResponse",
|
||||
"BulkDeregistration",
|
||||
"HandoffMeasurementRequest2",
|
||||
"FacilitiesDirective2",
|
||||
"HandoffBack2",
|
||||
"HandoffToThird2",
|
||||
"AuthenticationDirectiveForward",
|
||||
"AuthenticationStatusReport",
|
||||
"InformationBackward",
|
||||
"InformationDirective",
|
||||
"InformationForward",
|
||||
"InterSystemAnswer",
|
||||
"InterSystemPage2",
|
||||
"InterSystemSetup",
|
||||
"OriginationRequest",
|
||||
"RandomVariableRequest",
|
||||
"RedirectionDirective",
|
||||
"RemoteUserInteractionDirective",
|
||||
"SMSDeliveryBackward",
|
||||
"SMSDeliveryForward",
|
||||
"SMSDeliveryPointToPoint",
|
||||
"SMSNotification",
|
||||
"SMSRequest",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"AnalyzedInformation",
|
||||
"ConnectionFailureReport",
|
||||
"ConnectResource",
|
||||
"DisconnectResource",
|
||||
"FacilitySelectedAndAvailable",
|
||||
"InstructionRequest",
|
||||
"Modify",
|
||||
"ResetTimer",
|
||||
"Search",
|
||||
"SeizeResource",
|
||||
"SRFDirective",
|
||||
"TBusy",
|
||||
"TNoAnswer",
|
||||
"", "", "",
|
||||
"BulkDisconnection",
|
||||
"CallControlDirective",
|
||||
"OAnswer",
|
||||
"ODisconnect",
|
||||
"CallRecoveryReport",
|
||||
"TAnswer",
|
||||
"TDisconnect",
|
||||
"UnreliableCallData",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"ShortMessageAnalyzed",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
|
||||
};
|
||||
|
||||
void is41_register_encode_arg(u8 opr_code, int (*func)())
|
||||
{
|
||||
is41_assign_arg[opr_code] = func;
|
||||
}
|
||||
|
||||
void is41_register_encode_rsp(u8 opr_code, int (*func)())
|
||||
{
|
||||
is41_assign_rsp[opr_code] = func;
|
||||
}
|
||||
|
||||
void is41_register_decode_arg(u8 opr_code, int (*func)())
|
||||
{
|
||||
is41_extract_arg[opr_code] = func;
|
||||
}
|
||||
|
||||
void is41_register_decode_rsp(u8 opr_code, int (*func)())
|
||||
{
|
||||
is41_extract_rsp[opr_code] = func;
|
||||
}
|
||||
|
||||
void init_assignFunc_pointer()
|
||||
{
|
||||
is41_register_encode_arg(IS41OPR_AuthenticationDirective, assign_is41AuthenticationDirective_arg);
|
||||
is41_register_encode_rsp(IS41OPR_AuthenticationDirective, assign_is41AuthenticationDirective_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_AuthenticationFailureReport, assign_is41AuthenticationFailureReport_arg);
|
||||
is41_register_encode_rsp(IS41OPR_AuthenticationFailureReport, assign_is41AuthenticationFailureReport_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_AuthenticationRequest, assign_is41AuthenticationRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_AuthenticationRequest, assign_is41AuthenticationRequest_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_AuthenticationStatusReport, assign_is41AuthenticationStatusReport_arg);
|
||||
is41_register_encode_rsp(IS41OPR_AuthenticationStatusReport, assign_is41AuthenticationStatusReport_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_AuthenticationDirectiveForward, assign_is41AuthenticationDirectiveForward_arg);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_BaseStationChallenge, assign_is41BaseStationChallenge_arg);
|
||||
is41_register_encode_rsp(IS41OPR_BaseStationChallenge, assign_is41BaseStationChallenge_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_CountRequest, assign_is41CountRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_CountRequest, assign_is41CountRequest_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_SMSDeliveryBackward, assign_Is41SmsDeliveryBackward_arg);
|
||||
is41_register_encode_rsp(IS41OPR_SMSDeliveryBackward, assign_Is41SmsDeliveryBackward_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_SMSDeliveryForward, assign_Is41SmsDeliveryForward_arg);
|
||||
is41_register_encode_rsp(IS41OPR_SMSDeliveryForward, assign_Is41SmsDeliveryForward_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_SMSDeliveryPointToPoint, assign_Is41SmsDeliveryPointToPoint_arg);
|
||||
is41_register_encode_rsp(IS41OPR_SMSDeliveryPointToPoint, assign_Is41SmsDeliveryPointToPoint_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_SMSNotification, assign_Is41SmsNotification_arg);
|
||||
is41_register_encode_rsp(IS41OPR_SMSNotification, assign_Is41SmsNotification_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_SMSRequest, assign_Is41SmsRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_SMSRequest, assign_Is41SmsRequest_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_RegistrationNotification, assign_is41RegistrationNotification_arg);
|
||||
is41_register_encode_rsp(IS41OPR_RegistrationNotification, assign_is41RegistrationNotification_rsp);
|
||||
is41_register_encode_arg(IS41OPR_RegistrationCancellation, assign_is41RegistrationCancellation_arg);
|
||||
is41_register_encode_rsp(IS41OPR_RegistrationCancellation, assign_is41RegistrationCancellation_rsp);
|
||||
is41_register_encode_arg(IS41OPR_LocationRequest, assign_is41LocationRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_LocationRequest, assign_is41LocationRequest_rsp);
|
||||
is41_register_encode_arg(IS41OPR_RoutingRequest, assign_is41RoutingRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_RoutingRequest, assign_is41RoutingRequest_rsp);
|
||||
is41_register_encode_arg(IS41OPR_MSInactive, assign_is41MSInactive_arg);
|
||||
is41_register_encode_rsp(IS41OPR_MSInactive, assign_is41MSInactive_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_FeatureRequest, assign_is41FeatureRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_FeatureRequest, assign_is41FeatureRequest_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_QualificationDirective, assign_is41QualificationDirective_arg);
|
||||
is41_register_encode_rsp(IS41OPR_QualificationDirective, assign_is41QualificationDirective_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_TransferToNumberRequest, assign_is41TransferToNumberRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_TransferToNumberRequest, assign_is41TransferToNumberRequest_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_RedirectionRequest, assign_is41RedirectionRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_RedirectionRequest, assign_is41RedirectionRequest_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_OriginationRequest, assign_is41OriginationRequest_arg);
|
||||
is41_register_encode_rsp(IS41OPR_OriginationRequest, assign_is41OriginationRequest_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_AnalyzedInformation, assign_is41AnalyzedInformation_arg);
|
||||
is41_register_encode_rsp(IS41OPR_AnalyzedInformation, assign_is41AnalyzedInformation_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_OAnswer, assign_is41OAnswer_arg);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_ODisconnect, assign_is41ODisconnect_arg);
|
||||
is41_register_encode_rsp(IS41OPR_ODisconnect, assign_is41ODisconnect_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_TAnswer, assign_is41TAnswer_arg);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_TDisconnect, assign_is41TDisconnect_arg);
|
||||
is41_register_encode_rsp(IS41OPR_TDisconnect, assign_is41TDisconnect_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_CallControlDirective, assign_is41CallControlDirective_arg);
|
||||
is41_register_encode_rsp(IS41OPR_CallControlDirective, assign_is41CallControlDirective_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_SeizeResource, assign_is41SeizeResource_arg);
|
||||
is41_register_encode_rsp(IS41OPR_SeizeResource, assign_is41SeizeResource_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_ConnectResource, assign_is41ConnectResource_arg);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_SRFDirective, assign_is41SRFDirective_arg);
|
||||
is41_register_encode_rsp(IS41OPR_SRFDirective, assign_is41SRFDirective_rsp);
|
||||
|
||||
is41_register_encode_arg(IS41OPR_ShortMessageAnalyzed, assign_is41ShortMessageAnalyzed_arg);
|
||||
is41_register_encode_rsp(IS41OPR_ShortMessageAnalyzed, assign_is41ShortMessageAnalyzed_rsp);
|
||||
}
|
||||
|
||||
void init_extractFunc_pointer()
|
||||
{
|
||||
is41_register_decode_arg(IS41OPR_AuthenticationDirective, extract_is41AuthenticationDirective_arg);
|
||||
is41_register_decode_rsp(IS41OPR_AuthenticationDirective, extract_is41AuthenticationDirective_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_AuthenticationFailureReport, extract_is41AuthenticationFailureReport_arg);
|
||||
is41_register_decode_rsp(IS41OPR_AuthenticationFailureReport, extract_is41AuthenticationFailureReport_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_AuthenticationRequest, extract_is41AuthenticationRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_AuthenticationRequest, extract_is41AuthenticationRequest_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_AuthenticationStatusReport, extract_is41AuthenticationStatusReport_arg);
|
||||
is41_register_decode_rsp(IS41OPR_AuthenticationStatusReport, extract_is41AuthenticationStatusReport_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_AuthenticationDirectiveForward, extract_is41AuthenticationDirectiveForward_arg);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_BaseStationChallenge, extract_is41BaseStationChallenge_arg);
|
||||
is41_register_decode_rsp(IS41OPR_BaseStationChallenge, extract_is41BaseStationChallenge_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_CountRequest, extract_is41CountRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_CountRequest, extract_is41CountRequest_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_SMSDeliveryBackward, extract_Is41SmsDeliveryBackward_arg);
|
||||
is41_register_decode_rsp(IS41OPR_SMSDeliveryBackward, extract_Is41SmsDeliveryBackward_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_SMSDeliveryForward, extract_Is41SmsDeliveryForward_arg);
|
||||
is41_register_decode_rsp(IS41OPR_SMSDeliveryForward, extract_Is41SmsDeliveryForward_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_SMSDeliveryPointToPoint, extract_Is41SmsDeliveryPointToPoint_arg);
|
||||
is41_register_decode_rsp(IS41OPR_SMSDeliveryPointToPoint, extract_Is41SmsDeliveryPointToPoint_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_SMSNotification, extract_Is41SmsNotification_arg);
|
||||
is41_register_decode_rsp(IS41OPR_SMSNotification, extract_Is41SmsNotification_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_SMSRequest, extract_Is41SmsRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_SMSRequest, extract_Is41SmsRequest_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_RegistrationNotification, extract_is41RegistrationNotification_arg);
|
||||
is41_register_decode_rsp(IS41OPR_RegistrationNotification, extract_is41RegistrationNotification_rsp);
|
||||
is41_register_decode_arg(IS41OPR_RegistrationCancellation, extract_is41RegistrationCancellation_arg);
|
||||
is41_register_decode_rsp(IS41OPR_RegistrationCancellation, extract_is41RegistrationCancellation_rsp);
|
||||
is41_register_decode_arg(IS41OPR_LocationRequest, extract_is41LocationRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_LocationRequest, extract_is41LocationRequest_rsp);
|
||||
is41_register_decode_arg(IS41OPR_RoutingRequest, extract_is41RoutingRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_RoutingRequest, extract_is41RoutingRequest_rsp);
|
||||
is41_register_decode_arg(IS41OPR_MSInactive, extract_is41MSInactive_arg);
|
||||
is41_register_decode_rsp(IS41OPR_MSInactive, extract_is41MSInactive_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_FeatureRequest, extract_is41FeatureRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_FeatureRequest, extract_is41FeatureRequest_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_QualificationDirective, extract_is41QualificationDirective_arg);
|
||||
is41_register_decode_rsp(IS41OPR_QualificationDirective, extract_is41QualificationDirective_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_TransferToNumberRequest, extract_is41TransferToNumberRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_TransferToNumberRequest, extract_is41TransferToNumberRequest_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_RedirectionRequest, extract_is41RedirectionRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_RedirectionRequest, extract_is41RedirectionRequest_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_OriginationRequest, extract_is41OriginationRequest_arg);
|
||||
is41_register_decode_rsp(IS41OPR_OriginationRequest, extract_is41OriginationRequest_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_AnalyzedInformation, extract_is41AnalyzedInformation_arg);
|
||||
is41_register_decode_rsp(IS41OPR_AnalyzedInformation, extract_is41AnalyzedInformation_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_OAnswer, extract_is41OAnswer_arg);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_ODisconnect, extract_is41ODisconnect_arg);
|
||||
is41_register_decode_rsp(IS41OPR_ODisconnect, extract_is41ODisconnect_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_TAnswer, extract_is41TAnswer_arg);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_TDisconnect, extract_is41TDisconnect_arg);
|
||||
is41_register_decode_rsp(IS41OPR_TDisconnect, extract_is41TDisconnect_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_CallControlDirective, extract_is41CallControlDirective_arg);
|
||||
is41_register_decode_rsp(IS41OPR_CallControlDirective, extract_is41CallControlDirective_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_SeizeResource, extract_is41SeizeResource_arg);
|
||||
is41_register_decode_rsp(IS41OPR_SeizeResource, extract_is41SeizeResource_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_ConnectResource, extract_is41ConnectResource_arg);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_SRFDirective, extract_is41SRFDirective_arg);
|
||||
is41_register_decode_rsp(IS41OPR_SRFDirective, extract_is41SRFDirective_rsp);
|
||||
|
||||
is41_register_decode_arg(IS41OPR_ShortMessageAnalyzed, extract_is41ShortMessageAnalyzed_arg);
|
||||
is41_register_decode_rsp(IS41OPR_ShortMessageAnalyzed, extract_is41ShortMessageAnalyzed_rsp);
|
||||
}
|
||||
|
||||
int is41_u8Type_to_charType(u8 type,char *cType)
|
||||
{
|
||||
if(type >= 128)
|
||||
return 0;
|
||||
else if(strlen(is41_opr_string[type]) == 0)
|
||||
return 0;
|
||||
strcpy(cType, is41_opr_string[type]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*int is41_u8Type_to_charType(u8 type,char *cType)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
// Authentication service operation
|
||||
case IS41OPR_AuthenticationDirective:
|
||||
sprintf(cType,"AuthenticationDirective");
|
||||
break;
|
||||
case IS41OPR_AuthenticationFailureReport:
|
||||
sprintf(cType,"AuthenticationFailureReport");
|
||||
break;
|
||||
case IS41OPR_AuthenticationRequest:
|
||||
sprintf(cType,"AuthenticationRequest");
|
||||
break;
|
||||
case IS41OPR_AuthenticationStatusReport:
|
||||
sprintf(cType,"AuthenticationStatusReport");
|
||||
break;
|
||||
case IS41OPR_AuthenticationDirectiveForward:
|
||||
sprintf(cType,"AuthenticationDirectiveForward");
|
||||
break;
|
||||
case IS41OPR_CountRequest:
|
||||
sprintf(cType,"CountRequest");
|
||||
break;
|
||||
case IS41OPR_BaseStationChallenge:
|
||||
sprintf(cType,"BaseStationChallenge");
|
||||
break;
|
||||
case IS41OPR_SMSDeliveryBackward:
|
||||
sprintf(cType,"SMSDeliveryBackward");
|
||||
break;
|
||||
case IS41OPR_SMSDeliveryForward:
|
||||
sprintf(cType,"SMSDeliveryForward");
|
||||
break;
|
||||
case IS41OPR_SMSDeliveryPointToPoint:
|
||||
sprintf(cType,"SMSDeliveryPointToPoint");
|
||||
break;
|
||||
case IS41OPR_SMSNotification:
|
||||
sprintf(cType,"IS41OPR_SMSNotification");
|
||||
break;
|
||||
case IS41OPR_SMSRequest:
|
||||
sprintf(cType,"SMSRequest");
|
||||
break;
|
||||
|
||||
case IS41OPR_RegistrationNotification:
|
||||
sprintf(cType,"REGNOT");
|
||||
break;
|
||||
case IS41OPR_RegistrationCancellation:
|
||||
sprintf(cType,"REGCANC");
|
||||
break;
|
||||
case IS41OPR_LocationRequest:
|
||||
sprintf(cType,"LOCREQ");
|
||||
break;
|
||||
case IS41OPR_RoutingRequest:
|
||||
sprintf(cType,"ROUTREQ");
|
||||
break;
|
||||
case IS41OPR_MSInactive:
|
||||
sprintf(cType,"MSINACT");
|
||||
break;
|
||||
case IS41OPR_FeatureRequest:
|
||||
sprintf(cType,"FEATREQ");
|
||||
break;
|
||||
case IS41OPR_QualificationDirective:
|
||||
sprintf(cType,"QUALDIR");
|
||||
break;
|
||||
case IS41OPR_TransferToNumberRequest:
|
||||
sprintf(cType,"TRANUMREQ");
|
||||
break;
|
||||
case IS41OPR_RedirectionRequest:
|
||||
sprintf(cType,"REDREQ");
|
||||
break;
|
||||
|
||||
default: // unknown operation
|
||||
// sprintf(info_str,"MAPP error:the operation is unknown:%d",opr_ptr->message_type);
|
||||
// xap_send_error(info_str);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}*/
|
||||
|
||||
int build_is41param(struct MapOprSrv_struct *opr_ptr,u8 *buf) // build is41 service paramter
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u8 seq_flag=1;
|
||||
int param_len = 0;
|
||||
u8 info_str[1024];
|
||||
char charName[128];
|
||||
|
||||
if (opr_ptr == NULL || buf == NULL)
|
||||
return 0;
|
||||
if (!is41_u8Type_to_charType(opr_ptr->message_type,charName))
|
||||
{
|
||||
is41_debug(IS41DB_ENCODE,"[IS41-Encode]Building param,Operation code:%d not correct",opr_ptr->message_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (opr_ptr->message_flag == MAP_REQUEST)
|
||||
{
|
||||
is41_debug(IS41DB_ENCODE,"[IS41-Encode] MAP_REQUEST,OPRType=%s",charName);
|
||||
param_len = (*is41_assign_arg[opr_ptr->message_type]) (opr_ptr,buf);
|
||||
}
|
||||
else if (opr_ptr->message_flag == MAP_RESPONSE)
|
||||
{
|
||||
is41_debug(IS41DB_ENCODE,"[IS41-Encode] MAP_RESPONSE,OPRType=%s",charName);
|
||||
param_len = (*is41_assign_rsp[opr_ptr->message_type])(opr_ptr,buf);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
||||
if (seq_flag == 1 && param_len > 0)
|
||||
{
|
||||
memcpy(info_str,buf,param_len%1024);
|
||||
AsnEncode(buf,256,&asn_buf);
|
||||
param_len = AddTLV(SET_NATIONAL,param_len,info_str,0xe0,&asn_buf);
|
||||
is41_debug(IS41DB_ENCODE,"[IS41-Encode] Completed,len=%d",param_len);
|
||||
is41_showbuf(IS41DB_ENCODE,buf,param_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
AsnEncode(buf,256,&asn_buf);
|
||||
param_len = AddTLV(SET_NATIONAL,0,info_str,0xc0,&asn_buf);
|
||||
is41_debug(IS41DB_ENCODE,"[IS41-Encode] Completed,paramlen=0");
|
||||
is41_showbuf(IS41DB_ENCODE,buf,param_len);
|
||||
}
|
||||
return param_len;
|
||||
}
|
||||
|
||||
u8 extract_is41param(struct MapOprSrv_struct *opr_ptr,u8 opr_code,u8 opr_flag,u32 pre_param_len,u8 *pre_param)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
// u8 info_str[1024];
|
||||
u8 param[1024];
|
||||
int param_len;
|
||||
char charName[128];
|
||||
|
||||
asn_decode(pre_param,1,&asn_buf);
|
||||
param_len = get_tlv(SET_NATIONAL,param,&asn_buf);
|
||||
|
||||
if (param_len == -1) // not has sequence id
|
||||
{
|
||||
param_len = pre_param_len;
|
||||
memcpy(param,pre_param,param_len);
|
||||
}
|
||||
|
||||
if (!is41_u8Type_to_charType(opr_code,charName))
|
||||
{
|
||||
is41_debug(IS41DB_ENCODE,"[IS41-Encode]Extracting param,Operation code:%d not correct",opr_code);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (opr_flag == MAP_INDICATE)
|
||||
{
|
||||
is41_debug(IS41DB_DECODE,"[IS41-Decode]USER->IS41P,IS41_INDICATE,OPRType=%s",charName);
|
||||
is41_showbuf(IS41DB_DECODE,param,param_len);
|
||||
if (*is41_extract_arg[opr_code] != NULL)
|
||||
{
|
||||
return (*is41_extract_arg[opr_code])(opr_ptr,param_len,param);
|
||||
}
|
||||
else
|
||||
{
|
||||
is41_debug(IS41DB_ERR,"[IS41-Decode]No decode function for IS41_INDICATE opr_code=%d",opr_code);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if (opr_flag == MAP_CONFIRM)
|
||||
{
|
||||
is41_debug(IS41DB_DECODE,"[IS41-Decode]USER->IS41P,MAP_CONFIRM,OPRType=%s",charName);
|
||||
is41_showbuf(IS41DB_DECODE,param,param_len);
|
||||
if (*is41_extract_rsp[opr_code] != NULL)
|
||||
return (*is41_extract_rsp[opr_code])(opr_ptr,param_len,param);
|
||||
else
|
||||
{
|
||||
is41_debug(IS41DB_ERR,"[IS41-Decode]No decode function for IS41_CONFIRM opr_code=%d",opr_code);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
3650
plat/xapp/src/mapp/is41_debug.c
Normal file
3650
plat/xapp/src/mapp/is41_debug.c
Normal file
File diff suppressed because it is too large
Load Diff
23
plat/xapp/src/mapp/is41_init.c
Normal file
23
plat/xapp/src/mapp/is41_init.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/* IS41 init c file */
|
||||
/* created by daniel zhang 2004-06-18 */
|
||||
/* last modify by daniel zhang 2004-07-13 */
|
||||
/* version 1.0 */
|
||||
/* ------------------------------------ */
|
||||
|
||||
void is41_debug_setup();
|
||||
void is41_debug_timer();
|
||||
|
||||
|
||||
void init_assignFunc_pointer();
|
||||
void init_extractFunc_pointer();
|
||||
void is41_init()
|
||||
{
|
||||
is41_debug_setup();
|
||||
init_assignFunc_pointer();
|
||||
init_extractFunc_pointer();
|
||||
}
|
||||
|
||||
void is41_timer()
|
||||
{
|
||||
is41_debug_timer();
|
||||
}
|
||||
430
plat/xapp/src/mapp/map_LCSCode.c
Normal file
430
plat/xapp/src/mapp/map_LCSCode.c
Normal file
@@ -0,0 +1,430 @@
|
||||
#include "map_includes.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int extract_RoutingInfoForLCS_Arg(RoutingInfoForLCS_Arg *ptr,u32 buf_len,u8 *buf)
|
||||
|
||||
{
|
||||
|
||||
ASN_BUF asn_buf;
|
||||
|
||||
int len;
|
||||
|
||||
u8 temp_buf[256];
|
||||
|
||||
u32 flag=0;
|
||||
|
||||
|
||||
|
||||
if (buf_len == 0)
|
||||
|
||||
{
|
||||
|
||||
mapp_log_debug("extract RoutingInfoForLCS_Arg param len is:0");
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
|
||||
return RER;
|
||||
|
||||
len = get_tlv("0",temp_buf,&asn_buf); /* mlc number */
|
||||
|
||||
if (len > 1 && len <= ISDN_LEN)
|
||||
|
||||
{
|
||||
|
||||
flag |= 0x01;
|
||||
|
||||
ptr->mlcNumber[0] = len;
|
||||
|
||||
memcpy(ptr->mlcNumber+1,temp_buf,len);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
mapp_log_debug("extract RoutingInfoForLCS_Arg:loss MLC number");
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (get_tlv("1",temp_buf,&asn_buf) != -1)/* targetMs */
|
||||
|
||||
{
|
||||
|
||||
flag |= 0x02;
|
||||
|
||||
len = get_tlv("1.0",temp_buf,&asn_buf); // IMSI
|
||||
|
||||
if (len == IMSI_LEN && (temp_buf[IMSI_LEN-1]&0xf0) == 0xf0)
|
||||
|
||||
{
|
||||
|
||||
ptr->targetMs.identityChoice = 0x01;
|
||||
|
||||
memcpy(ptr->targetMs.imsi,temp_buf,IMSI_LEN);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
len = get_tlv("1.1",temp_buf,&asn_buf); // msisdn
|
||||
|
||||
if (len > 0 && len <= ISDN_LEN)
|
||||
|
||||
{
|
||||
|
||||
ptr->targetMs.identityChoice = 0x02;
|
||||
|
||||
ptr->targetMs.msisdn[0] = len;
|
||||
|
||||
memcpy(ptr->targetMs.msisdn+1,temp_buf,len);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
mapp_log_debug("extract RoutingInfoForLCS_Arg:loss TargetMs");
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
ptr->param_flag = flag;
|
||||
|
||||
return buf_len;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int assign_RoutingInfoForLCS_Res(RoutingInfoForLCS_Res *ptr,u8 *buf, u8 ver)
|
||||
|
||||
{
|
||||
|
||||
ASN_BUF asn_buf;
|
||||
|
||||
u32 flag;
|
||||
|
||||
int buf_len=0;
|
||||
|
||||
u8 len;
|
||||
|
||||
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
|
||||
flag = ptr->param_flag;
|
||||
|
||||
|
||||
|
||||
if (flag & 0x01) /* targetMs */
|
||||
|
||||
{
|
||||
|
||||
if (ptr->targetMs.identityChoice == 1) // IMSI
|
||||
|
||||
buf_len = add_tlv("0.0",IMSI_LEN,ptr->targetMs.imsi,0x80,&asn_buf);
|
||||
|
||||
else if (ptr->targetMs.identityChoice == 2) // msisdn
|
||||
|
||||
{
|
||||
|
||||
len = ptr->targetMs.msisdn[0];
|
||||
|
||||
buf_len = add_tlv("0.1",len,ptr->targetMs.msisdn+1,0x80,&asn_buf);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
return RER;
|
||||
|
||||
|
||||
|
||||
if (flag & 0x02)/* mscNumber */
|
||||
|
||||
{
|
||||
|
||||
len = ptr->mscNumber[0];
|
||||
|
||||
buf_len = add_tlv("1.4-1",len,ptr->mscNumber+1,0x00,&asn_buf);
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
mapp_log_debug("assign RoutingInfoForLCS_Res:loss MSC NUMBER");
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return buf_len;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int extract_ProvideSubscriberLocation_Arg(ProvideSubscriberLocation_Arg *ptr,u32 buf_len,u8 *buf)
|
||||
|
||||
{
|
||||
|
||||
ASN_BUF asn_buf;
|
||||
|
||||
int len;
|
||||
|
||||
u8 temp_buf[256];
|
||||
|
||||
u32 flag=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (buf_len == 0)
|
||||
|
||||
{
|
||||
|
||||
mapp_log_debug("extract ProvideSubscriberLocation_Arg param len is:0");
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
|
||||
return RER;
|
||||
|
||||
|
||||
|
||||
if((len=get_tlv("16-1.0",temp_buf,&asn_buf)) > 0)/* locationType */
|
||||
|
||||
{
|
||||
|
||||
flag |= 0x01;
|
||||
|
||||
ptr->locationType.locationEstimateType = temp_buf[0];
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
return RER;
|
||||
|
||||
|
||||
|
||||
if((len=get_tlv("4-2",temp_buf,&asn_buf)) > 0)/* MLC number */
|
||||
|
||||
{
|
||||
|
||||
flag |= 0x02;
|
||||
|
||||
ptr->mlcNumber[0] = len;
|
||||
|
||||
memcpy(ptr->mlcNumber+1,temp_buf,len);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
return RER;
|
||||
|
||||
|
||||
|
||||
if ((len=get_tlv("2",temp_buf,&asn_buf)) != -1) /* imsi */
|
||||
|
||||
{
|
||||
|
||||
if (len == IMSI_LEN)
|
||||
|
||||
{
|
||||
|
||||
flag |= 0x08;
|
||||
|
||||
memcpy(ptr->imsi,temp_buf,len);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ((len=get_tlv("3",temp_buf,&asn_buf)) != -1) /* msisdn */
|
||||
|
||||
{
|
||||
|
||||
if (len > 0 && len <= ISDN_LEN)
|
||||
|
||||
{
|
||||
|
||||
flag |= 0x04;
|
||||
|
||||
ptr->msisdn[0] = len;
|
||||
|
||||
memcpy(ptr->msisdn+1,temp_buf,len);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ptr->param_flag = flag;
|
||||
|
||||
return buf_len;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int assign_ProvideSubscriberLocation_Res(ProvideSubscriberLocation_Res *ptr,u8 *buf, u8 ver)
|
||||
|
||||
{
|
||||
|
||||
ASN_BUF asn_buf;
|
||||
|
||||
u32 flag;
|
||||
|
||||
int buf_len=0;
|
||||
|
||||
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
|
||||
flag = ptr->param_flag;
|
||||
|
||||
if (flag & 0x01)/* locationEstimate */
|
||||
|
||||
{
|
||||
|
||||
u8 locationEstimate[maxExtGeographicalInformation] = {0};
|
||||
|
||||
if(ptr->locationEstimate.typeOfShape != EllipsoidPoint) /* only support EllipsoidPoint */
|
||||
|
||||
return RER;
|
||||
|
||||
locationEstimate[0] |= ptr->locationEstimate.typeOfShape << 4;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(ptr->locationEstimate.degreesOfLatitude >= 0)
|
||||
|
||||
locationEstimate[1] &= 0x00;
|
||||
|
||||
else
|
||||
|
||||
locationEstimate[1] |= 0x80;
|
||||
|
||||
ptr->locationEstimate.degreesOfLatitude &= 0x7fffff;
|
||||
|
||||
locationEstimate[1] |= ptr->locationEstimate.degreesOfLatitude >> 16;
|
||||
|
||||
locationEstimate[2] = ptr->locationEstimate.degreesOfLatitude >> 8;
|
||||
|
||||
locationEstimate[3] = ptr->locationEstimate.degreesOfLatitude & 0xff;
|
||||
|
||||
|
||||
|
||||
ptr->locationEstimate.degreesOfLongitude &= 0xffffff;
|
||||
|
||||
locationEstimate[4] = ptr->locationEstimate.degreesOfLongitude >> 16;
|
||||
|
||||
locationEstimate[5] = ptr->locationEstimate.degreesOfLongitude >> 8;
|
||||
|
||||
locationEstimate[6] = ptr->locationEstimate.degreesOfLongitude & 0xff;
|
||||
|
||||
|
||||
|
||||
buf_len = add_tlv("4-1",7,locationEstimate,0x00,&asn_buf);
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
return RER;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (flag & 0x02)/* cgi */
|
||||
|
||||
{
|
||||
|
||||
u8 cgi[16] = {0};
|
||||
|
||||
if(ptr->cgi.cgiOrLaiChoice != CgiOrSai) /* only support cgiOrSai */
|
||||
|
||||
return RER;
|
||||
|
||||
memcpy(cgi,ptr->cgi.mccMnc,3);
|
||||
|
||||
cgi[3] = ptr->cgi.lac >> 8;
|
||||
|
||||
cgi[4] = ptr->cgi.lac & 0xff;
|
||||
|
||||
cgi[5] = ptr->cgi.cellId >> 8;
|
||||
|
||||
cgi[6] = ptr->cgi.cellId & 0xff;
|
||||
|
||||
buf_len = add_tlv("6-2.0",7,cgi,0x80,&asn_buf);
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return buf_len;
|
||||
|
||||
}
|
||||
|
||||
260
plat/xapp/src/mapp/map_LCSCode.h
Normal file
260
plat/xapp/src/mapp/map_LCSCode.h
Normal file
@@ -0,0 +1,260 @@
|
||||
|
||||
|
||||
/***************** LCS **************
|
||||
|
||||
#define AC_locationServiceGateWay 37
|
||||
|
||||
#define AC_locationServiceEnquiry 38
|
||||
|
||||
|
||||
|
||||
#define RoutingInfoForLCS 85
|
||||
|
||||
#define ProvideSubscriberLocation 83
|
||||
|
||||
**************** LCS **************/
|
||||
|
||||
|
||||
|
||||
typedef struct _SubscriberIdentity
|
||||
|
||||
{
|
||||
|
||||
u8 identityChoice; /*1:imsi,2:msisdn*/
|
||||
|
||||
u8 msisdn[ISDN_LEN+1]; /* TBCD */
|
||||
|
||||
u8 imsi[IMSI_LEN+1]; /* TBCD */
|
||||
|
||||
}SubscriberIdentity;
|
||||
|
||||
|
||||
|
||||
typedef struct _MapRoutingInfoForLCS_Arg
|
||||
|
||||
{
|
||||
|
||||
u32 param_flag;
|
||||
|
||||
u8 mlcNumber[ISDN_LEN+1]; /* TBCD */
|
||||
|
||||
SubscriberIdentity targetMs;
|
||||
|
||||
u8 user_error;
|
||||
|
||||
u8 provider_error;
|
||||
|
||||
}RoutingInfoForLCS_Arg;
|
||||
|
||||
|
||||
|
||||
typedef struct _MapRoutingInfoForLCS_Res
|
||||
|
||||
{
|
||||
|
||||
u32 param_flag;
|
||||
|
||||
SubscriberIdentity targetMs;
|
||||
|
||||
u8 mscNumber[ISDN_LEN+1]; /* TBCD */
|
||||
|
||||
u8 user_error;
|
||||
|
||||
u8 provider_error;
|
||||
|
||||
}RoutingInfoForLCS_Res;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum _LocationEstimateType
|
||||
|
||||
{
|
||||
|
||||
currentLocation = 0,
|
||||
|
||||
currentOrLastKnownLocation,
|
||||
|
||||
initialLocation,
|
||||
|
||||
activateDeferredLocation,
|
||||
|
||||
cancelDeferredLocation,
|
||||
|
||||
notificationVerificationOnly
|
||||
|
||||
}LocationEstimateType;
|
||||
|
||||
|
||||
|
||||
typedef enum _DeferredLocationEventType
|
||||
|
||||
{
|
||||
|
||||
msAvailable = 0,
|
||||
|
||||
enteringIntoArea,
|
||||
|
||||
leavingFromArea,
|
||||
|
||||
beingInsideArea,
|
||||
|
||||
periodicLDR
|
||||
|
||||
}DeferredLocationEventType;
|
||||
|
||||
|
||||
|
||||
typedef struct _LocationType
|
||||
|
||||
{
|
||||
|
||||
LocationEstimateType locationEstimateType;
|
||||
|
||||
DeferredLocationEventType deferredLocationEventType;
|
||||
|
||||
}LocationType;
|
||||
|
||||
|
||||
|
||||
typedef struct _ProvideSubscriberLocation_Arg
|
||||
|
||||
{
|
||||
|
||||
u32 param_flag;
|
||||
|
||||
LocationType locationType;
|
||||
|
||||
u8 mlcNumber[ISDN_LEN+1]; /* TBCD */
|
||||
|
||||
u8 msisdn[ISDN_LEN+1]; /* TBCD */
|
||||
|
||||
u8 imsi[IMSI_LEN+1]; /* TBCD */
|
||||
|
||||
u8 user_error;
|
||||
|
||||
u8 provider_error;
|
||||
|
||||
}ProvideSubscriberLocation_Arg;
|
||||
|
||||
|
||||
|
||||
typedef enum _TypeOfShape
|
||||
|
||||
{
|
||||
|
||||
EllipsoidPoint = 0,
|
||||
|
||||
EllipsoidPointWithUncertaintyCircle = 1,
|
||||
|
||||
EllipsoidPointWithUncertaintyEllipse = 3,
|
||||
|
||||
Polygon = 5,
|
||||
|
||||
EllipsoidPointWithAltitude = 8,
|
||||
|
||||
EllipsoidPointWithAltitudeAndUncertaintyEllipsoid = 9,
|
||||
|
||||
EllipsoidArc =10
|
||||
|
||||
}TypeOfShape;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define maxExtGeographicalInformation 20
|
||||
|
||||
typedef struct _LocationEstimate
|
||||
|
||||
{
|
||||
|
||||
TypeOfShape typeOfShape;/* only support EllipsoidPoint */
|
||||
|
||||
long degreesOfLatitude;
|
||||
|
||||
long degreesOfLongitude;
|
||||
|
||||
u8 reserve[maxExtGeographicalInformation - 7];
|
||||
|
||||
}LocationEstimate;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum _CgiSaiOrLaiChoice
|
||||
|
||||
{
|
||||
|
||||
CgiOrSai = 1,
|
||||
|
||||
LAI = 2
|
||||
|
||||
}CgiSaiOrLaiChoice;
|
||||
|
||||
|
||||
|
||||
typedef struct _CGI
|
||||
|
||||
{
|
||||
|
||||
CgiSaiOrLaiChoice cgiOrLaiChoice;
|
||||
|
||||
/*
|
||||
|
||||
-- octet 1 bits 4321 Mobile Country Code 1st digit
|
||||
|
||||
-- bits 8765 Mobile Country Code 2nd digit
|
||||
|
||||
-- octet 2 bits 4321 Mobile Country Code 3rd digit
|
||||
|
||||
-- bits 8765 Mobile Network Code 3rd digit
|
||||
|
||||
-- or filler (1111) for 2 digit MNCs
|
||||
|
||||
-- octet 3 bits 4321 Mobile Network Code 1st digit
|
||||
|
||||
-- bits 8765 Mobile Network Code 2nd digit
|
||||
|
||||
-- octets 4 and 5 Location Area Code according to 3GPP TS 24.008
|
||||
|
||||
-- octets 6 and 7 Cell Identity (CI) value or
|
||||
|
||||
-- Service Area Code (SAC) value
|
||||
|
||||
-- according to 3GPP TS 23.003
|
||||
|
||||
*/
|
||||
|
||||
u8 mccMnc[3]; /* tbcd */
|
||||
|
||||
u16 lac; /* integer */
|
||||
|
||||
u16 cellId; /* integer */
|
||||
|
||||
}CGI;
|
||||
|
||||
|
||||
|
||||
typedef struct _ProvideSubscriberLocation_Res
|
||||
|
||||
{
|
||||
|
||||
u32 param_flag;
|
||||
|
||||
LocationEstimate locationEstimate;
|
||||
|
||||
CGI cgi;
|
||||
|
||||
u8 user_error;
|
||||
|
||||
u8 provider_error;
|
||||
|
||||
}ProvideSubscriberLocation_Res;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
75
plat/xapp/src/mapp/map_acn.h
Normal file
75
plat/xapp/src/mapp/map_acn.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* MAP application context name head file */
|
||||
/* Written by Liu zhiguo 2001-12-28 */
|
||||
/* Version 1.0 (according GSM 09.02 17.3.3) */
|
||||
/* ---------------------------------------- */
|
||||
#ifndef _MAP_ACN
|
||||
#define _MAP_ACN
|
||||
|
||||
/* public portion */
|
||||
#define Identified_Organization 0x04
|
||||
#define ETSI 0x00
|
||||
#define MobileDomain 0x00
|
||||
#define GSM_Network 0x01
|
||||
#define AC_ID 0x00
|
||||
#define AC_Version1 0x01
|
||||
#define AC_Version2 0x02
|
||||
#define AC_Version3 0x03
|
||||
/* private portion */
|
||||
#define AC_networkLocUp 1 // network loction update
|
||||
#define AC_locationCancel 2 // location cancel
|
||||
#define AC_roamingNbEnquiry 3 // roaming number enquiry
|
||||
#define AC_locInfoRetrieval 5 // location info retrieval
|
||||
#define AC_reset 10 // reset context
|
||||
#define AC_handoverControl 11 // handover control
|
||||
#define AC_equipmentMngt 13 // equipment management
|
||||
#define AC_infoRetrieval 14 // info retrieval
|
||||
#define AC_interVlrInfoRetrieval 15
|
||||
#define AC_subscriberDataMngt 16
|
||||
#define AC_tracing 17 // tracing
|
||||
#define AC_networkFunctionalSs 18
|
||||
#define AC_networkUnstructuredSs 19
|
||||
#define AC_shortMsgGateway 20
|
||||
#define AC_shortMsgMoRelay 21
|
||||
#define AC_shortMsgAlert 23
|
||||
#define AC_mwdMngt 24
|
||||
#define AC_shortMsgMtRelay 25
|
||||
#define AC_imsiRetrieval 26
|
||||
#define AC_msPurging 27
|
||||
#define AC_subsriberInfoEnquiry 28
|
||||
#define AC_anyTimeInfoEnquiry 29
|
||||
#define AC_callControlTransfer 6
|
||||
#define AC_ssInvNotify 36 // ss-InvocationNotificationContext
|
||||
#define AC_sIWFSAllocation 12 // sIWFSAllocationContext
|
||||
#define AC_groupCallControl 31 // group call control context
|
||||
#define AC_gprsLocUp 32 // GPRS location update context
|
||||
#define AC_gprsLocInfoRetrieval 33 // GPRS location info retrieval context
|
||||
#define AC_failureReport 34 // failure report context
|
||||
#define AC_gprsNotify 35 // GPRS notify context
|
||||
#define AC_reporting 7 // reporting context
|
||||
#define AC_callCompletion 8 // call completion context
|
||||
#define AC_authFailReport 39 //authenticationFailureReport add by gxchen
|
||||
#define AC_istAlert 4 //istAlertingContext ist-Alert add by gxchen
|
||||
#define AC_serviceTermination 9 //serviceTerminationContext ist-Command add by gxchen
|
||||
|
||||
#define AC_anyTimeInfoHandling 43
|
||||
|
||||
/* MAP-H application context */
|
||||
#define AC_SecurityTriplet 200 // security triplet
|
||||
#define AC_SubsInter 201 // subscriber interrogate
|
||||
#define AC_HLRSubsMng 202 // HLR subscriber management
|
||||
#define AC_HLRPingAUC 203 // HLR ping AUC
|
||||
|
||||
#define AC_VlrCamelPhase 209
|
||||
|
||||
/* Opr,vlr,hlr ACN */
|
||||
#define OprVlrACN 210
|
||||
#define OprHlrACN 211
|
||||
|
||||
/***************** LCS **************/
|
||||
#define AC_locationServiceGateWay 37
|
||||
#define AC_locationServiceEnquiry 38
|
||||
/***************** LCS **************/
|
||||
|
||||
#define AC_Test 255
|
||||
|
||||
#endif
|
||||
343
plat/xapp/src/mapp/map_code.h
Normal file
343
plat/xapp/src/mapp/map_code.h
Normal file
@@ -0,0 +1,343 @@
|
||||
/* MAP operation and error code */
|
||||
/* written by liu zhiguo 2001-07-25 */
|
||||
/* Version 1.0 (according GSM 09.02 17.5) */
|
||||
/* ------------------------------------- */
|
||||
#ifndef _MAP_CODE
|
||||
#define _MAP_CODE
|
||||
|
||||
/* +++++++++++++++++ */
|
||||
/* MAP message type */
|
||||
/* +++++++++++++++++ */
|
||||
/* dialogue control portion */
|
||||
#define MAP_OPEN 0xff
|
||||
#define MAP_CLOSE 0xfe
|
||||
#define MAP_U_ABORT 0xfd
|
||||
#define MAP_P_ABORT 0xfc
|
||||
#define MAP_NOTICE 0xfb
|
||||
#define MAP_DELIMITER 0xfa
|
||||
#define MAP_LINK 0xef
|
||||
|
||||
#define MAP_REQUEST 0x01
|
||||
#define MAP_INDICATE 0x02
|
||||
#define MAP_RESPONSE 0x03
|
||||
#define MAP_CONFIRM 0x04
|
||||
|
||||
/* ++++++++++++++++++++ */
|
||||
/* MAP operation code */
|
||||
/* ++++++++++++++++++++ */
|
||||
|
||||
/* locaion registration operation codes */
|
||||
#define UpLoc 2 // update location
|
||||
#define CancelLoc 3 // cancel location
|
||||
#define PurgeMS 67 // purge mobile station
|
||||
#define SndIdent 55 // send identification
|
||||
|
||||
/* handover operatin codes */
|
||||
#define PreHo 68 // prepare handover
|
||||
#define SndEndSig 29 // send end signal
|
||||
#define ProcAccSig 33 // process access signalling
|
||||
#define FwdAccSig 34 // forward access signalling
|
||||
#define PreSubsHo 69 // prepare subsequent handover
|
||||
|
||||
/* authentication operation codes */
|
||||
#define SndAuthInfo 56 // send authentication information
|
||||
#define AuthFailReport 15 //authenticationFailureReport add by gxchen
|
||||
|
||||
/* IMEI management operation codes */
|
||||
#define ChkIMEI 43 // check IMEI
|
||||
|
||||
/* subscriber management operation codes */
|
||||
#define InsSubData 7 // insert subscriber data
|
||||
#define DelSubData 8 // delete subscriber data
|
||||
#define SendParam 9 // send parameters
|
||||
|
||||
/* fault recovery operation codes */
|
||||
#define Reset 37 // reset
|
||||
#define FwdChkSSInd 38 // forward check SS indication
|
||||
#define RestoreData 57 // restore data
|
||||
|
||||
/* operation and maintenance operation codes */
|
||||
#define ActvTraceMode 50 // active trace mode
|
||||
#define DeactvTraceMode 51 // deactive trace mode
|
||||
#define SndIMSI 58 // send IMSI
|
||||
|
||||
/* call handling operation codes */
|
||||
#define SndRoutInfo 22 // send routing information
|
||||
#define ProvRoamNum 4 // provide roaming number
|
||||
#define ResumeCH 6 // resume call handling
|
||||
#define ProvSIWFSNum 31 // provide SIWFS nunmber
|
||||
#define SIWFSSigMdf 32 // SIWFS signalling modify
|
||||
#define SetRepState 73 // set report state
|
||||
#define StatusRep 74 // status report
|
||||
#define RmtUserFree 75 // remote user free
|
||||
#define IstAlert 87 //ist-Alert add by gxchen
|
||||
#define IstCommand 88 //ist-Command add by gxchen
|
||||
|
||||
/* supplementary service handling operation codes */
|
||||
#define RegSS 10 // register SS
|
||||
#define EraseSS 11 // erase SS
|
||||
#define ActvSS 12 // activate SS
|
||||
#define DeactvSS 13 // deactivate SS
|
||||
#define InterSS 14 // interrogate SS
|
||||
#define ProcUnstrctSSReq 59 // process unstructure SS request
|
||||
#define UnstrctSSReq 60 // unstructure SS request
|
||||
#define UnstrctSSNoti 61 // unstructure SS notify
|
||||
#define RegPasswd 17 // register password
|
||||
#define GetPasswd 18 // get password
|
||||
#define RegCCEntry 76 // register CC entry
|
||||
#define EraseCCEntry 77 // erase CC entry
|
||||
|
||||
/* short message service operation codes */
|
||||
#define SndRoutInfoForSM 45 // send routing information for SM
|
||||
#define FwdSM 46 // Forward SM V1
|
||||
#define MOFwdSM 46 // MO-forward SM
|
||||
#define MTFwdSM 46 // MT-forward SM
|
||||
#define MTFwdSM_v3 44
|
||||
#define RptSMDelvStat 47 // report SM delivery status
|
||||
#define InfSC 63 // inform service center
|
||||
#define AlrtSC 64 // alert service center
|
||||
#define RdyForSM 66 // ready for SM
|
||||
|
||||
/* provide subsriber info operation codes */
|
||||
#define ProvSubInfo 70 // provider subscriber information
|
||||
|
||||
/* any time interrogation operation codes */
|
||||
#define AnyTimeInter 71 // any time interrogation
|
||||
|
||||
/* any time subscription interrogation operation codes */
|
||||
#define AnyTimeSubInter 62 // any time subscription interrogation
|
||||
|
||||
/* supplementary service invocation notification operation codes */
|
||||
#define SSInvNoti 72 // SS invocation notification
|
||||
|
||||
/* group call operation codes */
|
||||
#define PreGrpCall 39 // prepare group call
|
||||
#define SndGrpCallEndSig 40 // send group call end signal
|
||||
#define ProcGrpCallSig 41 // process group call signalling
|
||||
#define FwdGrpCallSig 42 // forward group call signalling
|
||||
|
||||
/* GPRS location updating operation codes */
|
||||
#define UpGprsLoc 23 // update GPRS location
|
||||
|
||||
/* GPRS location information retrieval operation codes */
|
||||
#define SndRoutInfoForGprs 24 // send routing info for GPRS
|
||||
|
||||
/* failure reportin operation codes */
|
||||
#define FailRep 25 // failure report
|
||||
|
||||
/* GPRS notification operation codes */
|
||||
#define NoteMsPresForGprs 26 // note ms present for GPRS
|
||||
|
||||
/* MAP-H operaion codes, defined by owner */
|
||||
#define SecuTrip 200 // security triplets
|
||||
#define InterrSubs 201 // interrogate subscriber
|
||||
#define CreateSubs 202 // create subscriber
|
||||
#define DelSubs 203 // deleter subscriber
|
||||
#define PingAuc 204 // HLR ping AUC
|
||||
|
||||
/* +++++++++++++++++++++++++ */
|
||||
/* MAP operation error code */
|
||||
/* +++++++++++++++++++++++++ */
|
||||
|
||||
/* generic error codes */
|
||||
#define SysFail 34 // system failure
|
||||
#define DataMissing 35
|
||||
#define UnexpDataVal 36 // unexpected data value
|
||||
#define FaciNotSpprt 21 // facility not support
|
||||
#define IncomTerm 28 // incompatible terminal
|
||||
#define ResLimit 51 // resource limitation
|
||||
|
||||
/* identification and numbering error codes */
|
||||
#define UnknwnSub 1 // unknown subscriber
|
||||
#define NumChng 44 // number changed
|
||||
#define UnknwnMSC 3 // unknown MSC
|
||||
#define UnidentSub 5 // unidentified subscriber
|
||||
#define UnknwnEquip 7 // unkown equipment
|
||||
|
||||
/* subscription error codes */
|
||||
#define RoamNotAllow 8 // roaming not allowed
|
||||
#define IllgSub 9 // illegal subscriber
|
||||
#define IllgEquip 12 // illegal equipment
|
||||
#define BSNotProv 10 // bearer service not provisioned
|
||||
#define TSNotProv 11 // teleservice not provisioned
|
||||
|
||||
/* handover error codes */
|
||||
#define NoHONumAvail 25 // no handover number available
|
||||
#define SubsHOFail 26 // subsequent handover failure
|
||||
|
||||
/* operation and maintenance error codes */
|
||||
#define TrcBufferFull 40 // tracing buffer full
|
||||
|
||||
/* call handling error codes */
|
||||
#define NoRoamNumAvail 39 // no roaming number available
|
||||
#define AbsentSub 27 // absent subscriber
|
||||
#define BusySub 45 // busy subscriber
|
||||
#define NoSubReply 46 // no subscriber reply
|
||||
#define CallBarred 13
|
||||
#define FwdFail 47 // forwarding failing
|
||||
#define OR_NotAllow 48 // OR not allowed
|
||||
#define FwdViolate 14 // forwarding violate
|
||||
#define CUG_Reject 15
|
||||
|
||||
/* any time interrogatin error codes */
|
||||
#define ATI_NotAllow 49 // ati not allowed
|
||||
#define InformationNotAvailable 62
|
||||
|
||||
/* group call error codes */
|
||||
#define NoGrpCallNumAvail 50 // no group call number available
|
||||
|
||||
/* supplementary service error codes */
|
||||
#define IllgSSOper 16 // illegal SS operation
|
||||
#define SSErrStatus 17 // SS error status
|
||||
#define SSNotAvail 18 // SS not available
|
||||
#define SSSubscViolate 19 // SS subscription violation
|
||||
#define SSIncompat 20 // SS incompatibility
|
||||
#define UnknwnAlph 71 // unknown alphabet
|
||||
#define USSDBusy 72
|
||||
#define PWRegFail 37 // pw-registration failure
|
||||
#define NegPWCheck 38 // negative pw-check
|
||||
#define NumOfPWAttViolate 43 // number of pw-attempts violation
|
||||
#define ShortTermDen 29 // short term denial
|
||||
#define LongTermDen 30 // long term denial
|
||||
|
||||
/* short message service error codes */
|
||||
#define SubBusyForMTSMS 31 // subscriber busy for MT-SMS
|
||||
#define SMDelivFail 32 // SM-delivery failure
|
||||
#define MsgWaitListFull 33 // message waiting list full
|
||||
#define AbsentSubSM 6 // absent subscriber SM
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++ */
|
||||
/* MAP operation provider error */
|
||||
/* defined by user */
|
||||
/* ++++++++++++++++++++++++++++++++ */
|
||||
#define DupInvokeId 101 // duplicated invoke id
|
||||
#define SrvNotSupport 102 // service not supported
|
||||
#define MistypeParam 103 // mistyped parameter
|
||||
#define ResourceLimit 104 // resource limitation
|
||||
#define InitRelease 105 // initiating release
|
||||
#define UnexpResFromPeer 106 // unexpected response from the peer
|
||||
#define SrvCompleteFailure 107 // service completion failure
|
||||
#define NoResFromPeer 108 // no response from the peer
|
||||
#define InvResReceive 109 // invalid response received
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++ */
|
||||
/* the following codes is reserved */
|
||||
/* ++++++++++++++++++++++++++++++++ */
|
||||
|
||||
/* reserved operation codes */
|
||||
#define SndParam 9 // send parameter
|
||||
#define ProcUnstrctSSData 19 // process unstructure SS data
|
||||
#define PerformHo 28 // perform handover
|
||||
#define PerformSubsHo 30 // perform subsequence handvoer
|
||||
#define NoteInterHo 35 // note internal handover
|
||||
#define NoteSubPrnt 48 // not subscriber present
|
||||
#define AlrtSCWithoutRes 49 // alert service center without result
|
||||
#define TraceSubAct 52 // trace subscriber activity
|
||||
#define BeginSubAct 54 // beging subscriber activity
|
||||
|
||||
/* reserved error codes */
|
||||
#define UnknwnBS 2 // unknowd base station
|
||||
#define InvalidTBS 23 // invalid target base station
|
||||
#define NoRRAvail 24 // no radio resource available
|
||||
|
||||
/* MAP OPEN response result */
|
||||
#define OpenResultRefuse 0x01
|
||||
#define OpenResultAccept 0x02
|
||||
|
||||
/* MAP OPEN refuse result */
|
||||
#define ACNotSupported 0x01
|
||||
#define InvalidDesReference 0x02 // invalid destination reference
|
||||
#define InvalidOrgReference 0x03 // invalid original reference
|
||||
#define NoReasonGiven 0x04
|
||||
#define RemoteNodeNotReachable 0x05
|
||||
#define PotentialVerIncompat 0x06 // potential version incompatibility
|
||||
|
||||
/* MAP CLOSE release method */
|
||||
#define NormalRelease 0x01
|
||||
#define PrearrangedEnd 0x02
|
||||
|
||||
/* MAP U-ABORT user reason */
|
||||
#define ResourceLimite 0x01
|
||||
#define ResourceUnavailable 0x02
|
||||
#define ApplicationCancel 0x03
|
||||
#define ProcedureError 0x04
|
||||
|
||||
/* MAP U-AOBRT diagnostic information */
|
||||
#define ShortTermProblem 0x01
|
||||
#define LongTermProblem 0x02
|
||||
#define HandoverCancel 0x03
|
||||
#define RadioChannelRelease 0x04
|
||||
#define NetworkPathRelease 0x05
|
||||
#define CallRelease 0x06
|
||||
#define AssociateProcedureFailure 0x07
|
||||
#define TandemDialogueRelease 0x08
|
||||
#define RemoteOperationFailure 0x09
|
||||
|
||||
/* MAP P-ABORT provider reason */
|
||||
#define ProviderMalfunction 0x01
|
||||
#define SupportingReleased 0x02
|
||||
#define ResourceLimitation 0x03
|
||||
#define MaintenanceActivity 0x04
|
||||
#define VersionIncompatibility 0x05
|
||||
#define AbnormalMAPDialogue 0x06
|
||||
|
||||
/* MAP P-ABORT source */
|
||||
#define MAPProblem 0x01
|
||||
#define TCProblem 0x02
|
||||
#define NetworkProblem 0x03
|
||||
|
||||
/* MAP NOTICE problem diagnostic */
|
||||
#define AbnormalEventDetect 0x01
|
||||
#define ResponseRejected 0x02
|
||||
#define AbnormalEventReceived 0x03
|
||||
#define MessageNotDelivered 0x04
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////lw add MAP V1 Modify
|
||||
|
||||
#define SendParam 9 // send parameters
|
||||
#define NoteSubPrnt 48 // not subscriber present
|
||||
#define ProcUnstrctSSData 19 // process unstructure SS data
|
||||
#define BeginSubAct 54 // beging subscriber activity
|
||||
#define PerformHo 28 // perform handover
|
||||
#define PerformSubsHo 30 // perform subsequence handvoer
|
||||
#define NoteInterHo 35 // note internal handover
|
||||
#define BeginSubAct 54 // beging subscriber activity
|
||||
#define AlrtSCWithoutRes 49 // alert service center without result
|
||||
#define TraceSubAct 52 // trace subscriber activity
|
||||
//////////////////////////////////////
|
||||
|
||||
/**** OPR VLR message ********/
|
||||
#define DetermineOprUser 128
|
||||
#define VlrUpdateLocation 129
|
||||
/**** OPR VLR message ********/
|
||||
|
||||
/**** OPR HLR message ********/
|
||||
#define CreateUserWithMsisdnImsi 130
|
||||
#define DeleteOprUser 131
|
||||
/**** OPR HLR message ********/
|
||||
|
||||
/**** IMDM VLR message ********/
|
||||
#define VlrEnquiryIMDMStatus 132
|
||||
/**** IMDM VLR message ********/
|
||||
|
||||
/***************** LCS **************/
|
||||
#define RoutingInfoForLCS 85
|
||||
#define ProvideSubscriberLocation 83
|
||||
/***************** LCS **************/
|
||||
|
||||
|
||||
///////////////////////////////////Jink add MNP AIN (ANSI TCAP) start
|
||||
//National Operations code
|
||||
#define ProvideInstructionStart 3
|
||||
// opr_ptr->message_type = ProvideInstructionStart; opr_ptr->message_flag = 1;
|
||||
#define ConnectionControlConnect 4
|
||||
///////////////////////////////////Jink add MNP AIN (ANSI TCAP) end
|
||||
|
||||
|
||||
#endif
|
||||
436
plat/xapp/src/mapp/map_code_auc.c
Normal file
436
plat/xapp/src/mapp/map_code_auc.c
Normal file
@@ -0,0 +1,436 @@
|
||||
/* map coding auc service file */
|
||||
/* written by Liu Zhiguo 2002-06-03 */
|
||||
/* Version 2.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#include "map_includes.h"
|
||||
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding security triplets argument */
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_securityTriplets_arg(struct MapST_Arg *ptr,u8 *buf, u8 version)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
int temp_len;
|
||||
u8 temp_buf[256];
|
||||
u8 tag1 = 1;
|
||||
char tlv1[8];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
|
||||
sprintf(tlv1, "4-%d", tag1++);
|
||||
if(ptr->param_flag & 0x01) //imsi
|
||||
buf_len = add_tlv(tlv1,IMSI_LEN,ptr->imsi,0x00,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
sprintf(tlv1, "4-%d", tag1++);
|
||||
if(ptr->param_flag & 0x02) //hlr_id
|
||||
buf_len = add_tlv(tlv1,HLRID_LEN,ptr->hlr_id,0x00,&asn_buf);
|
||||
/* sprintf(tlv1, "1-%d", tag1++);
|
||||
if(ptr->param_flag & 0x04)
|
||||
buf_len = add_tlv(tlv1, 1, (u8*)&ptr->choice_flag, 0x80, &asn_buf);*/
|
||||
|
||||
//quintuplet add by gxchen
|
||||
if(version == 3)
|
||||
{
|
||||
sprintf(tlv1, "2-%d", tag1++);
|
||||
if(ptr->param_flag & 0x04)
|
||||
buf_len = add_tlv(tlv1, 1, &ptr->num_req_vec, 0x00, &asn_buf);
|
||||
else
|
||||
{
|
||||
mapp_log_debug("version_4 assign security arg lack numberOfRequestedVectors");
|
||||
// return RER; //temp take out
|
||||
}
|
||||
sprintf(tlv1, "5-%d", tag1++);
|
||||
if(ptr->param_flag & 0x08)
|
||||
buf_len = add_tlv(tlv1, 1, &ptr->seg_prohibit, 0x00, &asn_buf);
|
||||
sprintf(tlv1, "1-%d", tag1++);
|
||||
if(ptr->param_flag & 0x10)
|
||||
buf_len = add_tlv(tlv1, 1, &ptr->imm_res_prefer, 0x80, &asn_buf);
|
||||
sprintf(tlv1, "16");
|
||||
if(ptr->param_flag & 0x20)
|
||||
{
|
||||
temp_len = assign_authReSynInfo(&ptr->resyn_info, temp_buf);
|
||||
if(temp_len != RER)
|
||||
buf_len = add_tlv(tlv1, temp_len, temp_buf, 0x20, &asn_buf);
|
||||
}
|
||||
sprintf(tlv1, "3-%d", tag1++);
|
||||
if(ptr->param_flag & 0x40)
|
||||
buf_len = add_tlv(tlv1, 1, (u8*)&ptr->node_type, 0x80, &asn_buf);
|
||||
sprintf(tlv1, "4-%d", tag1++);
|
||||
if(ptr->param_flag & 0x80)
|
||||
buf_len = add_tlv(tlv1, 3, ptr->req_plmn_id, 0x80, &asn_buf);
|
||||
sprintf(tlv1, "5-%d", tag1++);
|
||||
if(ptr->param_flag & 0x100)
|
||||
buf_len = add_tlv(tlv1, 1, &ptr->num_req_add_vec, 0x80, &asn_buf);
|
||||
sprintf(tlv1, "6-%d", tag1++);
|
||||
if(ptr->param_flag & 0x200)
|
||||
buf_len = add_tlv(tlv1, 1, &ptr->add_vec_eps, 0x80, &asn_buf);
|
||||
}
|
||||
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_securityTriplets_arg(struct MapST_Arg *ptr,u32 buf_len,u8 *buf, u8 version)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u8 temp_buf[256];
|
||||
int len;
|
||||
u8 tag1 = 1;
|
||||
char tlv1[8];
|
||||
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_securityTriplets_arg buf_len=0");
|
||||
return RER;
|
||||
}
|
||||
if(asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
ptr->param_flag = 0;
|
||||
|
||||
sprintf(tlv1, "4-%d", tag1++);
|
||||
len = get_tlv(tlv1,temp_buf,&asn_buf);
|
||||
if(len == IMSI_LEN && (temp_buf[IMSI_LEN-1]&0xf0) == 0xf0 ) //imsi
|
||||
{
|
||||
ptr->param_flag |= 0x01;
|
||||
memcpy(ptr->imsi,temp_buf,len);
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("%s: lack IMSI", __FUNCTION__);
|
||||
return RER;
|
||||
}
|
||||
sprintf(tlv1, "4-%d", tag1++);
|
||||
if((len=get_tlv(tlv1,temp_buf,&asn_buf)) == HLRID_LEN ) //hlr_id
|
||||
{
|
||||
ptr->param_flag |= 0x02;
|
||||
memcpy(ptr->hlr_id,temp_buf,len);
|
||||
}
|
||||
/* sprintf(tlv1, "1-%d", tag1++);
|
||||
if((get_tlv(tlv1, temp_buf, &asn_buf)) == 1) //choice_flag
|
||||
{
|
||||
ptr->param_flag |= 0x04;
|
||||
ptr->choice_flag = temp_buf[0];
|
||||
}*/
|
||||
|
||||
//quintuplet add by gxchen
|
||||
if(version == 3)
|
||||
{
|
||||
sprintf(tlv1, "2-%d", tag1++);
|
||||
if(get_tlv(tlv1, temp_buf, &asn_buf) == 1)
|
||||
{
|
||||
ptr->param_flag |= 0x04;
|
||||
ptr->num_req_vec = temp_buf[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
mapp_log_debug("%s: lack numberOfRequestedVectors", __FUNCTION__);
|
||||
// return RER; //temp take out
|
||||
}
|
||||
sprintf(tlv1, "5-%d", tag1++);
|
||||
if(get_tlv(tlv1, temp_buf, &asn_buf) == 1)
|
||||
{
|
||||
ptr->param_flag |= 0x08;
|
||||
ptr->seg_prohibit = temp_buf[0];
|
||||
}
|
||||
sprintf(tlv1, "1-%d", tag1++);
|
||||
if(get_tlv(tlv1, temp_buf, &asn_buf) == 1)
|
||||
{
|
||||
ptr->param_flag |= 0x10;
|
||||
ptr->imm_res_prefer = temp_buf[0];
|
||||
}
|
||||
sprintf(tlv1, "16");
|
||||
if((len = get_tlv(tlv1, temp_buf, &asn_buf)) > 0)
|
||||
{
|
||||
ptr->param_flag |= 0x20;
|
||||
extract_authReSynInfo(&ptr->resyn_info, len, temp_buf);
|
||||
}
|
||||
sprintf(tlv1, "3-%d", tag1++);
|
||||
if(get_tlv(tlv1, temp_buf, &asn_buf) == 1)
|
||||
{
|
||||
ptr->param_flag |= 0x40;
|
||||
ptr->node_type = temp_buf[0];
|
||||
}
|
||||
sprintf(tlv1, "4-%d", tag1++);
|
||||
if(get_tlv(tlv1, temp_buf, &asn_buf) > 0)
|
||||
{
|
||||
ptr->param_flag |= 0x80;
|
||||
memcpy(ptr->req_plmn_id, temp_buf, 3);
|
||||
}
|
||||
sprintf(tlv1, "5-%d", tag1++);
|
||||
if(get_tlv(tlv1, temp_buf, &asn_buf) == 1)
|
||||
{
|
||||
ptr->param_flag |= 0x100;
|
||||
ptr->num_req_add_vec = temp_buf[0];
|
||||
}
|
||||
sprintf(tlv1, "6-%d", tag1++);
|
||||
if(get_tlv(tlv1, temp_buf, &asn_buf) == 1)
|
||||
{
|
||||
ptr->param_flag |= 0x200;
|
||||
ptr->add_vec_eps = temp_buf[0];
|
||||
}
|
||||
}
|
||||
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding security triplets response */
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_securityTriplets_res(struct MapST_Res *ptr,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
int ii;
|
||||
char tlv1[32];
|
||||
int temp_len;
|
||||
u8 temp_buf[256];
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
if ((ptr->param_flag & 0x2) == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--assign_securityTriplets_res flag=0");
|
||||
return RER;
|
||||
}
|
||||
if(ptr->param_flag & 0x01)
|
||||
buf_len = add_tlv("1", 1, (u8*)&ptr->choice_flag, 0x80, &asn_buf);
|
||||
|
||||
if(ptr->choice_flag == AUTH_LIST_QUINTUPLET) //add by gxchen
|
||||
{
|
||||
if (ptr->choice.quin_list.quin_len > AUTHLIST_LEN)
|
||||
{
|
||||
mapp_log_debug("MAPP--assign_securityTriplets_res quintuplet auth_len>AUTHLIST_LEN");
|
||||
return RER;
|
||||
}
|
||||
for(ii = 0; ii < ptr->choice.quin_list.quin_len && ii < 1; ii ++)
|
||||
{
|
||||
temp_len = assign_quintuplet(&ptr->choice.quin_list.quintuplet[ii], temp_buf);
|
||||
if(temp_len == RER)
|
||||
break;
|
||||
sprintf(tlv1, "16-%d", ii+1);
|
||||
buf_len = add_tlv(tlv1, temp_len, temp_buf, 0x20, &asn_buf);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ptr->choice.tri_list.tri_len > AUTHLIST_LEN)
|
||||
{
|
||||
mapp_log_debug("MAPP--assign_securityTriplets_res auth_len>AUTHLIST_LEN");
|
||||
return RER;
|
||||
}
|
||||
for (ii = 0;ii < ptr->choice.tri_list.tri_len;ii ++)
|
||||
{
|
||||
temp_len = assign_authset((AuthSet_struct*)&ptr->choice.tri_list.triplet[ii],temp_buf);
|
||||
if (temp_len == RER)
|
||||
break;
|
||||
sprintf(tlv1,"16-%d",ii+1);
|
||||
buf_len = add_tlv(tlv1,temp_len,temp_buf,0x20,&asn_buf);
|
||||
}
|
||||
}
|
||||
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_securityTriplets_res(struct MapST_Res *ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
u8 temp_buf[256];
|
||||
char tlv1[32];
|
||||
int ii;
|
||||
int len;
|
||||
ASN_BUF asn_buf;
|
||||
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_securityTriplets_res buf_len=0");
|
||||
return ROK;
|
||||
}
|
||||
if(asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
ptr->param_flag = 0;
|
||||
|
||||
//add by gxchen
|
||||
if((get_tlv("1", temp_buf, &asn_buf)) == 1) //choice flag
|
||||
{
|
||||
ptr->param_flag |= 0x01;
|
||||
ptr->choice_flag = temp_buf[0];
|
||||
}
|
||||
if(ptr->choice_flag == AUTH_LIST_QUINTUPLET) //quintuplet
|
||||
{
|
||||
ptr->choice.quin_list.quin_len = 0;
|
||||
for(ii = 0; ii < AUTHLIST_LEN; ii++)
|
||||
{
|
||||
sprintf(tlv1, "16-%d", ii+1);
|
||||
len = get_tlv(tlv1, temp_buf, &asn_buf);
|
||||
if(len <= 0) //has not data
|
||||
break;
|
||||
if(!extract_quintuplet(&ptr->choice.quin_list.quintuplet[ii], len, temp_buf))
|
||||
break;
|
||||
ptr->param_flag |= 0x02;
|
||||
ptr->choice.quin_list.quin_len++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr->choice.tri_list.tri_len = 0;
|
||||
for(ii = 0;ii < AUTHLIST_LEN;ii ++)
|
||||
{
|
||||
sprintf(tlv1,"16-%d",ii+1);
|
||||
len = get_tlv(tlv1,temp_buf,&asn_buf);
|
||||
if (len == -1)
|
||||
break;
|
||||
if (!extract_authset((AuthSet_struct*)&ptr->choice.tri_list.triplet[ii],len,temp_buf))
|
||||
break;
|
||||
ptr->param_flag |= 0x02;
|
||||
ptr->choice.tri_list.tri_len++;
|
||||
}
|
||||
}
|
||||
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding interrogation subscriber argument */
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_interrogateSubscriber_arg(struct MapIS_Arg *ptr,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
u32 flag;
|
||||
|
||||
flag = ptr->param_flag;
|
||||
asn_encode(buf,&asn_buf);
|
||||
if(flag & 0x01) //imsi
|
||||
buf_len = add_tlv("4-1",IMSI_LEN,ptr->imsi,0x00,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
if(flag & 0x02) //hlr_id
|
||||
buf_len = add_tlv("4-2",HLRID_LEN,ptr->hlr_id,0x00,&asn_buf);
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_interrogateSubscriber_arg(struct MapIS_Arg *ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u8 temp_buf[256];
|
||||
int len;
|
||||
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_interrogateSubscriber_arg buf_len=0");
|
||||
return RER;
|
||||
}
|
||||
if(asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
ptr->param_flag = 0;
|
||||
len = get_tlv("4-1",temp_buf,&asn_buf);
|
||||
if(len == IMSI_LEN && (temp_buf[IMSI_LEN-1]&0xf0) == 0xf0 )//imsi
|
||||
{
|
||||
ptr->param_flag|=0x01;
|
||||
memcpy(ptr->imsi,temp_buf,len);
|
||||
}
|
||||
else
|
||||
return RER;
|
||||
if((get_tlv("4-2",temp_buf,&asn_buf)) == HLRID_LEN)//hlr_id
|
||||
{
|
||||
ptr->param_flag |= 0x02;
|
||||
memcpy(ptr->hlr_id,temp_buf,HLRID_LEN);
|
||||
}
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding create subscriber argument */
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_createSubscriber_arg(struct MapCS_Arg *ptr,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
u32 flag;
|
||||
|
||||
flag = ptr->param_flag;
|
||||
asn_encode(buf,&asn_buf);
|
||||
if(flag & 0x01) //imsi
|
||||
buf_len = add_tlv("4-1",IMSI_LEN,ptr->imsi,0x00,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
if(flag & 0x02) //hlr_id
|
||||
buf_len = add_tlv("4-2",HLRID_LEN,ptr->hlr_id,0x00,&asn_buf);
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_createSubscriber_arg(struct MapCS_Arg *ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u8 temp_buf[256];
|
||||
int len;
|
||||
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_createSubscriber_arg buf_len=0");
|
||||
return RER;
|
||||
}
|
||||
if(asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
ptr->param_flag = 0;
|
||||
len = get_tlv("4-1",temp_buf,&asn_buf);
|
||||
if(len == IMSI_LEN && (temp_buf[7]&0xf0) == 0xf0) //imsi
|
||||
{
|
||||
ptr->param_flag |= 0x01;
|
||||
memcpy(ptr->imsi,temp_buf,len);
|
||||
}
|
||||
if((get_tlv("4-2",temp_buf,&asn_buf))==HLRID_LEN) //hlr_id
|
||||
{
|
||||
ptr->param_flag |= 0x02;
|
||||
memcpy(ptr->hlr_id,temp_buf,HLRID_LEN);
|
||||
}
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding delete subscriber argument */
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_deleteSubscriber_arg(struct MapDS_Arg *ptr,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
u32 flag;
|
||||
|
||||
flag = ptr->param_flag;
|
||||
asn_encode(buf,&asn_buf);
|
||||
if(flag & 0x01) //imsi
|
||||
buf_len = add_tlv("4-1",IMSI_LEN,ptr->imsi,0x00,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
if(flag & 0x02) //hlr_id
|
||||
buf_len = add_tlv("4-2",HLRID_LEN,ptr->hlr_id,0x00,&asn_buf);
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_deleteSubscriber_arg(struct MapDS_Arg *ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
u8 temp_buf[256];
|
||||
int len;
|
||||
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_createSubscriber_arg buf_len=0");
|
||||
return RER;
|
||||
}
|
||||
if(asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
ptr->param_flag = 0;
|
||||
len = get_tlv("4-1",temp_buf,&asn_buf);
|
||||
if(len == IMSI_LEN && (temp_buf[7]&0xf0) == 0xf0) //imsi
|
||||
{
|
||||
ptr->param_flag |= 0x01;
|
||||
memcpy(ptr->imsi,temp_buf,len);
|
||||
}
|
||||
if((get_tlv("4-2",temp_buf,&asn_buf))==HLRID_LEN) //hlr_id
|
||||
{
|
||||
ptr->param_flag |= 0x02;
|
||||
memcpy(ptr->hlr_id,temp_buf,HLRID_LEN);
|
||||
}
|
||||
return ROK;
|
||||
}
|
||||
1937
plat/xapp/src/mapp/map_code_ch.c
Normal file
1937
plat/xapp/src/mapp/map_code_ch.c
Normal file
File diff suppressed because it is too large
Load Diff
210
plat/xapp/src/mapp/map_code_dlgpdu.c
Normal file
210
plat/xapp/src/mapp/map_code_dlgpdu.c
Normal file
@@ -0,0 +1,210 @@
|
||||
/* MAP dialogue PDU coding/decoding c file */
|
||||
/* Written by Liu Zhiguo 2003-08-25 */
|
||||
/* Version: 1.0 */
|
||||
/* -------------------------------------- */
|
||||
|
||||
#include "map_includes.h"
|
||||
#include "../../../tcap/src/include/tcap_head.h"
|
||||
#include "../../../tcap/src/include/tcap_public.h"
|
||||
#include "../../../tcap/src/include/tcap_struct.h"
|
||||
#include "../xap_interfunc.h"
|
||||
#include "map_dlgpdu.h"
|
||||
|
||||
|
||||
static u8 MAPP_Dlgpdu[7] = {0x04,0x00,0x00,0x01,0x01,0x01,0x01};
|
||||
|
||||
u8 build_mapdlg(struct MapDlg_struct *dlg_ptr,u8 *data_buf) // build user information portion
|
||||
{
|
||||
struct MapDlgOpen_struct *map_open;
|
||||
struct MapDlgUAbort_struct *map_uabort;
|
||||
ASN_BUF asn_buf;
|
||||
u8 temp_buf[256],temp_data[256];
|
||||
int len=0,len1=0;
|
||||
|
||||
asn_encode(temp_buf,&asn_buf);
|
||||
switch (dlg_ptr->dlg_type)
|
||||
{
|
||||
case MAPDLG_OPEN:
|
||||
map_open = (MapDlgOpen_struct *) &dlg_ptr->map_dlg.map_open;
|
||||
if ((map_open->param_flag & 0x01))
|
||||
len1 = add_tlv("0.0",map_open->peer_ref[0],map_open->peer_ref+1,0x80,&asn_buf);
|
||||
if ((map_open->param_flag & 0x02))
|
||||
len1 = add_tlv("0.1",map_open->local_ref[0],map_open->local_ref+1,0x80,&asn_buf);
|
||||
break;
|
||||
case MAPDLG_ACCEPT:
|
||||
len1 = add_tlv("1",0,&dlg_ptr->dlg_type,0x80,&asn_buf);
|
||||
break;
|
||||
case MAPDLG_CLOSE:
|
||||
len1 = add_tlv("2",0,&dlg_ptr->dlg_type,0x80,&asn_buf);
|
||||
break;
|
||||
case MAPDLG_REFUSE:
|
||||
temp_data[0] = dlg_ptr->map_dlg.map_refuse.reason;
|
||||
len1 = add_tlv("3.10",1,temp_data,0x00,&asn_buf);
|
||||
break;
|
||||
case MAPDLG_UABORT:
|
||||
map_uabort = (MapDlgUAbort_struct *) &dlg_ptr->map_dlg.map_uabort;
|
||||
switch (map_uabort->choice_flag)
|
||||
{
|
||||
case 0:
|
||||
len1 = add_null("4.0",0x00,&asn_buf);
|
||||
break;
|
||||
case 1:
|
||||
len1 = add_null("4.1",0x00,&asn_buf);
|
||||
break;
|
||||
case 2:
|
||||
temp_data[0] = map_uabort->choice.resunavi;
|
||||
len1 = add_tlv("4.2.10",1,temp_data,0x00,&asn_buf);
|
||||
break;
|
||||
case 3:
|
||||
temp_data[0] = map_uabort->choice.appproccancel;
|
||||
len1 = add_tlv("4.3.10",1,temp_data,0x00,&asn_buf);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case MAPDLG_PABORT:
|
||||
temp_data[0] = dlg_ptr->map_dlg.map_pabort.reason;
|
||||
len1 = add_tlv("5.10",1,temp_data,0x00,&asn_buf);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
asn_encode(data_buf,&asn_buf);
|
||||
len = add_tlv("8",0,temp_data,0x20,&asn_buf);
|
||||
len = add_tlv("8.6-1",7,MAPP_Dlgpdu,0x00,&asn_buf);
|
||||
len = add_tlv("8.0-2",len1,temp_buf,0xa0,&asn_buf);
|
||||
return len;
|
||||
}
|
||||
|
||||
u8 extract_mapdlg(struct MapDlg_struct *dlg_ptr,struct dlgport_struct *port_ptr)
|
||||
{
|
||||
struct MapDlgOpen_struct *map_open;
|
||||
struct MapDlgUAbort_struct *map_uabort;
|
||||
ASN_BUF asn_buf;
|
||||
u8 temp_buf[256],temp_data[256];
|
||||
int len;
|
||||
|
||||
dlg_ptr->dlg_type = 0xff;
|
||||
len = asn_decode(port_ptr->user_info,1,&asn_buf);
|
||||
if (len != port_ptr->user_info_len)
|
||||
{
|
||||
sprintf((char *)temp_buf, "MAPP extract user info error, wrong length, %d v.s. %d", len, port_ptr->user_info_len);
|
||||
xap_send_error((char *)temp_buf);
|
||||
//return 0;
|
||||
}
|
||||
len = get_tlv("8",temp_buf,&asn_buf); // get External tag
|
||||
if (len == -1) // has nor external tag
|
||||
{
|
||||
xap_send_error("MAPP extract user info error, no external Tag");
|
||||
return 0;
|
||||
}
|
||||
len = get_tlv("8.6",temp_buf,&asn_buf);
|
||||
if (len == 7) // get MAP dialgoue PDU
|
||||
{
|
||||
if (temp_buf[5] != 1 || temp_buf[6] != 1)
|
||||
{
|
||||
xap_send_error("MAPP extract user info error identifier");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
len = get_tlv("8.0",temp_buf,&asn_buf); // get ASN.1 type
|
||||
if (len == -1)
|
||||
{
|
||||
xap_send_error("MAPP extract user info error ASN.1 type");
|
||||
return 0;
|
||||
}
|
||||
len = asn_decode(temp_buf,1,&asn_buf);
|
||||
len = get_tlv("0",temp_data,&asn_buf); // MAP_OPEN info
|
||||
if (len != -1)
|
||||
{
|
||||
dlg_ptr->dlg_type = MAPDLG_OPEN;
|
||||
map_open = (MapDlgOpen_struct *) &dlg_ptr->map_dlg.map_open;
|
||||
map_open->param_flag = 0;
|
||||
len = get_tlv("0.0",temp_data,&asn_buf); // local reference
|
||||
if (len != -1)
|
||||
{
|
||||
map_open->param_flag |= 0x02;
|
||||
map_open->local_ref[0] = len;
|
||||
memcpy(map_open->local_ref+1,temp_data,len);
|
||||
}
|
||||
len = get_tlv("0.1",temp_data,&asn_buf); // peer reference
|
||||
if (len != -1)
|
||||
{
|
||||
map_open->param_flag |= 0x01;
|
||||
map_open->peer_ref[0] = len;
|
||||
memcpy(map_open->peer_ref+1,temp_data,len);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
len = get_tlv("1",temp_data,&asn_buf); // MAP_ACCEPT info
|
||||
if (len != -1)
|
||||
{
|
||||
dlg_ptr->dlg_type = MAPDLG_ACCEPT;
|
||||
return 1;
|
||||
}
|
||||
len = get_tlv("2",temp_data,&asn_buf); // MAP_CLOSE info
|
||||
if (len != -1)
|
||||
{
|
||||
dlg_ptr->dlg_type = MAPDLG_CLOSE;
|
||||
return 1;
|
||||
}
|
||||
len = get_tlv("3",temp_data,&asn_buf); // MAP_REFUSE info
|
||||
if (len != -1)
|
||||
{
|
||||
dlg_ptr->dlg_type = MAPDLG_REFUSE;
|
||||
len = get_tlv("3.10",temp_data,&asn_buf);
|
||||
if (len != 1)
|
||||
{
|
||||
xap_send_error("MAPP extract user info refuse lack reason");
|
||||
return 0;
|
||||
}
|
||||
dlg_ptr->map_dlg.map_refuse.param_flag = 0x01;
|
||||
dlg_ptr->map_dlg.map_refuse.reason = temp_data[0];
|
||||
return 1;
|
||||
}
|
||||
len = get_tlv("4",temp_data,&asn_buf); // MAP_UABORT info
|
||||
if (len != -1)
|
||||
{
|
||||
dlg_ptr->dlg_type = MAPDLG_UABORT;
|
||||
map_uabort = (MapDlgUAbort_struct *) &dlg_ptr->map_dlg.map_uabort;
|
||||
len = get_tlv("4.0",temp_data,&asn_buf); // user specific reason
|
||||
if (len != -1)
|
||||
map_uabort->choice_flag = 0;
|
||||
len = get_tlv("4.1",temp_data,&asn_buf); // user resource limitation
|
||||
if (len != -1)
|
||||
map_uabort->choice_flag = 1;
|
||||
len = get_tlv("4.2",temp_data,&asn_buf); // resource unabailable
|
||||
if (len != -1)
|
||||
{
|
||||
map_uabort->choice_flag = 2;
|
||||
len = get_tlv("4.2.10",temp_data,&asn_buf);
|
||||
if (len == -1)
|
||||
return 0;
|
||||
map_uabort->choice.resunavi = temp_data[0];
|
||||
}
|
||||
len = get_tlv("4.3",temp_data,&asn_buf); // APC
|
||||
if (len != -1)
|
||||
{
|
||||
map_uabort->choice_flag = 3;
|
||||
len = get_tlv("4.3.10",temp_data,&asn_buf);
|
||||
if (len == -1)
|
||||
return 0;
|
||||
map_uabort->choice.appproccancel = temp_data[0];
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
len = get_tlv("5",temp_data,&asn_buf); // MAP_PAOBRT info
|
||||
if (len != -1)
|
||||
{
|
||||
dlg_ptr->dlg_type = MAPDLG_PABORT;
|
||||
len = get_tlv("5.10",temp_data,&asn_buf);
|
||||
if (len != 1)
|
||||
return 0;
|
||||
dlg_ptr->map_dlg.map_pabort.param_flag = 0x01;
|
||||
dlg_ptr->map_dlg.map_pabort.reason = temp_data[0];
|
||||
return 1;
|
||||
}
|
||||
xap_send_error("MAPP extract user info unknown type");
|
||||
return 0;
|
||||
}
|
||||
5305
plat/xapp/src/mapp/map_code_ms.c
Normal file
5305
plat/xapp/src/mapp/map_code_ms.c
Normal file
File diff suppressed because it is too large
Load Diff
231
plat/xapp/src/mapp/map_code_om.c
Normal file
231
plat/xapp/src/mapp/map_code_om.c
Normal file
@@ -0,0 +1,231 @@
|
||||
/* map coding operation & maintenance c file */
|
||||
/* written by Liu Zhiguo 2003-03-04 */
|
||||
/* Version 2.0 */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
#include "map_includes.h"
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding activate trace mode argument */
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_acttrcmodearg(struct MapATM_Arg *atm_ptr,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
if (atm_ptr->param_flag & 0x01) // imsi
|
||||
buf_len = add_tlv("0",IMSI_LEN,atm_ptr->imsi,0x80,&asn_buf);
|
||||
if (atm_ptr->param_flag & 0x02) // trace reference
|
||||
buf_len = add_tlv("1",2,atm_ptr->trace_ref,0x80,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
if (atm_ptr->param_flag & 0x04) // trace type
|
||||
buf_len = add_int("2",atm_ptr->trace_type,0x80,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
if (atm_ptr->param_flag & 0x08) // omc id
|
||||
buf_len = add_tlv("3",atm_ptr->omc_id[0],atm_ptr->omc_id+1,0x80,&asn_buf);
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_acttrcmodearg(struct MapATM_Arg *atm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
|
||||
atm_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_activate trace mode buf_len=0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf);
|
||||
if (len==IMSI_LEN && (temp_buf[IMSI_LEN-1]&0xf0) == 0xf0) //get imsi
|
||||
{
|
||||
atm_ptr->param_flag |= 0x01;
|
||||
memcpy(atm_ptr->imsi,temp_buf,IMSI_LEN);
|
||||
}
|
||||
if (get_tlv("1",temp_buf,&asn_buf) == 2)
|
||||
{
|
||||
atm_ptr->param_flag |= 0x02;
|
||||
memcpy(atm_ptr->trace_ref,temp_buf,2);
|
||||
}
|
||||
else
|
||||
return RER;
|
||||
if (get_tlv("2",temp_buf,&asn_buf) == 1)
|
||||
{
|
||||
atm_ptr->param_flag |= 0x04;
|
||||
atm_ptr->trace_type = temp_buf[0];
|
||||
}
|
||||
else
|
||||
return RER;
|
||||
len = get_tlv("3",temp_buf,&asn_buf);
|
||||
if (len > 0 && len <= ISDN_LEN)
|
||||
{
|
||||
atm_ptr->param_flag |= 0x08;
|
||||
atm_ptr->omc_id[0] = len;
|
||||
memcpy(atm_ptr->omc_id+1,temp_buf,len);
|
||||
}
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding activate trace mode response */
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_acttrcmoderes(struct MapATM_Res *atm_ptr,u8 *buf)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int extract_acttrcmoderes(struct MapATM_Res *atm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding deactivate trace mode argument */
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_deacttrcmodearg(struct MapDTM_Arg *dtm_ptr,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
if (dtm_ptr->param_flag & 0x01) // imsi
|
||||
buf_len = add_tlv("0",IMSI_LEN,dtm_ptr->imsi,0x80,&asn_buf);
|
||||
if (dtm_ptr->param_flag & 0x02) // trace reference
|
||||
buf_len = add_tlv("1",2,dtm_ptr->trace_ref,0x80,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_deacttrcmodearg(struct MapDTM_Arg *dtm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
|
||||
dtm_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_deactivate trace mode buf_len=0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("0",temp_buf,&asn_buf);
|
||||
if (len==IMSI_LEN && (temp_buf[IMSI_LEN-1]&0xf0) == 0xf0) //get imsi
|
||||
{
|
||||
dtm_ptr->param_flag |= 0x01;
|
||||
memcpy(dtm_ptr->imsi,temp_buf,IMSI_LEN);
|
||||
}
|
||||
if (get_tlv("1",temp_buf,&asn_buf) == 2)
|
||||
{
|
||||
dtm_ptr->param_flag |= 0x02;
|
||||
memcpy(dtm_ptr->trace_ref,temp_buf,2);
|
||||
}
|
||||
else
|
||||
return RER;
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding deactivate trace mode response */
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_deacttrcmoderes(struct MapDTM_Res *dtm_ptr,u8 *buf)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int extract_deacttrcmoderes(struct MapDTM_Res *dtm_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding send IMSI argument */
|
||||
/* ++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_sndimsiarg(struct MapSIMSI_Arg *sim_ptr,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
if (sim_ptr->param_flag & 0x01) // msisdn
|
||||
buf_len = add_tlv("4",sim_ptr->msisdn[0],sim_ptr->msisdn+1,0x00,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_sndimsiarg(struct MapSIMSI_Arg *sim_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
|
||||
sim_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_send imsi buf_len=0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("4",temp_buf,&asn_buf);
|
||||
if (len > 0 && len <= ISDN_LEN)
|
||||
{
|
||||
sim_ptr->param_flag |= 0x01;
|
||||
sim_ptr->msisdn[0] = len;
|
||||
memcpy(sim_ptr->msisdn+1,temp_buf,len);
|
||||
}
|
||||
else
|
||||
return RER;
|
||||
return ROK;
|
||||
}
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++ */
|
||||
/* encoding/decoding send IMSI response */
|
||||
/* ++++++++++++++++++++++++++++++++++++ */
|
||||
int assign_sndimsires(struct MapSIMSI_Res *sim_ptr,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int buf_len=0;
|
||||
|
||||
asn_encode(buf,&asn_buf);
|
||||
if (sim_ptr->param_flag & 0x01) // imsi
|
||||
buf_len = add_tlv("4",IMSI_LEN,sim_ptr->imsi,0x00,&asn_buf);
|
||||
else
|
||||
return RER;
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
int extract_sndimsires(struct MapSIMSI_Res *sim_ptr,u32 buf_len,u8 *buf)
|
||||
{
|
||||
ASN_BUF asn_buf;
|
||||
int len;
|
||||
u8 temp_buf[256];
|
||||
|
||||
sim_ptr->param_flag = 0;
|
||||
if (buf_len == 0)
|
||||
{
|
||||
mapp_log_debug("MAPP--extract_send imsi buf_len=0");
|
||||
return RER;
|
||||
}
|
||||
if (asn_decode_v3(buf,buf_len,&decErr,&asn_buf) == -1)
|
||||
return RER;
|
||||
len = get_tlv("4",temp_buf,&asn_buf);
|
||||
if (len == IMSI_LEN && (temp_buf[IMSI_LEN-1]&0xf0) == 0xf0)
|
||||
{
|
||||
sim_ptr->param_flag |= 0x01;
|
||||
memcpy(sim_ptr->imsi,temp_buf,IMSI_LEN);
|
||||
}
|
||||
else
|
||||
return RER;
|
||||
return ROK;
|
||||
}
|
||||
1322
plat/xapp/src/mapp/map_code_sms.c
Normal file
1322
plat/xapp/src/mapp/map_code_sms.c
Normal file
File diff suppressed because it is too large
Load Diff
1647
plat/xapp/src/mapp/map_code_ss.c
Normal file
1647
plat/xapp/src/mapp/map_code_ss.c
Normal file
File diff suppressed because it is too large
Load Diff
2345
plat/xapp/src/mapp/map_coding.c
Normal file
2345
plat/xapp/src/mapp/map_coding.c
Normal file
File diff suppressed because it is too large
Load Diff
546
plat/xapp/src/mapp/map_coding.h
Normal file
546
plat/xapp/src/mapp/map_coding.h
Normal file
@@ -0,0 +1,546 @@
|
||||
/* MAP coding head file */
|
||||
/* written by Liu Zhiguo 2003-03-04 */
|
||||
/* version 2.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#ifndef _MAP_CODING
|
||||
#define _MAP_CODING
|
||||
|
||||
/* define in map_code_ms.c */
|
||||
int assign_uplocarg(struct MapUL_Arg *ul_ptr,u8 *buf,u8 ver);
|
||||
int extract_uplocarg(struct MapUL_Arg *ul_ptr,u32 buf_len,u8 *buf ,u8 ver);
|
||||
int assign_uplocres(struct MapUL_Res *ul_ptr,u8 *buf);
|
||||
int extract_uplocres(struct MapUL_Res *ul_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
|
||||
/* ------------------------>>>>>>>>>>>>>>>> MAP v1 <<<<<<<<<<<<<<<<<<<<<<<<<----------------*/
|
||||
|
||||
//int assign_sendParameterres(struct MapSP_Res *sp_ptr,u8 *buf);
|
||||
//int extract_sendParameterArg(struct MapSP_Arg *sp_ptr,u32 buf_len,u8 *buf,u32 dialogue_id);
|
||||
|
||||
int assign_SendParaArg(struct MapSP_Arg *sendpara_ptr,u8 *buf);
|
||||
int extract_SendParaArg(struct MapSP_Arg *sendpara_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_SendParaRes(struct MapSP_Res *sp_ptr,u8 *buf);
|
||||
int extract_SendParaRes(struct MapSP_Res *sp_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_NotPresentArg(struct MapNP_Arg *np_ptr, u8 *buf);
|
||||
int extract_NotPresentArg( struct MapNP_Arg *np_ptr,u32 buf_len,u8 *buf) ;
|
||||
|
||||
int assign_ProcessUSSDArg(struct MapPUSSD_Arg *ussd_ptr, u8 *buf);
|
||||
int extract_ProcessUSSDArg( struct MapPUSSD_Arg *ussd_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_ProcessUSSDRes(struct MapPUSSD_Res *ussd_ptr, u8 *buf) ;
|
||||
int extract_ProcessUSSDRes( struct MapPUSSD_Res *ussd_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_SAArg(struct MapSA_Arg *sa_ptr, u8 *buf) ;
|
||||
int extract_SAArg( struct MapSA_Arg *sa_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_HOArg(struct MapHO_Arg *ho_ptr, u8 *buf) ;
|
||||
int extract_HOArg( struct MapHO_Arg *ho_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_HORes(struct MapHO_Res *ho_ptr, u8 *buf) ;
|
||||
int extract_HORes( struct MapHO_Res *ho_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_PFSHOArg(struct MapPFSHO_Arg *psho_ptr, u8 *buf);
|
||||
int extract_PFSHOArg( struct MapPFSHO_Arg *psho_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_PFSHORes(struct MapPFSHO_Res *psho_ptr,u8 *buf);
|
||||
int extract_PFSHORes(struct MapPFSHO_Res *psho_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_NIHOArg(struct MapNIHO_Arg *niho_ptr, u8 *buf) ;
|
||||
int extract_NIHOArg( struct MapNIHO_Arg *niho_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_TSAArg(struct MapTSA_Arg *tsa_ptr, u8 *buf);
|
||||
int extract_TSAArg( struct MapTSA_Arg *TSA_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_BSAArg(struct MapBSA_Arg *bsa_ptr, u8 *buf);
|
||||
int extract_BSAArg( struct MapBSA_Arg *bsa_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
|
||||
int assign_routinfoforsm_v1_arg(struct MapRIFSMV1_Arg *rif_ptr,u8 *buf);
|
||||
int extract_routinfoforsm_v1_arg(struct MapRIFSMV1_Arg *rif_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_routinfoforsm_v1_res(struct MapRIFSMV1_Res *rif_ptr,u8 *buf);
|
||||
int extract_routinfoforsm_v1_res(struct MapRIFSMV1_Res *rif_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
|
||||
int assign_fwdsmarg(struct MapFSM_Arg *ptr,u8 *buf);
|
||||
int extract_fwdsmarg(struct MapFSM_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_cancellocarg(struct MapCL_Arg *cl_ptr,u8 *buf,u8 ver);
|
||||
int extract_cancellocarg(struct MapCL_Arg *cl_ptr,u32 buf_len,u8 *buf,u8 ver);
|
||||
int assign_cancellocres(struct MapCL_Res *cl_ptr,u8 *buf);
|
||||
int extract_cancellocres(struct MapCL_Res *cl_ptr,u32 buf_len,u8 *buf);
|
||||
/* ------------------------>>>>>>>>>>>>>>>> MAP v1 <<<<<<<<<<<<<<<<<<<<<<<<<----------------*/
|
||||
|
||||
int assign_purgemsarg(struct MapPMS_Arg *pms_ptr,u8 *buf,u8 version);
|
||||
int extract_purgemsarg(struct MapPMS_Arg *pms_ptr,u32 buf_len,u8 *buf,u8 version);
|
||||
int assign_purgemsres(struct MapPMS_Res *pms_ptr,u8 *buf);
|
||||
int extract_purgemsres(struct MapPMS_Res *pms_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_sndidentarg(struct MapSI_Arg *ptr,u8 *buf);
|
||||
int extract_sndidentarg(struct MapSI_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
int assign_sndidentres(struct MapSI_Res *ptr,u8 *buf);
|
||||
int extract_sndidentres(struct MapSI_Res *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_upgprslocarg(struct MapUGL_Arg *ugl_ptr,u8 *buf);
|
||||
int extract_upgprslocarg(struct MapUGL_Arg *ugl_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_upgprslocres(struct MapUGL_Res *ugl_ptr,u8 *buf);
|
||||
int extract_upgprslocres(struct MapUGL_Res *ugl_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_prvsubinfoarg(struct MapPSI_Arg *psi_ptr,u8 *buf);
|
||||
int extract_prvsubinfoarg(struct MapPSI_Arg *psi_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_prvsubinfores(struct MapPSI_Res *psi_ptr,u8 *buf);
|
||||
int extract_prvsubinfores(struct MapPSI_Res *psi_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_anytimeintarg(struct MapATI_Arg *ati_ptr,u8 *buf);
|
||||
int extract_anytimeintarg(struct MapATI_Arg *ati_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_anytimeintres(struct MapATI_Res *ati_ptr,u8 *buf);
|
||||
int extract_anytimeintres(struct MapATI_Res *ati_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_anytimesubintarg(struct MapATSI_Arg *atsi_ptr,u8 *buf);
|
||||
int extract_anytimesubintarg(struct MapATSI_Arg *atsi_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_anytimesubintres(struct MapATSI_Res *atsi_ptr,u8 *buf);
|
||||
int extract_anytimesubintres(struct MapATSI_Res *atsi_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_authfailreportarg(MapAuthFailReport_Arg *fail_ptr, u8 *buf);
|
||||
int extract_authfailreportarg(MapAuthFailReport_Arg *fail_ptr, u32 buf_len, u8 *buf);
|
||||
|
||||
int assign_prehoarg(struct MapPHO_Arg *pho_ptr,u8 *buf);
|
||||
int extract_prehoarg(struct MapPHO_Arg *pho_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_prehores(struct MapPHO_Res *pho_ptr,u8 *buf);
|
||||
int extract_prehores(struct MapPHO_Res *pho_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_sndendsigarg(struct MapSES_Arg *ses_ptr,u8 *buf);
|
||||
int extract_sndendsigarg(struct MapSES_Arg *ses_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_prcaccsigarg(struct MapPAS_Arg *pas_ptr,u8 *buf);
|
||||
int extract_prcaccsigarg(struct MapPAS_Arg *pas_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_fwdaccsigarg(struct MapFAS_Arg *fas_ptr,u8 *buf);
|
||||
int extract_fwdaccsigarg(struct MapFAS_Arg *fas_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_presubshoarg(struct MapPSHO_Arg *psho_ptr,u8 *buf);
|
||||
int extract_presubshoarg(struct MapPSHO_Arg *psho_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_presubshores(struct MapPSHO_Res *psho_ptr,u8 *buf);
|
||||
int extract_presubshores(struct MapPSHO_Res *psho_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_sndauthinfoarg(struct MapSAI_Arg *sai_ptr,u8 *buf, u8 version); //modify by gxchen
|
||||
int assign_sndauthinfores(struct MapSAI_Res *sai_ptr,u8 *buf, u8 version);
|
||||
int extract_sndauthinfoarg(struct MapSAI_Arg *sai_ptr,u32 buf_len,u8 *buf, u8 version);
|
||||
int extract_sndauthinfores(struct MapSAI_Res *sai_ptr,u32 buf_len,u8 *buf, u8 version);
|
||||
|
||||
int assign_chkimeiarg(struct MapCIMEI_Arg *ptr,u8 *buf);
|
||||
int extract_chkimeiarg(struct MapCIMEI_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
int assign_chkimeires(struct MapCIMEI_Res *ptr,u8 *buf);
|
||||
int extract_chkimeires(struct MapCIMEI_Res *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_inssubdataarg(struct MapISD_Arg *isd_ptr,u8 *buf,u8 version);
|
||||
int assign_inssubdatares(struct MapISD_Res *isd_ptr,u8 *buf);
|
||||
int extract_inssubdataarg(struct MapISD_Arg *isd_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_inssubdatares(struct MapISD_Res *isd_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_delsubdataarg(struct MapDSD_Arg *dsd_ptr,u8 *buf);
|
||||
int extract_delsubdataarg(struct MapDSD_Arg *dsd_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_delsubdatares(struct MapDSD_Res *dsdr_ptr,u8 *buf);
|
||||
int extract_delsubdatares(struct MapDSD_Res *dsdr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_resetarg(struct MapReset_Arg *rs_ptr,u8 *buf);
|
||||
int extract_resetarg(struct MapReset_Arg *rs_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_restdataarg(struct MapRD_Arg *rsd_ptr,u8 *buf);
|
||||
int extract_restdataarg(struct MapRD_Arg *rsd_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_restdatares(struct MapRD_Res *rsd_ptr,u8 *buf);
|
||||
int extract_restdatares(struct MapRD_Res *rsd_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_sndroutinfogprsarg(struct MapSRIFG_Arg *sfg_ptr,u8 *buf);
|
||||
int extract_sndroutinfogprsarg(struct MapSRIFG_Arg *sfg_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_sndroutinfogprsres(struct MapSRIFG_Res *sfg_ptr,u8 *buf);
|
||||
int extract_sndroutinfogprsres(struct MapSRIFG_Res *sfg_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_failreportarg(struct MapFR_Arg *fr_ptr,u8 *buf);
|
||||
int extract_failreportarg(struct MapFR_Arg *fr_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_failreportres(struct MapFR_Res *fr_ptr,u8 *buf);
|
||||
int extract_failreportres(struct MapFR_Res *fr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_notemspregprsarg(struct MapNMPFG_Arg *npg_ptr,u8 *buf);
|
||||
int extract_notemspregprsarg(struct MapNMPFG_Arg *npg_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_notemspregprsres(struct MapNMPFG_Res *npg_ptr,u8 *buf);
|
||||
int extract_notemspregprsres(struct MapNMPFG_Res *npg_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
/* define in map_code_om.c */
|
||||
int assign_acttrcmodearg(struct MapATM_Arg *atm_ptr,u8 *buf);
|
||||
int extract_acttrcmodearg(struct MapATM_Arg *atm_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_acttrcmoderes(struct MapATM_Res *atm_ptr,u8 *buf);
|
||||
int extract_acttrcmoderes(struct MapATM_Res *atm_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_deacttrcmodearg(struct MapDTM_Arg *dtm_ptr,u8 *buf);
|
||||
int extract_deacttrcmodearg(struct MapDTM_Arg *dtm_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_deacttrcmoderes(struct MapDTM_Res *dtm_ptr,u8 *buf);
|
||||
int extract_deacttrcmoderes(struct MapDTM_Res *dtm_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_sndimsiarg(struct MapSIMSI_Arg *sim_ptr,u8 *buf);
|
||||
int extract_sndimsiarg(struct MapSIMSI_Arg *sim_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_sndimsires(struct MapSIMSI_Res *sim_ptr,u8 *buf);
|
||||
int extract_sndimsires(struct MapSIMSI_Res *sim_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
/* define in map_code_ch.c */
|
||||
int assign_sndroutinfoarg(struct MapSRI_Arg *sri_ptr,u8 *buf,u8 ver);
|
||||
int assign_sndroutinfores(struct MapSRI_Res *sri_ptr,u8 *buf,u8 version);
|
||||
int extract_sndroutinfoarg(struct MapSRI_Arg *sri_ptr,u32 buf_len,u8 *buf,u8 ver);
|
||||
int extract_sndroutinfores(struct MapSRI_Res *sri_ptr,u32 buf_len,u8 *buf,u8 version);
|
||||
|
||||
int assign_provroamnumarg(struct MapPRN_Arg *prn_ptr, u8 *buf);
|
||||
int assign_provroamnumres(struct MapPRN_Res *prn_ptr, u8 *buf);
|
||||
int extract_provroamnumarg(struct MapPRN_Arg *prn_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_provroamnumres(struct MapPRN_Res *prn_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_rescallhandarg(struct MapRCH_Arg *rch_ptr,u8 *buf);
|
||||
int extract_rescallhandarg(struct MapRCH_Arg *rch_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_rescallhandres(struct MapRCH_Res *rch_ptr,u8 *buf);
|
||||
int extract_rescallhandres(struct MapRCH_Res *rch_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_prvsiwfsnumarg(struct MapPSN_Arg *psn_ptr,u8 *buf);
|
||||
int extract_prvsiwfsnumarg(struct MapPSN_Arg *psn_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_prvsiwfsnumres(struct MapPSN_Res *psn_ptr,u8 *buf);
|
||||
int extract_prvsiwfsnumres(struct MapPSN_Res *psn_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_siwfssigmodarg(struct MapSSM_Arg *ssm_ptr,u8 *buf);
|
||||
int extract_siwfssigmodarg(struct MapSSM_Arg *ssm_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_siwfssigmodres(struct MapSSM_Res *ssm_ptr,u8 *buf);
|
||||
int extract_siwfssigmodres(struct MapSSM_Res *ssm_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_setrepstatearg(struct MapSRS_Arg *srs_ptr,u8 *buf);
|
||||
int extract_setrepstatearg(struct MapSRS_Arg *srs_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_setrepstateres(struct MapSRS_Res *srs_ptr,u8 *buf);
|
||||
int extract_setrepstateres(struct MapSRS_Res *srs_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_statreparg(struct MapSR_Arg *sr_ptr,u8 *buf);
|
||||
int extract_statreparg(struct MapSR_Arg *sr_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_statrepres(struct MapSR_Res *sr_ptr,u8 *buf);
|
||||
int extract_statrepres(struct MapSR_Res *sr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_rmtuserfreearg(struct MapRUF_Arg *ruf_ptr,u8 *buf);
|
||||
int extract_rmtuserfreearg(struct MapRUF_Arg *ruf_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_rmtuserfreeres(struct MapRUF_Res *ruf_ptr,u8 *buf);
|
||||
int extract_rmtuserfreeres(struct MapRUF_Res *ruf_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_istalertarg(struct MapISTAlert_Arg *ista_ptr, u8 *buf);
|
||||
int extract_istalertarg(struct MapISTAlert_Arg *ista_ptr, u32 buf_len, u8 *buf);
|
||||
int assign_istalertres(struct MapISTAlert_Res *ista_ptr, u8 *buf);
|
||||
int extract_istalertres(struct MapISTAlert_Res *ista_ptr, u32 buf_len, u8 *buf);
|
||||
|
||||
int assign_istcmdarg(struct MapISTCmd_Arg *istc_ptr, u8 *buf);
|
||||
int extract_istcmdarg(struct MapISTCmd_Arg *istc_ptr, u32 buf_len, u8 *buf);
|
||||
//int assign_istcmdres(struct MapISTCmd_Res *istc_ptr,u8 *buf);
|
||||
//int extract_istcmdres(struct MapISTCmd_Res *istc_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
/* define in map_code_ss.c */
|
||||
int assign_regssarg(struct MapRSS_Arg *rss_ptr, u8 *buf);
|
||||
int extract_regssarg(struct MapRSS_Arg *rss_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_regssres(struct MapRSS_Res *rss_ptr, u8 *buf);
|
||||
int extract_regssres(struct MapRSS_Res *rss_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_erassarg(struct MapESS_Arg *ess_ptr, u8 *buf);
|
||||
int extract_erassarg(struct MapESS_Arg *ess_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_erassres(struct MapESS_Res *essr_ptr, u8 *buf);
|
||||
int extract_erassres(struct MapESS_Res *essr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_actssarg(struct MapASS_Arg *ass_ptr, u8 *buf);
|
||||
int extract_actssarg(struct MapASS_Arg *ass_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_actssres(struct MapASS_Res *assr_ptr, u8 *buf);
|
||||
int extract_actssres(struct MapASS_Res *assr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_deactssarg(struct MapDASS_Arg *dss_ptr, u8 *buf);
|
||||
int extract_deactssarg(struct MapDASS_Arg *dss_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_deactssres(struct MapDASS_Res *dssr_ptr, u8 *buf);
|
||||
int extract_deactssres(struct MapDASS_Res *dssr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_intrssarg(struct MapINTSS_Arg *intrss_ptr, u8 *buf);
|
||||
int extract_intrssarg(struct MapINTSS_Arg *intr_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_intrssres(struct MapINTSS_Res *intrss_ptr, u8 *buf);
|
||||
int extract_intrssres(struct MapINTSS_Res *intrss_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_prcunssreqarg(struct MapPUSSR_Arg *psr_ptr,u8 *buf);
|
||||
int extract_prcunssreqarg(struct MapPUSSR_Arg *psr_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_prcunssreqres(struct MapPUSSR_Res *psr_ptr,u8 *buf);
|
||||
int extract_prcunssreqres(struct MapPUSSR_Res *psr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_unssreqarg(struct MapUSSR_Arg *usr_ptr,u8 *buf);
|
||||
int extract_unssreqarg(struct MapUSSR_Arg *usr_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_unssreqres(struct MapUSSR_Res *usr_ptr,u8 *buf);
|
||||
int extract_unssreqres(struct MapUSSR_Res *usr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_unssnotarg(struct MapUSSN_Arg *usn_ptr,u8 *buf);
|
||||
int extract_unssnotarg(struct MapUSSN_Arg *usn_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_unssnotres(struct MapUSSN_Res *usn_ptr,u8 *buf);
|
||||
int extract_unssnotres(struct MapUSSN_Res *usn_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_regpswdarg(struct MapRPSS_Arg *rpw_ptr,u8 *buf);
|
||||
int extract_regpswdarg(struct MapRPSS_Arg *rpw_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_regpswdres(struct MapRPSS_Res *rpwr_ptr,u8 *buf);
|
||||
int extract_regpswdres(struct MapRPSS_Res *rpwr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_getpswdarg(struct MapGPSS_Arg *gpw_ptr,u8 *buf);
|
||||
int extract_getpswdarg(struct MapGPSS_Arg *gpw_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_getpswdres(struct MapGPSS_Res *rpwr_ptr,u8 *buf);
|
||||
int extract_getpswdres(struct MapGPSS_Res *rpwr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_ssinvnotarg(struct MapSSIN_Arg *sin_ptr,u8 *buf);
|
||||
int extract_ssinvnotarg(struct MapSSIN_Arg *sin_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_ssinvnotres(struct MapSSIN_Res *sin_ptr,u8 *buf);
|
||||
int extract_ssinvnotres(struct MapSSIN_Res *sin_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_regccentarg(struct MapRCCE_Arg *rce_ptr,u8 *buf);
|
||||
int extract_regccentarg(struct MapRCCE_Arg *rce_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_regccentres(struct MapRCCE_Res *rce_ptr,u8 *buf);
|
||||
int extract_regccentres(struct MapRCCE_Res *rce_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_eraseccentarg(struct MapECCE_Arg *ece_ptr,u8 *buf);
|
||||
int extract_eraseccentarg(struct MapECCE_Arg *ece_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_eraseccentres(struct MapECCE_Res *ece_ptr,u8 *buf);
|
||||
int extract_eraseccentres(struct MapECCE_Res *ece_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
/* define in map_code_sms.c */
|
||||
int assign_routinfoforsmarg(struct MapRIFSM_Arg *rif_ptr,u8 *buf);
|
||||
int extract_routinfoforsmarg(struct MapRIFSM_Arg *rif_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_routinfoforsmres(struct MapRIFSM_Res *rif_ptr,u8 *buf);
|
||||
int extract_routinfoforsmres();
|
||||
|
||||
int assign_mofwdsmarg(struct MapMOFSM_Arg *ptr,u8 *buf,u8 version);
|
||||
int extract_mofwdsmarg(struct MapMOFSM_Arg *ptr,u32 buf_len,u8 *buf,u8 version);
|
||||
int assign_mofwdsmres(struct MapMOFSM_Res *ptr,u8 *buf,u8 version);
|
||||
int extract_mofwdsmres(struct MapMOFSM_Res *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_mtfwdsmarg(struct MapMTFSM_Arg *ptr,u8 *buf,u8 MAPVer);
|
||||
int extract_mtfwdsmarg(struct MapMTFSM_Arg *ptr,u32 buf_len,u8 *buf,u8 MAPVer);
|
||||
int assign_mtfwdsmres(struct MapMTFSM_Res *ptr,u8 *buf,u8 MAPVer);
|
||||
int extract_mtfwdsmres(struct MapMTFSM_Res *ptr,u32 buf_len,u8 *buf,u8 MAPVer);
|
||||
|
||||
int assign_repsmdelstatarg(struct MapRSMDS_Arg *ptr,u8 *buf);
|
||||
int extract_repsmdelstatarg(struct MapRSMDS_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
int assign_repsmdelstatres(struct MapRSMDS_Res *ptr,u8 *buf);
|
||||
int extract_repsmdelstatres(struct MapRSMDS_Res *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_infsrvcentarg(struct MapISC_Arg *ptr,u8 *buf);
|
||||
int extract_infsrvcentarg(struct MapISC_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_altsrvcentarg(struct MapASC_Arg *ptr,u8 *buf);
|
||||
int extract_altsrvcentarg(struct MapASC_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_rdyforsmarg(struct MapRFSM_Arg *ptr,u8 *buf);
|
||||
int extract_rdyforsmarg(struct MapRFSM_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
int assign_rdyforsmres(struct MapRFSM_Res *ptr,u8 *buf);
|
||||
int extract_rdyforsmres(struct MapRFSM_Res *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
/* +++++++++++++++++++++++++++++ */
|
||||
/* MAP-H (with AUC) structure */
|
||||
/* +++++++++++++++++++++++++++++ */
|
||||
int assign_securityTriplets_arg(struct MapST_Arg *ptr,u8 *buf, u8 version);
|
||||
int extract_securityTriplets_arg(struct MapST_Arg *ptr,u32 buf_len,u8 *buf, u8 version);
|
||||
int assign_securityTriplets_res();
|
||||
int extract_securityTriplets_res();
|
||||
|
||||
int assign_interrogateSubscriber_arg();
|
||||
int extract_interrogateSubscriber_arg();
|
||||
|
||||
int assign_createSubscriber_arg();
|
||||
int extract_createSubscriber_arg();
|
||||
|
||||
int assign_deleteSubscriber_arg();
|
||||
int extract_deleteSubscriber_arg();
|
||||
|
||||
/* ++++++++++++ */
|
||||
/* Common types */
|
||||
/* ++++++++++++ */
|
||||
int assign_authset(struct AuthSet_struct *auth_ptr,u8 *buf);
|
||||
int extract_authset(struct AuthSet_struct *auth_ptr,u32 buf_len,u8 *buf);
|
||||
//add by gxchen start
|
||||
int assign_triplet(Triplet_st *auth_ptr,u8 *buf);
|
||||
int extract_triplet(Triplet_st *auth_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_quintuplet(Quintuplet_st *auth_ptr,u8 *buf);
|
||||
int extract_quintuplet(Quintuplet_st *auth_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_gsmSecCon(GsmSecCon_st *con_ptr,u8 *buf);
|
||||
int extract_gsmSecCon(GsmSecCon_st *con_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_umtsSecCon(UmtsSecCon_st *con_ptr,u8 *buf);
|
||||
int extract_umtsSecCon(UmtsSecCon_st *con_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_authReSynInfo(AuthReSynInfo_st *resyn_ptr,u8 *buf);
|
||||
int extract_authReSynInfo(AuthReSynInfo_st *resyn_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_sgsnCapability(struct SgsnCap_s *cap_ptr, u8 *buf);
|
||||
int extract_sgsnCapability(struct SgsnCap_s *cap_ptr, u32 buf_len, u8 *buf);
|
||||
//add by gxchen end
|
||||
|
||||
int assign_extsiginfo(struct ExtSigInfo_struct *sig_ptr,u8 *buf);
|
||||
int extract_extsiginfo(struct ExtSigInfo_struct *sig_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_bscode(struct BSCode_struct *bs_ptr,u8 *buf,u8 flag);
|
||||
int extract_bscode(struct BSCode_struct *bs_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_subinfo(struct SubInfo_struct *info_ptr,u8 *buf);
|
||||
int extract_subinfo(struct SubInfo_struct *info_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_ocsi(struct OCsi_struct *ocsi_ptr,u8 *buf);
|
||||
int extract_ocsi(struct OCsi_struct *ocsi_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_tdpcritlist(struct OBCritLst_struct *list_ptr,u8 *buf);
|
||||
int extract_tdpcritlist(struct OBCritLst_struct *list_ptr,u32 buf_len,u8 *buf);
|
||||
int assign_ccbsfeat(struct CcbsFeat_struct *cf_ptr,u8 *buf);
|
||||
int extract_ccbsfeat(struct CcbsFeat_struct *cf_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
/* is41 */
|
||||
int assign_is41AuthenticationDirective_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41AuthenticationDirective_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int extract_is41AuthenticationDirective_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41AuthenticationDirective_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int assign_is41AuthenticationDirectiveForward_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41AuthenticationFailureReport_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41AuthenticationFailureReport_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41AuthenticationRequest_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41AuthenticationRequest_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41AuthenticationStatusReport_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41AuthenticationStatusReport_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41BaseStationChallenge_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41BaseStationChallenge_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41CountRequest_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_is41CountRequest_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
|
||||
int extract_is41AuthenticationDirectiveForward_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41AuthenticationFailureReport_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41AuthenticationFailureReport_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41AuthenticationRequest_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41AuthenticationRequest_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41AuthenticationStatusReport_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41AuthenticationStatusReport_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41BaseStationChallenge_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41BaseStationChallenge_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41CountRequest_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41CountRequest_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
|
||||
int assign_Is41SmsDeliveryBackward_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsDeliveryBackward_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsDeliveryForward_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsDeliveryForward_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsDeliveryPointToPoint_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsDeliveryPointToPoint_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsNotification_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsNotification_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsRequest_arg(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
int assign_Is41SmsRequest_rsp(struct MapOprSrv_struct *ptr,u8 *buf);
|
||||
|
||||
int extract_Is41SmsDeliveryBackward_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsDeliveryBackward_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsDeliveryForward_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsDeliveryForward_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsDeliveryPointToPoint_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsDeliveryPointToPoint_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsNotification_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsNotification_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsRequest_arg(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_Is41SmsRequest_rsp(struct MapOprSrv_struct *ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
int assign_is41RegistrationNotification_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41RegistrationNotification_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41RegistrationCancellation_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41RegistrationCancellation_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41LocationRequest_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41LocationRequest_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41RoutingRequest_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41RoutingRequest_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41MSInactive_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41MSInactive_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41FeatureRequest_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41FeatureRequest_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41QualificationDirective_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41QualificationDirective_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41TransferToNumberRequest_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41TransferToNumberRequest_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41RedirectionRequest_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41RedirectionRequest_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41OriginationRequest_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41OriginationRequest_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41AnalyzedInformation_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41AnalyzedInformation_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41OAnswer_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41ODisconnect_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41ODisconnect_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41TAnswer_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41TDisconnect_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41TDisconnect_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41CallControlDirective_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41CallControlDirective_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41SeizeResource_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41SeizeResource_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41ConnectResource_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41SRFDirective_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41SRFDirective_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41ShortMessageAnalyzed_arg(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
int assign_is41ShortMessageAnalyzed_rsp(struct MapOprSrv_struct *opr_ptr,u8 *buf);
|
||||
|
||||
int extract_is41RegistrationNotification_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41RegistrationNotification_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41RegistrationCancellation_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41RegistrationCancellation_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41LocationRequest_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41LocationRequest_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41RoutingRequest_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41RoutingRequest_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41MSInactive_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41MSInactive_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41FeatureRequest_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41FeatureRequest_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41QualificationDirective_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41QualificationDirective_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41TransferToNumberRequest_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41TransferToNumberRequest_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41RedirectionRequest_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41RedirectionRequest_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41OriginationRequest_arg(struct MapOprSrv_struct *opr_ptr, u32 buf_len, u8 *buf);
|
||||
int extract_is41OriginationRequest_rsp(struct MapOprSrv_struct *opr_ptr, u32 buf_len, u8 *buf);
|
||||
int extract_is41AnalyzedInformation_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41AnalyzedInformation_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41OAnswer_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41ODisconnect_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41ODisconnect_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41TAnswer_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41TDisconnect_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41TDisconnect_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41CallControlDirective_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41CallControlDirective_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41SeizeResource_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41SeizeResource_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41ConnectResource_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41SRFDirective_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41SRFDirective_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41ShortMessageAnalyzed_arg(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
int extract_is41ShortMessageAnalyzed_rsp(struct MapOprSrv_struct *opr_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
|
||||
/***************** LCS **************/
|
||||
int assign_ProvideSubscriberLocation_Res(ProvideSubscriberLocation_Res *ptr,u8 *buf, u8 ver);
|
||||
int assign_RoutingInfoForLCS_Res(RoutingInfoForLCS_Res *ptr,u8 *buf, u8 ver);
|
||||
int extract_ProvideSubscriberLocation_Arg(ProvideSubscriberLocation_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
int extract_RoutingInfoForLCS_Arg(RoutingInfoForLCS_Arg *ptr,u32 buf_len,u8 *buf);
|
||||
/***************** LCS **************/
|
||||
|
||||
//show message
|
||||
int debug_show_REGNOT_ARG(struct IS41_REGNOT_ARG *ptr,char *buf);
|
||||
int debug_show_REGNOT_RSP(struct IS41_REGNOT_RSP *ptr,char *buf);
|
||||
int debug_show_LOCREQ_ARG(struct IS41_LOCREQ_ARG *ptr,char *buf);
|
||||
int debug_show_LOCREQ_RSP(struct IS41_LOCREQ_RSP *ptr,char *buf);
|
||||
int debug_show_ROUTREQ_ARG(struct IS41_ROUTREQ_ARG *ptr,char *buf);
|
||||
int debug_show_ROUTREQ_RSP(struct IS41_ROUTREQ_RSP *ptr,char *buf);
|
||||
int debug_show_TRANUMREQ_ARG(struct IS41_TRANUMREQ_ARG *ptr,char *buf);
|
||||
int debug_show_TRANUMREQ_RSP(struct IS41_TRANUMREQ_RSP *ptr,char *buf);
|
||||
int debug_show_SMSREQ_ARG(struct IS41_SMSREQ_ARG *ptr,char *buf);
|
||||
int debug_show_SMSREQ_RSP(struct IS41_SMSREQ_RSP *ptr,char *buf);
|
||||
int debug_show_MSINACT_ARG(struct IS41_MSINACT_ARG *ptr,char *buf);
|
||||
int debug_show_MSINACT_RSP(struct IS41_MSINACT_RSP *ptr,char *buf);
|
||||
int debug_show_FEATREQ_ARG(struct IS41_FEATREQ_ARG *ptr,char *buf);
|
||||
int debug_show_FEATREQ_RSP(struct IS41_FEATREQ_RSP *ptr,char *buf);
|
||||
|
||||
int debug_show_AUTHREQ_ARG(IS41_AUTHREQ_ARG *AUTHREQ,char *charOpr);
|
||||
int debug_show_authreq_rsp(IS41_AUTHREQ_RSP *authreq,char *charOpr);
|
||||
int debug_show_ASREPORT_ARG(IS41_ASREPORT_ARG *ASREPORT,char *charOpr);
|
||||
int debug_show_asreport_rsp(IS41_ASREPORT_RSP *asreport,char *charOpr);
|
||||
int debug_show_BSCHALL_ARG(IS41_BSCHALL_ARG *BSCHALL,char *charOpr);
|
||||
int debug_show_bschall_rsp(IS41_BSCHALL_RSP *bschall,char *charOpr);
|
||||
int debug_show_AFREPORT_ARG(IS41_AFREPORT_ARG *AFREPORT,char *charOpr);
|
||||
int debug_show_afreport_rsp(IS41_AFREPORT_RSP *afreport,char *charOpr);
|
||||
int auc_debug_show_COUNTREQ_ARG(IS41_COUNTREQ_ARG *COUNTREQ,char *charOpr);
|
||||
int auc_debug_show_countreq_rsp(IS41_COUNTREQ_RSP *countreq,char *charOpr);
|
||||
int auc_debug_show_AUTHDIR_ARG(IS41_AUTHDIR_ARG *AUTHDIR,char *charOpr);
|
||||
int auc_debug_show_authdir_rsp(IS41_AUTHDIR_RSP *authdir,char *charOpr);
|
||||
#endif
|
||||
1353
plat/xapp/src/mapp/map_const.h
Normal file
1353
plat/xapp/src/mapp/map_const.h
Normal file
File diff suppressed because it is too large
Load Diff
104
plat/xapp/src/mapp/map_dlgpdu.h
Normal file
104
plat/xapp/src/mapp/map_dlgpdu.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/* MAP dialogue PDU head file */
|
||||
/* written by Liu zhiguo 2002-01-14 */
|
||||
/* Version 1.0 (according GSM 09.02 17.4) */
|
||||
/* ------------------------------------- */
|
||||
#ifndef _MAP_DLGPDU
|
||||
#define _MAP_DLGPDU
|
||||
|
||||
#define MAPDLG_OPEN 0x00
|
||||
#define MAPDLG_ACCEPT 0x01
|
||||
#define MAPDLG_CLOSE 0x02
|
||||
#define MAPDLG_REFUSE 0x03
|
||||
#define MAPDLG_UABORT 0x04 // user abort
|
||||
#define MAPDLG_PABORT 0x05 // provider abort
|
||||
|
||||
/* +++++++++++++++++++++++++ */
|
||||
/* MAP-Openinfo */
|
||||
/* +++++++++++++++++++++++++ */
|
||||
typedef struct MapDlgOpen_struct
|
||||
{
|
||||
u8 param_flag;
|
||||
u8 peer_ref[ISDN_LEN+1]; // peer reference
|
||||
u8 local_ref[ISDN_LEN+1]; // local reference
|
||||
} MapDlgOpen_struct;
|
||||
|
||||
/* +++++++++++++++++++++++++ */
|
||||
/* MAP-Refuseinfo */
|
||||
/* +++++++++++++++++++++++++ */
|
||||
typedef enum MapDlgReason_enum
|
||||
{
|
||||
noReasonGiven = 0,
|
||||
invalidDstRef = 1, // invalid destination reference
|
||||
invalidOrgRef = 2 // invalid original reference
|
||||
} MapDlgReason_enum;
|
||||
|
||||
typedef struct MapDlgRefuse_struct
|
||||
{
|
||||
u8 param_flag;
|
||||
enum MapDlgReason_enum reason;
|
||||
} MapDlgRefuse_struct;
|
||||
|
||||
/* +++++++++++++++++++++++++ */
|
||||
/* MAP-UserAbortinfo */
|
||||
/* +++++++++++++++++++++++++ */
|
||||
typedef enum MapDlgRUReason_enum // resource unavailable reason
|
||||
{
|
||||
shortTRLimit = 0, // short term resource limitation
|
||||
longTRLimit = 1 // long term resource limitation
|
||||
} MapDlgRUReason_enum;
|
||||
|
||||
typedef enum MapDlgPCReason_enum // procedure cancellation reason
|
||||
{
|
||||
handoverCancel = 0, // hand over cancellation
|
||||
radioChanRelease = 1, // radio channel release
|
||||
netPathRelease = 2, // network path release
|
||||
callRelease = 3, // call release
|
||||
assProFailure = 4, // associated procedure failure
|
||||
randomDialRelease = 5, // random dialogue release
|
||||
remOperFailure = 6 // remote operation failure
|
||||
} MapDlgPCReason_enum;
|
||||
|
||||
typedef struct MapDlgUAbort_struct
|
||||
{
|
||||
u8 choice_flag; // user abort choice
|
||||
union
|
||||
{
|
||||
enum MapDlgRUReason_enum resunavi; // resource unavailable, choice_flag = 2
|
||||
enum MapDlgPCReason_enum appproccancel; // application procedure cancellation, choice_flag = 3
|
||||
} choice;
|
||||
} MapDlgUAbort_struct;
|
||||
|
||||
/* +++++++++++++++++++++++++ */
|
||||
/* MAP-UserAbortinfo */
|
||||
/* +++++++++++++++++++++++++ */
|
||||
typedef enum MapDlgPAbortReason_enum
|
||||
{
|
||||
abnormaldial = 0, // abnormal dialogue
|
||||
invalidPDU = 1
|
||||
} MapDlgPAbortReason_enum;
|
||||
|
||||
typedef struct MapDlgPAbort_struct // MAP provider abort info
|
||||
{
|
||||
u8 param_flag;
|
||||
enum MapDlgPAbortReason_enum reason;
|
||||
} MapDlgPAbort_struct;
|
||||
|
||||
/* +++++++++++++++++++++++++ */
|
||||
/* MAP-DialoguePDU */
|
||||
/* +++++++++++++++++++++++++ */
|
||||
typedef struct MapDlg_struct
|
||||
{
|
||||
u8 dlg_type;
|
||||
union
|
||||
{
|
||||
struct MapDlgOpen_struct map_open;
|
||||
struct MapDlgRefuse_struct map_refuse;
|
||||
struct MapDlgUAbort_struct map_uabort;
|
||||
struct MapDlgPAbort_struct map_pabort;
|
||||
} map_dlg;
|
||||
} MapDlg_struct;
|
||||
|
||||
u8 build_mapdlg(struct MapDlg_struct *dlg_ptr,u8 *data_buf);
|
||||
u8 extract_mapdlg(struct MapDlg_struct *dlg_ptr,struct dlgport_struct *port_ptr);
|
||||
|
||||
#endif
|
||||
24
plat/xapp/src/mapp/map_includes.h
Normal file
24
plat/xapp/src/mapp/map_includes.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//////////////////////////////////////////////////
|
||||
//Title : map_includes.c
|
||||
//Auhtor : Liu Wei
|
||||
//Desc : map include headers
|
||||
//Created : 2007-05-18
|
||||
//Revision :
|
||||
//
|
||||
//Revision :
|
||||
//
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef _MAP_INCLUDES_H_
|
||||
#define _MAP_INCLUDES_H_
|
||||
|
||||
|
||||
#include "../../../public/src/include/pub_include.h"
|
||||
#include "../../../sccp/src/include/sccp.h"
|
||||
#include "map_const.h"
|
||||
#include "map_struct.h"
|
||||
#include "map_coding.h"
|
||||
#include "map_public.h"
|
||||
|
||||
#endif
|
||||
34
plat/xapp/src/mapp/map_opr_func.h
Normal file
34
plat/xapp/src/mapp/map_opr_func.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* MAP extension operation */
|
||||
/* ------------------------------------- */
|
||||
#ifndef _MAP_OPR_FUNC
|
||||
#define _MAP_OPR_FUNC
|
||||
|
||||
#include "map_includes.h"
|
||||
#include "../xap_interfunc.h"
|
||||
#include "map_code.h"
|
||||
|
||||
extern int assign_MapDetermineOprUserArg(struct MapDetermineOprUser_Arg *dou_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapDetermineOprUserArg(struct MapDetermineOprUser_Arg *dou_ptr,u32 buf_len,u8 *buf);
|
||||
extern int assign_MapDetermineOprUserRes(struct MapDetermineOprUser_Res *dou_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapDetermineOprUserRes(struct MapDetermineOprUser_Res *dou_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
extern int assign_MapVlrUpdateLocationArg(struct MapVlrUpdateLocation_Arg *cuwm_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapVlrUpdateLocationArg(struct MapVlrUpdateLocation_Arg *cuwm_ptr,u32 buf_len,u8 *buf);
|
||||
extern int assign_MapVlrUpdateLocationRes(struct MapVlrUpdateLocation_Res *cuwm_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapVlrUpdateLocationRes(struct MapVlrUpdateLocation_Res *cuwm_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
extern int assign_MapCreateUserWithMsisdnImsiArg(struct MapCreateUserWithMsisdnImsi_Arg *cuwm_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapCreateUserWithMsisdnImsiArg(struct MapCreateUserWithMsisdnImsi_Arg *cuwm_ptr,u32 buf_len,u8 *buf);
|
||||
extern int assign_MapCreateUserWithMsisdnImsiRes(struct MapCreateUserWithMsisdnImsi_Res *cuwm_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapCreateUserWithMsisdnImsiRes(struct MapCreateUserWithMsisdnImsi_Res *cuwm_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
extern int assign_MapDeleteOprUserArg(struct MapDeleteOprUser_Arg *dou_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapDeleteOprUserArg(struct MapDeleteOprUser_Arg *dou_ptr,u32 buf_len,u8 *buf);
|
||||
extern int assign_MapDeleteOprUserRes(struct MapDeleteOprUser_Res *dou_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapDeleteOprUserRes(struct MapDeleteOprUser_Res *dou_ptr,u32 buf_len,u8 *buf);
|
||||
|
||||
extern int assign_MapVlrEnquiryIMDM_Arg(struct MapVlrEnquiryIMDM_Arg *cuwm_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapVlrEnquiryIMDM_Arg(struct MapVlrEnquiryIMDM_Arg *cuwm_ptr,u32 buf_len,u8 *buf);
|
||||
extern int assign_MapVlrEnquiryIMDM_Res(struct MapVlrEnquiryIMDM_Res *cuwm_ptr,u8 *buf, u8 ver);
|
||||
extern int extract_MapVlrEnquiryIMDM_Res(struct MapVlrEnquiryIMDM_Res *cuwm_ptr,u32 buf_len,u8 *buf);
|
||||
#endif
|
||||
1112
plat/xapp/src/mapp/map_public.c
Normal file
1112
plat/xapp/src/mapp/map_public.c
Normal file
File diff suppressed because it is too large
Load Diff
26
plat/xapp/src/mapp/map_public.h
Normal file
26
plat/xapp/src/mapp/map_public.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* MAP public head file */
|
||||
/* written by Liu Zhiguo 2002-03-27 */
|
||||
/* version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#ifndef _MAP_PUBLIC
|
||||
#define _MAP_PUBLIC
|
||||
|
||||
void mapp_log_debug(const char *fmt, ...);
|
||||
|
||||
u8 bytestrtobitstr(u8 *bit_str,u8 *byte_str,u8 bit_len);
|
||||
u8 bitstrtobytestr(u8 *byte_str,u8 *bit_str,u8 bit_len);
|
||||
u8 tele_bittostr(u16 tele_data,u8 *tele_str,u8 ss_flag);
|
||||
u16 tele_strtobit(u8 *tele_str,u8 tele_len);
|
||||
u8 bearer_bittostr(u32 bearer_data, u8 *bearer_str,u8 ss_flag);
|
||||
u32 bearer_strtobit(u8 *bearer_str,u8 bearer_len);
|
||||
void get_sccpadd(struct SCCP_ADDRESS *add_ptr,u8 *data);
|
||||
void set_sccpadd(struct SCCP_ADDRESS *add_ptr,u8 *data);
|
||||
u8 map_com_ftos(struct MapComSrv_struct *map_com,u8 *data_flow);
|
||||
void map_com_stof(struct MapComSrv_struct *com_ptr,u8 *data_flow,u8 delimiter_flag);
|
||||
u8 map_opr_ftos(struct MapOprData_struct *opr_ptr,u8 *data_flow);
|
||||
void map_opr_stof(struct MapOprData_struct *opr_ptr,u8 *data_flow,u8 delimiter_flag);
|
||||
|
||||
char *is41_sequenceTag(char *tag,int sequence);
|
||||
|
||||
#endif
|
||||
4585
plat/xapp/src/mapp/map_struct.h
Normal file
4585
plat/xapp/src/mapp/map_struct.h
Normal file
File diff suppressed because it is too large
Load Diff
477
plat/xapp/src/mapp/win_struct.h
Normal file
477
plat/xapp/src/mapp/win_struct.h
Normal file
@@ -0,0 +1,477 @@
|
||||
/***************************/
|
||||
/****** WIN Parameter ******/
|
||||
/***************************/
|
||||
//N.S0009: 6.5.2.bv
|
||||
typedef struct IS41_PAR_MSID {
|
||||
u8 choice_flag; //0:min; 1:imsi
|
||||
u8 min[MIN_LEN];
|
||||
u8 imsi[IMSI_LEN];
|
||||
} IS41_PAR_MSID;
|
||||
|
||||
//N.S0013: 6.5.2.cl
|
||||
typedef struct IS41_PAR_EXESCR {
|
||||
u8 param_flag;
|
||||
u8 scrnameLen;
|
||||
u8 scrname[32];
|
||||
//optional
|
||||
u8 scrargLen;
|
||||
u8 scrarg[96];
|
||||
} IS41_PAR_EXESCR;
|
||||
|
||||
/***************************/
|
||||
/****** WIN Operation ******/
|
||||
/***************************/
|
||||
//N.S0018: 6.4.2.30 OriginationRequest INVOKE
|
||||
typedef struct IS41_ORREQ_ARG {
|
||||
u32 param_flag;
|
||||
u8 billid[7];//BillingID (Originating) M 6.5.2.16
|
||||
u8 digitsLen;
|
||||
u8 digits[32];//Digits (Dialed) M 6.5.2.58
|
||||
u8 esn[4];//ElectronicSerialNumber M 6.5.2.63
|
||||
u8 mscid[3];//MSCID (Originating MSC) M 6.5.2.82
|
||||
IS41_PAR_MSID msid;//MSID M 6.5.2.bv k
|
||||
u8 origtrigLen;
|
||||
u8 origtrig[32];//OriginationTriggers M 6.5.2.90
|
||||
u8 transcapLen;
|
||||
u8 transcap[32];//TransactionCapability M 6.5.2.160
|
||||
//optional
|
||||
u8 cpnameLen;
|
||||
u8 cpname[32];//CallingPartyName O 6.5.2.bw g, i
|
||||
u8 cpndgts1Len;
|
||||
u8 cpndgts1[32];//CallingPartyNumberDigits1 O 6.5.2.21 a
|
||||
u8 cpndgts2Len;
|
||||
u8 cpndgts2[32];//CallingPartyNumberDigits2 O 6.5.2.22 a
|
||||
u8 cpsubLen;
|
||||
u8 cpsub[32];//CallingPartySubaddress O 6.5.2.25 a
|
||||
u8 locid[2];//LocationAreaID O 6.5.2.77 a, l
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 b
|
||||
u8 featindLen;
|
||||
u8 featind[32];//FeatureIndicator O 6.5.2.ej m
|
||||
u8 mscinLen;
|
||||
u8 mscin[32];//MSCIdentificationNumber O 6.5.2.83 c
|
||||
u8 otfiLen;
|
||||
u8 otfi[32];//OneTimeFeatureIndicator O 6.5.2.88 d
|
||||
u8 pc_ssn[5];//PC_SSN (Originating MSC) O 6.5.2.93 e
|
||||
u8 plind;//PreferredLanguageIndicator O 6.5.2.96 j
|
||||
u8 senderinLen;
|
||||
u8 senderin[32];//SenderIdentificationNumber O 6.5.2.116 f
|
||||
u8 scellid[2];//ServingCellID O 6.5.2.117 a, n
|
||||
u8 triggertype;//TriggerType O 6.5.2.dh h
|
||||
IS41_PAR_WIN_CAP wincap;//WINCapability O 6.5.2.di o
|
||||
} IS41_ORREQ_ARG;
|
||||
|
||||
//N.S0018: 6.4.2.30 OriginationRequest RETURN RESULT
|
||||
typedef struct IS41_ORREQ_RSP {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 accden;//AccessDeniedReason O 6.5.2.1 a
|
||||
u8 actcodeLen;
|
||||
u8 actcode[32];//ActionCode O 6.5.2.2 b
|
||||
u8 annlistLen;
|
||||
u8 annlist[32];//AnnouncementList O 6.5.2.6 c
|
||||
u8 cpnstrg1Len;
|
||||
u8 cpnstrg1[32];//CallingPartyNumberString1 O 6.5.2.23 d, e
|
||||
u8 cpnstrg2Len;
|
||||
u8 cpnstrg2[32];//CallingPartyNumberString2 O 6.5.2.24 d, e
|
||||
u8 cpsubLen;
|
||||
u8 cpsub[32];//CallingPartySubaddress O 6.5.2.25 d, e, f
|
||||
u8 cardgtsLen;
|
||||
u8 cardgts[32];//CarrierDigits O 6.5.2.28 g
|
||||
u8 digitsLen;
|
||||
u8 digits[32];//Digits (Dialed) O 6.5.2.58 h
|
||||
u8 disptextLen;
|
||||
u8 disptext[32];//DisplayText O 6.5.2.bx d, e, r
|
||||
u8 acdgtsLen;
|
||||
u8 acdgts[32];//DMH_AccountCodeDigits O 6.5.2.59 i
|
||||
u8 abdgtsLen;
|
||||
u8 abdgts[32];//DMH_AlternateBillingDigits O 6.5.2.60 i
|
||||
u8 billdgtsLen;
|
||||
u8 billdgts[32];//DMH_BillingDigits O 6.5.2.61 i
|
||||
u8 redindLen;
|
||||
u8 redind[32];//DMH_RedirectionIndicator O 6.5.2.62 i, j
|
||||
u8 dmh_svcidLen;
|
||||
u8 dmh_svcid[32];//DMH_ServiceID O 6.5.2.ei s
|
||||
u8 grpinfoLen;
|
||||
u8 grpinfo[32];//GroupInformation O 6.5.2.69 k
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 i
|
||||
u8 natimeLen;
|
||||
u8 natime[32];//NoAnswerTime O 6.5.2.87 l
|
||||
u8 otfiLen;
|
||||
u8 otfi[32];//OneTimeFeatureIndicator O 6.5.2.88 m
|
||||
u8 pilotLen;
|
||||
u8 pilot[32];//PilotNumber O 6.5.2.95 k
|
||||
u8 rndgtsLen;
|
||||
u8 rndgts[32];//RedirectingNumberDigits O 6.5.2.107 f
|
||||
u8 rnstringLen;
|
||||
u8 rnstring[32];//RedirectingNumberString O 6.5.2.108 d
|
||||
u8 rsubLen;
|
||||
u8 rsub[32];//RedirectingSubaddress O 6.5.2.109 d, e
|
||||
u8 resumepic;//ResumePIC O 6.5.2.cu p
|
||||
u8 routdgtsLen;
|
||||
u8 routdgts[32];//RoutingDigits O 6.5.2.114 g
|
||||
IS41_PAR_TERMLIST termlist;//TerminationList O 6.5.2.156 n
|
||||
u8 termtrigLen;
|
||||
u8 termtrig[32];//TerminationTriggers O 6.5.2.57 o //should be 6.5.2.159
|
||||
u8 triggerlistnum;
|
||||
IS41_PAR_TRIGGER_LIST triggerlist[MAX_IS41_TRIG_LIST_NUM];//TriggerAddressList O 6.5.2.de q
|
||||
} IS41_ORREQ_RSP;
|
||||
|
||||
//N.S0018: 6.4.2.i AnalyzedInformation INVOKE
|
||||
typedef struct IS41_ANLYZD_ARG {
|
||||
u32 param_flag;
|
||||
u8 billid[7];//BillingID (Originating) M 6.5.2.16 a
|
||||
u8 digitsLen;
|
||||
u8 digits[32];//Digits (Dialed) M 6.5.2.58
|
||||
u8 mscid[3];//MSCID (Originating) M 6.5.2.82 b
|
||||
u8 transcapLen;
|
||||
u8 transcap[32];//TransactionCapability M 6.5.2.160
|
||||
u8 triggertype;//TriggerType M 6.5.2.dh c
|
||||
IS41_PAR_WIN_CAP wincap;//WINCapability M 6.5.2.di d
|
||||
//optional
|
||||
u8 cpnameLen;
|
||||
u8 cpname[32];//CallingPartyName O 6.5.2.bw e, m
|
||||
u8 cpndgts1Len;
|
||||
u8 cpndgts1[32];//CallingPartyNumberDigits1 O 6.5.2.21 e
|
||||
u8 cpndgts2Len;
|
||||
u8 cpndgts2[32];//CallingPartyNumberDigits2 O 6.5.2.22 e
|
||||
u8 cpsubLen;
|
||||
u8 cpsub[32];//CallingPartySubaddress O 6.5.2.25 e
|
||||
u8 cardgtsLen;
|
||||
u8 cardgts[32];//CarrierDigits O 6.5.2.28 n, o
|
||||
u8 cciLen;
|
||||
u8 cci[32];//ConferenceCallingIndicator O 6.5.2.49 f
|
||||
u8 destdgtsLen;
|
||||
u8 destdgts[32];//DestinationDigits O 6.5.2.56 n, p
|
||||
u8 redindLen;
|
||||
u8 redind[32];//DMH_RedirectionIndicator O 6.5.2.62 q
|
||||
u8 esn[4];//ElectronicSerialNumber O 6.5.2.63 g, r
|
||||
u8 featindLen;
|
||||
u8 featind[32];//FeatureIndicator O 6.5.2.ej s
|
||||
u8 locid[2];//LocationAreaID O 6.5.2.77 h, t
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 i
|
||||
u8 mscinLen;
|
||||
u8 mscin[32];//MSCIdentificationNumber O 6.5.2.83 j
|
||||
IS41_PAR_MSID msid;//MSID O 6.5.2.bv g, r
|
||||
u8 otfiLen;
|
||||
u8 otfi[32];//OneTimeFeatureIndicator O 6.5.2.88 k
|
||||
u8 plind;//PreferredLanguageIndicator O 6.5.2.96
|
||||
u8 rndgtsLen;
|
||||
u8 rndgts[32];//RedirectingNumberDigits O 6.5.2.107 e
|
||||
u8 rdnameLen;
|
||||
u8 rdname[32];//RedirectingPartyName O 6.5.2.by b, m
|
||||
u8 rsubLen;
|
||||
u8 rsub[32];//RedirectingSubaddress O 6.5.2.109 e
|
||||
u8 routdgtsLen;
|
||||
u8 routdgts[32];//RoutingDigits O 6.5.2.114 n, u
|
||||
u8 scellid[2];//ServingCellID O 6.5.2.117 h, v
|
||||
u8 mytyp;//SystemMyTypeCode O 6.5.2.147
|
||||
u8 tat;//TerminationAccessType O 6.5.2.155 l
|
||||
u8 tdo[2];//TimeDateOffset O 6.5.2.dd w
|
||||
u8 tod[3];//TimeOfDay O 6.5.2.em x
|
||||
} IS41_ANLYZD_ARG;
|
||||
|
||||
//N.S0018: 6.4.2.i AnalyzedInformation RETURN RESULT
|
||||
typedef struct IS41_ANLYZD_RSP {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 accden;//AccessDeniedReason O 6.5.2.1 a
|
||||
u8 actcodeLen;
|
||||
u8 actcode[32];//ActionCode O 6.5.2.2 b
|
||||
u8 annlistLen;
|
||||
u8 annlist[32];//AnnouncementList O 6.5.2.6 c
|
||||
u8 cardgtsLen;
|
||||
u8 cardgts[32];//CarrierDigits O 6.5.2.28 d
|
||||
u8 cciLen;
|
||||
u8 cci[32];//ConferenceCallingIndicator O 6.5.2.49 e
|
||||
u8 digitsLen;
|
||||
u8 digits[32];//Digits (Dialed) O 6.5.2.58 f
|
||||
u8 disptextLen;
|
||||
u8 disptext[32];//DisplayText O 6.5.2.bx d, m
|
||||
u8 acdgtsLen;
|
||||
u8 acdgts[32];//DMH_AccountCodeDigits O 6.5.2.59 g
|
||||
u8 abdgtsLen;
|
||||
u8 abdgts[32];//DMH_AlternateBillingDigits O 6.5.2.60 g
|
||||
u8 billdgtsLen;
|
||||
u8 billdgts[32];//DMH_BillingDigits O 6.5.2.61 g
|
||||
u8 redindLen;
|
||||
u8 redind[32];//DMH_RedirectionIndicator O 6.5.2.62 g, h
|
||||
u8 dmh_svcidLen;
|
||||
u8 dmh_svcid[32];//DMH_ServiceID O 6.5.2.ei n
|
||||
u8 natimeLen;
|
||||
u8 natime[32];//NoAnswerTime O 6.5.2.87 i
|
||||
u8 otfiLen;
|
||||
u8 otfi[32];//OneTimeFeatureIndicator O 6.5.2.88 j
|
||||
u8 rndgtsLen;
|
||||
u8 rndgts[32];//RedirectingNumberDigits O 6.5.2.107 d
|
||||
u8 resumepic;//ResumePIC O 6.5.2.cu k
|
||||
u8 routdgtsLen;
|
||||
u8 routdgts[32];//RoutingDigits O 6.5.2.114 d
|
||||
IS41_PAR_TERMLIST termlist;//TerminationList O 6.5.2.156 l
|
||||
u8 termtrigLen;
|
||||
u8 termtrig[32];//TerminationTriggers O 6.5.2.159 d
|
||||
u8 triggerlistnum;
|
||||
IS41_PAR_TRIGGER_LIST triggerlist[MAX_IS41_TRIG_LIST_NUM];//TriggerAddressList O 6.5.2.de d, o
|
||||
} IS41_ANLYZD_RSP;
|
||||
|
||||
//N.S0018: 6.4.2.aa OAnswer INVOKE
|
||||
typedef struct IS41_OANSWER_ARG {
|
||||
u32 param_flag;
|
||||
u8 billid[7];//BillingID (Originating) M 6.5.2.16 a
|
||||
u8 esn[4];//ElectronicSerialNumber M 6.5.2.63 b
|
||||
u8 mscid[3];//MSCID (Originating) M 6.5.2.82 c
|
||||
IS41_PAR_MSID msid;//MSID M 6.5.2.bv d
|
||||
u8 tdo[2];//TimeDateOffset M 6.5.2.dd e
|
||||
u8 tod[3];//TimeOfDay M 6.5.2.em f
|
||||
u8 triggertype;//TriggerType M 6.5.2.dh g
|
||||
//optional
|
||||
u8 locid[2];//LocationAreaID O 6.5.2.77 h, i
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 j
|
||||
u8 featindLen;
|
||||
u8 featind[32];//FeatureIndicator O 6.5.2.ej k
|
||||
u8 mscinLen;
|
||||
u8 mscin[32];//MSCIdentificationNumber O 6.5.2.83 l
|
||||
u8 scellid[2];//ServingCellID O 6.5.2.117 h, m
|
||||
u8 mytyp;//SystemMyTypeCode O 6.5.2.147
|
||||
} IS41_OANSWER_ARG;
|
||||
|
||||
//N.S0018: 6.4.2.ab ODisconnect INVOKE
|
||||
typedef struct IS41_ODISCONNECT_ARG {
|
||||
u32 param_flag;
|
||||
u8 billid[7];//BillingID (Originating) M 6.5.2.16 a
|
||||
u8 esn[4];//ElectronicSerialNumber M 6.5.2.63 b
|
||||
u8 mscid[3];//MSCID (Originating) M 6.5.2.82 c
|
||||
IS41_PAR_MSID msid;//MSID M 6.5.2.bv d
|
||||
u8 relcause;//ReleaseCause M 6.5.2.el e
|
||||
u8 tdo[2];//TimeDateOffset M 6.5.2.dd f
|
||||
u8 tod[3];//TimeOfDay M 6.5.2.em g
|
||||
u8 transcapLen;
|
||||
u8 transcap[32];//TransactionCapability M 6.5.2.160
|
||||
IS41_PAR_WIN_CAP wincap;//WINCapability M 6.5.2.di
|
||||
u8 triggertype;//TriggerType M 6.5.2.dh h
|
||||
//optional
|
||||
u8 locid[2];//LocationAreaID O 6.5.2.77 i, j
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 k
|
||||
u8 mscinLen;
|
||||
u8 mscin[32];//MSCIdentificationNumber O 6.5.2.83 l
|
||||
u8 scellid[2];//ServingCellID O 6.5.2.117 i, m
|
||||
u8 mytyp;//SystemMyTypeCode O 6.5.2.147
|
||||
} IS41_ODISCONNECT_ARG;
|
||||
|
||||
//N.S0018: 6.4.2.ab ODisconnect RETURN RESULT
|
||||
typedef struct IS41_ODISCONNECT_RSP {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 annlistLen;
|
||||
u8 annlist[32];//AnnouncementList O 6.5.2.6 a
|
||||
u8 dmh_svcidLen;
|
||||
u8 dmh_svcid[32];//DMH_ServiceID O 6.5.2.ei b
|
||||
} IS41_ODISCONNECT_RSP;
|
||||
|
||||
//N.S0018: 6.4.2.ad TAnswer INVOKE
|
||||
typedef struct IS41_TANSWER_ARG {
|
||||
u32 param_flag;
|
||||
u8 billid[7];//BillingID (Originating) M 6.5.2.16 a
|
||||
u8 esn[4];//ElectronicSerialNumber M 6.5.2.63 b
|
||||
u8 mscid[3];//MSCID M 6.5.2.82 c
|
||||
IS41_PAR_MSID msid;//MSID M 6.5.2.bv b
|
||||
u8 tdo[2];//TimeDateOffset M 6.5.2.dd d
|
||||
u8 tod[3];//TimeOfDay M 6.5.2.em e
|
||||
u8 transcapLen;
|
||||
u8 transcap[32];//TransactionCapability M 6.5.2.160
|
||||
u8 triggertype;//TriggerType M 6.5.2.dh f
|
||||
IS41_PAR_WIN_CAP wincap;//WINCapability M 6.5.2.di
|
||||
//optional
|
||||
u8 locid[2];//LocationAreaID O 6.5.2.77 g, h
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 i
|
||||
u8 featindLen;
|
||||
u8 featind[32];//FeatureIndicator O 6.5.2.ej j
|
||||
u8 mscinLen;
|
||||
u8 mscin[32];//MSCIdentificationNumber O 6.5.2.83 k
|
||||
u8 scellid[2];//ServingCellID O 6.5.2.117 g, l
|
||||
u8 mytyp;//SystemMyTypeCode O 6.5.2.147
|
||||
u8 tat;//TerminationAccessType O 6.5.2.155 m
|
||||
} IS41_TANSWER_ARG;
|
||||
|
||||
//N.S0018: 6.4.2.ae TDisconnect INVOKE
|
||||
typedef struct IS41_TDISCONNECT_ARG {
|
||||
u32 param_flag;
|
||||
u8 billid[7];//BillingID (Originating) M 6.5.2.16 a
|
||||
u8 esn[4];//ElectronicSerialNumber M 6.5.2.63 b
|
||||
u8 mscid[3];//MSCID M 6.5.2.82 c
|
||||
IS41_PAR_MSID msid;//MSID M 6.5.2.bv d
|
||||
u8 tdo[2];//TimeDateOffset M 6.5.2.dd e
|
||||
u8 tod[3];//TimeOfDay M 6.5.2.em f
|
||||
u8 triggertype;//TriggerType M 6.5.2.dh g
|
||||
//optional
|
||||
u8 locid[2];//LocationAreaID O 6.5.2.77 h, i
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 j
|
||||
u8 mscinLen;
|
||||
u8 mscin[32];//MSCIdentificationNumber O 6.5.2.83 k
|
||||
u8 relcause;//ReleaseCause O 6.5.2.el l
|
||||
u8 scellid[2];//ServingCellID O 6.5.2.117 h, m
|
||||
u8 mytyp;//SystemMyTypeCode O 6.5.2.147
|
||||
} IS41_TDISCONNECT_ARG;
|
||||
|
||||
//N.S0018: 6.4.2.ae TDisconnect RETURN RESULT
|
||||
typedef struct IS41_TDISCONNECT_RSP {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 dmh_svcidLen;
|
||||
u8 dmh_svcid[32];//DMH_ServiceID O 6.5.2.ei a
|
||||
} IS41_TDISCONNECT_RSP;
|
||||
|
||||
//N.S0018: 6.4.2.z CallControlDirective INVOKE
|
||||
typedef struct IS41_CCDIR_ARG {
|
||||
u32 param_flag;
|
||||
u8 billid[7];//BillingID M 6.5.2.16 a
|
||||
u8 mscid[3];//MSCID M 6.5.2.82 b
|
||||
IS41_PAR_MSID msid;//MSID M 6.5.2.bv c
|
||||
//optional
|
||||
u8 actcodeLen;
|
||||
u8 actcode[32];//ActionCode O 6.5.2.2 d
|
||||
u8 annlistLen;
|
||||
u8 annlist[32];//AnnouncementList O 6.5.2.6 e
|
||||
u8 disptextLen;
|
||||
u8 disptext[32];//DisplayText O 6.5.2.bx f
|
||||
u8 acdgtsLen;
|
||||
u8 acdgts[32];//DMH_AccountCodeDigits O 6.5.2.59 g
|
||||
u8 abdgtsLen;
|
||||
u8 abdgts[32];//DMH_AlternateBillingDigits O 6.5.2.60 g
|
||||
u8 billdgtsLen;
|
||||
u8 billdgts[32];//DMH_BillingDigits O 6.5.2.61 g
|
||||
u8 redindLen;
|
||||
u8 redind[32];//DMH_RedirectionIndicator O 6.5.2.62 g, h
|
||||
u8 esn[4];//ElectronicSerialNumber O 6.5.2.63 i, j
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 k
|
||||
u8 plind;//PreferredLanguageIndicator O 6.5.2.96 l, m
|
||||
IS41_PAR_TERMLIST termlist;//TerminationList O 6.5.2.156 n
|
||||
u8 triggerlistnum;
|
||||
IS41_PAR_TRIGGER_LIST triggerlist[MAX_IS41_TRIG_LIST_NUM];//TriggerAddressList O 6.5.2.de h
|
||||
} IS41_CCDIR_ARG;
|
||||
|
||||
//N.S0018: 6.4.2.z CallControlDirective RETURN RESULT
|
||||
typedef struct IS41_CCDIR_RSP {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 callstatusLen;
|
||||
u8 callstatus[32];//CallStatus O 6.5.2.en a
|
||||
} IS41_CCDIR_RSP;
|
||||
|
||||
//N.S0013: 6.4.2.r SeizeResource INVOKE
|
||||
typedef struct IS41_SEIZERES_ARG {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 plind;//PreferredLanguageIndicator O 6.5.2.96
|
||||
u8 psrLen;
|
||||
u8 psr[32];//PrivateSpecializedResource O 6.5.2.u a //should be 6.5.2.ct
|
||||
u8 srLen;
|
||||
u8 sr[32];//SpecializedResource O 6.5.2.dc a
|
||||
} IS41_SEIZERES_ARG;
|
||||
|
||||
//N.S0013: 6.4.2.r SeizeResource RETURN RESULT
|
||||
typedef struct IS41_SEIZERES_RSP {
|
||||
u32 param_flag;
|
||||
u8 destdgtsLen;
|
||||
u8 destdgts[32];//DestinationDigits M 6.5.2.56 a
|
||||
} IS41_SEIZERES_RSP;
|
||||
|
||||
//N.S0013: 6.4.2.k ConnectResource INVOKE
|
||||
typedef struct IS41_CONNRES_ARG {
|
||||
u32 param_flag;
|
||||
u8 destdgtsLen;
|
||||
u8 destdgts[32];//DestinationDigits M 6.5.2.56
|
||||
//optional
|
||||
u8 cardgtsLen;
|
||||
u8 cardgts[32];//CarrierDigits O 6.5.2.28 a
|
||||
u8 routdgtsLen;
|
||||
u8 routdgts[32];//RoutingDigits O 6.5.2.114 a
|
||||
} IS41_CONNRES_ARG;
|
||||
|
||||
//N.S0013: 6.4.2.n InstructionRequest INVOKE & RETURN RESULT
|
||||
typedef struct IS41_INSTREQ_ARG {
|
||||
u32 param_flag; //no parameter
|
||||
} IS41_INSTREQ_ARG;
|
||||
|
||||
typedef struct IS41_INSTREQ_RSP {
|
||||
u32 param_flag; //no parameter
|
||||
} IS41_INSTREQ_RSP;
|
||||
|
||||
//N.S0018: 6.4.2.s SRFDirective INVOKE
|
||||
typedef struct IS41_SRFDIR_ARG {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 annlistLen;
|
||||
u8 annlist[32];//AnnouncementList O 6.5.2.6 a, d
|
||||
u8 dgtccLen;
|
||||
u8 dgtcc[32];//DigitCollectionControl O 6.5.2.57 b
|
||||
IS41_PAR_EXESCR exescr;//ExecuteScript O 6.5.2.cl c, d
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 e
|
||||
} IS41_SRFDIR_ARG;
|
||||
|
||||
//N.S0013: 6.4.2.s SRFDirective RETURN RESULT
|
||||
typedef struct IS41_SRFDIR_RSP {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 digitsLen;
|
||||
u8 digits[32];//Digits (Dialed) O 6.5.2.58 a, b
|
||||
u8 scrresultLen;
|
||||
u8 scrresult[96];//ScriptResult O 6.5.2.cx c
|
||||
} IS41_SRFDIR_RSP;
|
||||
|
||||
//X.S0010: 6.4.2.ax ShortMessageAnalyzed INVOKE
|
||||
typedef struct IS41_SM_ANLYZD_ARG {
|
||||
u32 param_flag;
|
||||
u8 sms_brlen[2];//SMS_BearerLength M 6.5.2.hn a
|
||||
u8 sms_billidLen;
|
||||
u8 sms_billid[32];//SMS_BillingID M 6.5.2.ho b
|
||||
u8 sms_event;//SMS_Event M 6.5.2.hp c
|
||||
u8 smstidLen;
|
||||
u8 smstid[MAX_IS41_VARPAR_LEN];//SMS_TeleserviceIdentifier M 6.5.2.137 d
|
||||
//optional
|
||||
u8 esn[4];//ElectronicSerialNumber O 6.5.2.63 e, f
|
||||
u8 mdnLen;
|
||||
u8 mdn[32];//MobileDirectoryNumber O 6.5.2.80 e, f, g
|
||||
IS41_PAR_MSID msid;//MSID O 6.5.2.bv e, f, g
|
||||
u8 smscidLen;
|
||||
u8 smscid[MAX_IS41_VARPAR_LEN];//SMS_ChargeIndicator O 6.5.2.126 h
|
||||
u8 smsdaLen;
|
||||
u8 smsda[MAX_IS41_VARPAR_LEN];//SMS_DestinationAddress O 6.5.2.127 i
|
||||
u8 sms_pmcnt[4];//SMS_PendingMessageCount O 6.5.2.hr j
|
||||
u8 smsodaLen;
|
||||
u8 smsoda[MAX_IS41_VARPAR_LEN];//SMS_OriginalDestinationAddress O 6.5.2.131 k
|
||||
u8 smsodsLen;
|
||||
u8 smsods[MAX_IS41_VARPAR_LEN];//SMS_OriginalDestinationSubaddress O 6.5.2.132 l
|
||||
u8 smsooaLen;
|
||||
u8 smsooa[MAX_IS41_VARPAR_LEN];//SMS_OriginalOriginatingAddress O 6.5.2.133 m
|
||||
u8 smsoosLen;
|
||||
u8 smsoos[MAX_IS41_VARPAR_LEN];//SMS_OriginalOriginatingSubaddress O 6.5.2.134 l
|
||||
u8 smsoaLen;
|
||||
u8 smsoa[MAX_IS41_VARPAR_LEN];//SMS_OriginatingAddress O 6.5.2.135 n
|
||||
u8 tdo[2];//TimeDateOffset O 6.5.2.dd o
|
||||
u8 tod[3];//TimeOfDay O 6.5.2.em p
|
||||
} IS41_SM_ANLYZD_ARG;
|
||||
|
||||
//X.S0010: 6.4.2.ax ShortMessageAnalyzed RETURN RESULT
|
||||
typedef struct IS41_SM_ANLYZD_RSP {
|
||||
u32 param_flag;
|
||||
//optional
|
||||
u8 dmh_svcidLen;
|
||||
u8 dmh_svcid[32];//DMH_ServiceID O 6.5.2.ei a
|
||||
u8 smsbdLen;
|
||||
u8 smsbd[256];//SMS_BearerData O 6.5.2.124 b
|
||||
u8 smscauseLen;
|
||||
u8 smscause[32];//SMS_CauseCode O 6.5.2.125 c
|
||||
u8 sms_eventnotLen;
|
||||
u8 sms_eventnot[32];//SMS_EventNotification O 6.5.2.hq d
|
||||
} IS41_SM_ANLYZD_RSP;
|
||||
|
||||
|
||||
427
plat/xapp/src/roaming_rule.c
Normal file
427
plat/xapp/src/roaming_rule.c
Normal file
@@ -0,0 +1,427 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "../../snmp/src/include/snmp.h"
|
||||
#include "../../snmp/src/include/macro.h"
|
||||
|
||||
#include "roaming_rule.h"
|
||||
#include "../../public/src/uwav/numgrp.h"
|
||||
#include "../../public/src/uwav/number.h"
|
||||
|
||||
_roaming_rule_table rr_table;
|
||||
|
||||
#define ASN_1_OCTET_STRING 4
|
||||
#define ASN_1_INTEGER 2
|
||||
struct numgrp_table *xapp_rr_ptr=NULL;
|
||||
extern void xap_set_roaming_rule_flag();
|
||||
extern int ParseLineWithDot(char *str, char (*row)[128], int maxrow);
|
||||
extern int ParseLineWithSquare(char *str, char (*row)[128], int maxrow);
|
||||
extern int xap_get_response(u8 oidlen,u32 *oid,u8 *pdata,u8 *vartype);
|
||||
extern int xap_set_response(u8 oidlen,u32 *oid,u8 *pdata,u16 datalen);
|
||||
extern void xap_set_roaming_rule_param_flag();
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
int xap_save_roaming_rule()
|
||||
{
|
||||
char filename[]="./conf/roaming_rules.conf";
|
||||
int i;
|
||||
FILE *fpConf = NULL;
|
||||
_roaming_rule *ptr=NULL;
|
||||
|
||||
fpConf = fopen(filename,"w");
|
||||
if(fpConf == NULL)
|
||||
return 0;
|
||||
|
||||
for(i=0; i<MAX_RULES; i++)
|
||||
{
|
||||
ptr = &rr_table.roaming_rule[i];
|
||||
if(ptr->used_flag == 1)
|
||||
fprintf(fpConf, "%04d.%s.%d.%d.%d.%d.%d.%d.%d\r\n",
|
||||
ptr->id, ptr->prefix, ptr->lu_action, ptr->reject_cause,
|
||||
ptr->vlr_counter, ptr->no_voice_camel,
|
||||
ptr->no_sms_camel,
|
||||
ptr->smsc_camel_if,
|
||||
ptr->routing_home);
|
||||
}
|
||||
fclose(fpConf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int xap_read_roaming_rule_record(char * s)
|
||||
{
|
||||
char LineInfo[10][128]={{0}, {0}};
|
||||
char DetailInfo[10][128]={{0}, {0}};
|
||||
int rtn;
|
||||
int Instance;
|
||||
_roaming_rule *ptr;
|
||||
|
||||
rtn = ParseLineWithSquare(s, LineInfo, 1);
|
||||
rtn = ParseLineWithDot(LineInfo[0],DetailInfo, 9);
|
||||
Instance = strtoll(DetailInfo[0],NULL,10);
|
||||
if(Instance >= MAX_RULES)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
ptr = &rr_table.roaming_rule[Instance];
|
||||
ptr->used_flag = 1;
|
||||
ptr->id = Instance;
|
||||
strcpy(ptr->prefix , DetailInfo[1]);
|
||||
ptr->lu_action = atoi(DetailInfo[2]);
|
||||
ptr->reject_cause = atoi(DetailInfo[3]);
|
||||
ptr->vlr_counter = atoi(DetailInfo[4]);
|
||||
ptr->no_voice_camel = atoi(DetailInfo[5]);
|
||||
ptr->no_sms_camel = atoi(DetailInfo[6]);
|
||||
ptr->smsc_camel_if = atoi(DetailInfo[7]);
|
||||
ptr->routing_home = atoi(DetailInfo[8]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int xap_read_roaming_rule()
|
||||
{
|
||||
char filename[]="./conf/roaming_rules.conf";
|
||||
FILE *fp=NULL;
|
||||
char record[128];
|
||||
int len;
|
||||
|
||||
fp = fopen(filename, "r");
|
||||
if(fp == NULL)
|
||||
return 0;
|
||||
|
||||
memset(&rr_table, 0x00, sizeof(_roaming_rule_table));
|
||||
|
||||
while ( fgets(record, 128, fp) != (char *)0 )
|
||||
{
|
||||
if ( (int *)strchr(record,'#') != NULL ) continue;
|
||||
if ( (len=strlen(record))==0 ) continue;
|
||||
if(record[0]=='\n')continue;
|
||||
|
||||
xap_read_roaming_rule_record(record);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int xap_create_roaming_rule_table()
|
||||
{
|
||||
int i,len;
|
||||
struct number_group tmp_num_grp;
|
||||
|
||||
if( xapp_rr_ptr!= NULL)
|
||||
delete_numgrp_table(xapp_rr_ptr);
|
||||
|
||||
xapp_rr_ptr = assign_numgrp_table("rrule",MAX_RULES);
|
||||
for(i=0;i<MAX_RULES;i++)
|
||||
{
|
||||
len = strlen(rr_table.roaming_rule[i].prefix);
|
||||
if(len<1 && len>MAX_PREFIX_LEN)
|
||||
continue;
|
||||
tmp_num_grp.start.num_of_digit = len;
|
||||
memcpy(tmp_num_grp.start.digit, rr_table.roaming_rule[i].prefix, len);
|
||||
tmp_num_grp.end.num_of_digit = len;
|
||||
memcpy(tmp_num_grp.end.digit, rr_table.roaming_rule[i].prefix, len);
|
||||
tmp_num_grp.index = i;
|
||||
|
||||
numgrp_insert(xapp_rr_ptr,
|
||||
&tmp_num_grp.start,
|
||||
&tmp_num_grp.end,
|
||||
tmp_num_grp.index);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int xap_search_roaming_rule_table(char * vlr_number)
|
||||
{
|
||||
num16_t num16_tmp;
|
||||
int result=-1;
|
||||
int len, maxlen=0;
|
||||
register int i;
|
||||
|
||||
|
||||
for(i=0; i<MAX_RULES; i++)
|
||||
{
|
||||
if(rr_table.roaming_rule[i].used_flag)
|
||||
{
|
||||
len = strlen(rr_table.roaming_rule[i].prefix);
|
||||
if(strncasecmp(vlr_number, rr_table.roaming_rule[i].prefix, len) ==0)
|
||||
{
|
||||
if(len>maxlen)
|
||||
{
|
||||
maxlen = len;
|
||||
result = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
if(xapp_rr_ptr==NULL) return -1;
|
||||
|
||||
if(len==0) return -1;
|
||||
if(len>MAX_PREFIX_LEN) len = MAX_PREFIX_LEN;
|
||||
|
||||
num16_tmp.num_of_digit = len;
|
||||
memcpy(num16_tmp.digit,vlr_number,len);
|
||||
if(numgrp_search(&result, xapp_rr_ptr, &num16_tmp))
|
||||
return result;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int xap_roaming_rule_get_rule(char *vlr_number, _roaming_rule *ptr)
|
||||
{
|
||||
int index=-1;
|
||||
|
||||
if((index = xap_search_roaming_rule_table(vlr_number))< 0)
|
||||
return 0;
|
||||
|
||||
memcpy(ptr, &rr_table.roaming_rule[index], sizeof(_roaming_rule));;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int xap_roaming_rule_get_smsc_camel_flag(char *vlr_number)
|
||||
{
|
||||
int index=-1;
|
||||
_roaming_rule *ptr= NULL;
|
||||
|
||||
if((index = xap_search_roaming_rule_table(vlr_number))< 0)
|
||||
return 0;
|
||||
|
||||
ptr = &rr_table.roaming_rule[index];
|
||||
return ptr->smsc_camel_if;
|
||||
}
|
||||
|
||||
int xap_roaming_rule_get_routing_home_flag(char *vlr_number)
|
||||
{
|
||||
int index=-1;
|
||||
_roaming_rule *ptr= NULL;
|
||||
|
||||
if((index = xap_search_roaming_rule_table(vlr_number))< 0)
|
||||
return -1;
|
||||
|
||||
ptr = &rr_table.roaming_rule[index];
|
||||
return ptr->routing_home;
|
||||
}
|
||||
|
||||
int xap_roaming_rule_test(char *vlr_number)
|
||||
{
|
||||
_roaming_rule ptr;
|
||||
|
||||
if(xap_roaming_rule_get_rule(vlr_number, &ptr))
|
||||
{
|
||||
return ptr.id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/* ---------------------------------------------------------------------------*/
|
||||
/* ------------------------ function: xap_get_idle_index() -------------------*/
|
||||
/* -- return =0 ,failed, otherwise succeed -----------------------------------*/
|
||||
/* ---------------------------------------------------------------------------*/
|
||||
int xap_get_roaming_rule_idle_index(int type, int *newID)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case 1:
|
||||
for(i=0;i<MAX_RULES;i++)
|
||||
{
|
||||
if(rr_table.roaming_rule[i].used_flag == 0)
|
||||
{
|
||||
*newID = i;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* --------------------- */
|
||||
/* -- prefix routines -- */
|
||||
/* --------------------- */
|
||||
|
||||
int xap_getnext_roaming_rule(u32 *index_id)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = *index_id; i < MAX_RULES; i++)
|
||||
{
|
||||
if(rr_table.roaming_rule[i].used_flag)
|
||||
{
|
||||
*index_id = i;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
*index_id = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int xap_get_roaming_rule(u32 column, u32 *instance, u_char *pdata, u_char *vartype)
|
||||
{
|
||||
int datalen = 0,index;
|
||||
|
||||
index = instance[0];
|
||||
if(index < 0 || index >= MAX_RULES )
|
||||
return -1;
|
||||
if(rr_table.roaming_rule[index].used_flag == 0)
|
||||
return -1;
|
||||
|
||||
*vartype = ASN_1_OCTET_STRING;
|
||||
switch(column)
|
||||
{
|
||||
case 1: /* index */
|
||||
*vartype = ASN_1_INTEGER;
|
||||
datalen = 1;
|
||||
pdata[0] = index;
|
||||
break;
|
||||
case 2:
|
||||
datalen = strlen(rr_table.roaming_rule[index].prefix);
|
||||
memcpy(pdata,rr_table.roaming_rule[index].prefix,datalen);
|
||||
//if(datalen == 0) datalen = 1;
|
||||
break;
|
||||
case 3:
|
||||
*vartype = ASN_1_INTEGER;
|
||||
datalen = 1;
|
||||
pdata[0] = rr_table.roaming_rule[index].lu_action;
|
||||
break;
|
||||
case 4:
|
||||
*vartype = ASN_1_INTEGER;
|
||||
datalen = 1;
|
||||
pdata[0] = rr_table.roaming_rule[index].reject_cause;
|
||||
break;
|
||||
case 5:
|
||||
*vartype = ASN_1_INTEGER;
|
||||
datalen = 4;
|
||||
pdata[0] = rr_table.roaming_rule[index].vlr_counter>>24;
|
||||
pdata[1] = rr_table.roaming_rule[index].vlr_counter>>16;
|
||||
pdata[2] = rr_table.roaming_rule[index].vlr_counter>>8;
|
||||
pdata[3] = rr_table.roaming_rule[index].vlr_counter;
|
||||
break;
|
||||
case 6:
|
||||
*vartype = ASN_1_INTEGER;
|
||||
datalen = 1;
|
||||
pdata[0] = rr_table.roaming_rule[index].no_voice_camel;
|
||||
break;
|
||||
case 7:
|
||||
*vartype = ASN_1_INTEGER;
|
||||
datalen = 1;
|
||||
pdata[0] = rr_table.roaming_rule[index].no_sms_camel;
|
||||
break;
|
||||
case 8:
|
||||
*vartype = ASN_1_INTEGER;
|
||||
datalen = 1;
|
||||
pdata[0] = rr_table.roaming_rule[index].smsc_camel_if;
|
||||
break;
|
||||
case 9:
|
||||
*vartype = ASN_1_INTEGER;
|
||||
datalen = 1;
|
||||
pdata[0] = rr_table.roaming_rule[index].routing_home;
|
||||
break;
|
||||
case 10:
|
||||
*vartype = ASN_1_INTEGER;
|
||||
pdata[0] = 1; /* active */
|
||||
datalen = 1;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
return datalen;
|
||||
}
|
||||
|
||||
|
||||
int xap_set_roaming_rule(u32 column, u32 *instance, u_char *pdata, unsigned short datalen)
|
||||
{
|
||||
int index;
|
||||
//int newId;
|
||||
|
||||
//if(datalen == 0)
|
||||
// return -1;
|
||||
|
||||
index = instance[0];
|
||||
if(index < 0 || index >= MAX_RULES)
|
||||
return -1;
|
||||
|
||||
xap_set_roaming_rule_flag();
|
||||
switch(column)
|
||||
{
|
||||
case 1:/* create */
|
||||
index = pdata[0];
|
||||
if(index < 0 || index >= MAX_RULES)
|
||||
return -1;
|
||||
else
|
||||
{
|
||||
rr_table.roaming_rule[index].used_flag = 1;
|
||||
rr_table.roaming_rule[index].id = index;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2: /* prefix */
|
||||
if(datalen>=MAX_PREFIX_LEN)
|
||||
return -1;
|
||||
memset(rr_table.roaming_rule[index].prefix, 0x00, MAX_PREFIX_LEN);
|
||||
memcpy(rr_table.roaming_rule[index].prefix, pdata, datalen);
|
||||
break;
|
||||
case 3:
|
||||
if(pdata[0]>=2)
|
||||
return -1;
|
||||
rr_table.roaming_rule[index].lu_action = pdata[0];
|
||||
break;
|
||||
case 4:
|
||||
rr_table.roaming_rule[index].reject_cause = pdata[0];
|
||||
break;
|
||||
case 5:
|
||||
if(datalen>=5)
|
||||
return -1;
|
||||
{
|
||||
if(datalen==1)
|
||||
rr_table.roaming_rule[index].vlr_counter = pdata[0];
|
||||
else
|
||||
rr_table.roaming_rule[index].vlr_counter = pdata[0]*256+pdata[1];
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if(pdata[0]>2)
|
||||
return -1;
|
||||
rr_table.roaming_rule[index].no_voice_camel = pdata[0];
|
||||
break;
|
||||
case 7:
|
||||
if(pdata[0]>2)
|
||||
return -1;
|
||||
rr_table.roaming_rule[index].no_sms_camel = pdata[0];
|
||||
break;
|
||||
case 8:
|
||||
if(pdata[0]>2)
|
||||
return -1;
|
||||
rr_table.roaming_rule[index].smsc_camel_if = pdata[0];
|
||||
break;
|
||||
case 9:
|
||||
rr_table.roaming_rule[index].routing_home = pdata[0];
|
||||
break;
|
||||
case 10: /* status */
|
||||
if(pdata[0] == 6) /* 6==delete */
|
||||
{
|
||||
memset(&rr_table.roaming_rule[index] ,0x00 ,sizeof(_roaming_rule));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
return datalen;
|
||||
}
|
||||
|
||||
int xap_roaming_rules_init()
|
||||
{
|
||||
xap_read_roaming_rule();
|
||||
// xap_create_roaming_rule_table();
|
||||
return 1;
|
||||
}
|
||||
44
plat/xapp/src/roaming_rule.h
Normal file
44
plat/xapp/src/roaming_rule.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef _ROAMING_RULES_H
|
||||
#define _ROAMING_RULES_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define MAX_RULES 2048
|
||||
#define MAX_PREFIX_LEN 16
|
||||
|
||||
#define PLMN_NOT_ALLOWED 8
|
||||
#define UNEXPECTED_DATA_VALUE 36
|
||||
|
||||
typedef enum RR_NVCS
|
||||
{
|
||||
NO_NVCS_DISABLE,
|
||||
NO_NVCS_LU_ONLY, /* Only LU is allowed, no MO service */
|
||||
NO_NVCS_BOTH, /* Both LU and MO service */
|
||||
}_RR_NVCS;
|
||||
|
||||
typedef struct roaming_rule
|
||||
{
|
||||
u_char used_flag;
|
||||
u_short id;
|
||||
char prefix[MAX_PREFIX_LEN];
|
||||
u_char lu_action;
|
||||
u_char reject_cause;
|
||||
int vlr_counter;
|
||||
char no_voice_camel;
|
||||
char no_sms_camel;
|
||||
char smsc_camel_if;
|
||||
char routing_home;
|
||||
}_roaming_rule;
|
||||
|
||||
typedef struct roaming_rule_table
|
||||
{
|
||||
_roaming_rule roaming_rule[MAX_RULES];
|
||||
}_roaming_rule_table;
|
||||
|
||||
int snmpSetRoamingRule(u_char oidlen,u_long *oid,u_char *pdata,u_short datalen);
|
||||
int snmpGetRoamingRule(u_char oidlen,u_long *oid,u_char *pdata,u_char *vartype);
|
||||
int xapGetRoamingRule(_roaming_rule *rr_ptr);
|
||||
int xapGetSMSCamelFlag(char *vlr_number);
|
||||
int saveRoamingRule();
|
||||
|
||||
#endif
|
||||
1760
plat/xapp/src/xap_cdmacdr.c
Normal file
1760
plat/xapp/src/xap_cdmacdr.c
Normal file
File diff suppressed because it is too large
Load Diff
898
plat/xapp/src/xap_cdmacdr.h
Normal file
898
plat/xapp/src/xap_cdmacdr.h
Normal file
@@ -0,0 +1,898 @@
|
||||
/* HLR CDMA cdr structure */
|
||||
/* Created by daniel:2005-06-21 */
|
||||
/* Modify by daniel:2005-06-21 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#define DMHPAR_ASWID 0
|
||||
#define DMHPAR_AUDSN 1
|
||||
#define DMHPAR_AUDSUB 2
|
||||
#define DMHPAR_BIN 6
|
||||
#define DMHPAR_BILLIND 7
|
||||
#define DMHPAR_CDDGTS 8
|
||||
#define DMHPAR_CDLOC 9
|
||||
#define DMHPAR_CGDGTS 10
|
||||
#define DMHPAR_CGLOC 11
|
||||
#define DMHPAR_CHRGAMT 12
|
||||
#define DMHPAR_CNVDUR 13
|
||||
#define DMHPAR_CNVUSG 14
|
||||
#define DMHPAR_DATE 15
|
||||
#define DMHPAR_DIALDGTS 16
|
||||
#define DMHPAR_DUR 17
|
||||
#define DMHPAR_IDSUB 18
|
||||
#define DMHPAR_LNUM 19
|
||||
#define DMHPAR_MODIND 20
|
||||
#define DMHPAR_OSWID 21
|
||||
#define DMHPAR_RLEG 22
|
||||
#define DMHPAR_SEGNUM 23
|
||||
#define DMHPAR_SSWID 24
|
||||
#define DMHPAR_SWNO 25
|
||||
#define DMHPAR_SID 26
|
||||
#define DMHPAR_TOD 27
|
||||
#define DMHPAR_TKNUM 29
|
||||
#define DMHPAR_ACTIND 32
|
||||
#define DMHPAR_AJCKT 33
|
||||
#define DMHPAR_ACTSUB 34
|
||||
#define DMHPAR_ACHDUR 37
|
||||
#define DMHPAR_ACHUSG 38
|
||||
#define DMHPAR_AIRSSUB 39
|
||||
#define DMHPAR_AUTHCNT 42
|
||||
#define DMHPAR_AUTHDEN 43
|
||||
#define DMHPAR_AUTHTYP 44
|
||||
#define DMHPAR_CJCKT 47
|
||||
#define DMHPAR_CELLID 49
|
||||
#define DMHPAR_CHRGIND 50
|
||||
#define DMHPAR_CHRGSUB 51
|
||||
#define DMHPAR_CHRGTAX 52
|
||||
#define DMHPAR_CHRGTIND 53
|
||||
#define DMHPAR_CHRGUNIT 54
|
||||
#define DMHPAR_DENACC 56
|
||||
#define DMHPAR_DESTDGTS 57
|
||||
#define DMHPAR_ESN 58
|
||||
#define DMHPAR_EVTIND 60
|
||||
#define DMHPAR_FPARM 61
|
||||
#define DMHPAR_FBDUR 62
|
||||
#define DMHPAR_FBIND 64
|
||||
#define DMHPAR_FBUSG 65
|
||||
#define DMHPAR_FEATIND 66
|
||||
#define DMHPAR_FEATOPN 67
|
||||
#define DMHPAR_FRIND 68
|
||||
#define DMHPAR_HCOORD 69
|
||||
#define DMHPAR_HSWID 70
|
||||
#define DMHPAR_IECCDUR 71
|
||||
#define DMHPAR_INCDUR 73
|
||||
#define DMHPAR_INCUSG 74
|
||||
#define DMHPAR_LLIND 78
|
||||
#define DMHPAR_LJCKT 81
|
||||
#define DMHPAR_MIN 84
|
||||
#define DMHPAR_MRPI 85
|
||||
#define DMHPAR_NPANXX 86
|
||||
#define DMHPAR_NUMACT 87
|
||||
#define DMHPAR_NUMCHRG 89
|
||||
#define DMHPAR_NUMEVT 90
|
||||
#define DMHPAR_NUMLEG 91
|
||||
#define DMHPAR_NUMSEG 93
|
||||
#define DMHPAR_OLSUB 94
|
||||
#define DMHPAR_OGTDUR 95
|
||||
#define DMHPAR_OGTUSG 96
|
||||
#define DMHPAR_PLNAM 97
|
||||
#define DMHPAR_RCHNUM 99
|
||||
#define DMHPAR_RPI 100
|
||||
#define DMHPAR_REDIND 101
|
||||
#define DMHPAR_RLSUB 102
|
||||
#define DMHPAR_RBIN 103
|
||||
#define DMHPAR_RELIND 104
|
||||
#define DMHPAR_RIN 106
|
||||
#define DMHPAR_SRT 109
|
||||
#define DMHPAR_SJCKT 110
|
||||
#define DMHPAR_SPNAM 112
|
||||
#define DMHPAR_TSSUB 113
|
||||
#define DMHPAR_TSWID 114
|
||||
#define DMHPAR_TLSUB 115
|
||||
#define DMHPAR_TDO 116
|
||||
#define DMHPAR_TTIND 117
|
||||
#define DMHPAR_VCOORD 118
|
||||
#define DMHPAR_BINR 128
|
||||
#define DMHPAR_BRI 129
|
||||
#define DMHPAR_EJCKT 142
|
||||
#define DMHPAR_EVTSUB 143
|
||||
#define DMHPAR_FALSUB 146
|
||||
#define DMHPAR_PACAIND 150
|
||||
#define DMHPAR_PACASUB 151
|
||||
#define DMHPAR_AUXLSUB 161
|
||||
#define DMHPAR_IMEI 165
|
||||
#define DMHPAR_IMSI 166
|
||||
#define DMHPAR_LATA 167
|
||||
#define DMHPAR_NUMOCT 168
|
||||
#define DMHPAR_NUMPKT 169
|
||||
#define DMHPAR_TEXIND 170
|
||||
#define DMHPAR_CHRGTCOD 171
|
||||
#define DMHPAR_CHRGTTBL 172
|
||||
#define DMHPAR_FILLIND 178
|
||||
#define DMHPAR_FILLIC 179
|
||||
#define DMHPAR_MDN 184
|
||||
#define DMHPAR_NEICLNP 186
|
||||
#define DMHPAR_NUMFAL 188
|
||||
#define DMHPAR_NUMRED 189
|
||||
#define DMHPAR_NUMORG 190
|
||||
#define DMHPAR_NUMTRM 191
|
||||
#define DMHPAR_SELUSE 193
|
||||
#define DMHPAR_SUCOD 194
|
||||
#define DMHPAR_MYTYP 196
|
||||
#define DMHPAR_NUMAUX 199
|
||||
#define DMHPAR_NEIIP 200
|
||||
#define DMHPAR_IWFDUR 202
|
||||
#define DMHPAR_RETIND 207
|
||||
#define DMHPAR_RICODE 208
|
||||
#define DMHPAR_RSEG 209
|
||||
#define DMHPAR_WCNTRY 214
|
||||
|
||||
#define EVTIND_authorizationGranted 1
|
||||
#define EVTIND_authorizationExpired 2
|
||||
#define EVTIND_authorizationDenied 3
|
||||
#define EVTIND_securityViolationReport 4
|
||||
#define EVTIND_inactive 5
|
||||
#define EVTIND_deregistration 6
|
||||
#define EVTIND_registrationCanceled 7
|
||||
#define EVTIND_profileUpdated 8
|
||||
#define EVTIND_qualificationUpdated 9
|
||||
#define EVTIND_terminationDeniedInvalid 10
|
||||
#define EVTIND_terminationDeniedUnassigned 11
|
||||
#define EVTIND_terminationDeniedInactive 12
|
||||
#define EVTIND_terminationDeniedUnregistered 13
|
||||
#define EVTIND_terminationDeniedNoPageResponse 14
|
||||
#define EVTIND_terminationDeniedBusy 15
|
||||
#define EVTIND_terminationDeniedSCA 16
|
||||
#define EVTIND_terminationDeniedDND 17
|
||||
#define EVTIND_terminationDeniedCD 18
|
||||
#define EVTIND_terminationDeniedCS 19
|
||||
#define EVTIND_terminationDeniedOther 20
|
||||
#define EVTIND_callDelivered 21
|
||||
#define EVTIND_callForwarded 22
|
||||
#define EVTIND_callForwardingNotification 23
|
||||
#define EVTIND_messageWaitingNotification 24
|
||||
#define EVTIND_originationDeniedNoTrunk 25
|
||||
#define EVTIND_originationDeniedUnrecognized 26
|
||||
#define EVTIND_originationDeniedCB 27
|
||||
#define EVTIND_originationDeniedOther 28
|
||||
#define EVTIND_unspecifiedHourlyEvent 29
|
||||
#define EVTIND_unspecifiedDailyEvent 30
|
||||
#define EVTIND_unspecifiedWeeklyEvent 31
|
||||
#define EVTIND_unspecifiedMonthlyEvent 32
|
||||
#define EVTIND_unspecifiedQuarterlyEvent 33
|
||||
#define EVTIND_unspecifiedSemi_annualEvent 34
|
||||
#define EVTIND_unspecifiedAnnualEvent 35
|
||||
#define EVTIND_featureAccessAttempted 36
|
||||
#define EVTIND_SMSMO 37
|
||||
#define EVTIND_SMSMT 38
|
||||
#define EVTIND_SMSNOT 39
|
||||
|
||||
#define ACTIND_unspecified 0
|
||||
#define ACTIND_locallyDeniedRegistration 1
|
||||
#define ACTIND_homeDeniedRegistration 2
|
||||
#define ACTIND_powerOnRegistration 3
|
||||
#define ACTIND_autonomousRegistration 4
|
||||
#define ACTIND_missedAutonomousRegistration 5
|
||||
#define ACTIND_movementRegistration 6
|
||||
#define ACTIND_movementDetected 7
|
||||
#define ACTIND_powerDownDeregistration 8
|
||||
#define ACTIND_pageResponse 0
|
||||
#define ACTIND_noPageResponse 10
|
||||
#define ACTIND_messageWaiting 11
|
||||
#define ACTIND_abbreviatedAlert 12
|
||||
#define ACTIND_alert 13
|
||||
#define ACTIND_alertWithInformation 14
|
||||
#define ACTIND_alertingAnswered 15
|
||||
#define ACTIND_pACARequest 16
|
||||
#define ACTIND_originationRequest 17
|
||||
#define ACTIND_flashRequestWithoutInformation 18
|
||||
#define ACTIND_flashRequestWithInformation 19
|
||||
#define ACTIND_callModeChanged 20
|
||||
#define ACTIND_lostRadioContact 21
|
||||
#define ACTIND_measurementRequest 22
|
||||
#define ACTIND_mAHORequest 23
|
||||
#define ACTIND_intraSystemHandoff 24
|
||||
#define ACTIND_interSystemHandoff 25
|
||||
#define ACTIND_powerControlProblem 26
|
||||
#define ACTIND_protocolError 27
|
||||
#define ACTIND_spuriousEmissions 28
|
||||
#define ACTIND_orderedRegistration 29
|
||||
#define ACTIND_trafficChannelRegistration 30
|
||||
#define ACTIND_dataBurst_ShortMessage 31
|
||||
#define ACTIND_featureNotification 32
|
||||
#define ACTIND_lock 33
|
||||
#define ACTIND_unlock 34
|
||||
#define ACTIND_maintenanceRequired 35
|
||||
#define ACTIND_intrasystemSoftHandoffBegin 36
|
||||
#define ACTIND_intersystemSoftHandoffBegin 37
|
||||
#define ACTIND_packetDataRegistrationOnly 38
|
||||
|
||||
#define FEATIND_callForwarding_Unconditional 1
|
||||
#define FEATIND_callForwarding_Busy 2
|
||||
#define FEATIND_callForwarding_NoAnswer 3
|
||||
#define FEATIND_callForwarding_Other 4
|
||||
#define FEATIND_callWaiting 5
|
||||
#define FEATIND_threeWayCalling 6
|
||||
#define FEATIND_callDelivery 7
|
||||
#define FEATIND_doNotDisturb 8
|
||||
#define FEATIND_conferenceCalling 9
|
||||
#define FEATIND_callTransfer 10
|
||||
#define FEATIND_callingNumberIdentificationRestriction 11
|
||||
#define FEATIND_selectiveCallAcceptance 12
|
||||
#define FEATIND_authorizationCode 13
|
||||
#define FEATIND_speedDialing 14
|
||||
#define FEATIND_adviceOfCharging 15
|
||||
#define FEATIND_voiceMail 16
|
||||
#define FEATIND_callForwardDefault 17
|
||||
#define FEATIND_callingNumberIdentificationPresentation 18
|
||||
#define FEATIND_flexibleAlerting 19
|
||||
#define FEATIND_messageWaitingNotification 20
|
||||
#define FEATIND_mobileAccessHunting 21
|
||||
#define FEATIND_passwordCallAcceptance 22
|
||||
#define FEATIND_preferredLanguageService 23
|
||||
#define FEATIND_priorityAccessAndChannelAssignment 24
|
||||
#define FEATIND_remoteFeatureControl 25
|
||||
#define FEATIND_subscriberPINAccess 26
|
||||
#define FEATIND_subscriberPINIntercept 27
|
||||
#define FEATIND_voicePrivacy 28
|
||||
#define FEATIND_shortMessageDeliveryPoint_ToPointBearer 29
|
||||
#define FEATIND_shortMessageDeliveryBroadcast 30
|
||||
#define FEATIND_cellularPagingTeleservice 31
|
||||
#define FEATIND_cellularMessagingTeleservice 32
|
||||
#define FEATIND_intersystemCall 33
|
||||
#define FEATIND_voiceMailDelete 34
|
||||
#define FEATIND_voiceMailSend 35
|
||||
#define FEATIND_voiceMailDeposit 36
|
||||
#define FEATIND_answerHold 37
|
||||
#define FEATIND_userSelectiveCallForwarding 38
|
||||
|
||||
#define FEATOPN_featureRegistration 1
|
||||
#define FEATOPN_featureDeregistration 2
|
||||
#define FEATOPN_featureActivation 3
|
||||
#define FEATOPN_featureDeactivation 4
|
||||
#define FEATOPN_featureInvocation 5
|
||||
#define FEATOPN_featurePerCallActivation 6
|
||||
#define FEATOPN_featurePerCallDeactivation 7
|
||||
#define FEATOPN_featureRegistrationAndActivation 8
|
||||
#define FEATOPN_featureInterrogation 9
|
||||
#define FEATOPN_featureTesting 10
|
||||
#define FEATOPN_screenListEditing 11
|
||||
|
||||
#define FRIND_timerExpiry 1
|
||||
#define FRIND_networkFailure 2
|
||||
#define FRIND_operationError 3
|
||||
#define FRIND_operationReject 4
|
||||
#define FRIND_unspecified 5
|
||||
#define FRIND_unsuccessful 6
|
||||
#define FRIND_successful 7
|
||||
|
||||
typedef struct DMH_CallLocation
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 HcoordinateLen;
|
||||
u8 Hcoordinate[3];
|
||||
|
||||
u8 NPANXX[3];
|
||||
|
||||
u8 PlaceNameLen;
|
||||
u8 PlaceName[20];
|
||||
|
||||
u8 StateProvinceName[2];
|
||||
|
||||
u8 VcoordinateLen;
|
||||
u8 Vcoordinate[3];
|
||||
|
||||
u8 LocalAccessTransportAreaLen;
|
||||
u8 LocalAccessTransportArea[4];
|
||||
|
||||
u8 WorldCountry[3];
|
||||
}DMH_CallLocation;
|
||||
|
||||
typedef struct DMH_ReturnIndicator
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 ReturnIndicatorCode;
|
||||
|
||||
//optional part
|
||||
struct
|
||||
{
|
||||
u8 ParameterIdentifierLen;
|
||||
u8 ParameterIdentifier[16];
|
||||
} FaultyParameter;
|
||||
|
||||
}DMH_ReturnIndicator;
|
||||
|
||||
typedef struct DMH_FillIndicator
|
||||
{
|
||||
struct
|
||||
{
|
||||
u8 ParameterIdentifierLen;
|
||||
u8 ParameterIdentifier[16];
|
||||
} FaultyParameter;
|
||||
|
||||
u8 FillIndicatorCode;
|
||||
}DMH_FillIndicator;
|
||||
|
||||
typedef struct DMH_AuditSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 audsnLen;
|
||||
u8 audsn[4];//AuditSequenceNumber
|
||||
|
||||
//optional part
|
||||
u8 achdurLen;
|
||||
u8 achdur[4];//AirChannelDuration
|
||||
u8 cnvdurLen;
|
||||
u8 cnvdur[4];//ConversationDuration
|
||||
u8 fbdurLen;
|
||||
u8 fbdur[4];//FeatureBridgeDuration
|
||||
u8 ieccdurLen;
|
||||
u8 ieccdur[4];//IECConnectDuration
|
||||
u8 incdurLen;
|
||||
u8 incdur[4];//IncomingTrunkDuration
|
||||
u8 numactLen;
|
||||
u8 numact[4];//NumberOfActivities
|
||||
u8 numchrgLen;
|
||||
u8 numchrg[4];//NumberOfCharges
|
||||
u8 numevtLen;
|
||||
u8 numevt[4];//NumberOfEvents
|
||||
u8 numlegLen;
|
||||
u8 numleg[4];//NumberOfLegs
|
||||
u8 numsegLen;
|
||||
u8 numseg[4];//NumberOfSegments
|
||||
u8 ogtdurLen;
|
||||
u8 ogtdur[4];//OutgoingTrunkDuration
|
||||
u8 numfalLen;
|
||||
u8 numfal[4];//NumberOfFeatureActivationLegs
|
||||
u8 numorgLen;
|
||||
u8 numorg[8];//NumberOfOriginationLegs
|
||||
u8 numredLen;
|
||||
u8 numred[4];//NumberOfRedirectionLegs
|
||||
u8 numtrmLen;
|
||||
u8 numtrm[4];//NumberOfTerminationLegs
|
||||
u8 numauxLen;
|
||||
u8 numaux[4];//NumberOfAuxiliaryLegs
|
||||
u8 numoctLen;
|
||||
u8 numoct[4];//NumberOfOctets
|
||||
u8 numpktLen;
|
||||
u8 numpkt[4];//NumberOfPackets
|
||||
u8 iwfdurLen;
|
||||
u8 iwfdur[4];//IWFDuration
|
||||
DMH_FillIndicator fillind;
|
||||
DMH_ReturnIndicator retind;
|
||||
}DMH_AuditSubrecord;
|
||||
|
||||
typedef struct DMH_SwitchID
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 swno;//SwitchNumber
|
||||
u8 sid[2];//SystemIdentifier
|
||||
u8 bri[2];//BusinessRelationIdentifier
|
||||
u8 mytyp;//SystemMyTypeCode
|
||||
}DMH_SwitchID;
|
||||
|
||||
typedef struct DMH_IdentitySubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 Date[3];
|
||||
struct
|
||||
{
|
||||
u8 ChoiceFlag;
|
||||
|
||||
u8 esn[4];
|
||||
u8 imei[5];
|
||||
} Choice1;
|
||||
|
||||
struct
|
||||
{
|
||||
u8 ChoiceFlag;
|
||||
|
||||
u8 min[5];
|
||||
u8 imsi[8];
|
||||
u8 neiclnp[19];
|
||||
u8 neiip[4];
|
||||
} Choice2;
|
||||
|
||||
u8 tdoLen;
|
||||
u8 tdo[2];//TimeDateOffset
|
||||
u8 todLen;
|
||||
u8 tod[3];//TimeOfDay
|
||||
|
||||
struct
|
||||
{
|
||||
u8 ChoiceFlag;
|
||||
|
||||
DMH_SwitchID aswid;//AnchorSWID
|
||||
DMH_SwitchID oswid;//OriginatingSWID
|
||||
DMH_SwitchID sswid;//ServingSWID
|
||||
} Choice3;
|
||||
|
||||
u8 binLen;
|
||||
u8 bin[4];//BillingIdentificationNumber
|
||||
|
||||
DMH_SwitchID hswid;//HomeSWID
|
||||
|
||||
u8 mdnLen;
|
||||
u8 mdn[8];
|
||||
DMH_FillIndicator fillind;
|
||||
DMH_ReturnIndicator retind;
|
||||
|
||||
}DMH_IdentitySubrecord;
|
||||
|
||||
typedef struct DMH_EventSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 evtind;//EventIndicator
|
||||
u8 rinLen;
|
||||
u8 rin[4];//ReportIdentificationNumber
|
||||
|
||||
//optional part
|
||||
DMH_SwitchID aswid;//AnchorSWID
|
||||
|
||||
u8 authcnt;//AuthorizationCount
|
||||
u8 authden;//AuthorizationDenied
|
||||
u8 authtyp;//AuthorizationType
|
||||
u8 binLen;
|
||||
u8 bin[4];//BillingIdentificationNumber
|
||||
u8 Date[3];
|
||||
u8 denacc;//DenyAccess
|
||||
u8 featind;//FeatureIndicator
|
||||
u8 featopn;//FeatureOperation
|
||||
u8 frind;//FeatureResultIndicator
|
||||
|
||||
DMH_SwitchID oswid;//OriginatingSWID
|
||||
|
||||
u8 rbinLen;
|
||||
u8 rbin[4];//RelatedBillingIdentificationNumber
|
||||
u8 srt;//SecurityReportType
|
||||
|
||||
DMH_SwitchID sswid;//ServingSWID
|
||||
|
||||
u8 tdoLen;
|
||||
u8 tdo[2];//TimeDateOffset
|
||||
u8 todLen;
|
||||
u8 tod[3];//TimeOfDay
|
||||
DMH_FillIndicator fillind;
|
||||
DMH_ReturnIndicator retind;
|
||||
}DMH_EventSubrecord;
|
||||
|
||||
typedef struct DMH_ChargeSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 chrgamtLen;
|
||||
u8 chrgamt[4];//ChargeAmount
|
||||
u8 chrgind;//ChargeIndicator
|
||||
|
||||
//optional part
|
||||
u8 chrgtaxLen;
|
||||
u8 chrgtax[4];//ChargeTax
|
||||
u8 chrgtind;//ChargeTaxIndicator
|
||||
u8 chrgunit;//ChargeUnits
|
||||
u8 durLen;
|
||||
u8 dur[4];//Duration
|
||||
u8 mrpi;//MultipleRatePeriodIndicator,len=0
|
||||
u8 plnamLen;
|
||||
u8 plnam[20];//PlaceName
|
||||
u8 rpi;//RatePeriodIndicator
|
||||
u8 spnam[2];//StateProvinceName
|
||||
u8 ttind;//TollTariffIndicator
|
||||
u8 wcntry[3];//WorldCountry
|
||||
|
||||
struct
|
||||
{
|
||||
u8 ChoiceFlag;
|
||||
|
||||
u8 lnum;//LegNumber
|
||||
u8 segnum;//SegmentNumber
|
||||
} Choice;
|
||||
|
||||
u8 chrgtcodLen;
|
||||
u8 chrgtcod[2];//ChargeTaxCode
|
||||
u8 chrgttbl;//ChargeTaxTable
|
||||
u8 numoctLen;
|
||||
u8 numoct[4];//NumberOfOctets
|
||||
u8 numpktLen;
|
||||
u8 numpkt[4];//NumberOfPackets
|
||||
u8 seluseLen;
|
||||
u8 seluse[100];//SelectiveUse
|
||||
u8 sucod;//SelectiveUseCode
|
||||
u8 texind;//TaxExemptIndicator
|
||||
DMH_FillIndicator fillind;
|
||||
DMH_ReturnIndicator retind;
|
||||
}DMH_ChargeSubrecord;
|
||||
|
||||
typedef struct DMH_BeginForwardPath
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 cellidLen;
|
||||
u8 cellid[2];//CellIdentifier
|
||||
u8 modind;//ModulationIndicator
|
||||
u8 rchnumLen;
|
||||
u8 rchnum[2];//RadioChannelNumber
|
||||
u8 tknumLen;
|
||||
u8 tknum[2];//TrunkNumber
|
||||
|
||||
//optional part
|
||||
u8 bearind;//BearerIndicator
|
||||
u8 locidLen;
|
||||
u8 locid[2];//LocationAreaIdentifier
|
||||
u8 radattr[2];//RadioAttributes
|
||||
u8 trnsnumLen;
|
||||
u8 trnsnum[2];//TransceiverNumber
|
||||
u8 tkgrpLen;
|
||||
u8 tkgrp[2];//TrunkGroup
|
||||
|
||||
struct
|
||||
{
|
||||
u8 ChoiceFlag;
|
||||
//will add encode in the future
|
||||
|
||||
} Choice;
|
||||
|
||||
u8 cellnamLen;
|
||||
u8 cellnam[8];//CellName
|
||||
u8 tgpnamLen;
|
||||
u8 tgpnam[12];//TrunkGroupName
|
||||
u8 uzLen;
|
||||
u8 uz[3];//UserZoneNumber
|
||||
u8 bndclsLen;
|
||||
u8 bndcls[63];//BandClass
|
||||
u8 freqind;//FrequencyIndicator
|
||||
}DMH_BeginForwardPath;//BeginForwardPath
|
||||
|
||||
typedef struct DMH_EndForwardPath
|
||||
{
|
||||
u32 param_flag;
|
||||
}DMH_EndForwardPath;//BeginForwardPath
|
||||
|
||||
typedef struct DMH_ActivitySubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 actind;//ActivityIndicator
|
||||
u8 rinLen;
|
||||
u8 rin[4];//ReportIdentificationNumber
|
||||
|
||||
//optional part
|
||||
u8 authden;//AuthorizationDenied
|
||||
|
||||
DMH_BeginForwardPath bfpath;
|
||||
u8 binLen;
|
||||
u8 bin[4];//BillingIdentificationNumber
|
||||
u8 Date[3];
|
||||
u8 denacc;//DenyAccess
|
||||
u8 srt;//SecurityReportType
|
||||
|
||||
DMH_SwitchID sswid;//ServingSWID
|
||||
|
||||
u8 tdoLen;
|
||||
u8 tdo[2];//TimeDateOffset
|
||||
u8 todLen;
|
||||
u8 tod[3];//TimeOfDay
|
||||
DMH_FillIndicator fillind;
|
||||
u8 rsegLen;
|
||||
u8 rseg[3];//RelatedSegmentNumber
|
||||
DMH_ReturnIndicator retind;
|
||||
}DMH_ActivitySubrecord;
|
||||
|
||||
typedef struct DMH_FeatureBridgeUsage
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 fbind; //FeatureBridgeIndicator
|
||||
u8 durLen;
|
||||
u8 dur[4];//Duration
|
||||
u8 rlegLen;
|
||||
u8 rleg[3];//RelatedLegNumber
|
||||
u8 todLen;
|
||||
u8 tod[3];//TimeOfDay
|
||||
|
||||
}DMH_FeatureBridgeUsage;
|
||||
|
||||
typedef struct DMH_IncomingTrunkUsage
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 durLen;
|
||||
u8 dur[4];//Duration
|
||||
u8 todLen;
|
||||
u8 tod[3];//TimeOfDay
|
||||
u8 tknumLen;
|
||||
u8 tknum[2];//TrunkNumber
|
||||
|
||||
u8 cardgts[2];//CarrierDigits
|
||||
u8 Date[3];
|
||||
u8 relind;//ReleaseIndicator
|
||||
u8 tdoLen;
|
||||
u8 tdo[2];//TimeDateOffset
|
||||
u8 tkgrpLen;
|
||||
u8 tkgrp[2];//TrunkGroup
|
||||
u8 tgpnamLen;
|
||||
u8 tgpnam[12];//TrunkGroupName
|
||||
}DMH_IncomingTrunkUsage;
|
||||
|
||||
typedef struct DMH_OutgoingTrunkUsage
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 durLen;
|
||||
u8 dur[4];//Duration
|
||||
u8 todLen;
|
||||
u8 tod[3];//TimeOfDay
|
||||
u8 tknumLen;
|
||||
u8 tknum[2];//TrunkNumber
|
||||
|
||||
u8 cardgts[2];//CarrierDigits
|
||||
u8 Date[3];
|
||||
u8 relind;//ReleaseIndicator
|
||||
u8 tdoLen;
|
||||
u8 tdo[2];//TimeDateOffset
|
||||
u8 tkgrpLen;
|
||||
u8 tkgrp[2];//TrunkGroup
|
||||
u8 tgpnamLen;
|
||||
u8 tgpnam[12];//TrunkGroupName
|
||||
}DMH_OutgoingTrunkUsage;
|
||||
|
||||
typedef struct DMH_AirChannelUsage
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
DMH_BeginForwardPath bfpath;
|
||||
u8 durLen;
|
||||
u8 dur[4];//Duration
|
||||
u8 todLen;
|
||||
u8 tod[3];//TimeOfDay
|
||||
u8 Date[3];
|
||||
|
||||
//optional part
|
||||
DMH_EndForwardPath efpath;
|
||||
u8 relind;//ReleaseIndicator
|
||||
u8 tdoLen;
|
||||
u8 tdo[2];//TimeDateOffset
|
||||
}DMH_AirChannelUsage;
|
||||
|
||||
typedef struct DMH_AirSegmentSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
DMH_AirChannelUsage achusg;//AirChannelUsage
|
||||
u8 segnum;//SegmentNumber
|
||||
|
||||
//optional part
|
||||
struct
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 latLen;
|
||||
u8 lat[3];//Latitude
|
||||
u8 LONGLen;
|
||||
u8 LONG[3];//Longitude
|
||||
u8 resolLen;
|
||||
u8 resol[3];//Resolution
|
||||
}begloc;//BeginLocation
|
||||
DMH_IncomingTrunkUsage incusg;//IncomingTrunkUsage
|
||||
u8 lsind;//LastSegmentIndicator,len=0
|
||||
DMH_SwitchID sswid;//ServingSWID
|
||||
u8 cgblind;//ChargeableIndicator
|
||||
DMH_FillIndicator fillind;
|
||||
DMH_ReturnIndicator retind;
|
||||
|
||||
}DMH_AirSegmentSubrecord;
|
||||
|
||||
typedef struct DMH_FeatureActivationLegSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 dialdgtsLen;
|
||||
u8 dialdgts[32];//DialedDigits
|
||||
u8 lnum;//LegNumber
|
||||
|
||||
//optional part will be encoded in the future
|
||||
u8 frind;//FeatureResultIndicator, BIT13
|
||||
u8 llind;//LastLegIndicator, BIT15
|
||||
}DMH_FeatureActivationLegSubrecord;
|
||||
|
||||
typedef struct DMH_ConversationUsage
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 durLen;
|
||||
u8 dur[4];//Duration
|
||||
u8 todLen;
|
||||
u8 tod[3];//TimeOfDay
|
||||
|
||||
//optional part
|
||||
u8 Date[3];
|
||||
u8 relind;//ReleaseIndicator
|
||||
u8 tdoLen;
|
||||
u8 tdo[2];//TimeDateOffset
|
||||
u8 numoctLen;
|
||||
u8 numoct[4];//NumberOfOctets
|
||||
u8 numpktLen;
|
||||
u8 numpkt[4];//NumberOfPackets
|
||||
}DMH_ConversationUsage;
|
||||
|
||||
typedef struct DMH_OriginationLegSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 billind;//BillingIndicator
|
||||
u8 dialdgtsLen;
|
||||
u8 dialdgts[32];//DialedDigits
|
||||
u8 lnum;//LegNumber
|
||||
|
||||
DMH_CallLocation CalledLocation;//BIT8
|
||||
|
||||
DMH_CallLocation CallingLocation;//BIT11
|
||||
|
||||
DMH_ConversationUsage cnvusg;//ConversationUsage,BIT14
|
||||
DMH_FeatureBridgeUsage fbusg;//FeatureBridgeUsage,BIT16
|
||||
u8 llind;//LastLegIndicator,len=0,BIT19
|
||||
DMH_OutgoingTrunkUsage ogtusg;//OutgoingTrunkUsage.BIT20
|
||||
|
||||
}DMH_OriginationLegSubrecord;
|
||||
|
||||
typedef struct DMH_PACASegmentSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 cellidLen;
|
||||
u8 cellid[2];//CellIdentifier
|
||||
u8 durLen;
|
||||
u8 dur[4];//Duration
|
||||
u8 pacaind;//PACAIndicator
|
||||
u8 segnum;//SegmentNumber
|
||||
}DMH_PACASegmentSubrecord;
|
||||
|
||||
typedef struct DMH_RedirectionLegSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 billind;//BillingIndicator
|
||||
u8 cddgtsLen;
|
||||
u8 cddgts[9];//CalledDigits
|
||||
DMH_IncomingTrunkUsage incusg;//IncomingTrunkUsage
|
||||
u8 lnum;//LegNumber
|
||||
u8 redind;//RedirectionIndicator
|
||||
|
||||
//optional part
|
||||
DMH_CallLocation CalledLocation;//BIT6
|
||||
|
||||
u8 cgdgtsLen;
|
||||
u8 cgdgts[9];//CallingDigits, BIT8
|
||||
|
||||
DMH_CallLocation CallingLocation;//BIT9
|
||||
|
||||
DMH_ConversationUsage cnvusg;//ConversationUsage,BIT12
|
||||
u8 destdgtsLen;
|
||||
u8 destdgts[32];//DestinationDigits,BIT13
|
||||
u8 llind;//LastLegIndicator,len=0,BIT18
|
||||
DMH_OutgoingTrunkUsage ogtusg;//OutgoingTrunkUsage.BIT19
|
||||
|
||||
}DMH_RedirectionLegSubrecord;
|
||||
|
||||
typedef struct DMH_TandemSegmentSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
DMH_OutgoingTrunkUsage ogtusg;//OutgoingTrunkUsage
|
||||
u8 segnum;//SegmentNumber
|
||||
DMH_SwitchID tswid;//ServingSWID
|
||||
|
||||
//optional part will be added in the future
|
||||
}DMH_TandemSegmentSubrecord;
|
||||
|
||||
typedef struct DMH_TerminationLegSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 billind;//BillingIndicator
|
||||
u8 lnum;//LegNumber
|
||||
|
||||
//optional part
|
||||
DMH_CallLocation CalledLocation;//BIT6
|
||||
|
||||
u8 cgdgtsLen;
|
||||
u8 cgdgts[9];//CallingDigits,BIT9
|
||||
|
||||
DMH_CallLocation CallingLocation;//BIT10
|
||||
|
||||
DMH_ConversationUsage cnvusg;//ConversationUsage,BIT13
|
||||
DMH_FeatureBridgeUsage fbusg;//FeatureBridgeUsage,BIT16
|
||||
DMH_IncomingTrunkUsage incusg;//IncomingTrunkUsage,BIT17
|
||||
u8 llind;//LastLegIndicator,len=0,BIT19
|
||||
|
||||
}DMH_TerminationLegSubrecord;
|
||||
|
||||
typedef struct DMH_AuxiliaryLegSubrecord
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
u8 billind;//BillingIndicator
|
||||
u8 lnum;//LegNumber
|
||||
}DMH_AuxiliaryLegSubrecord;
|
||||
|
||||
typedef struct DMH_EventJacket
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
DMH_AuditSubrecord audsub;
|
||||
DMH_IdentitySubrecord idsub;
|
||||
DMH_EventSubrecord evtsub;
|
||||
DMH_ChargeSubrecord chrgsub;
|
||||
}DMH_EventJacket;
|
||||
|
||||
typedef struct DMH_ActivityJacket
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
DMH_AuditSubrecord audsub;
|
||||
DMH_IdentitySubrecord idsub;
|
||||
DMH_ActivitySubrecord actsub;
|
||||
DMH_ChargeSubrecord chrgsub;
|
||||
}DMH_ActivityJacket;
|
||||
|
||||
typedef struct DMH_CallJacket
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
DMH_AuditSubrecord audsub;
|
||||
DMH_IdentitySubrecord idsub;
|
||||
|
||||
DMH_ActivitySubrecord actsub;
|
||||
DMH_AirSegmentSubrecord airssub;
|
||||
DMH_ChargeSubrecord chrgsub;
|
||||
DMH_FeatureActivationLegSubrecord falsub;
|
||||
DMH_OriginationLegSubrecord olsub;
|
||||
DMH_PACASegmentSubrecord pacasub;
|
||||
DMH_RedirectionLegSubrecord rlsub;
|
||||
DMH_TandemSegmentSubrecord tssub;
|
||||
DMH_TerminationLegSubrecord tlsub;
|
||||
DMH_AuxiliaryLegSubrecord auxlsub;
|
||||
}DMH_CallJacket;
|
||||
|
||||
typedef struct DMH_LegJacket
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
DMH_IdentitySubrecord idsub;
|
||||
|
||||
DMH_ChargeSubrecord chrgsub;
|
||||
DMH_FeatureActivationLegSubrecord falsub;
|
||||
DMH_OriginationLegSubrecord olsub;
|
||||
DMH_RedirectionLegSubrecord rlsub;
|
||||
DMH_TerminationLegSubrecord tlsub;
|
||||
DMH_AuxiliaryLegSubrecord auxlsub;
|
||||
}DMH_LegJacket;
|
||||
|
||||
typedef struct DMH_SegmentJacket
|
||||
{
|
||||
u32 param_flag;
|
||||
|
||||
DMH_IdentitySubrecord idsub;
|
||||
|
||||
DMH_ActivitySubrecord actsub;
|
||||
DMH_AirSegmentSubrecord airssub;
|
||||
DMH_ChargeSubrecord chrgsub;
|
||||
DMH_PACASegmentSubrecord pacasub;
|
||||
DMH_TandemSegmentSubrecord tssub;
|
||||
}DMH_SegmentJacket;
|
||||
|
||||
|
||||
|
||||
int assign_DMHEventJacket(DMH_EventJacket *ptr,u8 *buf);
|
||||
int assign_DMH_ActivityJacket(DMH_ActivityJacket *ptr,u8 *buf);
|
||||
int assign_DMH_CallJacket(DMH_CallJacket *ptr,u8 *buf);
|
||||
int assign_DMH_LegJacket(DMH_LegJacket *ptr,u8 *buf);
|
||||
int assign_DMH_SegmentJacket(DMH_SegmentJacket *ptr,u8 *buf);
|
||||
void encode_DMH_date(u8 *date);
|
||||
u8 encode_DMH_TimeDateOffset(u8 *TimeDateOffset);
|
||||
u8 encode_DMH_TimeOfDay(u8 *TimeOfDay);
|
||||
|
||||
1063
plat/xapp/src/xap_interface.c
Normal file
1063
plat/xapp/src/xap_interface.c
Normal file
File diff suppressed because it is too large
Load Diff
11
plat/xapp/src/xap_interfunc.h
Normal file
11
plat/xapp/src/xap_interfunc.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/* XAP interface for map/cap use head file */
|
||||
/* Written by Liu Zhiguo 2003-08-26 */
|
||||
/* Version 1.0 */
|
||||
/* --------------------------------------- */
|
||||
|
||||
#ifndef _XAP_INTER_FUNC
|
||||
#define _XAP_INTER_FUNC
|
||||
|
||||
void xap_send_error(const char *fmt,...);
|
||||
|
||||
#endif
|
||||
1340
plat/xapp/src/xap_monitor.c
Normal file
1340
plat/xapp/src/xap_monitor.c
Normal file
File diff suppressed because it is too large
Load Diff
19
plat/xapp/src/xap_monitor.h
Normal file
19
plat/xapp/src/xap_monitor.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* XAP monitor head file */
|
||||
/* Written by Liu Zhiguo 2003-03-13 */
|
||||
/* Version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#ifndef _XAP_MONITOR
|
||||
#define _XAP_MONITOR
|
||||
|
||||
void xap_init_m(void);
|
||||
void xap_monitor(void);
|
||||
|
||||
void xap_send_error(const char *fmt,...);
|
||||
void xap_msg_display(u8 *info_str);
|
||||
void xap_dlg_display(struct CSLdlg_struct *dha_ptr);
|
||||
void xap_cmp_display(struct CSLcmp_struct *cha_ptr);
|
||||
void xap_watch_dog(u32 wd_site);
|
||||
void xap_logdebug(const char *fmt,...);
|
||||
|
||||
#endif
|
||||
3496
plat/xapp/src/xap_provider.c
Normal file
3496
plat/xapp/src/xap_provider.c
Normal file
File diff suppressed because it is too large
Load Diff
185
plat/xapp/src/xap_provider.h
Normal file
185
plat/xapp/src/xap_provider.h
Normal file
@@ -0,0 +1,185 @@
|
||||
/* XAP provider head file */
|
||||
/* Written by Liu Zhiguo 2003-08-26 */
|
||||
/* Version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#include "../../public/src/include/includes.h"
|
||||
#include "../../public/src/include/pub_fmt.h"
|
||||
#include "../../sccp/src/include/sccp.h"
|
||||
#include "../../tcap/src/include/tcap_head.h"
|
||||
#include "../../tcap/src/include/tcap_public.h"
|
||||
#include "../../tcap/src/include/tcap_struct.h"
|
||||
#include "ixap.h"
|
||||
#include "mapp/map_const.h"
|
||||
#include "mapp/map_public.h"
|
||||
#include "mapp/map_code.h"
|
||||
#include "mapp/map_coding.h"
|
||||
#include "mapp/is41_code.h"
|
||||
#include "mapp/map_struct.h"
|
||||
#include "mapp/map_acn.h"
|
||||
#include "mapp/map_dlgpdu.h"
|
||||
|
||||
#ifndef _PROVIDER_H
|
||||
#define _PROVIDER_H
|
||||
|
||||
#define XAP_MAP_SSN 1 // ssn is used for map
|
||||
#define XAP_CAP_SSN 2 // ssn is used for cap
|
||||
#define XAP_IS41_SSN 3 // ssn is used for is41
|
||||
#define XAP_AIN_SSN 4 //SSN IS USED FOR MNP AIN (ANSI TCAP)
|
||||
|
||||
#define XAP_VM_KEY 0xa0e00000
|
||||
#define XAP_VM_PERM 0664
|
||||
#define XAP_INTER_KEY 0xa0f00000
|
||||
#define XAP_INTER_PERM 0664
|
||||
|
||||
#define MAX_XAP_SSN 16
|
||||
#define XAP_OPEN_LEN 128
|
||||
#define XAP_ACN_LEN 7 // xap acn length
|
||||
#define XAP_ACN_NUM 50 // acn buffer length
|
||||
#define XAP_OPR_NUM 80 // operation length
|
||||
|
||||
#define XAP_ASCIN_LEN 1024
|
||||
#define XAP_ASCOUT_LEN 4096
|
||||
#define XAP_WTDOG_LEN 256
|
||||
|
||||
#define XAP_INIT 0x00
|
||||
#define XAP_IDLE 0x01
|
||||
#define XAP_WFUR 0x02 // wait for user requests
|
||||
#define XAP_WFCBI 0x03 // wait for check begin indicate
|
||||
#define XAP_DLG_INITIATED 0x05
|
||||
#define XAP_DLG_PENDING 0x04 // dialogue pending
|
||||
#define XAP_DLG_ACCEPTED 0x06
|
||||
#define XAP_DLG_ESTABLISHED 0x07
|
||||
#define XAP_DLG_SUSPEND 0x08
|
||||
#define XAP_DLG_HALT 0x09
|
||||
|
||||
/* the state of SSM */
|
||||
#define SSM_IDLE 0x00
|
||||
#define SSM_WFRESPONSE 0x01 // wait for response
|
||||
#define SSM_WFCONFIRM 0x02
|
||||
|
||||
/* the flag of requesting map SSM */
|
||||
#define SERVICE_INVOKED 0x01
|
||||
#define RESULT_RECEIVED 0x02
|
||||
#define PARTIAL_RESULT_RECEIVED 0x03
|
||||
#define NEGATIVE_RESULT_RECEIVED 0x04
|
||||
#define LINKED_REQUEST_RECEIVED 0x05
|
||||
#define LINKED_SERVICE_INVOKED 0x06
|
||||
#define USER_REJECT_RECEIVED 0x07
|
||||
#define PROVIDER_REJECT_RECEIVED 0x08
|
||||
#define TIMER_EXPIRY 0x09
|
||||
#define TERMINATED 0x0a
|
||||
|
||||
/* the flag of performing map SSM */
|
||||
#define SERVICE_INVOCATION_RECEIVED 0x01
|
||||
#define RESPONSE_ISSUED 0x02
|
||||
#define GUARD_TIMER 0x03
|
||||
|
||||
#define SUSPEND_TIME 1
|
||||
#define DLGPEND_TIME 180
|
||||
#define XAPP_TIMERHZ 100
|
||||
|
||||
#define XAPP_PRIVATE_TCAP 1
|
||||
#define XAPP_OPER_FAMILY 9
|
||||
#define XAPP_NATIONAL_TCAP 0
|
||||
typedef struct xap_acn_info // store info about application context name
|
||||
{
|
||||
u8 buf_len;
|
||||
u8 acn[XAP_ACN_NUM]; // acn buffer
|
||||
u8 acn_ver[XAP_ACN_NUM]; // acn version buffer
|
||||
} xap_acn_info;
|
||||
|
||||
typedef struct xap_opr_info // store info about opration code
|
||||
{
|
||||
u8 buf_len;
|
||||
u8 opr_code[XAP_OPR_NUM]; // operation code buffer
|
||||
u8 opr_class[XAP_OPR_NUM]; // operation class buffer
|
||||
u32 opr_timer[XAP_OPR_NUM]; // operation timer buffer
|
||||
} xap_opr_info;
|
||||
|
||||
|
||||
typedef struct xap_inter_struct // xap interface structure
|
||||
{
|
||||
u8 mcc[2];
|
||||
u8 mnc0;
|
||||
u8 cc[2];
|
||||
u8 ndc[3];
|
||||
u8 inter_prefix[2];
|
||||
u8 national_prefix[2];
|
||||
u8 local_prefix[2];
|
||||
u8 mnc[2];//expend mnc from 1 byte to 2 bytes
|
||||
u32 establishment_timer;
|
||||
/* mscid is special use for CDMA */
|
||||
u8 mscidToNum[256][14];
|
||||
/* mscid is special use for CDMA */
|
||||
|
||||
// define for the ssn control
|
||||
u8 regssn_len;
|
||||
u8 reg_ssn[MAX_XAP_SSN];
|
||||
u8 regssn_flag[MAX_XAP_SSN]; // indicate if the register SSN is MAP or CAP ssn
|
||||
u8 open_head[MAX_XAP_SSN];
|
||||
u8 open_tail[MAX_XAP_SSN];
|
||||
u32 open_did[MAX_XAP_SSN][XAP_OPEN_LEN];
|
||||
} xap_inter_struct;
|
||||
|
||||
typedef struct xap_debug_struct
|
||||
{
|
||||
char *start_time; // time of module start
|
||||
u32 monitor_did; // the dialogue id for monitored
|
||||
u8 error_switch;
|
||||
u8 map_switch;
|
||||
u8 cap_switch;
|
||||
u8 send_control; // control if can send xap message
|
||||
u8 ascin_buf[XAP_ASCIN_LEN];
|
||||
u8 ascout_buf[XAP_ASCOUT_LEN];
|
||||
u32 watch_dog[XAP_WTDOG_LEN];
|
||||
} xap_debug_struct;
|
||||
|
||||
typedef struct psmvm_data // xap provider state machine data
|
||||
{
|
||||
u8 xap_flag; // 0: empty; 1: map primitive; 2: cap primitive
|
||||
u8 psm_state;
|
||||
u8 sub_state1;
|
||||
u8 delimiter_flag;
|
||||
u8 acn;
|
||||
u8 acn_ver;
|
||||
u8 msg_type;
|
||||
u8 msg_flag;
|
||||
u32 port_id;
|
||||
u32 suspend_timer;
|
||||
u8 data_count;
|
||||
u8 recv_bsa_count;
|
||||
u8 opr_state[MAX_INVOKEID];
|
||||
u8 opr_code[MAX_INVOKEID];
|
||||
u8 opr_class[MAX_INVOKEID];
|
||||
} psmvm_data;
|
||||
|
||||
typedef struct xapp_vm_data // XAP provider virtue machine structure
|
||||
{
|
||||
struct psmvm_data psm_data;
|
||||
u8 recvcom_flag; // USER=>XAPP
|
||||
u8 recvopr_flag; // USER=>XAPP 0: has not data 1: has data 2: has partial data
|
||||
u8 sendcom_flag; // XAPP=>USER
|
||||
u8 sendopr_flag; // XAPP=>USER
|
||||
u32 recvopr_site; // USER=>XAPP 0: has not data 1: has data 2: has partial data
|
||||
struct MapComSrv_struct recvcom_data;
|
||||
struct MapOprData_struct recvopr_data;
|
||||
struct MapComSrv_struct sendcom_data;
|
||||
struct MapOprData_struct sendopr_data;
|
||||
struct CSLdlg_struct tcap_data;
|
||||
struct MapDlg_struct map_dlg;
|
||||
} xapp_vm_data;
|
||||
|
||||
typedef struct xap_vm_struct
|
||||
{
|
||||
int grantdid;
|
||||
struct xapp_vm_data xap_data[MAX_DIALOGUEID];
|
||||
struct xap_debug_struct debug_data;
|
||||
} xap_vm_struct;
|
||||
|
||||
// fix multiple definition====================================
|
||||
extern struct xap_vm_struct *xap_vm_ptr;
|
||||
extern struct xap_inter_struct *xap_inter_ptr;
|
||||
//
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user