init ems server code
This commit is contained in:
99
plat/bicc/Makefile
Normal file
99
plat/bicc/Makefile
Normal file
@@ -0,0 +1,99 @@
|
||||
|
||||
##----------------------------------------------------------##
|
||||
## ##
|
||||
## Universal Makefile for module template : V1.6.3 ##
|
||||
## ##
|
||||
## Created : Wei Liu 07/04/11 ##
|
||||
## Revision: [Last]Wei Liu 07/07/07 ##
|
||||
## ##
|
||||
##----------------------------------------------------------##
|
||||
|
||||
##---------------------------------------------------------------------##
|
||||
##--------------------------------------
|
||||
##
|
||||
## Project correlation(Customer define)
|
||||
##
|
||||
##--------------------------------------
|
||||
|
||||
## MODULE= [Module Name]
|
||||
## TYPE = app/plat => Module Type
|
||||
|
||||
## DBUG_FLAGS_ADD = [Module Define Gcc Flags for Debug ]
|
||||
## DBUG_FLAGS_ADD = [Module Define Gcc Flags for Release]
|
||||
|
||||
## BUILD = lib/exef => Output file format
|
||||
## CFG = debug/release => Build Configuration
|
||||
|
||||
## SRC_PATH = [Source file path]
|
||||
## INC_PATH = [Include file path]
|
||||
## APP_PATH = [App Module path]
|
||||
## PLT_PATH = [Plat Module path]
|
||||
|
||||
## PLT_LIB = [Needed plat lib for Link] => just for test or wxc2main
|
||||
## APP_LIB = [Needed app lib for Link] => just for test or wxc2main
|
||||
## LIB_ADD = [Needed Extend lib for Link] => just for test or wxc2main
|
||||
|
||||
## PLT_LIB e.g. = haepub fsm mng proto kernel aif mgc mgcp sip rtp \
|
||||
## 8ecp bicc smpp xapp tcap mtp3 m2ua \
|
||||
## snmp iptrans debug sccp public
|
||||
##
|
||||
## APP_LIB e.g. = msc vlr ssf hlr ae pps mnp smsc vms aas
|
||||
## LIB_ADD e.g. = -liba3a8 -lm
|
||||
|
||||
## OBJ_ADD = [Extend third party object files needed]
|
||||
## TEST_OBJ_PATH = [module object files Path for test ] => just for test
|
||||
##---------------------------------------------------------------------##
|
||||
|
||||
MODULE = bicc
|
||||
TYPE = plat
|
||||
|
||||
DBUG_FLAGS_ADD =
|
||||
RELS_FLAGS_ADD =
|
||||
|
||||
##Default commonly as below
|
||||
|
||||
BUILD = lib
|
||||
CFG = debug
|
||||
|
||||
|
||||
PLT_LIB =
|
||||
|
||||
APP_LIB =
|
||||
LIB_ADD =
|
||||
|
||||
SRC_PATH = ./src
|
||||
INC_PATH = ./src/include
|
||||
PLT_PATH = ../../plat
|
||||
APP_PATH = ../../mss
|
||||
|
||||
OBJ_ADD =
|
||||
TEST_OBJ_PATH =
|
||||
|
||||
PREPROC_CMD =
|
||||
POSTPROC_CMD =
|
||||
|
||||
##---------------------------------------------------------------------##
|
||||
##--------------------------------------
|
||||
##
|
||||
## Make configuration(Customer define)
|
||||
##
|
||||
##--------------------------------------
|
||||
|
||||
## CCFLAG_SWITCH = on/off => gcc flag show on/off
|
||||
## COVER_NEED = yes/no => PTF cover report needed
|
||||
## COVER_REPORT_PATH = [path ] => PTF cover report path
|
||||
|
||||
CCFLAG_SWITCH = off
|
||||
COVER_NEED = no
|
||||
COVER_REPORT_PATH = ./output
|
||||
MAKE_INCLUDE = $(HOME)/ems.git/include
|
||||
|
||||
##---------------------------------------------------------------------##
|
||||
|
||||
|
||||
##--------------------------------------
|
||||
##
|
||||
## include makefile.rules (Do not change)
|
||||
##
|
||||
##--------------------------------------
|
||||
include $(MAKE_INCLUDE)/Makefile.rules
|
||||
206
plat/bicc/src.old/bicc_apm.c
Normal file
206
plat/bicc/src.old/bicc_apm.c
Normal file
@@ -0,0 +1,206 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "./include/q765_5e.h"
|
||||
|
||||
void apm_decode_action(ActionInd_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = flw_ptr[1];
|
||||
}
|
||||
|
||||
u32 apm_encode_action(u8 *flw_ptr, const ActionInd_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val;
|
||||
return 2;
|
||||
}
|
||||
|
||||
void apm_decode_bncid(BncId_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->len = length - 1;
|
||||
memcpy(ptr->val, flw_ptr+1, ptr->len);
|
||||
}
|
||||
|
||||
u32 apm_encode_bncid(u8 *flw_ptr, const BncId_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
memcpy(flw_ptr+1, ptr->val, ptr->len);
|
||||
return ptr->len + 1;
|
||||
}
|
||||
|
||||
void apm_decode_bncchr(BncChr_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = flw_ptr[1];
|
||||
}
|
||||
|
||||
u32 apm_encode_bncchr(u8 *flw_ptr, const BncChr_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val;
|
||||
return 2;
|
||||
}
|
||||
|
||||
void apm_decode_bcinfo(BcInfo_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->bctp.bvei = (flw_ptr[1] >> 6) & 0x01;
|
||||
ptr->bctp.btcp_version = flw_ptr[1] & 0x1f;
|
||||
ptr->bctp.tpei = (flw_ptr[2] >> 6) & 0x01;
|
||||
ptr->bctp.tunnel_protocol = flw_ptr[2] & 0x3f;
|
||||
ptr->bctp.ipbcp_len = length - 3;
|
||||
memcpy(ptr->bctp.ipbcp_content, flw_ptr+3, ptr->bctp.ipbcp_len);
|
||||
}
|
||||
|
||||
u32 apm_encode_bcinfo(u8 *flw_ptr, const BcInfo_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = (ptr->bctp.bvei << 6) + (1 << 5) + ptr->bctp.btcp_version;
|
||||
flw_ptr[2] = (ptr->bctp.tpei << 6) + ptr->bctp.tunnel_protocol;
|
||||
memcpy(flw_ptr+3, ptr->bctp.ipbcp_content, ptr->bctp.ipbcp_len);
|
||||
return ptr->bctp.ipbcp_len + 3;
|
||||
}
|
||||
|
||||
void apm_decode_bctunnel(BcTunnel_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = flw_ptr[1];
|
||||
}
|
||||
|
||||
u32 apm_encode_bctunnel(u8 *flw_ptr, const BcTunnel_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val;
|
||||
return 2;
|
||||
}
|
||||
|
||||
void apm_decode_signaltype(SignalType_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = flw_ptr[1];
|
||||
}
|
||||
|
||||
u32 apm_encode_signaltype(u8 *flw_ptr, const SignalType_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val;
|
||||
return 2;
|
||||
}
|
||||
|
||||
void apm_decode_duration(Duration_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = (flw_ptr[1] << 8) + flw_ptr[2];
|
||||
}
|
||||
|
||||
u32 apm_encode_duration(u8 *flw_ptr, const Duration_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val >> 8;
|
||||
flw_ptr[2] = ptr->val & 0xff;
|
||||
return 3;
|
||||
}
|
||||
|
||||
void apm_decode(ApmUser_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
const u8 *old_ptr = flw_ptr;
|
||||
|
||||
while(flw_ptr+flw_ptr[1]+2-old_ptr <= length)
|
||||
{
|
||||
if(*flw_ptr == 0)
|
||||
break;
|
||||
switch(*flw_ptr)
|
||||
{
|
||||
case AP_ACTION:
|
||||
apm_decode_action(&ptr->action, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_BNCID:
|
||||
apm_decode_bncid(&ptr->bnc_id, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_BNCCHR:
|
||||
apm_decode_bncchr(&ptr->bnc_chr, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_BCINFO:
|
||||
apm_decode_bcinfo(&ptr->bc_info, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_BCTUNNEL:
|
||||
apm_decode_bctunnel(&ptr->bc_tunnel, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_SIGNALTYPE:
|
||||
apm_decode_signaltype(&ptr->signal_type, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_DURATION:
|
||||
apm_decode_duration(&ptr->duration, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
default:
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 apm_encode(u8 *flw_ptr, const ApmUser_struct *ptr)
|
||||
{
|
||||
u8 *old_ptr = flw_ptr;
|
||||
|
||||
if(ptr->action.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_ACTION;
|
||||
flw_ptr[1] = apm_encode_action(flw_ptr+2, &ptr->action);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->bnc_id.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_BNCID;
|
||||
flw_ptr[1] = apm_encode_bncid(flw_ptr+2, &ptr->bnc_id);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->bnc_chr.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_BNCCHR;
|
||||
flw_ptr[1] = apm_encode_bncchr(flw_ptr+2, &ptr->bnc_chr);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->bc_info.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_BCINFO;
|
||||
flw_ptr[1] = apm_encode_bcinfo(flw_ptr+2, &ptr->bc_info);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->bc_tunnel.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_BCTUNNEL;
|
||||
flw_ptr[1] = apm_encode_bctunnel(flw_ptr+2, &ptr->bc_tunnel);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->signal_type.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_SIGNALTYPE;
|
||||
flw_ptr[1] = apm_encode_signaltype(flw_ptr+2, &ptr->signal_type);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->duration.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_DURATION;
|
||||
flw_ptr[1] = apm_encode_duration(flw_ptr+2, &ptr->duration);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
return flw_ptr - old_ptr;
|
||||
}
|
||||
|
||||
|
||||
882
plat/bicc/src.old/bicc_debug.c
Normal file
882
plat/bicc/src.old/bicc_debug.c
Normal file
@@ -0,0 +1,882 @@
|
||||
#include "./include/var_ext.h"
|
||||
|
||||
//static u32 bicc_object_id[BICC_PREOID_LEN] = {1,3,6,1,4,1,1373,1,3,2,2,6};
|
||||
//static u16 bicc_sub_page[BICC_DEBUG_PAGE] = {0};
|
||||
//static u8 bicc_ascii_in[BICC_ASCIN_LEN] = {0};
|
||||
//static u8 bicc_ascii_out[BICC_ASCOUT_LEN] = {0};
|
||||
|
||||
#define BICC_DEBUG_ID 17
|
||||
#define BICC_VER_DEBUG "R91V0_01"
|
||||
|
||||
#define MONITOR_NONE 0x0000
|
||||
#define MONITOR_ERROR 0x0010
|
||||
#define MONITOR_ALL 0xffff
|
||||
|
||||
#define TRACE_FLAG_ON 1
|
||||
#define TRACE_FLAG_OFF 0
|
||||
|
||||
u8 AsciInBuf[4096];
|
||||
u8 AsciOutBuf[4096];
|
||||
u8 AsciTempBuf[4096];
|
||||
WORD MonitorFg;
|
||||
u8 info[1024];
|
||||
|
||||
static u8 log_help[] = {
|
||||
"BICC debug Help:\n\r\
|
||||
\n\r\
|
||||
1.help\n\r\
|
||||
2.log all/none\n\r\
|
||||
3.log error on/off\n\r\
|
||||
4.list cg[-cgNo] \n\r\
|
||||
5.list circuit[-circuitNo]\n\r\
|
||||
6.list port[-portNo]\n\r\
|
||||
7.list dmp\n\r\
|
||||
8.trace on-portNo\n\r\
|
||||
9.trace off[-portNo]\n\r\n\r\
|
||||
"
|
||||
};
|
||||
|
||||
static WORD disp_page[10];
|
||||
static u8 *disp_ptr = (u8 *) disp_page;
|
||||
|
||||
static DWORD debug_status_id[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,1
|
||||
};
|
||||
|
||||
static BYTE debug_status = 1;
|
||||
|
||||
static DWORD debug_name_id[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,2
|
||||
};
|
||||
|
||||
static DWORD debug_ascin_id[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,3
|
||||
};
|
||||
|
||||
static DWORD debug_ascout_id[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,4
|
||||
};
|
||||
|
||||
static DWORD debug_page_title[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,1,1
|
||||
};
|
||||
|
||||
static DWORD debug_page_line[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,1,2,1
|
||||
};
|
||||
|
||||
const static u8 BASE_ID_LEN = 15;
|
||||
const static u8 PAGE_POINT = 14;
|
||||
const static u8 LINE_POINT = 15;
|
||||
|
||||
static u8 title1_p[] =
|
||||
{
|
||||
" BICC Page 01 SAP Info\n\r\
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
|
||||
Subpage\n\r\
|
||||
Enable\n\r\
|
||||
CG num\n\r"
|
||||
};
|
||||
|
||||
static u8 title2_p[] =
|
||||
{
|
||||
" BICC Page 02 CG Info\n\r\
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
|
||||
Subpage\n\r\
|
||||
Enable\n\r\
|
||||
SAP id\n\r\
|
||||
NI\n\r\
|
||||
DPC\n\r"
|
||||
};
|
||||
|
||||
static u8 title3_p[] =
|
||||
{
|
||||
" BICC Page 03 CIrcuit Info\n\r\
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
|
||||
Subpage\n\r\
|
||||
CG id\n\r\
|
||||
CIC range\n\r\
|
||||
HEAD CIC\n\r"
|
||||
};
|
||||
|
||||
static u8 title4_p[] =
|
||||
{
|
||||
" BICC Page 04 Port Info\n\r\
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
|
||||
Subpage\n\r\
|
||||
Enable\n\r\
|
||||
FSM State\n\r\
|
||||
CIC State\n\r"
|
||||
};
|
||||
|
||||
static u8 debug_disp_line(u8 page, u8 line)
|
||||
{
|
||||
u8 disp_length;
|
||||
disp_length = 0;
|
||||
disp_ptr = (u8 *) disp_page;
|
||||
switch (page)
|
||||
{
|
||||
/*
|
||||
case 1: // Page 1: sap Info
|
||||
switch(line)
|
||||
{
|
||||
case 0:
|
||||
disp_ptr = (BYTE *) &disp_page[page];
|
||||
disp_length = 2;
|
||||
break;
|
||||
case 1:
|
||||
disp_ptr = (BYTE *) &Bicc_Data.debug_data.sap_enable;
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 2:
|
||||
disp_ptr = (BYTE *) &Bicc_Data.debug_data.sap_cg_num;
|
||||
disp_length = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2: // Page 2: cg Info
|
||||
//disp_page[page] = (disp_page[page]+1)%BICC_MAX_CG;
|
||||
switch(line)
|
||||
{
|
||||
case 0:
|
||||
disp_ptr = (BYTE *) &disp_page[page]; //Subpage
|
||||
disp_length = 2;
|
||||
break;
|
||||
case 1: //enable
|
||||
disp_ptr = (BYTE *) &(BiccResource.cg_pond[disp_page[page]].used_flag);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 2: //sap_id
|
||||
disp_ptr = (BYTE *) &(BiccResource.cg_pond[disp_page[page]].sap_id);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 3: //network_id
|
||||
disp_ptr = (BYTE *) &(BiccResource.cg_pond[disp_page[page]].attrib.network_id);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 4: //dpc
|
||||
disp_ptr = (BYTE *) &(BiccResource.cg_pond[disp_page[page]].attrib.dpc);
|
||||
disp_length = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Page 3: circuit Info
|
||||
//disp_page[page] = (disp_page[page]+1)%BICC_MAX_CIRCUIT;
|
||||
switch(line)
|
||||
{
|
||||
case 0:
|
||||
disp_ptr = (BYTE *) &disp_page[page]; //Subpage
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 1: //cg_id
|
||||
disp_ptr = (BYTE *) &(BiccResource.circuit_pond[disp_page[page]].cg_id);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 2: //cic_range
|
||||
disp_ptr = (BYTE *) &(BiccResource.circuit_pond[disp_page[page]].attrib.cic_range);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 3: //head_cic
|
||||
disp_ptr = (BYTE *) &(BiccResource.circuit_pond[disp_page[page]].attrib.head_cic);
|
||||
disp_length = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: // Page 4: port Info
|
||||
//disp_page[page] = (disp_page[page]+32)%BICC_MAX_PORT;
|
||||
switch(line)
|
||||
{
|
||||
case 0:
|
||||
disp_ptr = (BYTE *) &disp_page[page]; //Subpage
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 1: //enable
|
||||
disp_ptr = (BYTE *) &(BiccResource.port_pond[disp_page[page]].used_flag);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 2: //fsm_state
|
||||
disp_ptr = (BYTE *) &(BiccResource.port_pond[disp_page[page]].fsm_state);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 3: //cic_state
|
||||
disp_ptr = (BYTE *) &(BiccResource.port_pond[disp_page[page]].cic_state);
|
||||
disp_length = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
disp_length = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return disp_length;
|
||||
}
|
||||
|
||||
static void debug_disp_page(u8 page)
|
||||
{
|
||||
u8 disp_line;
|
||||
u8 disp_length;
|
||||
|
||||
debug_page_line[PAGE_POINT] = page + 5;
|
||||
|
||||
for (disp_line = 0; disp_line < 22; disp_line++)
|
||||
{
|
||||
disp_length = debug_disp_line(page, disp_line);
|
||||
debug_page_line[LINE_POINT] = disp_line + 2;
|
||||
debug_page_line[LINE_POINT + 1] = 2; // Data Pointer
|
||||
debug_set_response(BASE_ID_LEN + 2, debug_page_line, disp_ptr, disp_length);
|
||||
}
|
||||
}
|
||||
|
||||
int bicc_debug_init(void)
|
||||
{
|
||||
BYTE page;
|
||||
BYTE data[10];
|
||||
BYTE *ptr;
|
||||
|
||||
strcpy(AsciInBuf, "\0");
|
||||
strcpy(AsciOutBuf, "\0");
|
||||
MonitorFg = MONITOR_NONE;
|
||||
bzero(disp_page, 20);
|
||||
|
||||
ptr = data;
|
||||
|
||||
debug_set_response(BASE_ID_LEN, debug_status_id, &debug_status, 1);
|
||||
debug_set_response(BASE_ID_LEN, debug_name_id, BICC_VER_DEBUG, 10);
|
||||
debug_set_response(BASE_ID_LEN, debug_ascin_id, AsciInBuf, 4096);
|
||||
debug_set_response(BASE_ID_LEN, debug_ascout_id, AsciOutBuf, 4096);
|
||||
|
||||
for (page = 1; page < 5; page++)
|
||||
{
|
||||
switch (page)
|
||||
{
|
||||
case 1: //page 1
|
||||
ptr = title1_p;
|
||||
break;
|
||||
case 2: //page 2
|
||||
ptr = title2_p;
|
||||
break;
|
||||
case 3: //page 3
|
||||
ptr = title3_p;
|
||||
break;
|
||||
case 4: //page 4
|
||||
ptr = title4_p;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
debug_page_title[PAGE_POINT] = 5 + page;
|
||||
debug_set_response(BASE_ID_LEN + 1, debug_page_title, ptr, strlen(ptr));
|
||||
debug_disp_page(page);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void bicc_asciout_proc(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[1024];
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsprintf(buf, fmt, ap);
|
||||
if((strlen(AsciOutBuf) + strlen(buf)) < 4096)
|
||||
strcat(AsciOutBuf, buf);
|
||||
else
|
||||
strcpy(AsciOutBuf, buf);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
||||
void bicc_debug_refresh(void)
|
||||
{
|
||||
// int i;
|
||||
#if 0
|
||||
for(i=0;i<16;i++)
|
||||
{
|
||||
Bicc_Data.debug_data.sap_enable[i] = BiccResource.sap_pond[i].used_flag;
|
||||
Bicc_Data.debug_data.sap_cg_num[i] = BiccResource.sap_pond[i].cg_num;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void list_sap(WORD sapNo)
|
||||
{
|
||||
//u8 sapinfo[1024];
|
||||
if(sapNo >= BICC_MAX_SAP)
|
||||
return;
|
||||
|
||||
sprintf(info,"\
|
||||
Enable:%d\n\r\
|
||||
cg num:%d\n\r",
|
||||
BiccResource.sap_pond[sapNo].used_flag,BiccResource.sap_pond[sapNo].cg_num);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
void list_all_sap()
|
||||
{
|
||||
int i;
|
||||
sprintf(info, "Index CG(s)\n\r");
|
||||
bicc_asciout_proc(info);
|
||||
for(i=0; i<BICC_MAX_SAP; i++)
|
||||
{
|
||||
if(BiccResource.sap_pond[i].used_flag == 1)
|
||||
{
|
||||
sprintf(info, " %d %d\n\r", i, BiccResource.sap_pond[i].cg_num);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
void list_cg(WORD cgNo)
|
||||
{
|
||||
const pal_cg_struct *pcg;
|
||||
if(cgNo >= PAL_MAX_CG)
|
||||
return;
|
||||
pcg = pal_cg_ptr(cgNo);
|
||||
if(pcg == NULL)
|
||||
return;
|
||||
sprintf(info, "\
|
||||
Enable:%d\n\r\
|
||||
sap id:%d\n\r\
|
||||
circuit num:%d\n\r\
|
||||
variant_type:%d\n\r\
|
||||
priority:%d\n\r\
|
||||
network id:%d\n\r\
|
||||
opc:%ld\n\r\
|
||||
dpc:%ld\n\r\
|
||||
tg_id:%ld\n\r",
|
||||
pcg->enable,pcg->sap_id,pcg->circuit_num,pcg->attrib.variant,pcg->attrib.priority,pcg->attrib.network_id,pcg->attrib.opc,pcg->attrib.dpc,pcg->attrib.tg_id);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
void list_all_cg()
|
||||
{
|
||||
int i = 0;
|
||||
const pal_cg_struct *pcg;
|
||||
sprintf(info, "Index SAP Circuit(s) NetInd DPC OPC TG\n\r");
|
||||
bicc_asciout_proc(info);
|
||||
for(i=0; i<PAL_MAX_CG; i++)
|
||||
{
|
||||
pcg = pal_cg_ptr(i);
|
||||
if(pcg == NULL)
|
||||
continue;
|
||||
if(pcg->enable==0)
|
||||
continue;
|
||||
|
||||
if(pcg->attrib.protocol != PROTO_BICC)
|
||||
continue;
|
||||
sprintf(info, " %d %d %d %d %ld %ld %ld\n\r", i, pcg->sap_id, pcg->circuit_num, pcg->attrib.network_id, pcg->attrib.dpc, pcg->attrib.opc, pcg->attrib.tg_id);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void list_circuit(WORD circuitNo)
|
||||
{
|
||||
const pal_circuit_struct *pcircuit;
|
||||
if(circuitNo >= PAL_MAX_CIRCUIT)
|
||||
return;
|
||||
pcircuit = pal_circuit_ptr(circuitNo);
|
||||
if(pcircuit == NULL)
|
||||
return ;
|
||||
|
||||
sprintf(info,"\
|
||||
Enable:%d\n\r\
|
||||
cg id:%d\n\r\
|
||||
head cic:%ld\n\r\
|
||||
cic range:%d\n\r\
|
||||
plat id:%d\n\r",
|
||||
pcircuit->enable,pcircuit->cg_id,pcircuit->attrib.head_cic,pcircuit->attrib.cic_range,pcircuit->attrib.plat_id);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
|
||||
void list_all_circuit()
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
const pal_circuit_struct *pcircuit;
|
||||
const pal_cg_struct *pcg;
|
||||
// for(i = 0; i < BICC_MAX_SAP; i ++)
|
||||
//{
|
||||
sprintf(info, "Index CG PLAT CIC(s)\n\r");
|
||||
bicc_asciout_proc(info);
|
||||
for(i=0; i<PAL_MAX_CG; i++)
|
||||
{
|
||||
pcg = pal_cg_ptr(i);
|
||||
if(pcg == NULL)
|
||||
continue;
|
||||
if(pcg->enable == 0)
|
||||
continue;
|
||||
if(pcg->attrib.protocol != PROTO_BICC)
|
||||
continue;
|
||||
for(j = 0; j<PAL_MAX_CIRCUIT; j++)
|
||||
{
|
||||
pcircuit = pal_circuit_ptr(j);
|
||||
if(pcircuit == NULL)
|
||||
continue;
|
||||
if(pcircuit->enable == 0 || pcircuit->cg_id != pcg->id)
|
||||
continue;
|
||||
sprintf(info, " %d %d %d %d (%ld~~%ld)\n\r", i, pcircuit->cg_id, pcircuit->attrib.plat_id, pcircuit->attrib.cic_range, pcircuit->attrib.head_cic, pcircuit->attrib.head_cic+pcircuit->attrib.cic_range);
|
||||
bicc_asciout_proc(info);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void list_port(WORD portNo)
|
||||
{
|
||||
if(portNo>=BICC_MAX_PORT)
|
||||
return;
|
||||
sprintf(info,"\
|
||||
upper port:%ld\n\r\
|
||||
sprc_cmd:%x\n\r\
|
||||
primitive_cmd:%x\n\r\
|
||||
internal_cmd:%x\n\r\
|
||||
cic state{\n\r\
|
||||
call state:%d\n\r\
|
||||
suspend state:%d\n\r\
|
||||
block state:%d\n\r\
|
||||
}\n\r\
|
||||
fsm state{\n\r\
|
||||
cpc_state:%d\n\r\
|
||||
mgbs_state:%d\n\r\
|
||||
mgbr_state:%d\n\r\
|
||||
crs_state:%d\n\r\
|
||||
crr_state:%d\n\r\
|
||||
cgrs_state:%d\n\r\
|
||||
cgrr_state:%d\n\r\
|
||||
}\n\r",
|
||||
Bicc_Data.port_data[portNo].su_proc_id,Bicc_Data.port_data[portNo].sprc_cmd,
|
||||
Bicc_Data.port_data[portNo].primitive_cmd,Bicc_Data.port_data[portNo].internal_cmd,
|
||||
Bicc_Data.port_data[portNo].cic_state.call_state,Bicc_Data.port_data[portNo].cic_state.sus_state,
|
||||
Bicc_Data.port_data[portNo].cic_state.blo_state,Bicc_Data.port_data[portNo].fsm_state.cpc_state,
|
||||
Bicc_Data.port_data[portNo].fsm_state.mgbs_state,Bicc_Data.port_data[portNo].fsm_state.mgbr_state,
|
||||
Bicc_Data.port_data[portNo].fsm_state.crs_state,Bicc_Data.port_data[portNo].fsm_state.crr_state,
|
||||
Bicc_Data.port_data[portNo].fsm_state.cgrs_state,Bicc_Data.port_data[portNo].fsm_state.cgrr_state);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
void list_busy_port()
|
||||
{
|
||||
int i,j=0;
|
||||
sprintf(info, "Index PortNo CallState\n\r");
|
||||
bicc_asciout_proc(info);
|
||||
for(i=0;i<BICC_MAX_PORT;i++)
|
||||
{
|
||||
if(Bicc_Data.port_data[i].used_flag == 1)
|
||||
{
|
||||
sprintf(info,"%d %d %s\n\r",j++,i,(Bicc_Data.port_data[i].cic_state.call_state==1)?"INCOMING":"OUTGOING");
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void list_dmp()
|
||||
{
|
||||
sprintf(info, "\
|
||||
dmp active: %d\n\r\
|
||||
local plat id: %d\n\r\
|
||||
remote ip: %lx\n\r", Bicc_Data.dmp_data.active,Bicc_Data.dmp_data.processor_id,Bicc_Data.dmp_data.remote_ip);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
void bicc_debug_timer(void)
|
||||
{
|
||||
BYTE in_page, err_fg = 0;
|
||||
BYTE *ascii_in_ptr = NULL;
|
||||
BYTE *str_start = NULL, * tmpStr;
|
||||
WORD str_len, portNo=0;
|
||||
WORD num, cgNo, circuitNo;
|
||||
|
||||
if ((str_len = strlen(AsciInBuf)) > 0)
|
||||
{
|
||||
in_page = AsciInBuf[0] - 1;
|
||||
ascii_in_ptr = AsciInBuf + 1;
|
||||
|
||||
if (in_page > 4)
|
||||
err_fg = 1;
|
||||
else if (strcmp(ascii_in_ptr,"log error on") == 0)
|
||||
{
|
||||
MonitorFg = MonitorFg | MONITOR_ERROR;
|
||||
}
|
||||
else if (strcmp(ascii_in_ptr,"log error off") == 0)
|
||||
{
|
||||
MonitorFg = MonitorFg & (~MONITOR_ERROR);
|
||||
}
|
||||
else if (strcmp(ascii_in_ptr,"log all") == 0)
|
||||
{
|
||||
MonitorFg = MONITOR_ALL;
|
||||
|
||||
}
|
||||
else if (strcmp(ascii_in_ptr,"log none") == 0)
|
||||
{
|
||||
MonitorFg = MONITOR_NONE;
|
||||
|
||||
}
|
||||
else if (strcmp(ascii_in_ptr,"help") == 0)
|
||||
{
|
||||
bicc_asciout_proc(log_help);
|
||||
}
|
||||
else if (isdigit(ascii_in_ptr[0]))
|
||||
{
|
||||
num = strtoul(ascii_in_ptr, NULL, 10);
|
||||
disp_page[in_page] = num;
|
||||
debug_disp_page(in_page);
|
||||
}
|
||||
else if ((str_start = strstr(ascii_in_ptr, ">")) != NULL)
|
||||
{
|
||||
num = strtoul(str_start + 1, NULL, 10);
|
||||
disp_page[in_page] += num;
|
||||
debug_disp_page(in_page);
|
||||
}
|
||||
else if ((str_start = strstr(ascii_in_ptr, "<"))!= NULL)
|
||||
{
|
||||
num = strtoul(str_start + 1, NULL, 10);
|
||||
disp_page[in_page] -= num;
|
||||
debug_disp_page(in_page);
|
||||
}
|
||||
#if 0
|
||||
else if ((strstr (ascii_in_ptr, "list sap")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
sapNo = strtoul (tmpStr + 1, NULL, 10);
|
||||
list_sap(sapNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_all_sap();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if ((strstr (ascii_in_ptr,"list cg")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
// if((tmpStr = strsep(&&ascii_in_ptr, " \t")) != NULL)
|
||||
{
|
||||
cgNo = strtoul (tmpStr+1, NULL, 10);
|
||||
// strsep(, " \t");
|
||||
list_cg(cgNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_all_cg();
|
||||
}
|
||||
}
|
||||
else if ((strstr (ascii_in_ptr, "list circuit")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
circuitNo = strtoul (tmpStr + 1, NULL, 10);
|
||||
list_circuit(circuitNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_all_circuit();
|
||||
}
|
||||
}
|
||||
else if ((strstr (ascii_in_ptr, "list port")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
portNo = strtoul (tmpStr + 1, NULL, 10);
|
||||
list_port(portNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_busy_port();
|
||||
}
|
||||
|
||||
}
|
||||
else if((strstr (ascii_in_ptr, "list dmp")) != NULL)
|
||||
{
|
||||
list_dmp();
|
||||
}
|
||||
else if((strstr(ascii_in_ptr, "trace on")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr(ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
portNo = strtoul(tmpStr + 1, NULL, 10);
|
||||
//trace_port(portNo);
|
||||
Bicc_Data.port_data[portNo].trace_flag = 1;
|
||||
}
|
||||
else
|
||||
{}
|
||||
}
|
||||
else if ((strstr (ascii_in_ptr, "trace off")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
portNo = strtoul (tmpStr + 1, NULL, 10);
|
||||
Bicc_Data.port_data[portNo].trace_flag = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<BICC_MAX_PORT; i++)
|
||||
Bicc_Data.port_data[i].trace_flag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
err_fg = 1;
|
||||
|
||||
if (err_fg == 0)
|
||||
bicc_asciout_proc("Command OK!\n\r");
|
||||
else
|
||||
bicc_asciout_proc("Command Error!\n\r");
|
||||
|
||||
strcpy(AsciInBuf, "\0");
|
||||
}
|
||||
bicc_debug_refresh();
|
||||
}
|
||||
|
||||
|
||||
void bicc_log_err(const char *fmt, ...)
|
||||
{
|
||||
if ((MonitorFg & MONITOR_ERROR) == MONITOR_ERROR)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[1024];
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsprintf(buf, fmt, ap);
|
||||
if((strlen(AsciOutBuf) + strlen(buf)) < 4096-15)
|
||||
{
|
||||
strcat(AsciOutBuf, "\33[31m");
|
||||
strcat(AsciOutBuf, buf);
|
||||
strcat(AsciOutBuf, "\33[37m");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(AsciOutBuf, "\33[31m");
|
||||
strcat(AsciOutBuf, buf);
|
||||
strcat(AsciOutBuf, "\33[37m");
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int bicc_log_procedure(WORD mgNo, WORD portIndex, WORD chnlIndex, char *msg)
|
||||
{
|
||||
u8 monFlag = 0;
|
||||
|
||||
monFlag = 1;
|
||||
|
||||
if (monFlag == 1)
|
||||
{
|
||||
if (strlen(msg) >= 4096)
|
||||
sprintf(AsciTempBuf, "log msg is too long!\n\r");
|
||||
else
|
||||
sprintf(AsciTempBuf, "%s\n\r", msg);
|
||||
bicc_asciout_proc(AsciTempBuf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void display_bicc_msgtype(u8 msgtype, u32 cic)
|
||||
{
|
||||
switch(msgtype)
|
||||
{
|
||||
case M_ACM:
|
||||
bicc_asciout_proc("ACM:Address complete");
|
||||
break;
|
||||
case M_ANM:
|
||||
bicc_asciout_proc("ANM:Answer");
|
||||
break;
|
||||
case M_BLO:
|
||||
bicc_asciout_proc("BLO:Blocking");
|
||||
break;
|
||||
case M_BLA:
|
||||
bicc_asciout_proc("BLA:Blocking acknowledgement");
|
||||
break;
|
||||
case M_CPG:
|
||||
bicc_asciout_proc("CPG:Call progress");
|
||||
break;
|
||||
case M_CGB:
|
||||
bicc_asciout_proc("CGB:Circuit/CIC group blocking");
|
||||
break;
|
||||
case M_CGBA:
|
||||
bicc_asciout_proc("CGBA:Circuit/CIC group blocking acknowledgement");
|
||||
break;
|
||||
case M_CQM:
|
||||
bicc_asciout_proc("CQM:Circuit/CIC group query (national use)");
|
||||
break;
|
||||
case M_CQR:
|
||||
bicc_asciout_proc("CQR:Circuit/CIC group query response (national use)");
|
||||
break;
|
||||
case M_GRS:
|
||||
bicc_asciout_proc("GRS:Circuit/CIC group reset");
|
||||
break;
|
||||
case M_GRA:
|
||||
bicc_asciout_proc("GRA:Circuit/CIC group reset acknowledgement");
|
||||
break;
|
||||
case M_CGU:
|
||||
bicc_asciout_proc("CGU:Circuit/CIC group unblocking");
|
||||
break;
|
||||
case M_CGUA:
|
||||
bicc_asciout_proc("CGUA:Circuit/CIC group unblocking acknowledgement");
|
||||
break;
|
||||
case M_CRG:
|
||||
bicc_asciout_proc("CRG:Charge information (national use)");
|
||||
break;
|
||||
case M_CFN:
|
||||
bicc_asciout_proc("CFN:Confusion");
|
||||
break;
|
||||
case M_CON:
|
||||
bicc_asciout_proc("CON:Connect");
|
||||
break;
|
||||
case M_COT:
|
||||
bicc_asciout_proc("COT:Continuity");
|
||||
break;
|
||||
case M_FAC:
|
||||
bicc_asciout_proc("FAC:Facility ");
|
||||
break;
|
||||
case M_FAA:
|
||||
bicc_asciout_proc("FAA:Facility accepted");
|
||||
break;
|
||||
case M_FRJ:
|
||||
bicc_asciout_proc("FRJ:Facility reject");
|
||||
break;
|
||||
case M_FAR:
|
||||
bicc_asciout_proc("FAR:Facility request");
|
||||
break;
|
||||
case M_FOT:
|
||||
bicc_asciout_proc("FOT:Forward transfer");
|
||||
break;
|
||||
case M_IDR:
|
||||
bicc_asciout_proc("IDR:Identification request");
|
||||
break;
|
||||
case M_IRS:
|
||||
bicc_asciout_proc("IRS:Identification response");
|
||||
break;
|
||||
case M_INF:
|
||||
bicc_asciout_proc("INF:Information (national use)");
|
||||
break;
|
||||
case M_INR:
|
||||
bicc_asciout_proc("INR:Information request (national use)");
|
||||
break;
|
||||
case M_IAM:
|
||||
bicc_asciout_proc("IAM:Initial address");
|
||||
break;
|
||||
case M_NRM:
|
||||
bicc_asciout_proc("NRM:Network resource management");
|
||||
break;
|
||||
case M_REL:
|
||||
bicc_asciout_proc("REL:Release");
|
||||
break;
|
||||
case M_RLC:
|
||||
bicc_asciout_proc("RLC:Release complete");
|
||||
break;
|
||||
case M_RSC:
|
||||
bicc_asciout_proc("RSC:Reset circuit/CIC");
|
||||
break;
|
||||
case M_RES:
|
||||
bicc_asciout_proc("RES:Resume");
|
||||
break;
|
||||
case M_SGM:
|
||||
bicc_asciout_proc("SGM:Segmentation");
|
||||
break;
|
||||
case M_SAM:
|
||||
bicc_asciout_proc("SAM:Subsequent address");
|
||||
break;
|
||||
case M_SUS:
|
||||
bicc_asciout_proc("SUS:Suspend");
|
||||
break;
|
||||
case M_UBL:
|
||||
bicc_asciout_proc("UBL:Unblocking");
|
||||
break;
|
||||
case M_UBA:
|
||||
bicc_asciout_proc("UBA:Unblocking acknowledgement");
|
||||
break;
|
||||
case M_UCIC:
|
||||
bicc_asciout_proc("UCIC:Unequipped CIC (national use)");
|
||||
break;
|
||||
case M_APM:
|
||||
bicc_asciout_proc("APM:Application Transport");
|
||||
break;
|
||||
case M_USR:
|
||||
bicc_asciout_proc("USR:User-to-user information");
|
||||
break;
|
||||
default:
|
||||
bicc_asciout_proc("Unknown message");
|
||||
|
||||
}
|
||||
|
||||
bicc_asciout_proc("(message type=0x%x cic=%d)\r\n",msgtype,cic);
|
||||
}
|
||||
|
||||
|
||||
void monitor_bicc_msg(BYTE *msg,BYTE buf_len, BYTE flag, u32 cic, u32 portNo)
|
||||
{
|
||||
BYTE i,temp_buf[1024];
|
||||
if(MonitorFg == MONITOR_ALL)
|
||||
{
|
||||
if(flag == 0)
|
||||
bicc_asciout_proc("\33[33mReceive:\33[0m");
|
||||
else if(flag == 1)
|
||||
bicc_asciout_proc("\33[32mSend:\33[0m");
|
||||
else if(flag == 2)
|
||||
bicc_asciout_proc("\33[34mRedirect:\33[0m");
|
||||
display_bicc_msgtype(msg[0], cic);
|
||||
|
||||
if(flag != 2)
|
||||
{
|
||||
for (i = 0; i < buf_len; i ++)
|
||||
{
|
||||
sprintf(&temp_buf[3*i]," %02x", msg[i]);
|
||||
}
|
||||
sprintf(&temp_buf[3*i],"\n\r");
|
||||
bicc_asciout_proc(temp_buf);
|
||||
}
|
||||
}
|
||||
if(MonitorFg == MONITOR_NONE)
|
||||
{}
|
||||
if(Bicc_Data.port_data[portNo].trace_flag == 1)
|
||||
{
|
||||
if(flag == 0)
|
||||
bicc_asciout_proc("\33[33mReceive:\33[0m");
|
||||
else if(flag == 1)
|
||||
bicc_asciout_proc("\33[32mSend:\33[0m");
|
||||
else if(flag == 2)
|
||||
bicc_asciout_proc("\33[34mRedirect:\33[0m");
|
||||
display_bicc_msgtype(msg[0], cic);
|
||||
|
||||
if(flag != 2)
|
||||
{
|
||||
for (i = 0; i < buf_len; i ++)
|
||||
{
|
||||
sprintf(&temp_buf[3*i]," %02x", msg[i]);
|
||||
}
|
||||
sprintf(&temp_buf[3*i],"\n\r");
|
||||
bicc_asciout_proc(temp_buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2093
plat/bicc/src.old/bicc_fsm.c
Normal file
2093
plat/bicc/src.old/bicc_fsm.c
Normal file
File diff suppressed because it is too large
Load Diff
2093
plat/bicc/src.old/bicc_fsm.c.old
Normal file
2093
plat/bicc/src.old/bicc_fsm.c.old
Normal file
File diff suppressed because it is too large
Load Diff
362
plat/bicc/src.old/bicc_ipbcp.c
Normal file
362
plat/bicc/src.old/bicc_ipbcp.c
Normal file
@@ -0,0 +1,362 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "./include/ipbcp.h"
|
||||
|
||||
int sdp_decode_orig(SdpOrig_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->username, token);
|
||||
strcat(dst_ptr->username, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->session_id, token);
|
||||
strcat(dst_ptr->session_id, "\0");
|
||||
break;
|
||||
case 3:
|
||||
sprintf(dst_ptr->version, token);
|
||||
strcat(dst_ptr->version, "\0");
|
||||
break;
|
||||
case 4:
|
||||
sprintf(dst_ptr->network_type, token);
|
||||
strcat(dst_ptr->network_type, "\0");
|
||||
break;
|
||||
case 5:
|
||||
sprintf(dst_ptr->address_type, token);
|
||||
strcat(dst_ptr->address_type, "\0");
|
||||
break;
|
||||
case 6:
|
||||
sprintf(dst_ptr->address, token);
|
||||
strcat(dst_ptr->address, "\0");
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 6)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_conn(SdpConn_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->network_type, token);
|
||||
strcat(dst_ptr->network_type, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->address_type, token);
|
||||
strcat(dst_ptr->address_type, "\0");
|
||||
break;
|
||||
case 3:
|
||||
sprintf(dst_ptr->address, token);
|
||||
strcat(dst_ptr->address, "\0");
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 3)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_time(SdpTime_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->start, token);
|
||||
strcat(dst_ptr->start, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->stop, token);
|
||||
strcat(dst_ptr->stop, "\0");
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 2)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_attrib(SdpAttrib_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
if(strstr(src_ptr, "ipbcp:") != src_ptr)
|
||||
return 0;
|
||||
src_ptr += strlen("ipbcp:");
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->version, token);
|
||||
strcat(dst_ptr->version, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->type, token);
|
||||
strcat(dst_ptr->type, "\0");
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 2)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_mediaAnn(SdpMediaAnn_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->media, token);
|
||||
strcat(dst_ptr->media, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->port, token);
|
||||
strcat(dst_ptr->port, "\0");
|
||||
break;
|
||||
case 3:
|
||||
sprintf(dst_ptr->transport, token);
|
||||
strcat(dst_ptr->transport, "\0");
|
||||
strcpy(dst_ptr->fmt_list, src_ptr);
|
||||
strcat(dst_ptr->fmt_list, "\0");
|
||||
break;
|
||||
case 4:
|
||||
// sprintf(dst_ptr->fmt_list, token);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(field_id < 4)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_mediaAtt(SdpMediaAtt_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
if(strstr(src_ptr, "rtpmap:") != src_ptr)
|
||||
return 0;
|
||||
src_ptr += strlen("rtpmap:");
|
||||
while((token = strsep(&src_ptr, " /")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->payload, token);
|
||||
strcat(dst_ptr->payload, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->encoding_name, token);
|
||||
strcat(dst_ptr->encoding_name, "\0");
|
||||
break;
|
||||
case 3:
|
||||
sprintf(dst_ptr->clock_rate, token);
|
||||
strcat(dst_ptr->clock_rate, "\0");
|
||||
break;
|
||||
case 4:
|
||||
// sprintf(dst_ptr->p_time, token);
|
||||
field_id --;//to avoid 4 fields
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 3)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int sdp_decode_ptime(char* p_time, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
if((token = strstr(src_ptr, "ptime:")) == NULL)
|
||||
return 0;
|
||||
token = strtok(token, ":");
|
||||
token = strtok(NULL, ":");
|
||||
// p_time = token;
|
||||
// if(strlen(token)<8)
|
||||
if(token)
|
||||
{
|
||||
sprintf(p_time, token);
|
||||
strcat(p_time, "\0");
|
||||
}
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
int ipbcp_decode(IPBCP_struct *ipbcp_ptr, const char *ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
char temp_ipbcp[200];
|
||||
char *temp_ptr;
|
||||
|
||||
strncpy(temp_ipbcp, ptr, 200);
|
||||
temp_ptr = temp_ipbcp;
|
||||
memset(ipbcp_ptr, 0, sizeof(IPBCP_struct));
|
||||
while((token = strsep(&temp_ptr, "\r\n")) != NULL)
|
||||
{
|
||||
if(strlen(token) == 0)
|
||||
continue;
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
if((token[0] != 'v') || (token[1] != '='))
|
||||
return 0;
|
||||
sprintf(ipbcp_ptr->proto_ver, token+2);
|
||||
strcat(ipbcp_ptr->proto_ver, "\0");
|
||||
break;
|
||||
case 2:
|
||||
if((token[0] != 'o') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_orig(&ipbcp_ptr->orig, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 3:
|
||||
if((token[0] != 's') || (token[1] != '='))
|
||||
return 0;
|
||||
sprintf(ipbcp_ptr->session_name, token+2);
|
||||
|
||||
strcat(ipbcp_ptr->session_name, "\0");
|
||||
break;
|
||||
case 4:
|
||||
if((token[0] != 'c') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_conn(&ipbcp_ptr->conn_data, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 5:
|
||||
if((token[0] != 't') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_time(&ipbcp_ptr->time, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 6:
|
||||
if((token[0] != 'a') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_attrib(&ipbcp_ptr->attrib, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 7:
|
||||
if((token[0] != 'm') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_mediaAnn(&ipbcp_ptr->m_ann, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 8:
|
||||
if((token[0] != 'a') || (token[1] != '='))
|
||||
return 0;
|
||||
if(sdp_decode_mediaAtt(&ipbcp_ptr->m_att, token+2))
|
||||
// return 0;
|
||||
;
|
||||
else if(!sdp_decode_ptime(ipbcp_ptr->ptime, token+2))
|
||||
return 0;
|
||||
|
||||
break;
|
||||
case 9:
|
||||
if((token[0] != 'a') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_ptime(ipbcp_ptr->ptime, token+2))
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ipbcp_encode(char *ptr, const IPBCP_struct *ipbcp_ptr)
|
||||
{
|
||||
char tmp_buf[128];
|
||||
|
||||
sprintf(ptr, "v=%s\r\n", ipbcp_ptr->proto_ver);
|
||||
|
||||
sprintf(tmp_buf, "o=%s %s %s %s %s %s\r\n",
|
||||
ipbcp_ptr->orig.username,
|
||||
ipbcp_ptr->orig.session_id,
|
||||
ipbcp_ptr->orig.version,
|
||||
ipbcp_ptr->orig.network_type,
|
||||
ipbcp_ptr->orig.address_type,
|
||||
ipbcp_ptr->orig.address);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "s=%s\r\n", ipbcp_ptr->session_name);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "c=%s %s %s\r\n",
|
||||
ipbcp_ptr->conn_data.network_type,
|
||||
ipbcp_ptr->conn_data.address_type,
|
||||
ipbcp_ptr->conn_data.address);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "t=%s %s\r\n", ipbcp_ptr->time.start, ipbcp_ptr->time.stop);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "a=ipbcp:%s %s\r\n", ipbcp_ptr->attrib.version, ipbcp_ptr->attrib.type);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "m=%s %s %s %s\r\n",
|
||||
ipbcp_ptr->m_ann.media,
|
||||
ipbcp_ptr->m_ann.port,
|
||||
ipbcp_ptr->m_ann.transport,
|
||||
ipbcp_ptr->m_ann.fmt_list);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
if(strlen(ipbcp_ptr->m_att.payload) != 0)
|
||||
{
|
||||
sprintf(tmp_buf, "a=rtpmap:%s %s/%s\r\n",
|
||||
ipbcp_ptr->m_att.payload,
|
||||
ipbcp_ptr->m_att.encoding_name,
|
||||
ipbcp_ptr->m_att.clock_rate);
|
||||
strcat(ptr, tmp_buf);
|
||||
}
|
||||
//ipbcp_ptr->ptime[7]='\0';
|
||||
if((ipbcp_ptr->ptime[0] != '\0') && (strlen(ipbcp_ptr->ptime)<8))
|
||||
{
|
||||
sprintf(tmp_buf, "a=ptime:%s\r\n", ipbcp_ptr->ptime);
|
||||
strcat(ptr, tmp_buf);
|
||||
}
|
||||
return strlen(ptr);
|
||||
}
|
||||
1285
plat/bicc/src.old/bicc_msg.c
Normal file
1285
plat/bicc/src.old/bicc_msg.c
Normal file
File diff suppressed because it is too large
Load Diff
244
plat/bicc/src.old/bicc_prm.c
Normal file
244
plat/bicc/src.old/bicc_prm.c
Normal file
@@ -0,0 +1,244 @@
|
||||
#include "./include/inc.h"
|
||||
#include "./include/var_ext.h"
|
||||
#include "./include/q1902_3e.h"
|
||||
/**********************************************/
|
||||
/******* BICC Message&Primitive Mapping *******/
|
||||
/**********************************************/
|
||||
void app_msg2prm(AppTransM_struct *dst_ptr, AppTrans_struct *src_ptr)
|
||||
{
|
||||
dst_ptr->pres = src_ptr->pres;
|
||||
if(src_ptr->pres == 1)
|
||||
{
|
||||
memcpy(&dst_ptr->apm_info, &src_ptr->apm_info, sizeof(ApmUser_struct));
|
||||
dst_ptr->apm_info.sni = src_ptr->sni;
|
||||
dst_ptr->apm_info.rci = src_ptr->rci;
|
||||
}
|
||||
}
|
||||
|
||||
void app_prm2msg(AppTrans_struct *dst_ptr, AppTransM_struct *src_ptr)
|
||||
{
|
||||
dst_ptr->pres = src_ptr->pres;
|
||||
if(src_ptr->pres == 1)
|
||||
{
|
||||
dst_ptr->aci[0] = 0x00;
|
||||
dst_ptr->aci[1] = 0x00;
|
||||
dst_ptr->sni = src_ptr->apm_info.sni;
|
||||
dst_ptr->rci = src_ptr->apm_info.rci;
|
||||
dst_ptr->si = 0; //subsequent segment to first segment
|
||||
dst_ptr->segment = 0; //final segment
|
||||
dst_ptr->slr = 0;
|
||||
memcpy(&dst_ptr->apm_info, &src_ptr->apm_info, sizeof(ApmUser_struct));
|
||||
}
|
||||
}
|
||||
|
||||
void bicc_msg2prm(BiccReadPrim_union *prm_ptr, BiccMsg_union *msg_ptr, u8 msg_type)
|
||||
{
|
||||
memset(prm_ptr, 0, sizeof(BiccReadPrim_union));
|
||||
switch(msg_type)
|
||||
{
|
||||
case M_ACM:
|
||||
memcpy(&prm_ptr->alert_ind.backCall, &msg_ptr->acm.backCall, sizeof(BackCallInd_struct));
|
||||
app_msg2prm(&prm_ptr->alert_ind.app, &msg_ptr->acm.app);
|
||||
memcpy(&prm_ptr->alert_ind.cause, &msg_ptr->acm.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&prm_ptr->alert_ind.confTreat, &msg_ptr->acm.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->alert_ind.optBackCall, &msg_ptr->acm.optBackCall, sizeof(OptBackCallInd_struct));
|
||||
memcpy(&prm_ptr->alert_ind.utuInd, &msg_ptr->acm.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->alert_ind.utuInfo, &msg_ptr->acm.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_ANM:
|
||||
app_msg2prm(&prm_ptr->setup_cnf.app, &msg_ptr->anm.app);
|
||||
memcpy(&prm_ptr->setup_cnf.backCall, &msg_ptr->anm.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.confTreat, &msg_ptr->anm.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.connNum, &msg_ptr->anm.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.utuInd, &msg_ptr->anm.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.utuInfo, &msg_ptr->anm.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_APM:
|
||||
app_msg2prm(&prm_ptr->apm_ind.app, &msg_ptr->apm.app);
|
||||
break;
|
||||
case M_CPG:
|
||||
memcpy(&prm_ptr->cpg_ind.eventInfo, &msg_ptr->cpg.eventInfo, sizeof(EventInfo_struct));
|
||||
app_msg2prm(&prm_ptr->cpg_ind.app, &msg_ptr->cpg.app);
|
||||
memcpy(&prm_ptr->cpg_ind.backCall, &msg_ptr->cpg.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.calldiver,&msg_ptr->cpg.calldiver, sizeof(BiccCpg_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.cause, &msg_ptr->cpg.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.confTreat, &msg_ptr->cpg.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.connNum, &msg_ptr->cpg.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.utuInd, &msg_ptr->cpg.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.utuInfo, &msg_ptr->cpg.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_CGB:
|
||||
memcpy(&prm_ptr->cgb_ind.cicGrpSpv, &msg_ptr->cgb.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&prm_ptr->cgb_ind.rangeStatus, &msg_ptr->cgb.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGBA:
|
||||
memcpy(&prm_ptr->cgb_cnf.cicGrpSpv, &msg_ptr->cgb.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&prm_ptr->cgb_cnf.rangeStatus, &msg_ptr->cgb.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGU:
|
||||
memcpy(&prm_ptr->cgu_ind.cicGrpSpv, &msg_ptr->cgu.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&prm_ptr->cgu_ind.rangeStatus, &msg_ptr->cgu.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGUA:
|
||||
memcpy(&prm_ptr->cgu_cnf.cicGrpSpv, &msg_ptr->cgu.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&prm_ptr->cgu_cnf.rangeStatus, &msg_ptr->cgu.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_GRS:
|
||||
memcpy(&prm_ptr->grs_ind.rangeStatus, &msg_ptr->grs.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_GRA:
|
||||
memcpy(&prm_ptr->grs_cnf.rangeStatus, &msg_ptr->grs.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CON:
|
||||
app_msg2prm(&prm_ptr->setup_cnf.app, &msg_ptr->con.app);
|
||||
memcpy(&prm_ptr->setup_cnf.backCall, &msg_ptr->con.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.confTreat, &msg_ptr->con.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.connNum, &msg_ptr->con.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.utuInd, &msg_ptr->con.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.utuInfo, &msg_ptr->con.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_IAM:
|
||||
memcpy(&prm_ptr->setup_ind.natConn, &msg_ptr->iam.natConn, sizeof(NatConnInd_struct));
|
||||
memcpy(&prm_ptr->setup_ind.fwdCall, &msg_ptr->iam.fwdCall, sizeof(FwdCallInd_struct));
|
||||
memcpy(&prm_ptr->setup_ind.callingPtyCat, &msg_ptr->iam.callingPtyCat, sizeof(CallingPtyCat_struct));
|
||||
memcpy(&prm_ptr->setup_ind.transMedReq, &msg_ptr->iam.transMedReq, sizeof(TransMedReq_struct));
|
||||
memcpy(&prm_ptr->setup_ind.calledPtyNum, &msg_ptr->iam.calledPtyNum, sizeof(CalledPtyNum_struct));
|
||||
app_msg2prm(&prm_ptr->setup_ind.app, &msg_ptr->apm.app);
|
||||
memcpy(&prm_ptr->setup_ind.callingPtyNum, &msg_ptr->iam.callingPtyNum, sizeof(CallingPtyNum_struct));
|
||||
memcpy(&prm_ptr->setup_ind.collectCallReq, &msg_ptr->iam.collectCallReq, sizeof(CollectCallReq_struct));
|
||||
memcpy(&prm_ptr->setup_ind.confTreat, &msg_ptr->iam.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->setup_ind.correlationId, &msg_ptr->iam.correlationId, sizeof(CorrelationId_struct));
|
||||
memcpy(&prm_ptr->setup_ind.origCalledNum, &msg_ptr->iam.origCalledNum, sizeof(OrigCalledNum_struct));
|
||||
memcpy(&prm_ptr->setup_ind.redirgNum, &msg_ptr->iam.redirgNum, sizeof(RedirgNum_struct));
|
||||
memcpy(&prm_ptr->setup_ind.redirInfo, &msg_ptr->iam.redirInfo, sizeof(RedirInfo_struct));
|
||||
memcpy(&prm_ptr->setup_ind.scfId, &msg_ptr->iam.scfId, sizeof(ScfId_struct));
|
||||
memcpy(&prm_ptr->setup_ind.utuInd, &msg_ptr->iam.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->setup_ind.utuInfo, &msg_ptr->iam.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_REL:
|
||||
memcpy(&prm_ptr->rel_ind.cause, &msg_ptr->rel.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&prm_ptr->rel_ind.utuInd, &msg_ptr->rel.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->rel_ind.utuInfo, &msg_ptr->rel.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_RLC:
|
||||
memcpy(&prm_ptr->rel_cnf.cause, &msg_ptr->rlc.cause, sizeof(CauseInd_struct));
|
||||
break;
|
||||
case M_RES:
|
||||
memcpy(&prm_ptr->res_ind.susRes, &msg_ptr->res.susRes, sizeof(SusResInd_struct));
|
||||
break;
|
||||
case M_SUS:
|
||||
memcpy(&prm_ptr->sus_ind.susRes, &msg_ptr->sus.susRes, sizeof(SusResInd_struct));
|
||||
break;
|
||||
case M_SAM:
|
||||
memcpy(&prm_ptr->info_ind.subseqNum, &msg_ptr->sam.subseqNum, sizeof(SubseqNum_struct));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void bicc_prm2msg(BiccMsg_union *msg_ptr, BiccWritePrim_union *prm_ptr, u8 msg_type)
|
||||
{
|
||||
memset(msg_ptr, 0, sizeof(BiccMsg_union));
|
||||
switch(msg_type)
|
||||
{
|
||||
case M_ACM:
|
||||
memcpy(&msg_ptr->acm.backCall, &prm_ptr->alert_req.backCall, sizeof(BackCallInd_struct));
|
||||
app_prm2msg(&msg_ptr->acm.app, &prm_ptr->alert_req.app);
|
||||
memcpy(&msg_ptr->acm.cause, &prm_ptr->alert_req.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&msg_ptr->acm.confTreat, &prm_ptr->alert_req.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->acm.optBackCall, &prm_ptr->alert_req.optBackCall, sizeof(OptBackCallInd_struct));
|
||||
memcpy(&msg_ptr->acm.utuInd, &prm_ptr->alert_req.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->acm.utuInfo, &prm_ptr->alert_req.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_ANM:
|
||||
app_prm2msg(&msg_ptr->anm.app, &prm_ptr->setup_rsp.app);
|
||||
memcpy(&msg_ptr->anm.backCall, &prm_ptr->setup_rsp.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&msg_ptr->anm.confTreat, &prm_ptr->setup_rsp.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->anm.connNum, &prm_ptr->setup_rsp.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&msg_ptr->anm.utuInd, &prm_ptr->setup_rsp.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->anm.utuInfo, &prm_ptr->setup_rsp.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_APM:
|
||||
app_prm2msg(&msg_ptr->apm.app, &prm_ptr->apm_req.app);
|
||||
break;
|
||||
case M_CPG:
|
||||
memcpy(&msg_ptr->cpg.eventInfo, &prm_ptr->cpg_req.eventInfo, sizeof(EventInfo_struct));
|
||||
app_prm2msg(&msg_ptr->cpg.app, &prm_ptr->cpg_req.app);
|
||||
memcpy(&msg_ptr->cpg.backCall, &prm_ptr->cpg_req.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&msg_ptr->cpg.calldiver, &prm_ptr->cpg_req.calldiver, sizeof(BiccCpg_struct));
|
||||
memcpy(&msg_ptr->cpg.cause, &prm_ptr->cpg_req.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&msg_ptr->cpg.confTreat, &prm_ptr->cpg_req.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->cpg.connNum, &prm_ptr->cpg_req.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&msg_ptr->cpg.utuInd, &prm_ptr->cpg_req.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->cpg.utuInfo, &prm_ptr->cpg_req.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_CGB:
|
||||
memcpy(&msg_ptr->cgb.cicGrpSpv, &prm_ptr->cgb_req.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&msg_ptr->cgb.rangeStatus, &prm_ptr->cgb_req.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGBA:
|
||||
memcpy(&msg_ptr->cgb.cicGrpSpv, &prm_ptr->cgb_rsp.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&msg_ptr->cgb.rangeStatus, &prm_ptr->cgb_rsp.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGU:
|
||||
memcpy(&msg_ptr->cgu.cicGrpSpv, &prm_ptr->cgu_req.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&msg_ptr->cgu.rangeStatus, &prm_ptr->cgu_req.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGUA:
|
||||
memcpy(&msg_ptr->cgu.cicGrpSpv, &prm_ptr->cgu_rsp.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&msg_ptr->cgu.rangeStatus, &prm_ptr->cgu_rsp.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_GRS:
|
||||
memcpy(&msg_ptr->grs.rangeStatus, &prm_ptr->grs_req.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_GRA:
|
||||
memcpy(&msg_ptr->grs.rangeStatus, &prm_ptr->grs_rsp.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CON:
|
||||
app_prm2msg(&msg_ptr->con.app, &prm_ptr->setup_rsp.app);
|
||||
memcpy(&msg_ptr->con.backCall, &prm_ptr->setup_rsp.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&msg_ptr->con.confTreat, &prm_ptr->setup_rsp.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->con.connNum, &prm_ptr->setup_rsp.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&msg_ptr->con.utuInd, &prm_ptr->setup_rsp.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->con.utuInfo, &prm_ptr->setup_rsp.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_IAM:
|
||||
memcpy(&msg_ptr->iam.natConn, &prm_ptr->setup_req.natConn, sizeof(NatConnInd_struct));
|
||||
memcpy(&msg_ptr->iam.fwdCall, &prm_ptr->setup_req.fwdCall, sizeof(FwdCallInd_struct));
|
||||
memcpy(&msg_ptr->iam.callingPtyCat, &prm_ptr->setup_req.callingPtyCat, sizeof(CallingPtyCat_struct));
|
||||
memcpy(&msg_ptr->iam.transMedReq, &prm_ptr->setup_req.transMedReq, sizeof(TransMedReq_struct));
|
||||
memcpy(&msg_ptr->iam.calledPtyNum, &prm_ptr->setup_req.calledPtyNum, sizeof(CalledPtyNum_struct));
|
||||
app_prm2msg(&msg_ptr->iam.app, &prm_ptr->setup_req.app);
|
||||
memcpy(&msg_ptr->iam.callingPtyNum, &prm_ptr->setup_req.callingPtyNum, sizeof(CallingPtyNum_struct));
|
||||
memcpy(&msg_ptr->iam.collectCallReq, &prm_ptr->setup_req.collectCallReq, sizeof(CollectCallReq_struct));
|
||||
memcpy(&msg_ptr->iam.confTreat, &prm_ptr->setup_req.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->iam.correlationId, &prm_ptr->setup_req.correlationId, sizeof(CorrelationId_struct));
|
||||
memcpy(&msg_ptr->iam.origCalledNum, &prm_ptr->setup_req.origCalledNum, sizeof(OrigCalledNum_struct));
|
||||
memcpy(&msg_ptr->iam.redirgNum, &prm_ptr->setup_req.redirgNum, sizeof(RedirgNum_struct));
|
||||
memcpy(&msg_ptr->iam.redirInfo, &prm_ptr->setup_req.redirInfo, sizeof(RedirInfo_struct));
|
||||
memcpy(&msg_ptr->iam.scfId, &prm_ptr->setup_req.scfId, sizeof(ScfId_struct));
|
||||
memcpy(&msg_ptr->iam.utuInd, &prm_ptr->setup_req.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->iam.utuInfo, &prm_ptr->setup_req.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_REL:
|
||||
memcpy(&msg_ptr->rel.cause, &prm_ptr->rel_req.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&msg_ptr->rel.utuInd, &prm_ptr->rel_req.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->rel.utuInfo, &prm_ptr->rel_req.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_RLC:
|
||||
memcpy(&msg_ptr->rlc.cause, &prm_ptr->rel_rsp.cause, sizeof(CauseInd_struct));
|
||||
break;
|
||||
case M_RES:
|
||||
memcpy(&msg_ptr->res.susRes, &prm_ptr->res_req.susRes, sizeof(SusResInd_struct));
|
||||
break;
|
||||
case M_SUS:
|
||||
memcpy(&msg_ptr->sus.susRes, &prm_ptr->sus_req.susRes, sizeof(SusResInd_struct));
|
||||
break;
|
||||
case M_SAM:
|
||||
memcpy(&msg_ptr->sam.subseqNum, &prm_ptr->info_req.subseqNum, sizeof(SubseqNum_struct));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
1080
plat/bicc/src.old/biccif.c
Normal file
1080
plat/bicc/src.old/biccif.c
Normal file
File diff suppressed because it is too large
Load Diff
25
plat/bicc/src.old/include/bicc_debug.h
Normal file
25
plat/bicc/src.old/include/bicc_debug.h
Normal 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, ...);
|
||||
417
plat/bicc/src.old/include/biccif.h
Normal file
417
plat/bicc/src.old/include/biccif.h
Normal 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
|
||||
|
||||
34
plat/bicc/src.old/include/define.h
Normal file
34
plat/bicc/src.old/include/define.h
Normal 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
|
||||
|
||||
162
plat/bicc/src.old/include/inc.h
Normal file
162
plat/bicc/src.old/include/inc.h
Normal 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
|
||||
|
||||
60
plat/bicc/src.old/include/ipbcp.h
Normal file
60
plat/bicc/src.old/include/ipbcp.h
Normal 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
|
||||
456
plat/bicc/src.old/include/q1902_3e.h
Normal file
456
plat/bicc/src.old/include/q1902_3e.h
Normal 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
|
||||
|
||||
100
plat/bicc/src.old/include/q765_5e.h
Normal file
100
plat/bicc/src.old/include/q765_5e.h
Normal 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
|
||||
|
||||
14
plat/bicc/src.old/include/var_ext.h
Normal file
14
plat/bicc/src.old/include/var_ext.h
Normal 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
|
||||
206
plat/bicc/src/bicc_apm.c
Normal file
206
plat/bicc/src/bicc_apm.c
Normal file
@@ -0,0 +1,206 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "./include/q765_5e.h"
|
||||
|
||||
void apm_decode_action(ActionInd_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = flw_ptr[1];
|
||||
}
|
||||
|
||||
u32 apm_encode_action(u8 *flw_ptr, const ActionInd_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val;
|
||||
return 2;
|
||||
}
|
||||
|
||||
void apm_decode_bncid(BncId_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->len = length - 1;
|
||||
memcpy(ptr->val, flw_ptr+1, ptr->len);
|
||||
}
|
||||
|
||||
u32 apm_encode_bncid(u8 *flw_ptr, const BncId_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
memcpy(flw_ptr+1, ptr->val, ptr->len);
|
||||
return ptr->len + 1;
|
||||
}
|
||||
|
||||
void apm_decode_bncchr(BncChr_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = flw_ptr[1];
|
||||
}
|
||||
|
||||
u32 apm_encode_bncchr(u8 *flw_ptr, const BncChr_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val;
|
||||
return 2;
|
||||
}
|
||||
|
||||
void apm_decode_bcinfo(BcInfo_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->bctp.bvei = (flw_ptr[1] >> 6) & 0x01;
|
||||
ptr->bctp.btcp_version = flw_ptr[1] & 0x1f;
|
||||
ptr->bctp.tpei = (flw_ptr[2] >> 6) & 0x01;
|
||||
ptr->bctp.tunnel_protocol = flw_ptr[2] & 0x3f;
|
||||
ptr->bctp.ipbcp_len = length - 3;
|
||||
memcpy(ptr->bctp.ipbcp_content, flw_ptr+3, ptr->bctp.ipbcp_len);
|
||||
}
|
||||
|
||||
u32 apm_encode_bcinfo(u8 *flw_ptr, const BcInfo_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = (ptr->bctp.bvei << 6) + (1 << 5) + ptr->bctp.btcp_version;
|
||||
flw_ptr[2] = (ptr->bctp.tpei << 6) + ptr->bctp.tunnel_protocol;
|
||||
memcpy(flw_ptr+3, ptr->bctp.ipbcp_content, ptr->bctp.ipbcp_len);
|
||||
return ptr->bctp.ipbcp_len + 3;
|
||||
}
|
||||
|
||||
void apm_decode_bctunnel(BcTunnel_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = flw_ptr[1];
|
||||
}
|
||||
|
||||
u32 apm_encode_bctunnel(u8 *flw_ptr, const BcTunnel_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val;
|
||||
return 2;
|
||||
}
|
||||
|
||||
void apm_decode_signaltype(SignalType_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = flw_ptr[1];
|
||||
}
|
||||
|
||||
u32 apm_encode_signaltype(u8 *flw_ptr, const SignalType_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val;
|
||||
return 2;
|
||||
}
|
||||
|
||||
void apm_decode_duration(Duration_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
ptr->pres = 1;
|
||||
ptr->comp_info = flw_ptr[0];
|
||||
ptr->val = (flw_ptr[1] << 8) + flw_ptr[2];
|
||||
}
|
||||
|
||||
u32 apm_encode_duration(u8 *flw_ptr, const Duration_struct *ptr)
|
||||
{
|
||||
flw_ptr[0] = ptr->comp_info;
|
||||
flw_ptr[1] = ptr->val >> 8;
|
||||
flw_ptr[2] = ptr->val & 0xff;
|
||||
return 3;
|
||||
}
|
||||
|
||||
void apm_decode(ApmUser_struct *ptr, const u8 *flw_ptr, u8 length)
|
||||
{
|
||||
const u8 *old_ptr = flw_ptr;
|
||||
|
||||
while(flw_ptr+flw_ptr[1]+2-old_ptr <= length)
|
||||
{
|
||||
if(*flw_ptr == 0)
|
||||
break;
|
||||
switch(*flw_ptr)
|
||||
{
|
||||
case AP_ACTION:
|
||||
apm_decode_action(&ptr->action, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_BNCID:
|
||||
apm_decode_bncid(&ptr->bnc_id, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_BNCCHR:
|
||||
apm_decode_bncchr(&ptr->bnc_chr, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_BCINFO:
|
||||
apm_decode_bcinfo(&ptr->bc_info, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_BCTUNNEL:
|
||||
apm_decode_bctunnel(&ptr->bc_tunnel, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_SIGNALTYPE:
|
||||
apm_decode_signaltype(&ptr->signal_type, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
case AP_DURATION:
|
||||
apm_decode_duration(&ptr->duration, flw_ptr+2, flw_ptr[1]);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
default:
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 apm_encode(u8 *flw_ptr, const ApmUser_struct *ptr)
|
||||
{
|
||||
u8 *old_ptr = flw_ptr;
|
||||
|
||||
if(ptr->action.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_ACTION;
|
||||
flw_ptr[1] = apm_encode_action(flw_ptr+2, &ptr->action);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->bnc_id.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_BNCID;
|
||||
flw_ptr[1] = apm_encode_bncid(flw_ptr+2, &ptr->bnc_id);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->bnc_chr.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_BNCCHR;
|
||||
flw_ptr[1] = apm_encode_bncchr(flw_ptr+2, &ptr->bnc_chr);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->bc_info.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_BCINFO;
|
||||
flw_ptr[1] = apm_encode_bcinfo(flw_ptr+2, &ptr->bc_info);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->bc_tunnel.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_BCTUNNEL;
|
||||
flw_ptr[1] = apm_encode_bctunnel(flw_ptr+2, &ptr->bc_tunnel);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->signal_type.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_SIGNALTYPE;
|
||||
flw_ptr[1] = apm_encode_signaltype(flw_ptr+2, &ptr->signal_type);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
if(ptr->duration.pres == 1)
|
||||
{
|
||||
flw_ptr[0] = AP_DURATION;
|
||||
flw_ptr[1] = apm_encode_duration(flw_ptr+2, &ptr->duration);
|
||||
flw_ptr += flw_ptr[1] + 2;
|
||||
}
|
||||
return flw_ptr - old_ptr;
|
||||
}
|
||||
|
||||
|
||||
882
plat/bicc/src/bicc_debug.c
Normal file
882
plat/bicc/src/bicc_debug.c
Normal file
@@ -0,0 +1,882 @@
|
||||
#include "./include/var_ext.h"
|
||||
|
||||
//static u32 bicc_object_id[BICC_PREOID_LEN] = {1,3,6,1,4,1,1373,1,3,2,2,6};
|
||||
//static u16 bicc_sub_page[BICC_DEBUG_PAGE] = {0};
|
||||
//static u8 bicc_ascii_in[BICC_ASCIN_LEN] = {0};
|
||||
//static u8 bicc_ascii_out[BICC_ASCOUT_LEN] = {0};
|
||||
|
||||
#define BICC_DEBUG_ID 17
|
||||
#define BICC_VER_DEBUG "R91V0_01"
|
||||
|
||||
#define MONITOR_NONE 0x0000
|
||||
#define MONITOR_ERROR 0x0010
|
||||
#define MONITOR_ALL 0xffff
|
||||
|
||||
#define TRACE_FLAG_ON 1
|
||||
#define TRACE_FLAG_OFF 0
|
||||
|
||||
u8 AsciInBuf[4096];
|
||||
u8 AsciOutBuf[4096];
|
||||
u8 AsciTempBuf[4096];
|
||||
WORD MonitorFg;
|
||||
u8 info[1024];
|
||||
|
||||
static u8 log_help[] = {
|
||||
"BICC debug Help:\n\r\
|
||||
\n\r\
|
||||
1.help\n\r\
|
||||
2.log all/none\n\r\
|
||||
3.log error on/off\n\r\
|
||||
4.list cg[-cgNo] \n\r\
|
||||
5.list circuit[-circuitNo]\n\r\
|
||||
6.list port[-portNo]\n\r\
|
||||
7.list dmp\n\r\
|
||||
8.trace on-portNo\n\r\
|
||||
9.trace off[-portNo]\n\r\n\r\
|
||||
"
|
||||
};
|
||||
|
||||
static WORD disp_page[10];
|
||||
static u8 *disp_ptr = (u8 *) disp_page;
|
||||
|
||||
static DWORD debug_status_id[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,1
|
||||
};
|
||||
|
||||
static BYTE debug_status = 1;
|
||||
|
||||
static DWORD debug_name_id[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,2
|
||||
};
|
||||
|
||||
static DWORD debug_ascin_id[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,3
|
||||
};
|
||||
|
||||
static DWORD debug_ascout_id[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,4
|
||||
};
|
||||
|
||||
static DWORD debug_page_title[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,1,1
|
||||
};
|
||||
|
||||
static DWORD debug_page_line[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,1,1,2,3,1,2,BICC_DEBUG_ID + 2,1,2,1
|
||||
};
|
||||
|
||||
const static u8 BASE_ID_LEN = 15;
|
||||
const static u8 PAGE_POINT = 14;
|
||||
const static u8 LINE_POINT = 15;
|
||||
|
||||
static u8 title1_p[] =
|
||||
{
|
||||
" BICC Page 01 SAP Info\n\r\
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
|
||||
Subpage\n\r\
|
||||
Enable\n\r\
|
||||
CG num\n\r"
|
||||
};
|
||||
|
||||
static u8 title2_p[] =
|
||||
{
|
||||
" BICC Page 02 CG Info\n\r\
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
|
||||
Subpage\n\r\
|
||||
Enable\n\r\
|
||||
SAP id\n\r\
|
||||
NI\n\r\
|
||||
DPC\n\r"
|
||||
};
|
||||
|
||||
static u8 title3_p[] =
|
||||
{
|
||||
" BICC Page 03 CIrcuit Info\n\r\
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
|
||||
Subpage\n\r\
|
||||
CG id\n\r\
|
||||
CIC range\n\r\
|
||||
HEAD CIC\n\r"
|
||||
};
|
||||
|
||||
static u8 title4_p[] =
|
||||
{
|
||||
" BICC Page 04 Port Info\n\r\
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\r\
|
||||
Subpage\n\r\
|
||||
Enable\n\r\
|
||||
FSM State\n\r\
|
||||
CIC State\n\r"
|
||||
};
|
||||
|
||||
static u8 debug_disp_line(u8 page, u8 line)
|
||||
{
|
||||
u8 disp_length;
|
||||
disp_length = 0;
|
||||
disp_ptr = (u8 *) disp_page;
|
||||
switch (page)
|
||||
{
|
||||
/*
|
||||
case 1: // Page 1: sap Info
|
||||
switch(line)
|
||||
{
|
||||
case 0:
|
||||
disp_ptr = (BYTE *) &disp_page[page];
|
||||
disp_length = 2;
|
||||
break;
|
||||
case 1:
|
||||
disp_ptr = (BYTE *) &Bicc_Data.debug_data.sap_enable;
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 2:
|
||||
disp_ptr = (BYTE *) &Bicc_Data.debug_data.sap_cg_num;
|
||||
disp_length = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2: // Page 2: cg Info
|
||||
//disp_page[page] = (disp_page[page]+1)%BICC_MAX_CG;
|
||||
switch(line)
|
||||
{
|
||||
case 0:
|
||||
disp_ptr = (BYTE *) &disp_page[page]; //Subpage
|
||||
disp_length = 2;
|
||||
break;
|
||||
case 1: //enable
|
||||
disp_ptr = (BYTE *) &(BiccResource.cg_pond[disp_page[page]].used_flag);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 2: //sap_id
|
||||
disp_ptr = (BYTE *) &(BiccResource.cg_pond[disp_page[page]].sap_id);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 3: //network_id
|
||||
disp_ptr = (BYTE *) &(BiccResource.cg_pond[disp_page[page]].attrib.network_id);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 4: //dpc
|
||||
disp_ptr = (BYTE *) &(BiccResource.cg_pond[disp_page[page]].attrib.dpc);
|
||||
disp_length = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Page 3: circuit Info
|
||||
//disp_page[page] = (disp_page[page]+1)%BICC_MAX_CIRCUIT;
|
||||
switch(line)
|
||||
{
|
||||
case 0:
|
||||
disp_ptr = (BYTE *) &disp_page[page]; //Subpage
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 1: //cg_id
|
||||
disp_ptr = (BYTE *) &(BiccResource.circuit_pond[disp_page[page]].cg_id);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 2: //cic_range
|
||||
disp_ptr = (BYTE *) &(BiccResource.circuit_pond[disp_page[page]].attrib.cic_range);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 3: //head_cic
|
||||
disp_ptr = (BYTE *) &(BiccResource.circuit_pond[disp_page[page]].attrib.head_cic);
|
||||
disp_length = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: // Page 4: port Info
|
||||
//disp_page[page] = (disp_page[page]+32)%BICC_MAX_PORT;
|
||||
switch(line)
|
||||
{
|
||||
case 0:
|
||||
disp_ptr = (BYTE *) &disp_page[page]; //Subpage
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 1: //enable
|
||||
disp_ptr = (BYTE *) &(BiccResource.port_pond[disp_page[page]].used_flag);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 2: //fsm_state
|
||||
disp_ptr = (BYTE *) &(BiccResource.port_pond[disp_page[page]].fsm_state);
|
||||
disp_length = 16;
|
||||
break;
|
||||
case 3: //cic_state
|
||||
disp_ptr = (BYTE *) &(BiccResource.port_pond[disp_page[page]].cic_state);
|
||||
disp_length = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
disp_length = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return disp_length;
|
||||
}
|
||||
|
||||
static void debug_disp_page(u8 page)
|
||||
{
|
||||
u8 disp_line;
|
||||
u8 disp_length;
|
||||
|
||||
debug_page_line[PAGE_POINT] = page + 5;
|
||||
|
||||
for (disp_line = 0; disp_line < 22; disp_line++)
|
||||
{
|
||||
disp_length = debug_disp_line(page, disp_line);
|
||||
debug_page_line[LINE_POINT] = disp_line + 2;
|
||||
debug_page_line[LINE_POINT + 1] = 2; // Data Pointer
|
||||
debug_set_response(BASE_ID_LEN + 2, debug_page_line, disp_ptr, disp_length);
|
||||
}
|
||||
}
|
||||
|
||||
int bicc_debug_init(void)
|
||||
{
|
||||
BYTE page;
|
||||
BYTE data[10];
|
||||
BYTE *ptr;
|
||||
|
||||
strcpy(AsciInBuf, "\0");
|
||||
strcpy(AsciOutBuf, "\0");
|
||||
MonitorFg = MONITOR_NONE;
|
||||
bzero(disp_page, 20);
|
||||
|
||||
ptr = data;
|
||||
|
||||
debug_set_response(BASE_ID_LEN, debug_status_id, &debug_status, 1);
|
||||
debug_set_response(BASE_ID_LEN, debug_name_id, BICC_VER_DEBUG, 10);
|
||||
debug_set_response(BASE_ID_LEN, debug_ascin_id, AsciInBuf, 4096);
|
||||
debug_set_response(BASE_ID_LEN, debug_ascout_id, AsciOutBuf, 4096);
|
||||
|
||||
for (page = 1; page < 5; page++)
|
||||
{
|
||||
switch (page)
|
||||
{
|
||||
case 1: //page 1
|
||||
ptr = title1_p;
|
||||
break;
|
||||
case 2: //page 2
|
||||
ptr = title2_p;
|
||||
break;
|
||||
case 3: //page 3
|
||||
ptr = title3_p;
|
||||
break;
|
||||
case 4: //page 4
|
||||
ptr = title4_p;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
debug_page_title[PAGE_POINT] = 5 + page;
|
||||
debug_set_response(BASE_ID_LEN + 1, debug_page_title, ptr, strlen(ptr));
|
||||
debug_disp_page(page);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void bicc_asciout_proc(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[1024];
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsprintf(buf, fmt, ap);
|
||||
if((strlen(AsciOutBuf) + strlen(buf)) < 4096)
|
||||
strcat(AsciOutBuf, buf);
|
||||
else
|
||||
strcpy(AsciOutBuf, buf);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
||||
void bicc_debug_refresh(void)
|
||||
{
|
||||
// int i;
|
||||
#if 0
|
||||
for(i=0;i<16;i++)
|
||||
{
|
||||
Bicc_Data.debug_data.sap_enable[i] = BiccResource.sap_pond[i].used_flag;
|
||||
Bicc_Data.debug_data.sap_cg_num[i] = BiccResource.sap_pond[i].cg_num;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void list_sap(WORD sapNo)
|
||||
{
|
||||
//u8 sapinfo[1024];
|
||||
if(sapNo >= BICC_MAX_SAP)
|
||||
return;
|
||||
|
||||
sprintf(info,"\
|
||||
Enable:%d\n\r\
|
||||
cg num:%d\n\r",
|
||||
BiccResource.sap_pond[sapNo].used_flag,BiccResource.sap_pond[sapNo].cg_num);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
void list_all_sap()
|
||||
{
|
||||
int i;
|
||||
sprintf(info, "Index CG(s)\n\r");
|
||||
bicc_asciout_proc(info);
|
||||
for(i=0; i<BICC_MAX_SAP; i++)
|
||||
{
|
||||
if(BiccResource.sap_pond[i].used_flag == 1)
|
||||
{
|
||||
sprintf(info, " %d %d\n\r", i, BiccResource.sap_pond[i].cg_num);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
void list_cg(WORD cgNo)
|
||||
{
|
||||
const pal_cg_struct *pcg;
|
||||
if(cgNo >= PAL_MAX_CG)
|
||||
return;
|
||||
pcg = pal_cg_ptr(cgNo);
|
||||
if(pcg == NULL)
|
||||
return;
|
||||
sprintf(info, "\
|
||||
Enable:%d\n\r\
|
||||
sap id:%d\n\r\
|
||||
circuit num:%d\n\r\
|
||||
variant_type:%d\n\r\
|
||||
priority:%d\n\r\
|
||||
network id:%d\n\r\
|
||||
opc:%ld\n\r\
|
||||
dpc:%ld\n\r\
|
||||
tg_id:%ld\n\r",
|
||||
pcg->enable,pcg->sap_id,pcg->circuit_num,pcg->attrib.variant,pcg->attrib.priority,pcg->attrib.network_id,pcg->attrib.opc,pcg->attrib.dpc,pcg->attrib.tg_id);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
void list_all_cg()
|
||||
{
|
||||
int i = 0;
|
||||
const pal_cg_struct *pcg;
|
||||
sprintf(info, "Index SAP Circuit(s) NetInd DPC OPC TG\n\r");
|
||||
bicc_asciout_proc(info);
|
||||
for(i=0; i<PAL_MAX_CG; i++)
|
||||
{
|
||||
pcg = pal_cg_ptr(i);
|
||||
if(pcg == NULL)
|
||||
continue;
|
||||
if(pcg->enable==0)
|
||||
continue;
|
||||
|
||||
if(pcg->attrib.protocol != PROTO_BICC)
|
||||
continue;
|
||||
sprintf(info, " %d %d %d %d %ld %ld %ld\n\r", i, pcg->sap_id, pcg->circuit_num, pcg->attrib.network_id, pcg->attrib.dpc, pcg->attrib.opc, pcg->attrib.tg_id);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void list_circuit(WORD circuitNo)
|
||||
{
|
||||
const pal_circuit_struct *pcircuit;
|
||||
if(circuitNo >= PAL_MAX_CIRCUIT)
|
||||
return;
|
||||
pcircuit = pal_circuit_ptr(circuitNo);
|
||||
if(pcircuit == NULL)
|
||||
return ;
|
||||
|
||||
sprintf(info,"\
|
||||
Enable:%d\n\r\
|
||||
cg id:%d\n\r\
|
||||
head cic:%ld\n\r\
|
||||
cic range:%d\n\r\
|
||||
plat id:%d\n\r",
|
||||
pcircuit->enable,pcircuit->cg_id,pcircuit->attrib.head_cic,pcircuit->attrib.cic_range,pcircuit->attrib.plat_id);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
|
||||
void list_all_circuit()
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
const pal_circuit_struct *pcircuit;
|
||||
const pal_cg_struct *pcg;
|
||||
// for(i = 0; i < BICC_MAX_SAP; i ++)
|
||||
//{
|
||||
sprintf(info, "Index CG PLAT CIC(s)\n\r");
|
||||
bicc_asciout_proc(info);
|
||||
for(i=0; i<PAL_MAX_CG; i++)
|
||||
{
|
||||
pcg = pal_cg_ptr(i);
|
||||
if(pcg == NULL)
|
||||
continue;
|
||||
if(pcg->enable == 0)
|
||||
continue;
|
||||
if(pcg->attrib.protocol != PROTO_BICC)
|
||||
continue;
|
||||
for(j = 0; j<PAL_MAX_CIRCUIT; j++)
|
||||
{
|
||||
pcircuit = pal_circuit_ptr(j);
|
||||
if(pcircuit == NULL)
|
||||
continue;
|
||||
if(pcircuit->enable == 0 || pcircuit->cg_id != pcg->id)
|
||||
continue;
|
||||
sprintf(info, " %d %d %d %d (%ld~~%ld)\n\r", i, pcircuit->cg_id, pcircuit->attrib.plat_id, pcircuit->attrib.cic_range, pcircuit->attrib.head_cic, pcircuit->attrib.head_cic+pcircuit->attrib.cic_range);
|
||||
bicc_asciout_proc(info);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void list_port(WORD portNo)
|
||||
{
|
||||
if(portNo>=BICC_MAX_PORT)
|
||||
return;
|
||||
sprintf(info,"\
|
||||
upper port:%ld\n\r\
|
||||
sprc_cmd:%x\n\r\
|
||||
primitive_cmd:%x\n\r\
|
||||
internal_cmd:%x\n\r\
|
||||
cic state{\n\r\
|
||||
call state:%d\n\r\
|
||||
suspend state:%d\n\r\
|
||||
block state:%d\n\r\
|
||||
}\n\r\
|
||||
fsm state{\n\r\
|
||||
cpc_state:%d\n\r\
|
||||
mgbs_state:%d\n\r\
|
||||
mgbr_state:%d\n\r\
|
||||
crs_state:%d\n\r\
|
||||
crr_state:%d\n\r\
|
||||
cgrs_state:%d\n\r\
|
||||
cgrr_state:%d\n\r\
|
||||
}\n\r",
|
||||
Bicc_Data.port_data[portNo].su_proc_id,Bicc_Data.port_data[portNo].sprc_cmd,
|
||||
Bicc_Data.port_data[portNo].primitive_cmd,Bicc_Data.port_data[portNo].internal_cmd,
|
||||
Bicc_Data.port_data[portNo].cic_state.call_state,Bicc_Data.port_data[portNo].cic_state.sus_state,
|
||||
Bicc_Data.port_data[portNo].cic_state.blo_state,Bicc_Data.port_data[portNo].fsm_state.cpc_state,
|
||||
Bicc_Data.port_data[portNo].fsm_state.mgbs_state,Bicc_Data.port_data[portNo].fsm_state.mgbr_state,
|
||||
Bicc_Data.port_data[portNo].fsm_state.crs_state,Bicc_Data.port_data[portNo].fsm_state.crr_state,
|
||||
Bicc_Data.port_data[portNo].fsm_state.cgrs_state,Bicc_Data.port_data[portNo].fsm_state.cgrr_state);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
void list_busy_port()
|
||||
{
|
||||
int i,j=0;
|
||||
sprintf(info, "Index PortNo CallState\n\r");
|
||||
bicc_asciout_proc(info);
|
||||
for(i=0;i<BICC_MAX_PORT;i++)
|
||||
{
|
||||
if(Bicc_Data.port_data[i].used_flag == 1)
|
||||
{
|
||||
sprintf(info,"%d %d %s\n\r",j++,i,(Bicc_Data.port_data[i].cic_state.call_state==1)?"INCOMING":"OUTGOING");
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void list_dmp()
|
||||
{
|
||||
sprintf(info, "\
|
||||
dmp active: %d\n\r\
|
||||
local plat id: %d\n\r\
|
||||
remote ip: %lx\n\r", Bicc_Data.dmp_data.active,Bicc_Data.dmp_data.processor_id,Bicc_Data.dmp_data.remote_ip);
|
||||
bicc_asciout_proc(info);
|
||||
}
|
||||
|
||||
void bicc_debug_timer(void)
|
||||
{
|
||||
BYTE in_page, err_fg = 0;
|
||||
BYTE *ascii_in_ptr = NULL;
|
||||
BYTE *str_start = NULL, * tmpStr;
|
||||
WORD str_len, portNo=0;
|
||||
WORD num, cgNo, circuitNo;
|
||||
|
||||
if ((str_len = strlen(AsciInBuf)) > 0)
|
||||
{
|
||||
in_page = AsciInBuf[0] - 1;
|
||||
ascii_in_ptr = AsciInBuf + 1;
|
||||
|
||||
if (in_page > 4)
|
||||
err_fg = 1;
|
||||
else if (strcmp(ascii_in_ptr,"log error on") == 0)
|
||||
{
|
||||
MonitorFg = MonitorFg | MONITOR_ERROR;
|
||||
}
|
||||
else if (strcmp(ascii_in_ptr,"log error off") == 0)
|
||||
{
|
||||
MonitorFg = MonitorFg & (~MONITOR_ERROR);
|
||||
}
|
||||
else if (strcmp(ascii_in_ptr,"log all") == 0)
|
||||
{
|
||||
MonitorFg = MONITOR_ALL;
|
||||
|
||||
}
|
||||
else if (strcmp(ascii_in_ptr,"log none") == 0)
|
||||
{
|
||||
MonitorFg = MONITOR_NONE;
|
||||
|
||||
}
|
||||
else if (strcmp(ascii_in_ptr,"help") == 0)
|
||||
{
|
||||
bicc_asciout_proc(log_help);
|
||||
}
|
||||
else if (isdigit(ascii_in_ptr[0]))
|
||||
{
|
||||
num = strtoul(ascii_in_ptr, NULL, 10);
|
||||
disp_page[in_page] = num;
|
||||
debug_disp_page(in_page);
|
||||
}
|
||||
else if ((str_start = strstr(ascii_in_ptr, ">")) != NULL)
|
||||
{
|
||||
num = strtoul(str_start + 1, NULL, 10);
|
||||
disp_page[in_page] += num;
|
||||
debug_disp_page(in_page);
|
||||
}
|
||||
else if ((str_start = strstr(ascii_in_ptr, "<"))!= NULL)
|
||||
{
|
||||
num = strtoul(str_start + 1, NULL, 10);
|
||||
disp_page[in_page] -= num;
|
||||
debug_disp_page(in_page);
|
||||
}
|
||||
#if 0
|
||||
else if ((strstr (ascii_in_ptr, "list sap")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
sapNo = strtoul (tmpStr + 1, NULL, 10);
|
||||
list_sap(sapNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_all_sap();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if ((strstr (ascii_in_ptr,"list cg")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
// if((tmpStr = strsep(&&ascii_in_ptr, " \t")) != NULL)
|
||||
{
|
||||
cgNo = strtoul (tmpStr+1, NULL, 10);
|
||||
// strsep(, " \t");
|
||||
list_cg(cgNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_all_cg();
|
||||
}
|
||||
}
|
||||
else if ((strstr (ascii_in_ptr, "list circuit")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
circuitNo = strtoul (tmpStr + 1, NULL, 10);
|
||||
list_circuit(circuitNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_all_circuit();
|
||||
}
|
||||
}
|
||||
else if ((strstr (ascii_in_ptr, "list port")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
portNo = strtoul (tmpStr + 1, NULL, 10);
|
||||
list_port(portNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_busy_port();
|
||||
}
|
||||
|
||||
}
|
||||
else if((strstr (ascii_in_ptr, "list dmp")) != NULL)
|
||||
{
|
||||
list_dmp();
|
||||
}
|
||||
else if((strstr(ascii_in_ptr, "trace on")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr(ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
portNo = strtoul(tmpStr + 1, NULL, 10);
|
||||
//trace_port(portNo);
|
||||
Bicc_Data.port_data[portNo].trace_flag = 1;
|
||||
}
|
||||
else
|
||||
{}
|
||||
}
|
||||
else if ((strstr (ascii_in_ptr, "trace off")) != NULL)
|
||||
{
|
||||
if((tmpStr = strstr (ascii_in_ptr, "-")) != NULL)
|
||||
{
|
||||
portNo = strtoul (tmpStr + 1, NULL, 10);
|
||||
Bicc_Data.port_data[portNo].trace_flag = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<BICC_MAX_PORT; i++)
|
||||
Bicc_Data.port_data[i].trace_flag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
err_fg = 1;
|
||||
|
||||
if (err_fg == 0)
|
||||
bicc_asciout_proc("Command OK!\n\r");
|
||||
else
|
||||
bicc_asciout_proc("Command Error!\n\r");
|
||||
|
||||
strcpy(AsciInBuf, "\0");
|
||||
}
|
||||
bicc_debug_refresh();
|
||||
}
|
||||
|
||||
|
||||
void bicc_log_err(const char *fmt, ...)
|
||||
{
|
||||
if ((MonitorFg & MONITOR_ERROR) == MONITOR_ERROR)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[1024];
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsprintf(buf, fmt, ap);
|
||||
if((strlen(AsciOutBuf) + strlen(buf)) < 4096-15)
|
||||
{
|
||||
strcat(AsciOutBuf, "\33[31m");
|
||||
strcat(AsciOutBuf, buf);
|
||||
strcat(AsciOutBuf, "\33[37m");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(AsciOutBuf, "\33[31m");
|
||||
strcat(AsciOutBuf, buf);
|
||||
strcat(AsciOutBuf, "\33[37m");
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int bicc_log_procedure(WORD mgNo, WORD portIndex, WORD chnlIndex, char *msg)
|
||||
{
|
||||
u8 monFlag = 0;
|
||||
|
||||
monFlag = 1;
|
||||
|
||||
if (monFlag == 1)
|
||||
{
|
||||
if (strlen(msg) >= 4096)
|
||||
sprintf(AsciTempBuf, "log msg is too long!\n\r");
|
||||
else
|
||||
sprintf(AsciTempBuf, "%s\n\r", msg);
|
||||
bicc_asciout_proc(AsciTempBuf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void display_bicc_msgtype(u8 msgtype, u32 cic)
|
||||
{
|
||||
switch(msgtype)
|
||||
{
|
||||
case M_ACM:
|
||||
bicc_asciout_proc("ACM:Address complete");
|
||||
break;
|
||||
case M_ANM:
|
||||
bicc_asciout_proc("ANM:Answer");
|
||||
break;
|
||||
case M_BLO:
|
||||
bicc_asciout_proc("BLO:Blocking");
|
||||
break;
|
||||
case M_BLA:
|
||||
bicc_asciout_proc("BLA:Blocking acknowledgement");
|
||||
break;
|
||||
case M_CPG:
|
||||
bicc_asciout_proc("CPG:Call progress");
|
||||
break;
|
||||
case M_CGB:
|
||||
bicc_asciout_proc("CGB:Circuit/CIC group blocking");
|
||||
break;
|
||||
case M_CGBA:
|
||||
bicc_asciout_proc("CGBA:Circuit/CIC group blocking acknowledgement");
|
||||
break;
|
||||
case M_CQM:
|
||||
bicc_asciout_proc("CQM:Circuit/CIC group query (national use)");
|
||||
break;
|
||||
case M_CQR:
|
||||
bicc_asciout_proc("CQR:Circuit/CIC group query response (national use)");
|
||||
break;
|
||||
case M_GRS:
|
||||
bicc_asciout_proc("GRS:Circuit/CIC group reset");
|
||||
break;
|
||||
case M_GRA:
|
||||
bicc_asciout_proc("GRA:Circuit/CIC group reset acknowledgement");
|
||||
break;
|
||||
case M_CGU:
|
||||
bicc_asciout_proc("CGU:Circuit/CIC group unblocking");
|
||||
break;
|
||||
case M_CGUA:
|
||||
bicc_asciout_proc("CGUA:Circuit/CIC group unblocking acknowledgement");
|
||||
break;
|
||||
case M_CRG:
|
||||
bicc_asciout_proc("CRG:Charge information (national use)");
|
||||
break;
|
||||
case M_CFN:
|
||||
bicc_asciout_proc("CFN:Confusion");
|
||||
break;
|
||||
case M_CON:
|
||||
bicc_asciout_proc("CON:Connect");
|
||||
break;
|
||||
case M_COT:
|
||||
bicc_asciout_proc("COT:Continuity");
|
||||
break;
|
||||
case M_FAC:
|
||||
bicc_asciout_proc("FAC:Facility ");
|
||||
break;
|
||||
case M_FAA:
|
||||
bicc_asciout_proc("FAA:Facility accepted");
|
||||
break;
|
||||
case M_FRJ:
|
||||
bicc_asciout_proc("FRJ:Facility reject");
|
||||
break;
|
||||
case M_FAR:
|
||||
bicc_asciout_proc("FAR:Facility request");
|
||||
break;
|
||||
case M_FOT:
|
||||
bicc_asciout_proc("FOT:Forward transfer");
|
||||
break;
|
||||
case M_IDR:
|
||||
bicc_asciout_proc("IDR:Identification request");
|
||||
break;
|
||||
case M_IRS:
|
||||
bicc_asciout_proc("IRS:Identification response");
|
||||
break;
|
||||
case M_INF:
|
||||
bicc_asciout_proc("INF:Information (national use)");
|
||||
break;
|
||||
case M_INR:
|
||||
bicc_asciout_proc("INR:Information request (national use)");
|
||||
break;
|
||||
case M_IAM:
|
||||
bicc_asciout_proc("IAM:Initial address");
|
||||
break;
|
||||
case M_NRM:
|
||||
bicc_asciout_proc("NRM:Network resource management");
|
||||
break;
|
||||
case M_REL:
|
||||
bicc_asciout_proc("REL:Release");
|
||||
break;
|
||||
case M_RLC:
|
||||
bicc_asciout_proc("RLC:Release complete");
|
||||
break;
|
||||
case M_RSC:
|
||||
bicc_asciout_proc("RSC:Reset circuit/CIC");
|
||||
break;
|
||||
case M_RES:
|
||||
bicc_asciout_proc("RES:Resume");
|
||||
break;
|
||||
case M_SGM:
|
||||
bicc_asciout_proc("SGM:Segmentation");
|
||||
break;
|
||||
case M_SAM:
|
||||
bicc_asciout_proc("SAM:Subsequent address");
|
||||
break;
|
||||
case M_SUS:
|
||||
bicc_asciout_proc("SUS:Suspend");
|
||||
break;
|
||||
case M_UBL:
|
||||
bicc_asciout_proc("UBL:Unblocking");
|
||||
break;
|
||||
case M_UBA:
|
||||
bicc_asciout_proc("UBA:Unblocking acknowledgement");
|
||||
break;
|
||||
case M_UCIC:
|
||||
bicc_asciout_proc("UCIC:Unequipped CIC (national use)");
|
||||
break;
|
||||
case M_APM:
|
||||
bicc_asciout_proc("APM:Application Transport");
|
||||
break;
|
||||
case M_USR:
|
||||
bicc_asciout_proc("USR:User-to-user information");
|
||||
break;
|
||||
default:
|
||||
bicc_asciout_proc("Unknown message");
|
||||
|
||||
}
|
||||
|
||||
bicc_asciout_proc("(message type=0x%x cic=%d)\r\n",msgtype,cic);
|
||||
}
|
||||
|
||||
|
||||
void monitor_bicc_msg(BYTE *msg,BYTE buf_len, BYTE flag, u32 cic, u32 portNo)
|
||||
{
|
||||
BYTE i,temp_buf[1024];
|
||||
if(MonitorFg == MONITOR_ALL)
|
||||
{
|
||||
if(flag == 0)
|
||||
bicc_asciout_proc("\33[33mReceive:\33[0m");
|
||||
else if(flag == 1)
|
||||
bicc_asciout_proc("\33[32mSend:\33[0m");
|
||||
else if(flag == 2)
|
||||
bicc_asciout_proc("\33[34mRedirect:\33[0m");
|
||||
display_bicc_msgtype(msg[0], cic);
|
||||
|
||||
if(flag != 2)
|
||||
{
|
||||
for (i = 0; i < buf_len; i ++)
|
||||
{
|
||||
sprintf(&temp_buf[3*i]," %02x", msg[i]);
|
||||
}
|
||||
sprintf(&temp_buf[3*i],"\n\r");
|
||||
bicc_asciout_proc(temp_buf);
|
||||
}
|
||||
}
|
||||
if(MonitorFg == MONITOR_NONE)
|
||||
{}
|
||||
if(Bicc_Data.port_data[portNo].trace_flag == 1)
|
||||
{
|
||||
if(flag == 0)
|
||||
bicc_asciout_proc("\33[33mReceive:\33[0m");
|
||||
else if(flag == 1)
|
||||
bicc_asciout_proc("\33[32mSend:\33[0m");
|
||||
else if(flag == 2)
|
||||
bicc_asciout_proc("\33[34mRedirect:\33[0m");
|
||||
display_bicc_msgtype(msg[0], cic);
|
||||
|
||||
if(flag != 2)
|
||||
{
|
||||
for (i = 0; i < buf_len; i ++)
|
||||
{
|
||||
sprintf(&temp_buf[3*i]," %02x", msg[i]);
|
||||
}
|
||||
sprintf(&temp_buf[3*i],"\n\r");
|
||||
bicc_asciout_proc(temp_buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2093
plat/bicc/src/bicc_fsm.c
Normal file
2093
plat/bicc/src/bicc_fsm.c
Normal file
File diff suppressed because it is too large
Load Diff
362
plat/bicc/src/bicc_ipbcp.c
Normal file
362
plat/bicc/src/bicc_ipbcp.c
Normal file
@@ -0,0 +1,362 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "./include/ipbcp.h"
|
||||
|
||||
int sdp_decode_orig(SdpOrig_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->username, token);
|
||||
strcat(dst_ptr->username, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->session_id, token);
|
||||
strcat(dst_ptr->session_id, "\0");
|
||||
break;
|
||||
case 3:
|
||||
sprintf(dst_ptr->version, token);
|
||||
strcat(dst_ptr->version, "\0");
|
||||
break;
|
||||
case 4:
|
||||
sprintf(dst_ptr->network_type, token);
|
||||
strcat(dst_ptr->network_type, "\0");
|
||||
break;
|
||||
case 5:
|
||||
sprintf(dst_ptr->address_type, token);
|
||||
strcat(dst_ptr->address_type, "\0");
|
||||
break;
|
||||
case 6:
|
||||
sprintf(dst_ptr->address, token);
|
||||
strcat(dst_ptr->address, "\0");
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 6)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_conn(SdpConn_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->network_type, token);
|
||||
strcat(dst_ptr->network_type, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->address_type, token);
|
||||
strcat(dst_ptr->address_type, "\0");
|
||||
break;
|
||||
case 3:
|
||||
sprintf(dst_ptr->address, token);
|
||||
strcat(dst_ptr->address, "\0");
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 3)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_time(SdpTime_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->start, token);
|
||||
strcat(dst_ptr->start, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->stop, token);
|
||||
strcat(dst_ptr->stop, "\0");
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 2)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_attrib(SdpAttrib_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
if(strstr(src_ptr, "ipbcp:") != src_ptr)
|
||||
return 0;
|
||||
src_ptr += strlen("ipbcp:");
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->version, token);
|
||||
strcat(dst_ptr->version, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->type, token);
|
||||
strcat(dst_ptr->type, "\0");
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 2)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_mediaAnn(SdpMediaAnn_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
while((token = strsep(&src_ptr, " ")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->media, token);
|
||||
strcat(dst_ptr->media, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->port, token);
|
||||
strcat(dst_ptr->port, "\0");
|
||||
break;
|
||||
case 3:
|
||||
sprintf(dst_ptr->transport, token);
|
||||
strcat(dst_ptr->transport, "\0");
|
||||
strcpy(dst_ptr->fmt_list, src_ptr);
|
||||
strcat(dst_ptr->fmt_list, "\0");
|
||||
break;
|
||||
case 4:
|
||||
// sprintf(dst_ptr->fmt_list, token);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(field_id < 4)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sdp_decode_mediaAtt(SdpMediaAtt_struct *dst_ptr, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
|
||||
if(strstr(src_ptr, "rtpmap:") != src_ptr)
|
||||
return 0;
|
||||
src_ptr += strlen("rtpmap:");
|
||||
while((token = strsep(&src_ptr, " /")) != NULL)
|
||||
{
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
sprintf(dst_ptr->payload, token);
|
||||
strcat(dst_ptr->payload, "\0");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(dst_ptr->encoding_name, token);
|
||||
strcat(dst_ptr->encoding_name, "\0");
|
||||
break;
|
||||
case 3:
|
||||
sprintf(dst_ptr->clock_rate, token);
|
||||
strcat(dst_ptr->clock_rate, "\0");
|
||||
break;
|
||||
case 4:
|
||||
// sprintf(dst_ptr->p_time, token);
|
||||
field_id --;//to avoid 4 fields
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(field_id != 3)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int sdp_decode_ptime(char* p_time, char *src_ptr)
|
||||
{
|
||||
char *token;
|
||||
if((token = strstr(src_ptr, "ptime:")) == NULL)
|
||||
return 0;
|
||||
token = strtok(token, ":");
|
||||
token = strtok(NULL, ":");
|
||||
// p_time = token;
|
||||
// if(strlen(token)<8)
|
||||
if(token)
|
||||
{
|
||||
sprintf(p_time, token);
|
||||
strcat(p_time, "\0");
|
||||
}
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
int ipbcp_decode(IPBCP_struct *ipbcp_ptr, const char *ptr)
|
||||
{
|
||||
char *token;
|
||||
unsigned char field_id = 0;
|
||||
char temp_ipbcp[200];
|
||||
char *temp_ptr;
|
||||
|
||||
strncpy(temp_ipbcp, ptr, 200);
|
||||
temp_ptr = temp_ipbcp;
|
||||
memset(ipbcp_ptr, 0, sizeof(IPBCP_struct));
|
||||
while((token = strsep(&temp_ptr, "\r\n")) != NULL)
|
||||
{
|
||||
if(strlen(token) == 0)
|
||||
continue;
|
||||
switch(++field_id)
|
||||
{
|
||||
case 1:
|
||||
if((token[0] != 'v') || (token[1] != '='))
|
||||
return 0;
|
||||
sprintf(ipbcp_ptr->proto_ver, token+2);
|
||||
strcat(ipbcp_ptr->proto_ver, "\0");
|
||||
break;
|
||||
case 2:
|
||||
if((token[0] != 'o') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_orig(&ipbcp_ptr->orig, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 3:
|
||||
if((token[0] != 's') || (token[1] != '='))
|
||||
return 0;
|
||||
sprintf(ipbcp_ptr->session_name, token+2);
|
||||
|
||||
strcat(ipbcp_ptr->session_name, "\0");
|
||||
break;
|
||||
case 4:
|
||||
if((token[0] != 'c') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_conn(&ipbcp_ptr->conn_data, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 5:
|
||||
if((token[0] != 't') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_time(&ipbcp_ptr->time, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 6:
|
||||
if((token[0] != 'a') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_attrib(&ipbcp_ptr->attrib, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 7:
|
||||
if((token[0] != 'm') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_mediaAnn(&ipbcp_ptr->m_ann, token+2))
|
||||
return 0;
|
||||
break;
|
||||
case 8:
|
||||
if((token[0] != 'a') || (token[1] != '='))
|
||||
return 0;
|
||||
if(sdp_decode_mediaAtt(&ipbcp_ptr->m_att, token+2))
|
||||
// return 0;
|
||||
;
|
||||
else if(!sdp_decode_ptime(ipbcp_ptr->ptime, token+2))
|
||||
return 0;
|
||||
|
||||
break;
|
||||
case 9:
|
||||
if((token[0] != 'a') || (token[1] != '='))
|
||||
return 0;
|
||||
if(!sdp_decode_ptime(ipbcp_ptr->ptime, token+2))
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ipbcp_encode(char *ptr, const IPBCP_struct *ipbcp_ptr)
|
||||
{
|
||||
char tmp_buf[128];
|
||||
|
||||
sprintf(ptr, "v=%s\r\n", ipbcp_ptr->proto_ver);
|
||||
|
||||
sprintf(tmp_buf, "o=%s %s %s %s %s %s\r\n",
|
||||
ipbcp_ptr->orig.username,
|
||||
ipbcp_ptr->orig.session_id,
|
||||
ipbcp_ptr->orig.version,
|
||||
ipbcp_ptr->orig.network_type,
|
||||
ipbcp_ptr->orig.address_type,
|
||||
ipbcp_ptr->orig.address);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "s=%s\r\n", ipbcp_ptr->session_name);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "c=%s %s %s\r\n",
|
||||
ipbcp_ptr->conn_data.network_type,
|
||||
ipbcp_ptr->conn_data.address_type,
|
||||
ipbcp_ptr->conn_data.address);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "t=%s %s\r\n", ipbcp_ptr->time.start, ipbcp_ptr->time.stop);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "a=ipbcp:%s %s\r\n", ipbcp_ptr->attrib.version, ipbcp_ptr->attrib.type);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
sprintf(tmp_buf, "m=%s %s %s %s\r\n",
|
||||
ipbcp_ptr->m_ann.media,
|
||||
ipbcp_ptr->m_ann.port,
|
||||
ipbcp_ptr->m_ann.transport,
|
||||
ipbcp_ptr->m_ann.fmt_list);
|
||||
strcat(ptr, tmp_buf);
|
||||
|
||||
if(strlen(ipbcp_ptr->m_att.payload) != 0)
|
||||
{
|
||||
sprintf(tmp_buf, "a=rtpmap:%s %s/%s\r\n",
|
||||
ipbcp_ptr->m_att.payload,
|
||||
ipbcp_ptr->m_att.encoding_name,
|
||||
ipbcp_ptr->m_att.clock_rate);
|
||||
strcat(ptr, tmp_buf);
|
||||
}
|
||||
//ipbcp_ptr->ptime[7]='\0';
|
||||
if((ipbcp_ptr->ptime[0] != '\0') && (strlen(ipbcp_ptr->ptime)<8))
|
||||
{
|
||||
sprintf(tmp_buf, "a=ptime:%s\r\n", ipbcp_ptr->ptime);
|
||||
strcat(ptr, tmp_buf);
|
||||
}
|
||||
return strlen(ptr);
|
||||
}
|
||||
1285
plat/bicc/src/bicc_msg.c
Normal file
1285
plat/bicc/src/bicc_msg.c
Normal file
File diff suppressed because it is too large
Load Diff
244
plat/bicc/src/bicc_prm.c
Normal file
244
plat/bicc/src/bicc_prm.c
Normal file
@@ -0,0 +1,244 @@
|
||||
#include "./include/inc.h"
|
||||
#include "./include/var_ext.h"
|
||||
#include "./include/q1902_3e.h"
|
||||
/**********************************************/
|
||||
/******* BICC Message&Primitive Mapping *******/
|
||||
/**********************************************/
|
||||
void app_msg2prm(AppTransM_struct *dst_ptr, AppTrans_struct *src_ptr)
|
||||
{
|
||||
dst_ptr->pres = src_ptr->pres;
|
||||
if(src_ptr->pres == 1)
|
||||
{
|
||||
memcpy(&dst_ptr->apm_info, &src_ptr->apm_info, sizeof(ApmUser_struct));
|
||||
dst_ptr->apm_info.sni = src_ptr->sni;
|
||||
dst_ptr->apm_info.rci = src_ptr->rci;
|
||||
}
|
||||
}
|
||||
|
||||
void app_prm2msg(AppTrans_struct *dst_ptr, AppTransM_struct *src_ptr)
|
||||
{
|
||||
dst_ptr->pres = src_ptr->pres;
|
||||
if(src_ptr->pres == 1)
|
||||
{
|
||||
dst_ptr->aci[0] = 0x00;
|
||||
dst_ptr->aci[1] = 0x00;
|
||||
dst_ptr->sni = src_ptr->apm_info.sni;
|
||||
dst_ptr->rci = src_ptr->apm_info.rci;
|
||||
dst_ptr->si = 0; //subsequent segment to first segment
|
||||
dst_ptr->segment = 0; //final segment
|
||||
dst_ptr->slr = 0;
|
||||
memcpy(&dst_ptr->apm_info, &src_ptr->apm_info, sizeof(ApmUser_struct));
|
||||
}
|
||||
}
|
||||
|
||||
void bicc_msg2prm(BiccReadPrim_union *prm_ptr, BiccMsg_union *msg_ptr, u8 msg_type)
|
||||
{
|
||||
memset(prm_ptr, 0, sizeof(BiccReadPrim_union));
|
||||
switch(msg_type)
|
||||
{
|
||||
case M_ACM:
|
||||
memcpy(&prm_ptr->alert_ind.backCall, &msg_ptr->acm.backCall, sizeof(BackCallInd_struct));
|
||||
app_msg2prm(&prm_ptr->alert_ind.app, &msg_ptr->acm.app);
|
||||
memcpy(&prm_ptr->alert_ind.cause, &msg_ptr->acm.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&prm_ptr->alert_ind.confTreat, &msg_ptr->acm.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->alert_ind.optBackCall, &msg_ptr->acm.optBackCall, sizeof(OptBackCallInd_struct));
|
||||
memcpy(&prm_ptr->alert_ind.utuInd, &msg_ptr->acm.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->alert_ind.utuInfo, &msg_ptr->acm.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_ANM:
|
||||
app_msg2prm(&prm_ptr->setup_cnf.app, &msg_ptr->anm.app);
|
||||
memcpy(&prm_ptr->setup_cnf.backCall, &msg_ptr->anm.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.confTreat, &msg_ptr->anm.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.connNum, &msg_ptr->anm.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.utuInd, &msg_ptr->anm.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.utuInfo, &msg_ptr->anm.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_APM:
|
||||
app_msg2prm(&prm_ptr->apm_ind.app, &msg_ptr->apm.app);
|
||||
break;
|
||||
case M_CPG:
|
||||
memcpy(&prm_ptr->cpg_ind.eventInfo, &msg_ptr->cpg.eventInfo, sizeof(EventInfo_struct));
|
||||
app_msg2prm(&prm_ptr->cpg_ind.app, &msg_ptr->cpg.app);
|
||||
memcpy(&prm_ptr->cpg_ind.backCall, &msg_ptr->cpg.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.calldiver,&msg_ptr->cpg.calldiver, sizeof(BiccCpg_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.cause, &msg_ptr->cpg.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.confTreat, &msg_ptr->cpg.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.connNum, &msg_ptr->cpg.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.utuInd, &msg_ptr->cpg.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->cpg_ind.utuInfo, &msg_ptr->cpg.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_CGB:
|
||||
memcpy(&prm_ptr->cgb_ind.cicGrpSpv, &msg_ptr->cgb.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&prm_ptr->cgb_ind.rangeStatus, &msg_ptr->cgb.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGBA:
|
||||
memcpy(&prm_ptr->cgb_cnf.cicGrpSpv, &msg_ptr->cgb.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&prm_ptr->cgb_cnf.rangeStatus, &msg_ptr->cgb.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGU:
|
||||
memcpy(&prm_ptr->cgu_ind.cicGrpSpv, &msg_ptr->cgu.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&prm_ptr->cgu_ind.rangeStatus, &msg_ptr->cgu.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGUA:
|
||||
memcpy(&prm_ptr->cgu_cnf.cicGrpSpv, &msg_ptr->cgu.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&prm_ptr->cgu_cnf.rangeStatus, &msg_ptr->cgu.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_GRS:
|
||||
memcpy(&prm_ptr->grs_ind.rangeStatus, &msg_ptr->grs.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_GRA:
|
||||
memcpy(&prm_ptr->grs_cnf.rangeStatus, &msg_ptr->grs.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CON:
|
||||
app_msg2prm(&prm_ptr->setup_cnf.app, &msg_ptr->con.app);
|
||||
memcpy(&prm_ptr->setup_cnf.backCall, &msg_ptr->con.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.confTreat, &msg_ptr->con.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.connNum, &msg_ptr->con.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.utuInd, &msg_ptr->con.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->setup_cnf.utuInfo, &msg_ptr->con.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_IAM:
|
||||
memcpy(&prm_ptr->setup_ind.natConn, &msg_ptr->iam.natConn, sizeof(NatConnInd_struct));
|
||||
memcpy(&prm_ptr->setup_ind.fwdCall, &msg_ptr->iam.fwdCall, sizeof(FwdCallInd_struct));
|
||||
memcpy(&prm_ptr->setup_ind.callingPtyCat, &msg_ptr->iam.callingPtyCat, sizeof(CallingPtyCat_struct));
|
||||
memcpy(&prm_ptr->setup_ind.transMedReq, &msg_ptr->iam.transMedReq, sizeof(TransMedReq_struct));
|
||||
memcpy(&prm_ptr->setup_ind.calledPtyNum, &msg_ptr->iam.calledPtyNum, sizeof(CalledPtyNum_struct));
|
||||
app_msg2prm(&prm_ptr->setup_ind.app, &msg_ptr->apm.app);
|
||||
memcpy(&prm_ptr->setup_ind.callingPtyNum, &msg_ptr->iam.callingPtyNum, sizeof(CallingPtyNum_struct));
|
||||
memcpy(&prm_ptr->setup_ind.collectCallReq, &msg_ptr->iam.collectCallReq, sizeof(CollectCallReq_struct));
|
||||
memcpy(&prm_ptr->setup_ind.confTreat, &msg_ptr->iam.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&prm_ptr->setup_ind.correlationId, &msg_ptr->iam.correlationId, sizeof(CorrelationId_struct));
|
||||
memcpy(&prm_ptr->setup_ind.origCalledNum, &msg_ptr->iam.origCalledNum, sizeof(OrigCalledNum_struct));
|
||||
memcpy(&prm_ptr->setup_ind.redirgNum, &msg_ptr->iam.redirgNum, sizeof(RedirgNum_struct));
|
||||
memcpy(&prm_ptr->setup_ind.redirInfo, &msg_ptr->iam.redirInfo, sizeof(RedirInfo_struct));
|
||||
memcpy(&prm_ptr->setup_ind.scfId, &msg_ptr->iam.scfId, sizeof(ScfId_struct));
|
||||
memcpy(&prm_ptr->setup_ind.utuInd, &msg_ptr->iam.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->setup_ind.utuInfo, &msg_ptr->iam.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_REL:
|
||||
memcpy(&prm_ptr->rel_ind.cause, &msg_ptr->rel.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&prm_ptr->rel_ind.utuInd, &msg_ptr->rel.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&prm_ptr->rel_ind.utuInfo, &msg_ptr->rel.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_RLC:
|
||||
memcpy(&prm_ptr->rel_cnf.cause, &msg_ptr->rlc.cause, sizeof(CauseInd_struct));
|
||||
break;
|
||||
case M_RES:
|
||||
memcpy(&prm_ptr->res_ind.susRes, &msg_ptr->res.susRes, sizeof(SusResInd_struct));
|
||||
break;
|
||||
case M_SUS:
|
||||
memcpy(&prm_ptr->sus_ind.susRes, &msg_ptr->sus.susRes, sizeof(SusResInd_struct));
|
||||
break;
|
||||
case M_SAM:
|
||||
memcpy(&prm_ptr->info_ind.subseqNum, &msg_ptr->sam.subseqNum, sizeof(SubseqNum_struct));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void bicc_prm2msg(BiccMsg_union *msg_ptr, BiccWritePrim_union *prm_ptr, u8 msg_type)
|
||||
{
|
||||
memset(msg_ptr, 0, sizeof(BiccMsg_union));
|
||||
switch(msg_type)
|
||||
{
|
||||
case M_ACM:
|
||||
memcpy(&msg_ptr->acm.backCall, &prm_ptr->alert_req.backCall, sizeof(BackCallInd_struct));
|
||||
app_prm2msg(&msg_ptr->acm.app, &prm_ptr->alert_req.app);
|
||||
memcpy(&msg_ptr->acm.cause, &prm_ptr->alert_req.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&msg_ptr->acm.confTreat, &prm_ptr->alert_req.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->acm.optBackCall, &prm_ptr->alert_req.optBackCall, sizeof(OptBackCallInd_struct));
|
||||
memcpy(&msg_ptr->acm.utuInd, &prm_ptr->alert_req.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->acm.utuInfo, &prm_ptr->alert_req.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_ANM:
|
||||
app_prm2msg(&msg_ptr->anm.app, &prm_ptr->setup_rsp.app);
|
||||
memcpy(&msg_ptr->anm.backCall, &prm_ptr->setup_rsp.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&msg_ptr->anm.confTreat, &prm_ptr->setup_rsp.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->anm.connNum, &prm_ptr->setup_rsp.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&msg_ptr->anm.utuInd, &prm_ptr->setup_rsp.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->anm.utuInfo, &prm_ptr->setup_rsp.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_APM:
|
||||
app_prm2msg(&msg_ptr->apm.app, &prm_ptr->apm_req.app);
|
||||
break;
|
||||
case M_CPG:
|
||||
memcpy(&msg_ptr->cpg.eventInfo, &prm_ptr->cpg_req.eventInfo, sizeof(EventInfo_struct));
|
||||
app_prm2msg(&msg_ptr->cpg.app, &prm_ptr->cpg_req.app);
|
||||
memcpy(&msg_ptr->cpg.backCall, &prm_ptr->cpg_req.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&msg_ptr->cpg.calldiver, &prm_ptr->cpg_req.calldiver, sizeof(BiccCpg_struct));
|
||||
memcpy(&msg_ptr->cpg.cause, &prm_ptr->cpg_req.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&msg_ptr->cpg.confTreat, &prm_ptr->cpg_req.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->cpg.connNum, &prm_ptr->cpg_req.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&msg_ptr->cpg.utuInd, &prm_ptr->cpg_req.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->cpg.utuInfo, &prm_ptr->cpg_req.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_CGB:
|
||||
memcpy(&msg_ptr->cgb.cicGrpSpv, &prm_ptr->cgb_req.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&msg_ptr->cgb.rangeStatus, &prm_ptr->cgb_req.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGBA:
|
||||
memcpy(&msg_ptr->cgb.cicGrpSpv, &prm_ptr->cgb_rsp.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&msg_ptr->cgb.rangeStatus, &prm_ptr->cgb_rsp.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGU:
|
||||
memcpy(&msg_ptr->cgu.cicGrpSpv, &prm_ptr->cgu_req.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&msg_ptr->cgu.rangeStatus, &prm_ptr->cgu_req.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CGUA:
|
||||
memcpy(&msg_ptr->cgu.cicGrpSpv, &prm_ptr->cgu_rsp.cicGrpSpv, sizeof(CicGrpSpv_struct));
|
||||
memcpy(&msg_ptr->cgu.rangeStatus, &prm_ptr->cgu_rsp.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_GRS:
|
||||
memcpy(&msg_ptr->grs.rangeStatus, &prm_ptr->grs_req.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_GRA:
|
||||
memcpy(&msg_ptr->grs.rangeStatus, &prm_ptr->grs_rsp.rangeStatus, sizeof(RangeStatus_struct));
|
||||
break;
|
||||
case M_CON:
|
||||
app_prm2msg(&msg_ptr->con.app, &prm_ptr->setup_rsp.app);
|
||||
memcpy(&msg_ptr->con.backCall, &prm_ptr->setup_rsp.backCall, sizeof(BackCallInd_struct));
|
||||
memcpy(&msg_ptr->con.confTreat, &prm_ptr->setup_rsp.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->con.connNum, &prm_ptr->setup_rsp.connNum, sizeof(ConnNum_struct));
|
||||
memcpy(&msg_ptr->con.utuInd, &prm_ptr->setup_rsp.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->con.utuInfo, &prm_ptr->setup_rsp.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_IAM:
|
||||
memcpy(&msg_ptr->iam.natConn, &prm_ptr->setup_req.natConn, sizeof(NatConnInd_struct));
|
||||
memcpy(&msg_ptr->iam.fwdCall, &prm_ptr->setup_req.fwdCall, sizeof(FwdCallInd_struct));
|
||||
memcpy(&msg_ptr->iam.callingPtyCat, &prm_ptr->setup_req.callingPtyCat, sizeof(CallingPtyCat_struct));
|
||||
memcpy(&msg_ptr->iam.transMedReq, &prm_ptr->setup_req.transMedReq, sizeof(TransMedReq_struct));
|
||||
memcpy(&msg_ptr->iam.calledPtyNum, &prm_ptr->setup_req.calledPtyNum, sizeof(CalledPtyNum_struct));
|
||||
app_prm2msg(&msg_ptr->iam.app, &prm_ptr->setup_req.app);
|
||||
memcpy(&msg_ptr->iam.callingPtyNum, &prm_ptr->setup_req.callingPtyNum, sizeof(CallingPtyNum_struct));
|
||||
memcpy(&msg_ptr->iam.collectCallReq, &prm_ptr->setup_req.collectCallReq, sizeof(CollectCallReq_struct));
|
||||
memcpy(&msg_ptr->iam.confTreat, &prm_ptr->setup_req.confTreat, sizeof(ConfTreatInd_struct));
|
||||
memcpy(&msg_ptr->iam.correlationId, &prm_ptr->setup_req.correlationId, sizeof(CorrelationId_struct));
|
||||
memcpy(&msg_ptr->iam.origCalledNum, &prm_ptr->setup_req.origCalledNum, sizeof(OrigCalledNum_struct));
|
||||
memcpy(&msg_ptr->iam.redirgNum, &prm_ptr->setup_req.redirgNum, sizeof(RedirgNum_struct));
|
||||
memcpy(&msg_ptr->iam.redirInfo, &prm_ptr->setup_req.redirInfo, sizeof(RedirInfo_struct));
|
||||
memcpy(&msg_ptr->iam.scfId, &prm_ptr->setup_req.scfId, sizeof(ScfId_struct));
|
||||
memcpy(&msg_ptr->iam.utuInd, &prm_ptr->setup_req.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->iam.utuInfo, &prm_ptr->setup_req.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_REL:
|
||||
memcpy(&msg_ptr->rel.cause, &prm_ptr->rel_req.cause, sizeof(CauseInd_struct));
|
||||
memcpy(&msg_ptr->rel.utuInd, &prm_ptr->rel_req.utuInd, sizeof(UserToUserInd_struct));
|
||||
memcpy(&msg_ptr->rel.utuInfo, &prm_ptr->rel_req.utuInfo, sizeof(UserToUserInfo_struct));
|
||||
break;
|
||||
case M_RLC:
|
||||
memcpy(&msg_ptr->rlc.cause, &prm_ptr->rel_rsp.cause, sizeof(CauseInd_struct));
|
||||
break;
|
||||
case M_RES:
|
||||
memcpy(&msg_ptr->res.susRes, &prm_ptr->res_req.susRes, sizeof(SusResInd_struct));
|
||||
break;
|
||||
case M_SUS:
|
||||
memcpy(&msg_ptr->sus.susRes, &prm_ptr->sus_req.susRes, sizeof(SusResInd_struct));
|
||||
break;
|
||||
case M_SAM:
|
||||
memcpy(&msg_ptr->sam.subseqNum, &prm_ptr->info_req.subseqNum, sizeof(SubseqNum_struct));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
1080
plat/bicc/src/biccif.c
Normal file
1080
plat/bicc/src/biccif.c
Normal file
File diff suppressed because it is too large
Load Diff
25
plat/bicc/src/include/bicc_debug.h
Normal file
25
plat/bicc/src/include/bicc_debug.h
Normal 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, ...);
|
||||
417
plat/bicc/src/include/biccif.h
Normal file
417
plat/bicc/src/include/biccif.h
Normal 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
|
||||
|
||||
34
plat/bicc/src/include/define.h
Normal file
34
plat/bicc/src/include/define.h
Normal 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
|
||||
|
||||
162
plat/bicc/src/include/inc.h
Normal file
162
plat/bicc/src/include/inc.h
Normal 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
|
||||
|
||||
60
plat/bicc/src/include/ipbcp.h
Normal file
60
plat/bicc/src/include/ipbcp.h
Normal 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
|
||||
456
plat/bicc/src/include/q1902_3e.h
Normal file
456
plat/bicc/src/include/q1902_3e.h
Normal 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
|
||||
|
||||
100
plat/bicc/src/include/q765_5e.h
Normal file
100
plat/bicc/src/include/q765_5e.h
Normal 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
|
||||
|
||||
14
plat/bicc/src/include/var_ext.h
Normal file
14
plat/bicc/src/include/var_ext.h
Normal 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
|
||||
Reference in New Issue
Block a user