init ems server code
This commit is contained in:
16
plat/tcap/src/include/idmanage.h
Normal file
16
plat/tcap/src/include/idmanage.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/* ID manage head file */
|
||||
/* written by Liu Zhiguo 2002-08-06 */
|
||||
/* Version 2.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
void init_id();
|
||||
u32 chkcount_did(void);
|
||||
u32 chkcount_did_occupied(void);
|
||||
u32 chkcount_did_max(void);
|
||||
u32 assign_did();
|
||||
void free_did(u32 did);
|
||||
u8 check_did(u32 did);
|
||||
u8 assign_iid(u32 did);
|
||||
void free_iid(u32 did,u8 iid);
|
||||
u8 check_iid(u32 did,u8 iid);
|
||||
u8 store_iid(u32 did,u8 iid);
|
||||
18
plat/tcap/src/include/itcap.h
Normal file
18
plat/tcap/src/include/itcap.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* itcap head file */
|
||||
#ifdef _ITCAP_H_
|
||||
#define _ITCAP_H_
|
||||
|
||||
#include "../../../public/src/include/public.h"
|
||||
#include "tcap_public.h"
|
||||
#include "tcap_struct.h"
|
||||
|
||||
void tcap_disp_dlg(struct CSLdlg_struct *dha_ptr,u8 disp_flag);
|
||||
void tcap_disp_cmp(struct CSLcmp_struct *cha_ptr,u8 disp_flag);
|
||||
|
||||
u8 RecvTcapDlg(struct CSLdlg_struct *dha_ptr,u32 dlg_flag);
|
||||
u8 RecvTcapCmp(struct CSLcmp_struct *cha_ptr,u32 dlg_flag);
|
||||
u8 SendTcapDlg(struct CSLdlg_struct *dha_ptr);
|
||||
u8 SendTcapCmp(struct CSLcmp_struct *cha_ptr);
|
||||
int itcap_reg_ssn(u8 ssn);
|
||||
void tcap_change_local_ssn(u32 proc,u8 src_ssn,u8 dst_ssn);
|
||||
#endif
|
||||
256
plat/tcap/src/include/tcap_head.h
Normal file
256
plat/tcap/src/include/tcap_head.h
Normal file
@@ -0,0 +1,256 @@
|
||||
/* TCAP head file */
|
||||
/* Written by Liu Zhiguo 2002-08-06 */
|
||||
/* Version 2.0 */
|
||||
/* --------------------------------- */
|
||||
#ifndef _TCAP_HEAD
|
||||
#define _TCAP_HEAD
|
||||
|
||||
/* TC or TR dialogue portion */
|
||||
/* TC or TR message type tag */
|
||||
#define Unidirectional 0x61
|
||||
#define Begin 0x62
|
||||
#define End 0x64
|
||||
#define Continue 0x65
|
||||
#define P_Abort 0x66 // terminated by service provider
|
||||
#define U_Abort 0x67 // terminated by TC user
|
||||
#define Abort 0x67
|
||||
#define Notice 0x68 // Network Service Provider inform
|
||||
|
||||
#define Unidirectional_Ansi 0xE1
|
||||
#define Query_WithPerm_Ansi 0xE2
|
||||
#define Query_WithoutPerm_Ansi 0xE3
|
||||
#define Response_Ansi 0xE4
|
||||
#define Conversation_WithPerm_Ansi 0xE5
|
||||
#define Conversation_WithoutPerm_Ansi 0xE6
|
||||
#define Abort_Ansi 0xF6
|
||||
#define P_Abort_Ansi 0xF5 // terminated by service provider
|
||||
#define U_Abort_Ansi 0xF6 // terminated by TC user
|
||||
|
||||
/* transaction ID tags */
|
||||
#define Org_TID 0x48 // originating transaction ID tag
|
||||
#define Dst_TID 0x49 // destination transaction ID tag
|
||||
|
||||
/* P-Abort cause tag */
|
||||
#define P_Abort_Cause 0x4a
|
||||
|
||||
/* coding of P-Abort Cause values */
|
||||
#define P_Abort_UMT 0x00 // unrecognized message type
|
||||
#define P_Abort_UTID 0x01 // unrecognized transaction ID
|
||||
#define P_Abort_BFTP 0x02 // badly formatted transaction portion
|
||||
#define P_Abort_ITP 0x03 // incorrect transaction portion
|
||||
#define P_Abort_RL 0x04 // resource limitation
|
||||
#define P_Abort_ADLG 0x05 // abnormal dialogue
|
||||
#define P_Abort_NCDP 0x06 // no common dialogue portion
|
||||
|
||||
#define P_Abort_UMT_Ansi 0x01 // unrecognized message type
|
||||
#define P_Abort_ITP_Ansi 0x02 // incorrect transaction portion
|
||||
#define P_Abort_BFTP_Ansi 0x03 // badly formatted transaction portion
|
||||
#define P_Abort_UTID_Ansi 0x04 // unrecognized transaction ID
|
||||
#define P_Abort_PTRP_Ansi 0x05 // permission to release problem
|
||||
#define P_Abort_RL_Ansi 0x06 // resource limitation
|
||||
#define P_Abort_UDPID_Ansi 0x07 // unrecognized dialogue portion id
|
||||
#define P_Abort_BSDP_Ansi 0x08 // badly structured dialogue portion
|
||||
#define P_Abort_MDP_Ansi 0x09 // missing dialogue portion
|
||||
#define P_Abort_IDP_Ansi 0x0A // inconsistent dialogue portion
|
||||
|
||||
/* dialogue portion tag */
|
||||
#define Dialogue_Portion 0x6b
|
||||
|
||||
/* component portion tag */
|
||||
#define Component_Portion 0x6c
|
||||
|
||||
/* TC Component portion */
|
||||
/* component type tag */
|
||||
#define Invoke 0xa1
|
||||
#define Result_L 0xa2 // return result last
|
||||
#define Error 0xa3 // indicate operation execution failed
|
||||
#define U_Error 0xa3
|
||||
#define Reject 0xa4
|
||||
#define U_Reject 0xa4 // reject by TC user
|
||||
#define L_Reject 0xa5 // local reject
|
||||
#define R_Reject 0xa6 // remote reject
|
||||
#define Result_NL 0xa7 // return result not last
|
||||
#define L_Cancel 0xa8 // inform TC user local terminated by timeout
|
||||
#define U_Cancel 0xa8 // local terminate by TC user
|
||||
|
||||
#define Invoke_L_Ansi 0xe9 // Invoke Last
|
||||
#define Result_L_Ansi 0xea // return result last
|
||||
#define Error_Ansi 0xeb // indicate operation execution failed
|
||||
#define U_Error_Ansi 0xeb
|
||||
#define Reject_Ansi 0xec // Reject
|
||||
#define U_Reject_Ansi 0xec // reject by TC user
|
||||
#define L_Reject_Ansi 0xe8 // local reject
|
||||
#define R_Reject_Ansi 0xe7 // remote reject
|
||||
#define Invoke_NL_Ansi 0xed // Invoke not last
|
||||
#define Result_NL_Ansi 0xee // return result not last
|
||||
|
||||
/* component ID tag */
|
||||
#define Invoke_ID 0x02
|
||||
#define Linked_ID 0x80
|
||||
|
||||
/* coding of NULL tag */
|
||||
#define Invoke_ID_NULL 0x05
|
||||
|
||||
/* operation code tag */
|
||||
#define Local_Operation_Code 0x02
|
||||
#define Global_Operation_Code 0x06
|
||||
|
||||
/* parameter tag */
|
||||
#define Sequence 0x30
|
||||
#define Set 0x31
|
||||
|
||||
/* error code tag */
|
||||
#define Local_Error_Code 0x02
|
||||
#define Global_Error_Code 0x06
|
||||
|
||||
/* coding of problem type tag */
|
||||
#define General_Problem 0x80
|
||||
#define Invoke_Problem 0x81
|
||||
#define Return_Result 0x82
|
||||
#define Return_Error 0x83
|
||||
|
||||
#define General_Problem_Ansi 0x01
|
||||
#define Invoke_Problem_Ansi 0x02
|
||||
#define Return_Result_Ansi 0x03
|
||||
#define Return_Error_Ansi 0x04
|
||||
#define Transaction_Ansi 0x05
|
||||
|
||||
/* coding of general problem */
|
||||
#define General_Problem_UC 0x00 // unrecognized component
|
||||
#define General_Problem_MC 0x01 // mistyped component
|
||||
#define General_Problem_BSC 0x02 // badly structured component
|
||||
|
||||
#define General_Problem_UC_Ansi 0x01 // unrecognized component
|
||||
#define General_Problem_MC_Ansi 0x02 // mistyped component/incorrect component portion
|
||||
#define General_Problem_BSC_Ansi 0x03 // badly structured component
|
||||
#define General_Problem_ICC_Ansi 0x04 // incorrect component coding
|
||||
|
||||
/* coding of invoke problem */
|
||||
#define Invoke_Problem_DIID 0x00 // duplicate invoke ID
|
||||
#define Invoke_Problem_UO 0x01 // unrecognized operation
|
||||
#define Invoke_Problem_MP 0x02 // mistyped parameter
|
||||
#define Invoke_Problem_RL 0x03 // resource limitation
|
||||
#define Invoke_Problem_IR 0x04 // initiating release
|
||||
#define Invoke_Problem_ULID 0x05 // unrecognized linked ID
|
||||
#define Invoke_Problem_LRU 0x06 // linked response unexpected
|
||||
#define Invoke_Problem_ULO 0x07 // unexpected linked operation
|
||||
|
||||
#define Invoke_Problem_DIID_Ansi 0x01 // duplicate invoke ID
|
||||
#define Invoke_Problem_UO_Ansi 0x02 // unrecognized operation
|
||||
#define Invoke_Problem_MP_Ansi 0x03 // mistyped parameter
|
||||
#define Invoke_Problem_ULID_Ansi 0x04 // unrecognized linked ID
|
||||
|
||||
/* coding of return result problem */
|
||||
#define Return_Result_UIID 0x00 // unrecognized invoke ID
|
||||
#define Return_Result_RRU 0x01 // return result unexpected
|
||||
#define Return_Result_MP 0x02 // mistyped parameter
|
||||
|
||||
#define Return_Result_UIID_Ansi 0x01 // unrecognized invoke ID
|
||||
#define Return_Result_RRU_Ansi 0x02 // return result unexpected
|
||||
#define Return_Result_MP_Ansi 0x03 // mistyped parameter
|
||||
|
||||
/* coding of return error problem */
|
||||
#define Return_Error_UIID 0x00 // unrecognized invoke ID
|
||||
#define Return_Error_REU 0x01 // return error unexpected
|
||||
#define Return_Error_URE 0x02 // unrecognized error
|
||||
#define Return_Error_UEE 0x03 // unexpected error
|
||||
#define Return_Error_MP 0x04 // mistyped parameter
|
||||
|
||||
#define Return_Error_UIID_Ansi 0x01 // unrecognized invoke ID
|
||||
#define Return_Error_REU_Ansi 0x02 // return error unexpected
|
||||
#define Return_Error_URE_Ansi 0x03 // unrecognized error
|
||||
#define Return_Error_UEE_Ansi 0x04 // unexpected error
|
||||
#define Return_Error_MP_Ansi 0x05 // mistyped parameter
|
||||
|
||||
/* Dialogue Portion */
|
||||
/* external tag */
|
||||
#define External 0x28
|
||||
|
||||
/* object identifier */
|
||||
#define Object_Identifier 0x06
|
||||
#define Integer 0x02
|
||||
|
||||
/* dialogue tag */
|
||||
#define PDU_AARQ 0x60
|
||||
#define PDU_AARE 0x61
|
||||
#define PDU_ABRT 0x64
|
||||
/* protocol version tag */
|
||||
#define Protocol_Version 0x80
|
||||
|
||||
/* application context name tag */
|
||||
#define Application_Context_Name 0xa1
|
||||
|
||||
/* user information tag */
|
||||
#define User_Information 0xbe
|
||||
|
||||
/* abort source tag */
|
||||
#define Abort_Source 0x80
|
||||
|
||||
/* result tag in Q.773 this tag is 0x82 */
|
||||
//#define Result 0xa2
|
||||
|
||||
/* result source diagnostic tag */
|
||||
#define Result_Source_Diagnostic 0xa3
|
||||
|
||||
/* encoding tag */
|
||||
#define Single_ASN1_type 0xa0
|
||||
#define Octet_Aligned 0x81 // maybe 0xa1
|
||||
#define Arbitrary 0x82 // maybe 0xa2
|
||||
|
||||
/* result value */
|
||||
#define Accepted 0x00
|
||||
#define Reject_permanent 0x01
|
||||
|
||||
/* dialogue service diagnostic tag in Q.773,value is 0x21 and 0x22 */
|
||||
#define Dialogue_Service_Provider 0x02
|
||||
#define Dialogue_Service_User 0x01
|
||||
|
||||
/* dialogue service user diagnostic tag */
|
||||
#define DSU_N 0x00 // null
|
||||
#define DSU_NRG 0x01 // no reason given
|
||||
#define DSU_ACNNS 0x02 // application context name not supplied
|
||||
|
||||
/* dialogue service provider diagnostic tag */
|
||||
#define DSP_N 0x00 // null
|
||||
#define DSP_NRG 0x01 // no reason given
|
||||
#define DSP_NCDP 0x02 // no common dialogue portion
|
||||
|
||||
/* abort source */
|
||||
|
||||
#define ABRTDlg_Service_User 0x00
|
||||
#define ABRTDlg_Service_Provider 0x01
|
||||
|
||||
/* unidirectional dialogue tag */
|
||||
#define PDU_AUDT 0x65
|
||||
#define PDU_ASUDT 0x66
|
||||
|
||||
#define REQUEST 1
|
||||
#define INDICATE 2
|
||||
#define RESPONSE 3
|
||||
#define CONFIRM 4
|
||||
|
||||
#define PRE_END 1 // pre arranged end
|
||||
#define BASIC_END 2 // basic end
|
||||
|
||||
#define DERR_ASN1 0x01 // decode error: asn1 decode error
|
||||
#define DERR_UNTYPE 0x02 // decode error: unknown message type
|
||||
#define DERR_UNTID 0x03 // decode error: lack transaction id
|
||||
#define DERR_OTHER 0x04 // decode error: other reason
|
||||
|
||||
#define UABORT_NULL 0x00 // uabort reason:no
|
||||
#define UABORT_SPEC 0x01 // uabort reason:specific reason
|
||||
#define UABORT_ACNNS 0x02 // uabort reason:application context name not supplied
|
||||
|
||||
#define ANSI_TAG_CLASS_CONS 0xE0
|
||||
#define ANSI_TAG_CLASS_PRIM 0xC0
|
||||
|
||||
#define ITU_TCAP 0
|
||||
#define ANSI_TCAP 1
|
||||
|
||||
#define TYPE_NATIONAL 0
|
||||
#define TYPE_PRIVATE 1
|
||||
|
||||
#define TYPE_INT 0
|
||||
#define TYPE_OID 1
|
||||
|
||||
#endif
|
||||
21
plat/tcap/src/include/tcap_m.h
Normal file
21
plat/tcap/src/include/tcap_m.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* TCAP monitor head file */
|
||||
/* written by Liu Zhiguo 2001-10-19 */
|
||||
/* Version 1.0 */
|
||||
/* -------------------------------- */
|
||||
|
||||
#include "../../../public/src/include/pub_include.h"
|
||||
|
||||
#ifndef _TCAP_M
|
||||
#define _TCAP_M
|
||||
|
||||
/* in the m.c */
|
||||
void init_m();
|
||||
void tcap_set_local_ip();
|
||||
void tcap_monitor();
|
||||
void tcap_send_ascout(char *asc_str);
|
||||
void tcap_send_error(char *err_str);
|
||||
void tcap_send_alarm(u8 alarm_code,u8 alarm_level);
|
||||
void HexToDisplay(u8 *to_asc, u8 *from_hex, u8 from_len);
|
||||
void tcap_send_info(char *info);
|
||||
|
||||
#endif
|
||||
3
plat/tcap/src/include/tcap_proc.h
Normal file
3
plat/tcap/src/include/tcap_proc.h
Normal file
@@ -0,0 +1,3 @@
|
||||
void tcap_fsm(void); // TCAP state machine, 10ms
|
||||
void tcap_init(int didgrant,DWORD localip, DWORD peerip); // init TCAP system
|
||||
|
||||
68
plat/tcap/src/include/tcap_public.h
Normal file
68
plat/tcap/src/include/tcap_public.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* TCAP public define head file */
|
||||
/* written by Liu Zhiguo 2002-08-06 */
|
||||
/* Version 2.0 */
|
||||
/* ------------------------------- */
|
||||
|
||||
#ifndef _TCAP_PUBLIC
|
||||
#define _TCAP_PUBLIC
|
||||
|
||||
#include "../../../public/src/include/includes.h"
|
||||
#include "tcap_head.h"
|
||||
|
||||
#define MAX_DIALOGUEID 4096
|
||||
#define MAX_INVOKEID 256
|
||||
#define TCAP_ASCIN_LEN 80
|
||||
#define TCAP_ASCOUT_LEN 4096
|
||||
#define TCAP_UTILIZE_COUNT 97
|
||||
#define TCAP_UTILIZE_LEN 76
|
||||
#define TCAP_HB_LEN 8
|
||||
#define TCAP_DLG_LEN 128 // max dialogue length
|
||||
#define TCAP_CMP_LEN 256 // max component length
|
||||
#define TCAP_ACN_LEN 10 // max context name length
|
||||
#define TCAP_USERINFO_LEN 64 // max user infomation length
|
||||
#define TCAP_UABORT_INFO_LEN 64 // max user abort infomation length
|
||||
#define TCAP_SECURITY_CONTEXT_LEN 64 // max security context infomation length
|
||||
#define TCAP_CONFIDENTIAL_INFO_LEN 64 // max confidentiality infomation length
|
||||
#define MAX_TEMPINVOKEID 8
|
||||
#define TCAP_BUF_LEN 256
|
||||
#define TCAP_SLS_NUM 16
|
||||
//#define TCAP_PARAM_LEN 170 // max parameter length when has dialogue portion
|
||||
#define TCAP_PARAM_LEN 210 // max parameter length when has dialogue portion
|
||||
#define TCAP_PARAM_LEN_1 210 // max parameter length when has not dialogue portion
|
||||
|
||||
#define MAX_TSL_BUF 4
|
||||
#define MAX_CSL_BUF 4
|
||||
|
||||
#define TCAP_MODULE_ID 3
|
||||
#define TCAP_SYSTEM_ID 4
|
||||
#define TCAP_LED_CODE 5
|
||||
|
||||
/* the state of TSM or DSM */
|
||||
#define TCAP_INIT 0
|
||||
#define TCAP_IDLE 1
|
||||
#define TCAP_IR 2 // initiation received
|
||||
#define TCAP_IS 3 // initiation send
|
||||
#define TCAP_ACTIVE 4 // active state
|
||||
#define TCAP_SUSPEND 7 // suspend state
|
||||
/* the state of ISM */
|
||||
#define SENT_STATE1 2
|
||||
#define SENT_STATE2 3
|
||||
#define SENT_STATE3 4
|
||||
#define SENT_STATE4 5
|
||||
#define WAIT_REJECT_STATE 6
|
||||
|
||||
/* the class of ISM */
|
||||
#define OPERATION_CLASS1 1 // operation class 1
|
||||
#define OPERATION_CLASS2 2 // operation class 2
|
||||
#define OPERATION_CLASS3 3 // operation class 3
|
||||
#define OPERATION_CLASS4 4 // operation class 4
|
||||
|
||||
#define INVOKE_TIMER 10
|
||||
#define REJECT_TIMER 2
|
||||
#define SUSPEND_TIMER 2
|
||||
#define IDLE_TIMER 60
|
||||
#define EXPIRE_TIMER 240
|
||||
#define TCAP_TIMERHZ 50
|
||||
#define ISM_TIMERHZ 50
|
||||
|
||||
#endif
|
||||
391
plat/tcap/src/include/tcap_struct.h
Normal file
391
plat/tcap/src/include/tcap_struct.h
Normal file
@@ -0,0 +1,391 @@
|
||||
/* TCAP structure head file */
|
||||
/* written by Liu Zhiguo 2002-08-06 */
|
||||
/* Version 2.0 */
|
||||
/* ------------------------------- */
|
||||
|
||||
#ifndef _TCAP_STRUCT
|
||||
#define _TCAP_STRUCT
|
||||
|
||||
#define TCAP_KEY 0xa0100000
|
||||
#define TCAP_PERM 0664
|
||||
|
||||
typedef struct tcapdebug_struct // tcap debug structure
|
||||
{
|
||||
u8 default_invtime; // default invoke time, init is 10s
|
||||
u8 default_rejtime; // default reject time, init is 1s
|
||||
u8 error_switch; // show error record switch
|
||||
u8 sccp_switch; // show receive data from sccp switch
|
||||
u8 tcu_switch; // show send data to TC-User switch
|
||||
u8 send_control; // control if can send out tcap message
|
||||
u8 start_time[6];
|
||||
u8 current_time[6];
|
||||
u32 monitor_did;
|
||||
u32 local_ip;
|
||||
u32 peer_ip;
|
||||
u8 watch_dog[256];
|
||||
u8 ascin_buf[TCAP_ASCIN_LEN];
|
||||
u8 ascout_buf[TCAP_ASCOUT_LEN];
|
||||
u8 current_csta;
|
||||
u32 csta_time[TCAP_UTILIZE_COUNT];
|
||||
u32 tc_utilize[TCAP_UTILIZE_COUNT][TCAP_UTILIZE_LEN];
|
||||
u8 hb_status[TCAP_HB_LEN];
|
||||
} tcapdebug_struct;
|
||||
|
||||
/* +++++++++++++++++++++++++++++++ */
|
||||
/* Transaction sub-layer structure */
|
||||
/* +++++++++++++++++++++++++++++++ */
|
||||
typedef struct TRUni_struct // transaction unidirectional struct
|
||||
{
|
||||
u8 dialogue_len;
|
||||
u8 components_len;
|
||||
u8 dialogue[TCAP_DLG_LEN];
|
||||
u8 components[TCAP_CMP_LEN];
|
||||
} TRUni_struct;
|
||||
|
||||
typedef struct TRBegin_struct // transaction begin struct
|
||||
{
|
||||
u8 tid_flag;
|
||||
u32 transaction_id;
|
||||
u8 dialogue_len;
|
||||
u8 components_len;
|
||||
u8 dialogue[TCAP_DLG_LEN];
|
||||
u8 components[TCAP_CMP_LEN];
|
||||
} TRBegin_struct;
|
||||
|
||||
typedef struct TRContinue_struct // transaction continue struct
|
||||
{
|
||||
u8 ltid_flag;
|
||||
u8 ptid_flag;
|
||||
u32 local_tid;
|
||||
u32 peer_tid;
|
||||
u8 dialogue_len;
|
||||
u8 components_len;
|
||||
u8 dialogue[TCAP_DLG_LEN];
|
||||
u8 components[TCAP_CMP_LEN];
|
||||
} TRContinue_struct;
|
||||
|
||||
typedef struct TREnd_struct // transaction end struct
|
||||
{
|
||||
u8 tid_flag;
|
||||
u32 transaction_id;
|
||||
u8 termination;
|
||||
u8 dialogue_len;
|
||||
u8 components_len;
|
||||
u8 dialogue[TCAP_DLG_LEN];
|
||||
u8 components[TCAP_CMP_LEN];
|
||||
} TREnd_struct;
|
||||
|
||||
typedef struct TRUAbort_struct // transaction u-abort struct
|
||||
{
|
||||
u8 tid_flag;
|
||||
u32 transaction_id;
|
||||
u8 dialogue_len;
|
||||
u8 dialogue[TCAP_DLG_LEN];
|
||||
u8 uabort_info_len;
|
||||
u8 uabort_info[TCAP_UABORT_INFO_LEN];
|
||||
} TRUAbort_struct;
|
||||
|
||||
typedef struct TRPAbort_struct // transaction p-abort struct
|
||||
{
|
||||
u8 tid_flag;
|
||||
u32 transaction_id;
|
||||
u8 abort_reason;
|
||||
} TRPAbort_struct;
|
||||
|
||||
typedef struct TRNotice_struct // transcation notice struct
|
||||
{
|
||||
u8 tid_flag;
|
||||
u32 transaction_id;
|
||||
u8 report_cause;
|
||||
} TRNotice_struct;
|
||||
|
||||
typedef struct TSL_struct
|
||||
{
|
||||
u8 message_type;
|
||||
u8 message_flag;
|
||||
u8 peer_tid_len; /* added by Pierre, 2006-08-19 */
|
||||
struct SCCP_ADDRESS local_add;
|
||||
struct SCCP_ADDRESS peer_add;
|
||||
union
|
||||
{
|
||||
struct TRUni_struct tr_uni;
|
||||
struct TRBegin_struct tr_begin;
|
||||
struct TRContinue_struct tr_continue;
|
||||
struct TREnd_struct tr_end;
|
||||
struct TRUAbort_struct tr_uabort;
|
||||
struct TRPAbort_struct tr_pabort;
|
||||
struct TRNotice_struct tr_notice;
|
||||
} tsl_prim;
|
||||
} TSL_struct;
|
||||
|
||||
/* +++++++++++++++++++++++++++++++ */
|
||||
/* Component sub-layer structure */
|
||||
/* +++++++++++++++++++++++++++++++ */
|
||||
|
||||
/* define dialogue handing primitive structure */
|
||||
typedef struct AARQ_struct
|
||||
{
|
||||
u8 version[2];
|
||||
u8 acn_len;
|
||||
u8 acn[TCAP_ACN_LEN];
|
||||
u8 user_info_len;
|
||||
u8 user_info[TCAP_USERINFO_LEN];
|
||||
} AARQ_struct;
|
||||
|
||||
typedef struct AARE_struct
|
||||
{
|
||||
u8 version[2];
|
||||
u8 acn_len;
|
||||
u8 acn[TCAP_ACN_LEN];
|
||||
u8 result;
|
||||
u8 diagnostic_flag; // user or provider
|
||||
u8 diagnostic_type; // reason
|
||||
u8 user_info_len;
|
||||
u8 user_info[TCAP_USERINFO_LEN];
|
||||
} AARE_struct;
|
||||
|
||||
typedef struct ABRT_struct
|
||||
{
|
||||
u8 abort_source;
|
||||
u8 user_info_len;
|
||||
u8 user_info[TCAP_USERINFO_LEN];
|
||||
} ABRT_struct;
|
||||
|
||||
typedef struct ASUDT_struct
|
||||
{
|
||||
u8 version;
|
||||
u8 acn_type;
|
||||
u8 acn_len;
|
||||
u8 acn[TCAP_ACN_LEN];
|
||||
u8 user_info_len;
|
||||
u8 user_info[TCAP_USERINFO_LEN];
|
||||
u8 security_context_type;
|
||||
u8 security_context_len;
|
||||
u8 security_context[TCAP_SECURITY_CONTEXT_LEN];
|
||||
u8 confidential_info_len;
|
||||
u8 confidential_info[TCAP_CONFIDENTIAL_INFO_LEN];
|
||||
} ASUDT_struct;
|
||||
|
||||
typedef struct dlgPDU_struct
|
||||
{
|
||||
u8 dialogue_type;
|
||||
union
|
||||
{
|
||||
struct AARQ_struct aarq;
|
||||
struct AARE_struct aare;
|
||||
struct ABRT_struct abrt;
|
||||
struct ASUDT_struct asudt;
|
||||
} pdu_union;
|
||||
} dlgPDU_struct;
|
||||
|
||||
typedef struct dlgport_struct // dialogue portion in the TC
|
||||
{
|
||||
u8 acn_type;
|
||||
u8 acn_len;
|
||||
u8 acn[TCAP_ACN_LEN];
|
||||
u8 user_info_len;
|
||||
u8 user_info[TCAP_USERINFO_LEN];
|
||||
u8 security_context_type;
|
||||
u8 security_context_len;
|
||||
u8 security_context[TCAP_SECURITY_CONTEXT_LEN];
|
||||
u8 confidential_info_len;
|
||||
u8 confidential_info[TCAP_CONFIDENTIAL_INFO_LEN];
|
||||
} dlgport_struct;
|
||||
|
||||
typedef struct TCUni_struct // component unidirectional struct
|
||||
{
|
||||
struct SCCP_ADDRESS local_add;
|
||||
struct SCCP_ADDRESS peer_add;
|
||||
u8 dialogue_flag;
|
||||
struct dlgport_struct dlg_data;
|
||||
u8 component_present;
|
||||
} TCUni_struct;
|
||||
|
||||
typedef struct TCBegin_struct
|
||||
{
|
||||
struct SCCP_ADDRESS local_add;
|
||||
struct SCCP_ADDRESS peer_add;
|
||||
u8 dialogue_flag;
|
||||
struct dlgport_struct dlg_data;
|
||||
u8 component_present;
|
||||
} TCBegin_struct;
|
||||
|
||||
typedef struct TCContinue_struct
|
||||
{
|
||||
u8 dialogue_flag;
|
||||
struct dlgport_struct dlg_data;
|
||||
u8 component_present;
|
||||
} TCContinue_struct;
|
||||
|
||||
typedef struct TCEnd_struct
|
||||
{
|
||||
u8 dialogue_flag;
|
||||
struct dlgport_struct dlg_data;
|
||||
u8 component_present;
|
||||
u8 termination;
|
||||
} TCEnd_struct;
|
||||
|
||||
typedef struct TCUAbort_struct
|
||||
{
|
||||
u8 uabort_reason;
|
||||
u8 dialogue_flag;
|
||||
struct dlgport_struct dlg_data;
|
||||
u8 uabort_info_len;
|
||||
u8 uabort_info[TCAP_UABORT_INFO_LEN];
|
||||
} TCUAbort_struct;
|
||||
|
||||
typedef struct TCPAbort_struct
|
||||
{
|
||||
u8 pabort_reason;
|
||||
} TCPAbort_struct;
|
||||
|
||||
typedef struct TCNotice_struct
|
||||
{
|
||||
u8 report_reason;
|
||||
} TCNotice_struct;
|
||||
|
||||
typedef struct CSLdlg_struct // dialogue primitive in CSL
|
||||
{
|
||||
u32 dialogue_id;
|
||||
u8 message_type;
|
||||
u8 message_flag;
|
||||
union
|
||||
{
|
||||
struct TCUni_struct tc_uni;
|
||||
struct TCBegin_struct tc_begin;
|
||||
struct TCContinue_struct tc_continue;
|
||||
struct TCEnd_struct tc_end;
|
||||
struct TCUAbort_struct tc_uabort;
|
||||
struct TCPAbort_struct tc_pabort;
|
||||
struct TCNotice_struct tc_notice;
|
||||
} dlg_prim;
|
||||
} CSLdlg_struct;
|
||||
|
||||
/* define component handing primitive structure */
|
||||
typedef struct TCInvoke_struct
|
||||
{
|
||||
u8 linkedid_flag;
|
||||
u8 linked_id;
|
||||
u8 operation_domain;
|
||||
u8 operation_family;
|
||||
u8 operation_code;
|
||||
u8 parameter_len;
|
||||
u8 parameter[TCAP_CMP_LEN];
|
||||
u8 operation_class;
|
||||
u32 timer;
|
||||
} TCInvoke_struct;
|
||||
|
||||
typedef struct TCResult_struct
|
||||
{
|
||||
u8 operation_flag; // the flag indicate if has operation code
|
||||
u8 operation_domain;
|
||||
u8 operation_family;
|
||||
u8 operation_code;
|
||||
u8 parameter_len;
|
||||
u8 parameter[TCAP_CMP_LEN];
|
||||
} TCResult_struct;
|
||||
|
||||
typedef struct TCUError_struct
|
||||
{
|
||||
u8 error_type; // error tag
|
||||
u8 error_code; // error code
|
||||
u8 parameter_len;
|
||||
u8 parameter[TCAP_CMP_LEN];
|
||||
} TCUError_struct;
|
||||
|
||||
typedef struct TCReject_struct
|
||||
{
|
||||
u8 problem_type;
|
||||
u8 problem_code;
|
||||
u8 parameter_len;
|
||||
u8 parameter[TCAP_CMP_LEN];
|
||||
} TCReject_struct;
|
||||
|
||||
typedef struct CSLcmp_struct
|
||||
{
|
||||
u32 dialogue_id; // dialogue id
|
||||
u8 invoke_id; // invoke id
|
||||
u8 message_type;
|
||||
u8 message_flag;
|
||||
u8 last_flag;
|
||||
union
|
||||
{
|
||||
struct TCInvoke_struct tc_invoke;
|
||||
struct TCResult_struct tc_result;
|
||||
struct TCUError_struct tc_uerror;
|
||||
struct TCReject_struct tc_reject;
|
||||
} cmp_prim;
|
||||
} CSLcmp_struct;
|
||||
|
||||
/* +++++++++++++++++++++++++++++++ */
|
||||
/* TCAP virtue machine structure */
|
||||
/* +++++++++++++++++++++++++++++++ */
|
||||
typedef struct ismvm_data
|
||||
{
|
||||
u8 used_flag;
|
||||
u8 linked_iid;
|
||||
u8 ism_state;
|
||||
u8 ism_msgtype;
|
||||
u8 ism_msgflag;
|
||||
u8 ism_msgclass;
|
||||
u8 ism_oper_domain;
|
||||
u8 ism_oper_family;
|
||||
u8 ism_oper_code;
|
||||
u32 ism_timer;
|
||||
} ismvm_data;
|
||||
|
||||
typedef struct tcapvm_struct
|
||||
{
|
||||
struct SCCP_ADDRESS local_add;
|
||||
struct SCCP_ADDRESS peer_add;
|
||||
u8 peer_tid_len;
|
||||
u32 peer_tid;
|
||||
u32 tcap_timer;
|
||||
u8 tcap_state;
|
||||
u8 ac_mode;
|
||||
u8 proto_type;
|
||||
u8 tcaprecv_head;
|
||||
u8 tcaprecv_tail;
|
||||
struct ismvm_data ism_data[MAX_TEMPINVOKEID];
|
||||
struct TSL_struct tsl_data[MAX_TSL_BUF];
|
||||
} tcapvm_struct;
|
||||
|
||||
typedef struct tcapint_struct // tcap interface structure
|
||||
{
|
||||
u8 dlgrecv_head;
|
||||
u8 dlgrecv_tail;
|
||||
u8 dlgsend_head;
|
||||
u8 dlgsend_tail;
|
||||
struct CSLdlg_struct dlg_recv[MAX_TSL_BUF];
|
||||
struct CSLdlg_struct dlg_send[MAX_TSL_BUF];
|
||||
u8 cmprecv_head;
|
||||
u8 cmprecv_tail;
|
||||
u8 cmpsend_head;
|
||||
u8 cmpsend_tail;
|
||||
struct CSLcmp_struct cmp_recv[MAX_CSL_BUF];
|
||||
struct CSLcmp_struct cmp_send[MAX_CSL_BUF];
|
||||
} tcapint_struct;
|
||||
|
||||
typedef struct tcapbuf_struct // TCAP buffer structure
|
||||
{
|
||||
int grantdid;
|
||||
struct tcapvm_struct tcapvm_data[MAX_DIALOGUEID];
|
||||
struct tcapint_struct tcapint_data[MAX_DIALOGUEID];
|
||||
struct tcapdebug_struct tcap_debug;
|
||||
} tcapbuf_struct;
|
||||
|
||||
struct tcapbuf_struct *tcap_ptr;
|
||||
|
||||
u8 tsl_message_decode(struct SCLC_MSG *sccp_ptr,struct TSL_struct *dst_ptr,u8 *err_code);// tsl decode
|
||||
u8 tsl_message_encode(struct SCLC_MSG *sccp_ptr,struct TSL_struct *tsl_ptr,u8 flag);// tsl encode
|
||||
u8 extract_dp(struct dlgPDU_struct *pdu_ptr,u8 *databuf,int datalen,u8 proto_type); // extract dialogue portion
|
||||
u8 build_dp(u8 *content,struct dlgPDU_struct *dlg_ptr,u8 un_flag,u8 proto_type); // build dialogue portion
|
||||
int extract_component(struct CSLcmp_struct *cmp_ptr,u8 *data_buf,u32 proc,int *section_len); // extract component portion
|
||||
int assemble_component(u8 *string,struct CSLcmp_struct *cha_ptr); // assemble component portion
|
||||
void tcapvm_init(); // init share memory
|
||||
u8 write_ism(CSLcmp_struct *cmp_ptr);
|
||||
void tco_program(void); // transaction coordinator
|
||||
void tsm_program(u32 proc);
|
||||
void ism_program(u32 proc); // invocation state machine
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user