init ems server code

This commit is contained in:
2024-09-27 15:39:34 +08:00
parent 9d4009aaca
commit 9930e4e58f
1551 changed files with 110216 additions and 102864 deletions

View File

@@ -0,0 +1,25 @@
#include "define.h"
#include "../../../debug/src/include/debug.h"
#define LOG_ERR_FLAG 0x01
#define LOG_BICC_FLAG 0x02
#define LOG_MSG_FLAG 0x04
#define LOG_TIME_FLAG 0x08
#define LOG_DMP_FLAG 0x10
#define LOG_ALL_FLAG 0x1f
#define LOG_FILE_FLAG 0x20
/*******************************/
#define MAX_OPR_LEN 16
#define MAX_OBJ_LEN 32
#define MAX_VALUE_LEN 32
#define BICC_PREOID_LEN 12
#define BICC_DEBUG_OID 17
#define BICC_DEBUG_PAGE 10
#define BICC_ASCIN_LEN 128
#define BICC_ASCOUT_LEN 4096
int bicc_debug_init();
void bicc_debug_timer();
void monitor_bicc_msg(u8 *msg,u8 buf_len, BYTE flag, u32 cic, u32 portNo);
void bicc_asciout_proc(const char *fmt, ...);

View File

@@ -0,0 +1,417 @@
#ifndef _BICCIF_H_
#define _BICCIF_H_
#include "q765_5e.h"
#include "q1902_3e.h"
#include "../../../mtp3/src/include/mtp3.h"
#include "../../../snmp/src/include/snmp.h"
//#include "../../../public/src/include/proto_pub.h"
#include "bicc_debug.h"
#include "../../../pal/pal.h"
/*********************************/
/*** BICC Management Structure ***/
/*********************************/
#define BICC_CM_OK 1 //command request success
#define BICC_CM_FAILED -1 //command request failed
/*************************************
******BICC Resource Structure*********
*************************************/
#define BICC_MAX_PORT 8192
#define BICC_CG_CIRCUIT 32
#define BICC_CIRCUIT_CIC 32
/*** BICC Primitive Parameter Structure (different to q1902_3e) ***/
typedef struct AppTransM_struct { //Application Transport Mechanism
u8 pres;
ApmUser_struct apm_info;
} AppTransM_struct;
/*********************************/
/**** BICC Primitive Structure ***/
/*********************************/
typedef struct BiccSetup_Req {
NatConnInd_struct natConn;//F
FwdCallInd_struct fwdCall;//F
CallingPtyCat_struct callingPtyCat;//F
TransMedReq_struct transMedReq;//F
CalledPtyNum_struct calledPtyNum;//V
AppTransM_struct app;
CallingPtyNum_struct callingPtyNum;
CollectCallReq_struct collectCallReq;
ConfTreatInd_struct confTreat;
CorrelationId_struct correlationId;
OrigCalledNum_struct origCalledNum;
RedirgNum_struct redirgNum;
RedirInfo_struct redirInfo;
ScfId_struct scfId;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccSetup_Req, BiccSetup_Ind;
typedef struct BiccSetup_Rsp {
AppTransM_struct app;
BackCallInd_struct backCall;//C: use it if no alert req is sent before
ConfTreatInd_struct confTreat;
ConnNum_struct connNum;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccSetup_Rsp, BiccSetup_Cnf;
typedef struct BiccAlert_Req {
BackCallInd_struct backCall;//F
AppTransM_struct app;
CauseInd_struct cause;
ConfTreatInd_struct confTreat;
OptBackCallInd_struct optBackCall;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccAlert_Req, BiccAlert_Ind;
typedef struct BiccInfo_Req {
SubseqNum_struct subseqNum;//V
} BiccInfo_Req, BiccInfo_Ind;
typedef struct BiccApm_Req {
AppTransM_struct app;
} BiccApm_Req, BiccApm_Ind;
typedef struct BiccCpg_Req {
EventInfo_struct eventInfo;//F
AppTransM_struct app;
BackCallInd_struct backCall;
CallDiverInfo_struct calldiver;
CauseInd_struct cause;
ConfTreatInd_struct confTreat;
ConnNum_struct connNum;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccCpg_Req, BiccCpg_Ind;
typedef struct BiccRel_Req {
CauseInd_struct cause;//V
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccRel_Req, BiccRel_Ind;
typedef struct BiccRel_Rsp {
CauseInd_struct cause;
} BiccRel_Rsp, BiccRel_Cnf;
typedef struct BiccRes_Req {
SusResInd_struct susRes;//F
} BiccRes_Req, BiccRes_Ind;
typedef struct BiccSus_Req {
SusResInd_struct susRes;//F
} BiccSus_Req, BiccSus_Ind;
typedef struct BiccCgb_Req {
CicGrpSpv_struct cicGrpSpv;//F
RangeStatus_struct rangeStatus;//V
} BiccCgb_Req, BiccCgb_Ind;
typedef struct BiccCgb_Rsp {
CicGrpSpv_struct cicGrpSpv;//F
RangeStatus_struct rangeStatus;//V
} BiccCgb_Rsp, BiccCgb_Cnf;
typedef struct BiccCgu_Req {
CicGrpSpv_struct cicGrpSpv;//F
RangeStatus_struct rangeStatus;//V
} BiccCgu_Req, BiccCgu_Ind;
typedef struct BiccCgu_Rsp {
CicGrpSpv_struct cicGrpSpv;//F
RangeStatus_struct rangeStatus;//V
} BiccCgu_Rsp, BiccCgu_Cnf;
typedef struct BiccGrs_Req {
RangeStatus_struct rangeStatus;//V
} BiccGrs_Req, BiccGrs_Ind;
typedef struct BiccGrs_Rsp {
RangeStatus_struct rangeStatus;//V
} BiccGrs_Rsp, BiccGrs_Cnf;
typedef struct BiccSta_Req
{
BiccMsg_struct biccMsg;
}BiccSta_Req;
typedef struct BiccFac_Req
{
FacInd_struct facInd;
}BiccFac_Req, BiccFac_Ind;
typedef struct BiccFac_Rsp
{
FacInd_struct facInd;
}BiccFac_Rsp, BiccFac_Cnf;
typedef union BiccWritePrim_union {
BiccSetup_Req setup_req;
BiccSetup_Rsp setup_rsp;
BiccAlert_Req alert_req;
BiccInfo_Req info_req;
BiccApm_Req apm_req;
BiccCpg_Req cpg_req;
BiccRel_Req rel_req;
BiccRel_Rsp rel_rsp;
BiccRes_Req res_req;
BiccSus_Req sus_req;
BiccCgb_Req cgb_req;//only used in BICC module
BiccCgb_Rsp cgb_rsp;//only used in BICC module
BiccCgu_Req cgu_req;//only used in BICC module
BiccCgu_Rsp cgu_rsp;//only used in BICC module
BiccGrs_Req grs_req;//only used in BICC module
BiccGrs_Rsp grs_rsp;//only used in BICC module
BiccFac_Req fac_req;
BiccFac_Rsp fac_rsp;
} BiccWritePrim_union;
typedef union BiccReadPrim_union {
BiccSetup_Ind setup_ind;
BiccSetup_Cnf setup_cnf;
BiccAlert_Ind alert_ind;
BiccInfo_Ind info_ind;
BiccApm_Ind apm_ind;
BiccCpg_Ind cpg_ind;
BiccRel_Ind rel_ind;
BiccRel_Cnf rel_cnf;
BiccRes_Ind res_ind;
BiccSus_Ind sus_ind;
BiccCgb_Ind cgb_ind;//only used in BICC module
BiccCgb_Cnf cgb_cnf;//only used in BICC module
BiccCgu_Ind cgu_ind;//only used in BICC module
BiccCgu_Cnf cgu_cnf;//only used in BICC module
BiccGrs_Ind grs_ind;//only used in BICC module
BiccGrs_Cnf grs_cnf;//only used in BICC module
BiccFac_Ind fac_ind;
BiccFac_Cnf fac_cnf;
} BiccReadPrim_union;
/********************************************/
/****** BICC Internal Command *************/
/********************************************/
#define BICC_CMD_UNBLO 0x01
#define BICC_CMD_BLO 0x02
#define BICC_CMD_RESET 0x03
#define BICC_CMD_RESET_COMP 0x04
#define BICC_SI_CPCI 0x10
#define BICC_SI_CPCO 0x20
#define BICC_SI_BLS 0x30
#define BICC_SI_BLR 0x40
#define BICC_SI_MGBR 0x50
#define BICC_SI_MGBS 0x60
#define BICC_SI_CRS 0x70
#define BICC_SI_CRR 0x80
#define BICC_SI_CGRS 0x90
#define BICC_SI_CGRR 0xA0
/********************************************/
/****** BICC Event/Primitive Definition *****/
/********************************************/
#define BICC_SETUP_REQ 0x01 //user-defined, first 4-digit:type of primitive second 4-digit:type of event
#define BICC_SETUP_IND 0x41
#define BICC_SETUP_RSP 0x81
#define BICC_SETUP_CNF 0xc1
#define BICC_ALERT_REQ 0x02
#define BICC_ALERT_IND 0x42
#define BICC_INFO_REQ 0x03
#define BICC_INFO_IND 0x43
#define BICC_APM_REQ 0x04
#define BICC_APM_IND 0x44
#define BICC_PROG_REQ 0x05
#define BICC_PROG_IND 0x45
#define BICC_RELEASE_REQ 0x06
#define BICC_RELEASE_IND 0x46
#define BICC_RELEASE_RSP 0x86
#define BICC_RELEASE_CNF 0xc6
#define BICC_RESET_REQ 0x07
#define BICC_RESET_IND 0x47
#define BICC_RESET_CNF 0xc7
#define BICC_RESET_RSP 0x87
#define BICC_GROUP_RESET_REQ 0x17
#define BICC_BLOCK_REQ 0x08
#define BICC_BLOCK_IND 0x48
#define BICC_BLOCK_RSP 0x88
#define BICC_BLOCK_CNF 0xc8
#define BICC_UNBLOCK_REQ 0x09
#define BICC_UNBLOCK_IND 0x49
#define BICC_UNBLOCK_RSP 0x89
#define BICC_UNBLOCK_CNF 0xc9
#define BICC_SUSPEND_REQ 0x0a
#define BICC_SUSPEND_IND 0x4a
#define BICC_RESUME_REQ 0x0b
#define BICC_RESUME_IND 0x4b
#define BICC_REATTEMPT_IND 0x4c
#define BICC_FAILURE_IND 0x4f
#define BICC_FAC_REQ 0x0d
#define BICC_FAC_RSP 0x8d
#define BICC_FAC_IND 0x4d
#define BICC_FAC_CNF 0xcd
#define BICC_STA_IND 0x4e
#define BICC_STA_REQ 0x0e
#define BICC_MAINTENANCE_IND 0x44 //
#define BICC_STOP_REQ 0xee
#define BICC_STOP_CNF 0xef
typedef int f_bicc_setup_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_setup_anm_cnf(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_setup_con_cnf(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_release_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_release_cnf(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_alert_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_info_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_prog_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_suspend_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_resume_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_reset_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_reset_cnf(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_apm_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_reattempt_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_failure_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_block_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_block_cnf(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_unblock_ind(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef int f_bicc_unblock_cnf(Pst *pst, const BiccReadPrim_union *prm_ptr);
typedef struct bicc_eventhandle_struct
{
f_bicc_setup_ind *h_bicc_setup_ind;
f_bicc_setup_anm_cnf *h_bicc_setup_anm_cnf;
f_bicc_setup_con_cnf *h_bicc_setup_con_cnf;
f_bicc_release_ind *h_bicc_release_ind;
f_bicc_release_cnf *h_bicc_release_cnf;
f_bicc_alert_ind *h_bicc_alert_ind;
f_bicc_info_ind *h_bicc_info_ind;
f_bicc_prog_ind *h_bicc_prog_ind;
f_bicc_suspend_ind *h_bicc_suspend_ind;
f_bicc_resume_ind *h_bicc_resume_ind;
f_bicc_block_ind *h_bicc_block_ind;
f_bicc_block_cnf *h_bicc_block_cnf;
f_bicc_unblock_ind *h_bicc_unblock_ind;
f_bicc_unblock_cnf *h_bicc_unblock_cnf;
f_bicc_reset_ind *h_bicc_reset_ind;
f_bicc_reset_cnf *h_bicc_reset_cnf;
f_bicc_apm_ind *h_bicc_apm_ind;
f_bicc_reattempt_ind *h_bicc_reattempt_ind;
f_bicc_failure_ind *h_bicc_failure_ind;
}BICC_EventHandle_struct;
typedef struct _bicc_sap_attrib_
{
BICC_EventHandle_struct event_handle;
}bicc_sap_sttrib_;
typedef enum _BICC_network_id
{
SI_INTERNATIONAL = 0,
SI_INTERNATIONAL_SPARE = 1,
SI_NATIONAL = 2,
SI_NATIONAL_SPARE = 3,
}SI_Netwrok_ID;
typedef struct bicc_cic_state
{
u8 call_state;
u8 sus_state; //suspend state, remote hold? local hold?
u8 blo_state; //block state, remote block? local hold?
}BICC_CIC_state;
typedef struct bicc_fsm_state
{
u8 cpc_state;
u8 mgbs_state;
u8 mgbr_state;
u8 crs_state;
u8 crr_state;
u8 cgrs_state;
u8 cgrr_state;
}BICC_Fsm_state;
typedef struct bicc_port_struct
{
u8 used_flag;
u8 trace_flag;
u32 w_time;
u32 su_proc_id;
u8 sprc_cmd;
u8 primitive_cmd;
u8 internal_cmd;
BICC_Fsm_state fsm_state;
BICC_CIC_state cic_state;
up_message_2 s_mtp_msg; //message send to mtp3
}BICC_Port_struct;
extern up_message_2 r_mtp_msg; //message receive from mtp3
typedef struct BiccDmp_struct {
// If DMP is active, circuit 0-127 is according to proccessor 0, circuit 128-255 is accroding to proccessor 1 //
u8 active;
u8 processor_id;
u32 remote_ip;
} BiccDmp_struct;
/**********************
***upper layer interface***
***********************
*/
extern int BICC_con_req(Pst *pst, BiccSetup_Req *ptr); //iam //Connection establishment request
extern int BICC_con_rsp(Pst *pst, BiccSetup_Rsp *ptr); //anm,con //Connection establishment response
extern int BICC_rel_req(Pst *pst, BiccRel_Req *ptr); //Release request
extern int BICC_rel_rsp(Pst *pst, BiccRel_Rsp *ptr); //Release response
extern int BICC_alert_req(Pst *pst, BiccAlert_Req *ptr); //alert
extern int BICC_info_req(Pst *pst, BiccInfo_Req *ptr); //sam
extern int BICC_prog_req(Pst *pst, BiccCpg_Req *ptr); //progress
extern int BICC_apm_req(Pst *pst, BiccApm_Req *ptr);
extern int BICC_sus_req(Pst *pst, BiccSus_Req *ptr); //Call suspend request
extern int BICC_resm_req(Pst *pst, BiccRes_Req *ptr); //Call resume request
extern int BICC_block_req(Pst *pst, BiccCgb_Req *ptr); //block req
extern int BICC_block_rsp(Pst *pst, BiccCgb_Req *ptr);
extern int BICC_unblock_req(Pst *pst, BiccCgb_Req *ptr); //unblock req
extern int BICC_unblock_rsp(Pst *pst, BiccCgb_Req *ptr);
extern int BICC_reset_req(Pst *pst, BiccGrs_Req *ptr);
extern int BICC_reset_rsp(Pst *pst, BiccGrs_Rsp *ptr); //reset response
extern void BICC_EMPTY_OPTPAR(void *ptr, u8 prim);
extern BOOL bicc_trunk_reachable(u32 cg_id);
/*****************************
*** layer management interface***
******************************
*/
int BICC_active_dmp(u8 plat_id, u32 alter_id );
int BICC_deactive_dmp();
/***********************
*** lower layer interface***
************************
*/
void BICC_msdc_proc(u32 pid, up_message_2 *upmsg_ptr);
int BICC_mdsc_proc();
/******************************
*** system service interface***
*******************************
*/
void BICC_init(int interval_ms, int local_id);
void BICC_timer();
#endif

View File

@@ -0,0 +1,34 @@
#ifndef _DEFINE_H_
#define _DEFINE_H_
//typedef int BOOL;
#ifndef _T_U8
#define _T_U8
typedef unsigned char u8;
#endif
#ifndef _T_U16
#define _T_U16
typedef unsigned short u16;
#endif
#ifndef _T_U32
#define _T_U32
typedef unsigned int u32;
#endif
#define BICC_TOLERANT
#define BICC_REATTEMPT
#define BICC_DEBUG
//Event
#define EN_NONE 0x00
#define EN_ANM 0x01
#define EN_CON 0x02
#define EN_GROUP 0x03
#define M_LOCAL_BLOCK 0x01
#define M_REMOTE_BLOCK 0x02
#endif

View File

@@ -0,0 +1,162 @@
#ifndef _INC_H
#define _INC_H
#include <string.h>
#include <stdio.h>
#include "../../../mtp3/src/include/mtp3.h"
#include "../../../snmp/src/include/snmp.h"
#include "biccif.h"
#define BICC_VERSION {9, 0, 10, 0}
#define BICC_SCREEN_SIZE 32
#define BICC_TIMER_STOP 0
#define BICC_TIMER_EXPIRED 1
#define BICC_T1 15
#define BICC_T5 300
#define BICC_T7 30
#define BICC_T8 10
#define BICC_T9 120
#define BICC_T12 15
#define BICC_T13 300
#define BICC_T14 15
#define BICC_T15 300
#define BICC_T16 15
#define BICC_T17 300
#define BICC_T18 15
#define BICC_T19 300
#define BICC_T20 15
#define BICC_T21 300
#define BICC_T22 15
#define BICC_T23 300
//#define BICC_T24 1
//#define BICC_T25 1
//#define BICC_T26 60
//#define BICC_T27 240
#define BICC_T28 10
#define BICC_T33 12
#define BICC_T34 2
#define BICC_T35 15
//#define BICC_T36 10
//#define BICC_T37 2
#define BICC_T40 10
#define BICC_T41 10
#define BICC_T42 5
#define BICC_T43 5
#define BICC_USER_T10 10//user defined timer,10s
#define BICC_CIC_IDLE 0
#define BICC_INCOMING 1
#define BICC_OUTGOING 2
#define BICC_RESET 3
#define BICC_TYPE_INCOMING 0
#define BICC_TYPE_OUTGOING 1
#define BICC_TYPE_BIDIRECT 2
#define BICC_ORIG_SUSPEND 0 //originating side suspend
#define BICC_TERM_SUSPEND 1 //terminating side suspend
typedef struct BiccTimer_struct
{
int t1;
int t5;
int t7;
int t8;
int t9;
int t12;
int t13;
int t14;
int t15;
int t16;
int t17;
int t18;
int t19;
int t20;
int t21;
int t22;
int t23;
int t28;
int t33;
int t34;
int t35;
int t40;
int t41;
int t42;
int t43;
int user_t10;
}BiccTimer_struct;
typedef struct BiccMng_struct {
u8 state;
u32 lnk_id;
RangeStatus_struct rangeStatus;
} BiccMng_struct;
typedef struct BiccDebug_struct {
u32 flag;
u8 sap_enable[BICC_SCREEN_SIZE];
u8 sap_cg_num[BICC_SCREEN_SIZE];
//u8 cg_enable[BICC_SCREEN_SIZE];
//u8 network_id[BICC_SCREEN_SIZE];
// page 1 //
u8 cic_enable[BICC_SCREEN_SIZE];
u8 cic_type[BICC_SCREEN_SIZE];
u8 l_block[BICC_SCREEN_SIZE];
u8 r_block[BICC_SCREEN_SIZE];
// page 2 //
u8 cic_status[BICC_SCREEN_SIZE];
u8 cpc_state[BICC_SCREEN_SIZE];
u8 mgbs_state[BICC_SCREEN_SIZE];
u8 mgbr_state[BICC_SCREEN_SIZE];
u8 crs_state[BICC_SCREEN_SIZE];
u8 crr_state[BICC_SCREEN_SIZE];
u8 cgrs_state[BICC_SCREEN_SIZE];
u8 cgrr_state[BICC_SCREEN_SIZE];
// page 3 //
u8 sprc_command[BICC_SCREEN_SIZE];
u8 mgbs_command[BICC_SCREEN_SIZE];
u8 mgbr_command[BICC_SCREEN_SIZE];
u8 crs_command[BICC_SCREEN_SIZE];
u8 crr_command[BICC_SCREEN_SIZE];
u8 cgrs_command[BICC_SCREEN_SIZE];
u8 cgrr_command[BICC_SCREEN_SIZE];
u8 prim_command[BICC_SCREEN_SIZE];
// page 4 //
u8 mng_state;
u8 mng_lnk_id;
} BiccDebug_struct;
typedef struct BiccData_struct
{
BiccDebug_struct debug_data;
BiccMng_struct mng_data;
BiccDmp_struct dmp_data;
BiccTimer_struct timer_data[BICC_MAX_PORT];
//BICC_Fsm_state fsm_data[BICC_MAX_PORT];
BICC_Port_struct port_data[BICC_MAX_PORT];
}BiccData_struct;
typedef struct stat_struct {
// u32 en_cic;
u32 lblo_cic;
u32 rblo_cic;
// u32 in_cic;
// u32 out_cic;
// u32 bi_cic;
u32 idle_call;
u32 in_call;
u32 out_call;
u32 lsus_cic;
u32 rsus_cic;
}stat_struct;
#endif

View File

@@ -0,0 +1,60 @@
// Q.1970E; RFC 2327 //
#ifndef _IPBCP_H_
#define _IPBCP_H_
typedef struct SdpOrig_struct {
char username[16];
char session_id[16];
char version[8];
char network_type[8];
char address_type[8];
char address[16];
} SdpOrig_struct;
typedef struct SdpConn_struct {
char network_type[8];
char address_type[8];
char address[16];
} SdpConn_struct;
typedef struct SdpTime_struct {
char start[16]; //0
char stop[16]; //0
} SdpTime_struct;
typedef struct SdpAttrib_struct {
char version[8]; //1
char type[16]; //"Request"/"Accepted"/"Confused"/"Rejected"
} SdpAttrib_struct;
typedef struct SdpMediaAnn_struct {
char media[16];
char port[8];
char transport[16];
char fmt_list[128];
} SdpMediaAnn_struct;
// specify RTP dynamic payload types //
typedef struct SdpMediaAtt_struct {
char payload[8];
char encoding_name[16];
char clock_rate[8];
// char p_time[8];
} SdpMediaAtt_struct;
typedef struct IPBCP_struct {
char proto_ver[8]; //Protocol version (M)
SdpOrig_struct orig; //Orign (M)
char session_name[16]; //Session name (M)
SdpConn_struct conn_data; //Connection data
SdpTime_struct time; //Time
SdpAttrib_struct attrib; //Session attribute
SdpMediaAnn_struct m_ann; //Media announcement (M)
SdpMediaAtt_struct m_att; //Media attributes
char ptime[8];
} IPBCP_struct;
extern int ipbcp_decode(IPBCP_struct *ipbcp_ptr, const char *ptr);
extern int ipbcp_encode(char *ptr, const IPBCP_struct *ipbcp_ptr);
#endif

View File

@@ -0,0 +1,456 @@
#ifndef _q1902_3E_H_
#define _q1902_3E_H_
#include "define.h"
#include "q765_5e.h"
/******************************************/
/******** BICC SIO (Q.1901E C.7.3) ********/
/******************************************/
#define BICC_SI 13
/******************************************/
/* Message Type Codes (Q.1902-3E, page 5) */
/******************************************/
#define M_ACM 0x06//Address complete
#define M_ANM 0x09//Answer
#define M_APM 0x41//Application transport
#define M_BLO 0x13//Blocking
#define M_BLA 0x15//Blocking acknowledgement
#define M_CPG 0x2c//Call progress
#define M_CGB 0x18//Circuit/CIC group blocking
#define M_CGBA 0x1a//Circuit/CIC group blocking acknowledgement
#define M_CQM 0x2a//Circuit/CIC group query (national use)
#define M_CQR 0x2b//Circuit/CIC group query response (national use)
#define M_GRS 0x17//Circuit/CIC group reset
#define M_GRA 0x29//Circuit/CIC group reset acknowledgement
#define M_CGU 0x19//Circuit/CIC group unblocking
#define M_CGUA 0x1b//Circuit/CIC group unblocking acknowledgement
#define M_CRG 0x31//Charge information (national use)
#define M_CFN 0x2f//Confusion
#define M_CON 0x07//Connect
#define M_COT 0x05//Continuity
#define M_FAC 0x33//Facility
#define M_FAA 0x20//Facility accepted
#define M_FRJ 0x21//Facility reject
#define M_FAR 0x1f//Facility request
#define M_FOT 0x08//Forward transfer
#define M_IDR 0x36//Identification request
#define M_IRS 0x37//Identification response
#define M_INF 0x04//Information (national use)
#define M_INR 0x03//Information request (national use)
#define M_IAM 0x01//Initial address
#define M_LOP 0x40//Loop prevention
#define M_NRM 0x32//Network resource management
#define M_PRI 0x42//Pre-release information
#define M_REL 0x0c//Release
#define M_RLC 0x10//Release complete
#define M_RSC 0x12//Reset circuit/CIC
#define M_RES 0x0e//Resume
#define M_SGM 0x38//Segmentation
#define M_SAM 0x02//Subsequent address
#define M_SDM 0x43//Subsequent Directory Number (national use)
#define M_SUS 0x0d//Suspend
#define M_UBL 0x14//Unblocking
#define M_UBA 0x16//Unblocking acknowledgement
#define M_UCIC 0x2e//Unequipped CIC (national use)
#define M_USR 0x2d//User-to-user information
/*********************************************/
/* Parameter Name Codes (Q.1902-3E, page 10) */
/*********************************************/
#define P_APPTRANS 0x78//Application transport
#define P_BACKCALLIND 0x11//Backward call indicators
#define P_CALLEDPTYNUM 0x04//Called party number
#define P_CALLINGPTYNUM 0x0a//Calling party number
#define P_CALLINGPTYCAT 0x09//Calling party's category
#define P_CAUSEIND 0x02//Cause indicators
#define P_CICGRPSPV 0x15//Circuit/CIC group supervision message type
#define P_COLLECTCALLREQ 0x79//Collect call request
#define P_CONFTREATIND 0x72//Conference treatment indicators
#define P_CONNNUM 0x21//Connected number
#define P_CORRELATIONID 0x65//Correlation id
#define P_EVENINFO 0x24//Event information
#define P_FACIND 0x18//Facility indicator
#define P_FWDCALLIND 0x07//Forward call indicators
#define P_NATCONNIND 0x06//Nature of connection indicators
#define P_ORIGCALLEDNUM 0x28//Original called number
#define P_RANGESTATUS 0x16//Range and status
#define P_REDIRGNUM 0x0b//Redirecting number
#define P_REDIRINFO 0x13//Redirection information
#define P_SCFID 0x66//SCF id
#define P_SUBSEQNUM 0x05//Subsequent number
#define P_SUSRESIND 0x22//Suspend/Resume indicators
#define P_TRANSMEDREQ 0x02//Transmission medium requirement
#define P_UTUIND 0x2a//User-to-user indicators
#define P_UTUINFO 0x20//User-to-user information
#define P_CALLDIVERINFO 0x36//Call diversion information
#define P_OPTBACKCALLIND 0x29//Optional backward call indicators
/**********************************************/
/* Parameter Structure (Q.1902-3E, section 6) */
/**********************************************/
#define MAX_BICC_DIGIT 32
#define BICC_STATUS_LEN 32
#define BICC_APP_LEN 200
#define MAX_DIAGNOSTIC_LEN 32
typedef struct AppTrans_struct {
u8 pres;
u8 aci[2]; //Application context identifier
u8 :6;
u8 sni:1; //Send notification indicator
u8 rci:1; //Release call indicator
u16 :1;
u16 si:1; //Sequence indicator
u16 segment:6; //APM segmentation indicator
u16 :1;
u16 slr:7; //Segmentation local reference
// APM-user information (For APM'98-user application only) //
ApmUser_struct apm_info;
} AppTrans_struct;
typedef struct BackCallInd_struct {
u8 pres;
u8 val[2];
} BackCallInd_struct;
typedef struct CalledPtyNum_struct {
u8 pres;
u8 nai;
u8 inn;
u8 npi;
u8 numOfDigit;
u8 digit[MAX_BICC_DIGIT];
} CalledPtyNum_struct;
typedef struct CallingPtyNum_struct {
u8 pres;
u8 nai;
u8 ni;
u8 npi;
u8 apri;
u8 si;
u8 numOfDigit;
u8 digit[MAX_BICC_DIGIT];
} CallingPtyNum_struct;
typedef struct CallingPtyCat_struct {
u8 pres;
u8 val;
} CallingPtyCat_struct;
/* defined in Q.850E */
typedef struct CauseInd_struct {
u8 pres;
u8 codingStd;
u8 location;
u8 causeVal;
//diagnostic
} CauseInd_struct;
typedef struct CicGrpSpv_struct {
u8 pres;
u8 val;
} CicGrpSpv_struct;
typedef struct CollectCallReq_struct {
u8 pres;
u8 val;
} CollectCallReq_struct;
typedef struct ConfTreatInd_struct {
u8 pres;
u8 val;
} ConfTreatInd_struct;
typedef struct ConnNum_struct {
u8 pres;
u8 nai;
u8 npi;
u8 apri;
u8 si;
u8 numOfDigit;
u8 digit[MAX_BICC_DIGIT];
} ConnNum_struct;
typedef struct EventInfo_struct {
u8 pres;
u8 val;
} EventInfo_struct;
typedef struct FacInd_struct {
u8 pres;
u8 val;
} FacInd_struct;
typedef struct FwdCallInd_struct {
u8 pres;
u8 val[2];
} FwdCallInd_struct;
typedef struct GenericNumber_struct {
u8 pres;
u8 nqi; //Number qualifier indicator
u8 nai;
u8 ni;
u8 npi;
u8 apri;
u8 si;
u8 numOfDigit;
u8 digit[MAX_BICC_DIGIT];
} GenericNumber_struct;
typedef struct GenericDigits_struct /* Generic Digits */
{
u8 pres;
u8 typeOfDigits;
u8 encodeScheme;
u8 numOfDigit;
u8* digits;
} GenericDigits_struct;
typedef GenericDigits_struct CorrelationId_struct; //R10
//typedef struct CorrelationId_struct { //R9
// u8 pres;
// u8 digit[4]; //4 bytes
//}CorrelationId_struct;
typedef struct NatConnInd_struct {
u8 pres;
u8 val;
} NatConnInd_struct;
typedef struct OrigCalledNum_struct {
u8 pres;
u8 nai;
u8 npi;
u8 apri;
u8 numOfDigit;
u8 digit[MAX_BICC_DIGIT];
} OrigCalledNum_struct;
typedef struct RangeStatus_struct {
u8 pres;
u8 range;
u8 status[BICC_STATUS_LEN];
} RangeStatus_struct;
typedef struct RedirgNum_struct {
u8 pres;
u8 nai;
u8 npi;
u8 apri;
u8 numOfDigit;
u8 digit[MAX_BICC_DIGIT];
} RedirgNum_struct;
typedef struct RedirInfo_struct{
u8 pres;
u8 redInd;
u8 origRedirReason;
u8 redirCounter;
u8 redirReason;
}RedirInfo_struct;
typedef GenericDigits_struct ScfId_struct;
/*typedef struct ScfId_struct {
u8 pres;
u8 nai;
u8 inn;
u8 npi;
u8 numOfDigit;
u8 digit[MAX_BICC_DIGIT];
}ScfId_struct;
*/
typedef struct SubseqNum_struct {
u8 pres;
u8 numOfDigit;
u8 digit[MAX_BICC_DIGIT];
} SubseqNum_struct;
typedef struct SusResInd_struct {
u8 pres;
u8 val;
} SusResInd_struct;
typedef struct TransMedReq_struct {
u8 pres;
u8 val;
} TransMedReq_struct;
typedef struct UserToUserInd_struct {
u8 pres;
u8 val;
} UserToUserInd_struct;
typedef struct UserToUserInfo_struct {
u8 pres;
u8 len;
u8 val[129];
} UserToUserInfo_struct;
typedef struct CallDiverInfo_struct
{
u8 pres;
u8 notifSubsOption;
u8 redirReason;
}CallDiverInfo_struct;
typedef struct OptBackCallInd_struct
{
u8 pres;
u8 inbandInfoInd;
u8 callDiverOccurInd;
u8 simpSegmInd;
u8 mlppUserInd;
}OptBackCallInd_struct;
/********************************************/
/* Message structure (Q.1902-3E, section 7) */
/********************************************/
typedef struct BiccAcm_struct {
BackCallInd_struct backCall;//F
AppTrans_struct app;
CauseInd_struct cause;
ConfTreatInd_struct confTreat;
OptBackCallInd_struct optBackCall;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccAcm_struct;
typedef struct BiccAnm_struct {
AppTrans_struct app;
BackCallInd_struct backCall;
ConfTreatInd_struct confTreat;
ConnNum_struct connNum;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccAnm_struct;
typedef struct BiccApm_struct {
AppTrans_struct app;
} BiccApm_struct;
typedef struct BiccCpg_struct {
EventInfo_struct eventInfo;//F
AppTrans_struct app;
BackCallInd_struct backCall;
CallDiverInfo_struct calldiver;
CauseInd_struct cause;
ConfTreatInd_struct confTreat;
ConnNum_struct connNum;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccCpg_struct;
typedef struct BiccCgb_struct {
CicGrpSpv_struct cicGrpSpv;//F
RangeStatus_struct rangeStatus;//V
} BiccCgb_struct;
typedef struct BiccCgba_struct {
CicGrpSpv_struct cicGrpSpv;//F
RangeStatus_struct rangeStatus;//V
} BiccCgba_struct;
typedef struct BiccCgu_struct {
CicGrpSpv_struct cicGrpSpv;//F
RangeStatus_struct rangeStatus;//V
} BiccCgu_struct;
typedef struct BiccCgua_struct {
CicGrpSpv_struct cicGrpSpv;//F
RangeStatus_struct rangeStatus;//V
} BiccCgua_struct;
typedef struct BiccGrs_struct {
RangeStatus_struct rangeStatus;//V
} BiccGrs_struct;
typedef struct BiccGra_struct {
RangeStatus_struct rangeStatus;//V
} BiccGra_struct;
typedef struct BiccCon_struct {
BackCallInd_struct backCall;//F
AppTrans_struct app;
ConfTreatInd_struct confTreat;
ConnNum_struct connNum;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccCon_struct;
typedef struct BiccIam_struct {
NatConnInd_struct natConn;//F
FwdCallInd_struct fwdCall;//F
CallingPtyCat_struct callingPtyCat;//F
TransMedReq_struct transMedReq;//F
CalledPtyNum_struct calledPtyNum;//V
AppTrans_struct app;
CallingPtyNum_struct callingPtyNum;
CollectCallReq_struct collectCallReq;
ConfTreatInd_struct confTreat;
CorrelationId_struct correlationId;
OrigCalledNum_struct origCalledNum;
RedirgNum_struct redirgNum;
RedirInfo_struct redirInfo;
ScfId_struct scfId;
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccIam_struct;
typedef struct BiccRel_struct {
CauseInd_struct cause;//V
UserToUserInd_struct utuInd;
UserToUserInfo_struct utuInfo;
} BiccRel_struct;
typedef struct BiccRlc_struct {
CauseInd_struct cause;
} BiccRlc_struct;
typedef struct BiccRes_struct {
SusResInd_struct susRes;//F
//Optional
} BiccRes_struct;
typedef struct BiccSus_struct {
SusResInd_struct susRes;//F
//Optional
} BiccSus_struct;
typedef struct BiccSam_struct {
SubseqNum_struct subseqNum;//V
//Optional
} BiccSam_struct;
typedef struct BiccMsg_struct
{
}BiccMsg_struct;
typedef union BiccMsg_union {
BiccAcm_struct acm;
BiccAnm_struct anm;
BiccApm_struct apm;
BiccCpg_struct cpg;
BiccCgb_struct cgb;
BiccCgba_struct cgba;
BiccCgu_struct cgu;
BiccCgua_struct cgua;
BiccGrs_struct grs;
BiccGra_struct gra;
BiccCon_struct con;
BiccIam_struct iam;
BiccRel_struct rel;
BiccRlc_struct rlc;
BiccRes_struct res;
BiccSus_struct sus;
BiccSam_struct sam;
} BiccMsg_union;
#endif

View File

@@ -0,0 +1,100 @@
#ifndef _q765_5E_H_
#define _q765_5E_H_
#include "define.h"
#define AP_ACTION 0x01
#define AP_BNCID 0x02
#define AP_IWFADDR 0x03
#define AP_CODECLIST 0x04
#define AP_SINGLECODEC 0x05
#define AP_BATCR 0x06
#define AP_BNCCHR 0x07
#define AP_BCINFO 0x08
#define AP_BCTUNNEL 0x09
#define AP_BCUI 0x0a
#define AP_SIGNAL 0x0b
#define AP_BRC 0x0c
#define AP_BRI 0x0d
#define AP_SIGNALTYPE 0x0e
#define AP_DURATION 0x0f
/************************************************/
/***** Encapsulated application information *****/
/************************************************/
typedef struct ActionInd_struct {
u8 pres;
u8 comp_info;
u8 val;
} ActionInd_struct;
typedef struct BncId_struct {
u8 pres;
u8 comp_info;
u8 len;
u8 val[4];
} BncId_struct;
typedef struct IwfAddr_struct {
u8 pres;
//...
} IwfAddr_struct;
typedef struct BncChr_struct {
u8 pres;
u8 comp_info;
u8 val;
} BncChr_struct;
typedef struct BCTP_struct {
// BTCP (Q.1990) //
u8 :1;
u8 bvei:1; //BCTP Version Error Indicator
u8 :1;
u8 btcp_version:5; //BCTP Version Indicator
u8 :1;
u8 tpei:1; //Tunnelled Protocol Error Indicator
u8 tunnel_protocol:6; //Tunnelled Protocol Indicator
// IPBCP (Q.1970) //
u8 ipbcp_len;
u8 ipbcp_content[200];
} BCTP_struct;
typedef struct BcInfo_struct {
u8 pres;
u8 comp_info;
BCTP_struct bctp;
} BcInfo_struct;
typedef struct BcTunnel_struct {
u8 pres;
u8 comp_info;
u8 val;
} BcTunnel_struct;
typedef struct SignalType_struct {
u8 pres;
u8 comp_info;
u8 val;
} SignalType_struct;
typedef struct Duration_struct {
u8 pres;
u8 comp_info;
u16 val;
} Duration_struct;
typedef struct ApmUser_struct {
u8 :6;
u8 sni:1; //Send notification indicator
u8 rci:1; //Release call indicator
ActionInd_struct action;
BncId_struct bnc_id;
BncChr_struct bnc_chr;
BcInfo_struct bc_info;
BcTunnel_struct bc_tunnel;
SignalType_struct signal_type;
Duration_struct duration;
} ApmUser_struct;
#endif

View File

@@ -0,0 +1,14 @@
#ifndef _VAR_EXT_H_
#define _VAR_EXT_H_
#include "define.h"
#include "biccif.h"
#include "inc.h"
extern u8 Bicc_Version[4];
extern BiccData_struct Bicc_Data;
extern BiccTimer_struct Timer_Data;
extern BiccReadPrim_union readPrim_union[BICC_MAX_PORT];
extern BiccWritePrim_union writePrim_union[BICC_MAX_PORT];
#endif