This commit is contained in:
zhangsz
2025-03-03 11:01:26 +08:00
parent 5f1710dc22
commit dae6fc93f7
1057 changed files with 519829 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# Makefile create for XAPP Test
# Create by liuwei
cc = gcc
#CFLAG = -g -Wall -c -DVMS_UNDER_DEVELOP
CFLAG = -g -Wall -c
LIB_DIR = ../..
XAPP_TEST_OBJ = xapp_main.o xapp_op_test.o xapp_coding_test.o
PUBLIC_LIB = -L$(LIB_DIR)/public -lpublic
MTP3_LIB = -L$(LIB_DIR)/mtp3 -lmtp3
DEBUG_LIB = -L$(LIB_DIR)/debug -ldebug
SNMP_LIB = -L$(LIB_DIR)/snmp -lsnmp
SCCP_LIB = -L$(LIB_DIR)/sccp -lsccp
TCAP_LIB = -L$(LIB_DIR)/tcap -ltcap
XAPP_LIB = -L$(LIB_DIR)/xapp -lxapp
IPTRANS_LIB = -L$(LIB_DIR)/iptrans -liptrans
xapp_test: $(XAPP_TEST_OBJ)
$(cc) -o xapp_test $(XAPP_TEST_OBJ) $(DEBUG_LIB) $(IPTRANS_LIB) $(SNMP_LIB) $(MTP3_LIB) $(SCCP_LIB) $(TCAP_LIB) $(XAPP_LIB) $(PUBLIC_LIB) -lm -lz
xapp_main.o: xapp_main.c
$(cc) $(CFLAG) xapp_main.c
xapp_op_test.o : xapp_op_test.c
$(cc) $(CFLAG) xapp_op_test.c
xapp_coding_test.o : xapp_coding_test.c
$(cc) $(CFLAG) xapp_coding_test.c
run:
cd .. ; rm -f *.a
cd ../mapp;make;cd ..
cd ../capp;make;cd ..
cd .. ;make;
rm -f xapp_test ; make
clean:
cd ../ ;make clean
rm -f *.o *.a *.bak core xapp_test
backup:

Binary file not shown.

View File

@@ -0,0 +1,179 @@
K 25
svn:wc:ra_dav:version-url
V 58
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf
END
hae_sys.conf
K 25
svn:wc:ra_dav:version-url
V 71
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/hae_sys.conf
END
cc_table.conf
K 25
svn:wc:ra_dav:version-url
V 72
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/cc_table.conf
END
map_operation.conf
K 25
svn:wc:ra_dav:version-url
V 77
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/map_operation.conf
END
map_acn.conf
K 25
svn:wc:ra_dav:version-url
V 71
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/map_acn.conf
END
help_page
K 25
svn:wc:ra_dav:version-url
V 68
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/help_page
END
ppsConf.txt
K 25
svn:wc:ra_dav:version-url
V 70
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/ppsConf.txt
END
smsc_sys.conf
K 25
svn:wc:ra_dav:version-url
V 72
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/smsc_sys.conf
END
hlr_parambit.conf
K 25
svn:wc:ra_dav:version-url
V 76
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/hlr_parambit.conf
END
HlrSysPara
K 25
svn:wc:ra_dav:version-url
V 69
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/HlrSysPara
END
wxc2exit.txt
K 25
svn:wc:ra_dav:version-url
V 71
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/wxc2exit.txt
END
xap_sysparam.conf
K 25
svn:wc:ra_dav:version-url
V 76
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/xap_sysparam.conf
END
xapp_test.conf
K 25
svn:wc:ra_dav:version-url
V 73
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/xapp_test.conf
END
system.ini.30K
K 25
svn:wc:ra_dav:version-url
V 73
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/system.ini.30K
END
system.inimscvlrhlr
K 25
svn:wc:ra_dav:version-url
V 78
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/system.inimscvlrhlr
END
menu_page
K 25
svn:wc:ra_dav:version-url
V 68
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/menu_page
END
profile
K 25
svn:wc:ra_dav:version-url
V 66
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/profile
END
.sccp.conf.swo
K 25
svn:wc:ra_dav:version-url
V 73
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/.sccp.conf.swo
END
system.ini
K 25
svn:wc:ra_dav:version-url
V 69
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/system.ini
END
smsc_csta.conf
K 25
svn:wc:ra_dav:version-url
V 73
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/smsc_csta.conf
END
iptrans.conf
K 25
svn:wc:ra_dav:version-url
V 71
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/iptrans.conf
END
wxc2_sys.conf
K 25
svn:wc:ra_dav:version-url
V 72
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/wxc2_sys.conf
END
conv_prefix.conf
K 25
svn:wc:ra_dav:version-url
V 75
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/conv_prefix.conf
END
mtp3.conf
K 25
svn:wc:ra_dav:version-url
V 68
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/mtp3.conf
END
cap_operation.conf
K 25
svn:wc:ra_dav:version-url
V 77
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/cap_operation.conf
END
conf.rar
K 25
svn:wc:ra_dav:version-url
V 67
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/conf.rar
END
cap_acn.conf
K 25
svn:wc:ra_dav:version-url
V 71
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/cap_acn.conf
END
smsc_parambit.conf
K 25
svn:wc:ra_dav:version-url
V 77
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/smsc_parambit.conf
END
sccp.conf
K 25
svn:wc:ra_dav:version-url
V 68
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/sccp.conf
END
system.ini.100k
K 25
svn:wc:ra_dav:version-url
V 74
/svn/wxc2/!svn/ver/1/trunk/R4S/plat/xapp/ut/xapp_test/conf/system.ini.100k
END

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,8 @@
#application context name configure file for CAP
total data length=4
#application context name data
No.1:50 00 // gsmSSF to gsmSCF
No.2:51 02 // assist handoff gsmSSF to gsmSCF
No.3:52 02 // gsmSRF to gsmSCF
No.4:128 02 // gsmSRF to gsmSCF

View File

@@ -0,0 +1,36 @@
# operation code configure file for CAP
total data length=32
#operation code
No.1:00 04 5 // initial DP
No.2:16 02 5 // assist request instructions
No.3:17 02 20 // establish temporary connection
No.4:18 04 5 // disconnect forward connection
No.5:19 04 5 // connect to resource
No.6:20 04 5 // connect
No.7:22 04 5 // release call
No.8:23 04 5 // request report BCSM event
No.9:24 04 5 // event report BCSM
No.10:31 04 5 // continue
No.11:33 04 5 // reset timer
No.12:34 04 5 // furnish charging information
No.13:35 04 5 // apply charging
No.14:36 04 5 // apply charging report
No.15:44 04 5 // call information report
No.16:45 04 5 // call information request
No.17:46 04 5 // send charging information
No.18:47 04 60 // play announcement
No.19:48 01 60 // prompt and collect user information
No.20:49 04 5 // specialized resource report
No.21:53 04 5 // cancel
No.22:55 04 5 // activity test
No.23:60 04 5 // initial DPSMS
No.24:61 04 5 // Furnishing charging info.SMS
No.25:62 04 5 // connect DPSMS
No.26:63 04 5 // request SMS event
No.27:64 04 5 // event report SMS
No.28:65 04 5 // continue SMS
No.29:66 04 5 // release DPSMS
No.30:67 04 5 // reset timer DPSMS
No.31:176 04 5 // VPS to PPS
No.32:177 04 5 // PPS to VPS

View File

@@ -0,0 +1,215 @@
# Country code table configure file
#List the country code
0086; // China
0001; // Canada & USA
0007; // Kazakhstan & Kirighzia & Kyrgyzstan & Russia & Sakhalin & Tajikistan & Uzbekistan
0020; // Egypt
0027; // South Africa
0030; // Greece
0031; // Netherlands
0036; // Hungary
0039; // Italy
0040; // Bomania
0041; // Switzerland
0042; // Czech Republic & Slovakia
0043; // Austria
0044; // United Kingdom
0045; // Denmark
0046; // Sweden
0047; // Norway
0048; // Poland
0049; // Germany
0051; // Peru
0052; // South Korea
0053; // Cuba
0054; // Argentina
0055; // Brazil
0056; // Chile
0057; // Colombia
0058; // Venezuela
0060; // Malaysia
0061; // Australia
0062; // Indonesia
0063; // Philippines
0064; // New Zealand
0065; // Singapore
0066; // Thailand
0081; // Japan
0084; // Vietnam
0090; // Turkey
0091; // India
0092; // Pakistan
0093; // Afghanistan
0094; // Sri Lanka
0095; // Myanmar (Burma)
0098; // Iran
0212; // Morocco
0213; // Algeria
0216; // Tunisia
0218; // Libya
0220; // Gambia
0221; // Senegal Republic
0222; // Mauritania
0223; // Mali Republic
0224; // Guinea
0225; // Ivory Coast
0226; // Burkina Faso
0227; // Niger
0228; // Togo
0229; // Benin
0230; // Mauritius
0231; // Liberia
0232; // Sierra Leone
0233; // Ghana
0234; // Nigeria
0235; // Chad Republic
0236; // Central Africa Republic
0237; // Cameroon
0239; // Sao Tome
0240; // Equatorial Guinea
0241; // Gabon
0242; // Congo
0243; // Zaire
0244; // Angola
0245; // Guinea Bissau
0246; // Diego Garcia
0247; // Ascension Islands
0248; // Seychelles
0249; // Sudan
0250; // Rwanda
0251; // Ethiopia
0252; // Somalia
0253; // Djibouti
0254; // Kenya
0255; // Tanzania
0256; // Uganda
0257; // Burundi
0258; // Mozambigue
0259; // Zanzibar
0260; // Zambia
0261; // Madagascar
0262; // Reunion Island
0263; // Zimbabwe
0264; // Namibia
0265; // Malawi
0266; // Lesotho
0267; // Botswana
0268; // Swaziland
0269; // Comoros
0290; // St.Helena
0291; // Eritrea
0297; // Aruba
0298; // Faeroe Islands
0299; // Greenland
#2696 // Mayotte Island
0321; // Belgium
0331; // France
0339; // Monaco
0349; // Spain
0350; // Gibraltar
0351; // Portugal
0352; // Luxembourg
0353; // Ireland
0354; // Iceland
0355; // Albania
0356; // Malta
0357; // Cyprus
0358; // Finland
0359; // Bulgaria
0370; // Lithuania
0371; // Latvia
0372; // Estonia
0373; // Moldova
0374; // Armenia
0375; // Belarus
0376; // Andorra
0380; // Ukraine
0381; // Yugoslavia
0385; // Croatia
0386; // Slovenia
0387; // Bosnia Herzegovina
0389; // Macedonia
0395; // San Marino
0396; // Vatican City
0417; // Liechtenstein
0500; // Falkland Islands
0501; // Belize
0502; // Guatemala
0503; // EI Salvador
0504; // Honduras
0505; // Nicaragua
0506; // Costa Rica
0507; // Panama
0508; // St.Pierre
0509; // Haiti
0521; // Mexico Band 1
0522; // Mexico Band 2
0523; // Mexico Band 3
0524; // Mexico Band 4
0525; // Mexico Band 5
0526; // Mexico Band 6
0527; // Mexico Band 7
0528; // Mexico Band 8
0590; // Guadeloupe
0591; // Bolivia
0592; // Ecuador & Guyana
0594; // French Guiana
0595; // Paraguay
0596; // French Antilles
0597; // Suriname
0598; // Uruguay
0599; // Netherlands Antilles
#5399 // Guantanamo Bay
0670; // Saipan
0671; // Guam
0672; // Antarctica(Casey) & Antarctica(Scott) & Christmas/Cocos
0673; // Brunei
0674; // Nauru
0675; // Papau New Guinea
0676; // Tonga
0677; // Solomon Islands
0678; // Vanuatu
0679; // Fiji Islands
0680; // Palau
0681; // Wallis/Futuna
0682; // Cook Island
0683; // Niue Island
0684; // American Samoa
0685; // West Samoa
0686; // Kiribati
0687; // New Caledonia
0688; // Tuvalu Islands
0689; // French Polynesia
0691; // Micronesia
0692; // Marshall Islands
#6723 // Norfolk Island
0787; // Puerto Rico
0809; // Anguilla & Antigua & Bahamas & Barbados & Bermuda......
0850; // North Korea
0852; // Hong Kong
0853; // Macao
0855; // Cambodia
0856; // Laos
0868; // Trinidad/Tobago
0880; // Bangladesh
0886; // Taiwan
0960; // Maldives
0961; // Lebanon
0962; // Jordan
0963; // Syria
0964; // Iraq
0965; // Kuwait
0966; // Saudi Arabia
0967; // Yemen Arab Rep.
0968; // Oman
0971; // United Arab Emirates
0972; // Israel
0973; // Bahrain
0974; // Qatar
0975; // Bhutan
0976; // Mongolia
0977; // Nepal
0994; // Azerbaijan
0995; // Georgia

View File

@@ -0,0 +1,6 @@
#HLR/AUC/EIR system configure file
#IP info of SMSC
hlr-0=172.18.234.1;
#hlr-1=172.18.133.1;
hlr-1=172.54.240.147;

View File

@@ -0,0 +1,20 @@
******************
* HELP PAGE *
******************
Welcome to DEBUG MONITOR.
Press 's' or 'S' to enter "SUB MODULE SELECTION PAGE".
In "SUB MODULE SELECTION PAGE",
Press 'x' or 'X' to return "HELP PAGE",
Press 'a-p' or 'A-P' to select sub module.
In each sub module, Press '0-9' and 'a-f' to select pages.
There are two methods to use Debug,
1. Serial Port, use PC-to-PC serial line.
2. Telnet, use "telnet dst_host_ip 4965".
$

View File

@@ -0,0 +1,17 @@
#ipconfig for pps
#port=type,num,interface
#type=UDP/TCP
#num=0-6
#interface=BUFFER/DIRECT
4950=UDP,6,DIRECT
4952=UDP,2,BUFFER
4953=UDP,3,BUFFER
4954=UDP,3,BUFFER
4955=UDP,3,BUFFER
4957=UDP,4,BUFFER
4960=UDP,3,BUFFER
4965=TCP,3,BUFFER
4969=UDP,3,BUFFER
4970=UDP,3,BUFFER
4971=UDP,2,BUFFER
4972=UDP,2,BUFFER

View File

@@ -0,0 +1,42 @@
#application context name configure file
total data length=36
#application context name data
No.1:01 03 // network location update
No.2:02 03 // location cancel
No.3:03 03 // roaming number enquiry
No.4:05 03 // location info retrieval
No.5:10 02 // reset context
No.6:11 02 // handover control
No.7:13 02 // equipment management
No.8:14 02 // info retrieval
No.9:15 02 // inter VLR info retrieval
No.10:16 03 // subscriber data management
No.11:17 03 // tracing
No.12:18 02 // network functional SS
No.13:19 02 // network unstructured SS
No.14:20 03 // short message gateway
No.15:21 03 // short message MO relay
No.16:23 02 // short message alert
No.17:24 03 // short message waiting data management
No.18:25 03 // mobile terminating short message relay
No.19:26 02 // imsi retrieval
No.20:27 03 // MS purging
No.21:28 03 // subscriber info enquiry
No.22:29 03 // any time info enquiry
No.23:06 03 // call control transfer
No.24:36 03 // invocation notification
No.25:12 03 // sIWFS allocation
No.26:31 03 // group call control
No.27:32 03 // GPRS location update
No.28:33 03 // GPRS location info retrieval
No.29:34 03 // failure report
No.30:35 03 // GPRS notify
No.31:07 03 // reporting
No.32:08 03 // call completion
No.33:200 02 // security triplets (MAP-H defined by Meng Xiaozhen)
No.34:201 02 // subscriber interrogate (MAP-H defined by Meng Xiaozhen)
No.35:202 02 // HLR subscriber management (MAP-H defined by Meng Xiaozhen)
No.36:203 02 // HLR ping AUC (MAP-H defined by Meng Xiaozhen reserved)
NO.37:09 01 // Send parameter

View File

@@ -0,0 +1,76 @@
# operation code configure file
total data length=72
#operation code
No.1:02 01 20 // update location
No.2:03 01 10 // cancel location
No.3:67 01 20 // purge mobile station
No.4:55 01 05 // send identification
No.5:68 01 20 // prepare handover
No.6:29 03 108000 // send end signal
No.7:33 04 05 // process access signalling
No.8:34 04 05 // forward access signalling
No.9:69 01 20 // prepare subsequent handover
No.10:56 01 20 // send authentication info
No.11:43 01 20 // check IMEI
No.12:07 01 20 // insert subscriber data
No.13:08 01 20 // delete subscriber data
No.14:37 04 20 // reset
No.15:38 04 20 // forward check ss indication
No.16:57 01 20 // restore data
No.17:50 01 20 // active trace mode
No.18:51 01 20 // deactive trace mode
No.19:58 01 20 // send imsi
No.20:22 01 20 // send routing info
No.21:04 01 20 // provide roaming number
No.22:06 01 20 // resume call handling
No.23:31 01 20 // provide SIWFS number
No.24:32 01 20 // SIWFS signalling modify
No.25:73 01 20 // set report state
No.26:74 01 20 // status report
No.27:75 01 60 // remote user free
No.28:10 01 20 // register ss
No.29:11 01 20 // erase ss
No.30:12 01 20 // activate ss
No.31:13 01 20 // deactivate ss
No.32:14 01 20 // interrogate ss
No.33:59 01 600 // process unstructure ss request
No.34:60 01 60 // unstructure ss request
No.35:61 01 60 // unstructure ss notify
No.36:17 01 60 // register password
No.37:18 03 20 // get password
No.38:76 01 20 // register cc entry
No.39:77 01 20 // erase cc entry
No.40:45 01 20 // send routing info for sm
No.41:46 01 60 // mo forward sm
No.42:44 01 60 // mt forward sm
No.43:47 01 05 // report sm delivery status
No.44:63 04 05 // inform service centre
No.45:64 01 05 // alert service center
No.46:66 01 05 // ready for sm
No.47:70 01 20 // provider subscriber info
No.48:71 01 20 // any time interrogation
No.49:72 01 20 // ss invocatin notification
No.50:39 01 20 // prepare group call
No.51:40 03 108000 // send group call end signal
No.52:41 04 05 // process group call signalling
No.53:42 04 05 // forward group call signalling
No.54:23 01 20 // update GPRS location
No.55:24 01 20 // send routing info for GPRS
No.56:25 01 20 // failure report
No.57:26 01 20 // note ms present for GPRS
No.58:200 01 05 // security triplets (MAP-H defined by Meng Xiaozhen)
No.59:201 01 05 // interrogate subscriber (MAP-H defined by Meng Xiaozhen)
No.60:202 01 05 // hlr create subscriber (MAP-H defined by Meng Xiaozhen)
No.61:203 01 05 // hlr delete subscriber (MAP-H defined by Meng Xiaozhen)
No.62:204 01 05 // hlr ping auc (MAP-H defined by Meng Xiaozhen reserved)
No.63:09 01 20 // send parameters
No.64:48 01 20 // not subscriber present
No.65:19 01 20 // process unstructure SS data
No.66:54 01 20 // beging subscriber activity
No.67:28 01 20 // perform handover
No.68:30 01 20 // perform subsequence handvoer
No.69:35 01 20 // note internal handover
No.70:54 01 20 // beging subscriber activity
No.71:49 01 20 // alert service center without result
No.72:52 01 20 // trace subscriber activity

View File

@@ -0,0 +1,13 @@
*******************
* MENU PAGE *
*******************
a -- IPTR i -- HLR
b -- MTP3 j -- SMSC
c -- SCCP k -- PPS
d -- TCAP l -- SNMP
e -- XAPP m --
f -- MSC n -- DEBUG
g -- VLR o -- AUC
h -- p -- EIR

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
# /etc/profile
# System wide environment and startup programs
# Functions and aliases go in /etc/bashrc
PATH=".:$PATH:/sbin:/usr/sbin:/usr/X11R6/bin:/etc/rc.d/init.d:/usr/local/wxc2/bin"
PATH=/usr/java/jdk1.3/bin:$PATH
ulimit -c 80000
if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
umask 002
else
umask 022
fi
USER=`id -un`
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
JAVA_COMPILER=javacomp ; export JAVA_COMPILER
LD_LIBRARY_PATH=/usr/local/mysql/lib ; export LD_LIBRARY_PATH
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do
if [ -x $i ]; then
. $i
fi
done
unset i
PATH=/usr/local/wxc2/bin:$PATH

View File

@@ -0,0 +1,26 @@
#SCCP Config file (R8V0_03)
[Local Node]
#ssn NetID msisdn ip0 ip1
4 2 - 172.18.128.1 172.18.129.1
6 2 8675557122002 172.18.199.1 -
7 2 8675557122001 172.18.198.1 -
8 2 8675599999999 172.18.234.3 172.18.99.1
9 2 86755920005 172.18.132.1 172.18.99.1
10 2 86755920004 172.18.132.1 172.18.99.1
11 2 86755920006 172.18.132.1 172.18.99.1
19 2 86755920007 172.18.132.1 172.18.99.1
20 2 86755920008 172.18.132.1 172.18.99.1
21 2 86755920009 172.18.132.1 172.18.99.1
22 2 867559000213 172.18.132.1 -
146 2 86755920011 172.18.132.1 172.18.99.1
147 2 86755920010 172.18.132.1 172.18.99.1
254 2 - 172.18.132.1 172.18.99.1
[GTT_Table]
#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep
0 6 460020000000000 460029999999999 2 000028 6 0 7
#1 1 8675590000000 8675599999998 2 000028 6 0 7
[RL_SSN]
#NetID DPC SSN

View File

@@ -0,0 +1,21 @@
# This file defines the SMSC CSTA row
# The max number of row is 20
# Attention: When you want to define the Entity name, the name of "MS" "All" and "Other" is reserved
# define the entity who send short message to SMSC
Receive from:
MS
PPS
VMS
#VMS+PPS
Other
#All
# define the entity who receive short message from SMSC
Send to:
MS
PPS
VMS
#VMS+PPS
Other
#All

View File

@@ -0,0 +1,5 @@
#SMSC system configure file
#IP info of SMSC
wxc2-0=172.18.98.1;
wxc2-1=172.18.99.1;

View File

@@ -0,0 +1 @@
pps-1=172.18.98.1;

View File

@@ -0,0 +1,4 @@
WXC2 procedure exit log
Time: Fri Nov 5 05:27:51 2004
Now module: MSC

View File

@@ -0,0 +1,2 @@
172.18.199.1
2000

Binary file not shown.

View File

@@ -0,0 +1,8 @@
#application context name configure file for CAP
total data length=4
#application context name data
No.1:50 00 // gsmSSF to gsmSCF
No.2:51 02 // assist handoff gsmSSF to gsmSCF
No.3:52 02 // gsmSRF to gsmSCF
No.4:128 02 // gsmSRF to gsmSCF

View File

@@ -0,0 +1,36 @@
# operation code configure file for CAP
total data length=32
#operation code
No.1:00 04 5 // initial DP
No.2:16 02 5 // assist request instructions
No.3:17 02 20 // establish temporary connection
No.4:18 04 5 // disconnect forward connection
No.5:19 04 5 // connect to resource
No.6:20 04 5 // connect
No.7:22 04 5 // release call
No.8:23 04 5 // request report BCSM event
No.9:24 04 5 // event report BCSM
No.10:31 04 5 // continue
No.11:33 04 5 // reset timer
No.12:34 04 5 // furnish charging information
No.13:35 04 5 // apply charging
No.14:36 04 5 // apply charging report
No.15:44 04 5 // call information report
No.16:45 04 5 // call information request
No.17:46 04 5 // send charging information
No.18:47 04 60 // play announcement
No.19:48 01 60 // prompt and collect user information
No.20:49 04 5 // specialized resource report
No.21:53 04 5 // cancel
No.22:55 04 5 // activity test
No.23:60 04 5 // initial DPSMS
No.24:61 04 5 // Furnishing charging info.SMS
No.25:62 04 5 // connect DPSMS
No.26:63 04 5 // request SMS event
No.27:64 04 5 // event report SMS
No.28:65 04 5 // continue SMS
No.29:66 04 5 // release DPSMS
No.30:67 04 5 // reset timer DPSMS
No.31:176 04 5 // VPS to PPS
No.32:177 04 5 // PPS to VPS

View File

@@ -0,0 +1,215 @@
# Country code table configure file
#List the country code
0086; // China
0001; // Canada & USA
0007; // Kazakhstan & Kirighzia & Kyrgyzstan & Russia & Sakhalin & Tajikistan & Uzbekistan
0020; // Egypt
0027; // South Africa
0030; // Greece
0031; // Netherlands
0036; // Hungary
0039; // Italy
0040; // Bomania
0041; // Switzerland
0042; // Czech Republic & Slovakia
0043; // Austria
0044; // United Kingdom
0045; // Denmark
0046; // Sweden
0047; // Norway
0048; // Poland
0049; // Germany
0051; // Peru
0052; // South Korea
0053; // Cuba
0054; // Argentina
0055; // Brazil
0056; // Chile
0057; // Colombia
0058; // Venezuela
0060; // Malaysia
0061; // Australia
0062; // Indonesia
0063; // Philippines
0064; // New Zealand
0065; // Singapore
0066; // Thailand
0081; // Japan
0084; // Vietnam
0090; // Turkey
0091; // India
0092; // Pakistan
0093; // Afghanistan
0094; // Sri Lanka
0095; // Myanmar (Burma)
0098; // Iran
0212; // Morocco
0213; // Algeria
0216; // Tunisia
0218; // Libya
0220; // Gambia
0221; // Senegal Republic
0222; // Mauritania
0223; // Mali Republic
0224; // Guinea
0225; // Ivory Coast
0226; // Burkina Faso
0227; // Niger
0228; // Togo
0229; // Benin
0230; // Mauritius
0231; // Liberia
0232; // Sierra Leone
0233; // Ghana
0234; // Nigeria
0235; // Chad Republic
0236; // Central Africa Republic
0237; // Cameroon
0239; // Sao Tome
0240; // Equatorial Guinea
0241; // Gabon
0242; // Congo
0243; // Zaire
0244; // Angola
0245; // Guinea Bissau
0246; // Diego Garcia
0247; // Ascension Islands
0248; // Seychelles
0249; // Sudan
0250; // Rwanda
0251; // Ethiopia
0252; // Somalia
0253; // Djibouti
0254; // Kenya
0255; // Tanzania
0256; // Uganda
0257; // Burundi
0258; // Mozambigue
0259; // Zanzibar
0260; // Zambia
0261; // Madagascar
0262; // Reunion Island
0263; // Zimbabwe
0264; // Namibia
0265; // Malawi
0266; // Lesotho
0267; // Botswana
0268; // Swaziland
0269; // Comoros
0290; // St.Helena
0291; // Eritrea
0297; // Aruba
0298; // Faeroe Islands
0299; // Greenland
#2696 // Mayotte Island
0321; // Belgium
0331; // France
0339; // Monaco
0349; // Spain
0350; // Gibraltar
0351; // Portugal
0352; // Luxembourg
0353; // Ireland
0354; // Iceland
0355; // Albania
0356; // Malta
0357; // Cyprus
0358; // Finland
0359; // Bulgaria
0370; // Lithuania
0371; // Latvia
0372; // Estonia
0373; // Moldova
0374; // Armenia
0375; // Belarus
0376; // Andorra
0380; // Ukraine
0381; // Yugoslavia
0385; // Croatia
0386; // Slovenia
0387; // Bosnia Herzegovina
0389; // Macedonia
0395; // San Marino
0396; // Vatican City
0417; // Liechtenstein
0500; // Falkland Islands
0501; // Belize
0502; // Guatemala
0503; // EI Salvador
0504; // Honduras
0505; // Nicaragua
0506; // Costa Rica
0507; // Panama
0508; // St.Pierre
0509; // Haiti
0521; // Mexico Band 1
0522; // Mexico Band 2
0523; // Mexico Band 3
0524; // Mexico Band 4
0525; // Mexico Band 5
0526; // Mexico Band 6
0527; // Mexico Band 7
0528; // Mexico Band 8
0590; // Guadeloupe
0591; // Bolivia
0592; // Ecuador & Guyana
0594; // French Guiana
0595; // Paraguay
0596; // French Antilles
0597; // Suriname
0598; // Uruguay
0599; // Netherlands Antilles
#5399 // Guantanamo Bay
0670; // Saipan
0671; // Guam
0672; // Antarctica(Casey) & Antarctica(Scott) & Christmas/Cocos
0673; // Brunei
0674; // Nauru
0675; // Papau New Guinea
0676; // Tonga
0677; // Solomon Islands
0678; // Vanuatu
0679; // Fiji Islands
0680; // Palau
0681; // Wallis/Futuna
0682; // Cook Island
0683; // Niue Island
0684; // American Samoa
0685; // West Samoa
0686; // Kiribati
0687; // New Caledonia
0688; // Tuvalu Islands
0689; // French Polynesia
0691; // Micronesia
0692; // Marshall Islands
#6723 // Norfolk Island
0787; // Puerto Rico
0809; // Anguilla & Antigua & Bahamas & Barbados & Bermuda......
0850; // North Korea
0852; // Hong Kong
0853; // Macao
0855; // Cambodia
0856; // Laos
0868; // Trinidad/Tobago
0880; // Bangladesh
0886; // Taiwan
0960; // Maldives
0961; // Lebanon
0962; // Jordan
0963; // Syria
0964; // Iraq
0965; // Kuwait
0966; // Saudi Arabia
0967; // Yemen Arab Rep.
0968; // Oman
0971; // United Arab Emirates
0972; // Israel
0973; // Bahrain
0974; // Qatar
0975; // Bhutan
0976; // Mongolia
0977; // Nepal
0994; // Azerbaijan
0995; // Georgia

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,6 @@
#HLR/AUC/EIR system configure file
#IP info of SMSC
hlr-0=172.18.234.1;
#hlr-1=172.18.133.1;
hlr-1=172.54.240.147;

View File

@@ -0,0 +1,20 @@
******************
* HELP PAGE *
******************
Welcome to DEBUG MONITOR.
Press 's' or 'S' to enter "SUB MODULE SELECTION PAGE".
In "SUB MODULE SELECTION PAGE",
Press 'x' or 'X' to return "HELP PAGE",
Press 'a-p' or 'A-P' to select sub module.
In each sub module, Press '0-9' and 'a-f' to select pages.
There are two methods to use Debug,
1. Serial Port, use PC-to-PC serial line.
2. Telnet, use "telnet dst_host_ip 4965".
$

Binary file not shown.

View File

@@ -0,0 +1,17 @@
#ipconfig for pps
#port=type,num,interface
#type=UDP/TCP
#num=0-6
#interface=BUFFER/DIRECT
4950=UDP,6,DIRECT
4952=UDP,2,BUFFER
4953=UDP,3,BUFFER
4954=UDP,3,BUFFER
4955=UDP,3,BUFFER
4957=UDP,4,BUFFER
4960=UDP,3,BUFFER
4965=TCP,3,BUFFER
4969=UDP,3,BUFFER
4970=UDP,3,BUFFER
4971=UDP,2,BUFFER
4972=UDP,2,BUFFER

View File

@@ -0,0 +1,42 @@
#application context name configure file
total data length=36
#application context name data
No.1:01 03 // network location update
No.2:02 03 // location cancel
No.3:03 03 // roaming number enquiry
No.4:05 03 // location info retrieval
No.5:10 02 // reset context
No.6:11 02 // handover control
No.7:13 02 // equipment management
No.8:14 02 // info retrieval
No.9:15 02 // inter VLR info retrieval
No.10:16 03 // subscriber data management
No.11:17 03 // tracing
No.12:18 02 // network functional SS
No.13:19 02 // network unstructured SS
No.14:20 03 // short message gateway
No.15:21 03 // short message MO relay
No.16:23 02 // short message alert
No.17:24 03 // short message waiting data management
No.18:25 03 // mobile terminating short message relay
No.19:26 02 // imsi retrieval
No.20:27 03 // MS purging
No.21:28 03 // subscriber info enquiry
No.22:29 03 // any time info enquiry
No.23:06 03 // call control transfer
No.24:36 03 // invocation notification
No.25:12 03 // sIWFS allocation
No.26:31 03 // group call control
No.27:32 03 // GPRS location update
No.28:33 03 // GPRS location info retrieval
No.29:34 03 // failure report
No.30:35 03 // GPRS notify
No.31:07 03 // reporting
No.32:08 03 // call completion
No.33:200 02 // security triplets (MAP-H defined by Meng Xiaozhen)
No.34:201 02 // subscriber interrogate (MAP-H defined by Meng Xiaozhen)
No.35:202 02 // HLR subscriber management (MAP-H defined by Meng Xiaozhen)
No.36:203 02 // HLR ping AUC (MAP-H defined by Meng Xiaozhen reserved)
NO.37:09 01 // Send parameter

View File

@@ -0,0 +1,76 @@
# operation code configure file
total data length=72
#operation code
No.1:02 01 20 // update location
No.2:03 01 10 // cancel location
No.3:67 01 20 // purge mobile station
No.4:55 01 05 // send identification
No.5:68 01 20 // prepare handover
No.6:29 03 108000 // send end signal
No.7:33 04 05 // process access signalling
No.8:34 04 05 // forward access signalling
No.9:69 01 20 // prepare subsequent handover
No.10:56 01 20 // send authentication info
No.11:43 01 20 // check IMEI
No.12:07 01 20 // insert subscriber data
No.13:08 01 20 // delete subscriber data
No.14:37 04 20 // reset
No.15:38 04 20 // forward check ss indication
No.16:57 01 20 // restore data
No.17:50 01 20 // active trace mode
No.18:51 01 20 // deactive trace mode
No.19:58 01 20 // send imsi
No.20:22 01 20 // send routing info
No.21:04 01 20 // provide roaming number
No.22:06 01 20 // resume call handling
No.23:31 01 20 // provide SIWFS number
No.24:32 01 20 // SIWFS signalling modify
No.25:73 01 20 // set report state
No.26:74 01 20 // status report
No.27:75 01 60 // remote user free
No.28:10 01 20 // register ss
No.29:11 01 20 // erase ss
No.30:12 01 20 // activate ss
No.31:13 01 20 // deactivate ss
No.32:14 01 20 // interrogate ss
No.33:59 01 600 // process unstructure ss request
No.34:60 01 60 // unstructure ss request
No.35:61 01 60 // unstructure ss notify
No.36:17 01 60 // register password
No.37:18 03 20 // get password
No.38:76 01 20 // register cc entry
No.39:77 01 20 // erase cc entry
No.40:45 01 20 // send routing info for sm
No.41:46 01 60 // mo forward sm
No.42:44 01 60 // mt forward sm
No.43:47 01 05 // report sm delivery status
No.44:63 04 05 // inform service centre
No.45:64 01 05 // alert service center
No.46:66 01 05 // ready for sm
No.47:70 01 20 // provider subscriber info
No.48:71 01 20 // any time interrogation
No.49:72 01 20 // ss invocatin notification
No.50:39 01 20 // prepare group call
No.51:40 03 108000 // send group call end signal
No.52:41 04 05 // process group call signalling
No.53:42 04 05 // forward group call signalling
No.54:23 01 20 // update GPRS location
No.55:24 01 20 // send routing info for GPRS
No.56:25 01 20 // failure report
No.57:26 01 20 // note ms present for GPRS
No.58:200 01 05 // security triplets (MAP-H defined by Meng Xiaozhen)
No.59:201 01 05 // interrogate subscriber (MAP-H defined by Meng Xiaozhen)
No.60:202 01 05 // hlr create subscriber (MAP-H defined by Meng Xiaozhen)
No.61:203 01 05 // hlr delete subscriber (MAP-H defined by Meng Xiaozhen)
No.62:204 01 05 // hlr ping auc (MAP-H defined by Meng Xiaozhen reserved)
No.63:09 01 20 // send parameters
No.64:48 01 20 // not subscriber present
No.65:19 01 20 // process unstructure SS data
No.66:54 01 20 // beging subscriber activity
No.67:28 01 20 // perform handover
No.68:30 01 20 // perform subsequence handvoer
No.69:35 01 20 // note internal handover
No.70:54 01 20 // beging subscriber activity
No.71:49 01 20 // alert service center without result
No.72:52 01 20 // trace subscriber activity

View File

@@ -0,0 +1,13 @@
*******************
* MENU PAGE *
*******************
a -- IPTR i -- HLR
b -- MTP3 j -- SMSC
c -- SCCP k -- PPS
d -- TCAP l -- SNMP
e -- XAPP m --
f -- MSC n -- DEBUG
g -- VLR o -- AUC
h -- p -- EIR

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,37 @@
# /etc/profile
# System wide environment and startup programs
# Functions and aliases go in /etc/bashrc
PATH=".:$PATH:/sbin:/usr/sbin:/usr/X11R6/bin:/etc/rc.d/init.d:/usr/local/wxc2/bin"
PATH=/usr/java/jdk1.3/bin:$PATH
ulimit -c 80000
if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
umask 002
else
umask 022
fi
USER=`id -un`
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
JAVA_COMPILER=javacomp ; export JAVA_COMPILER
LD_LIBRARY_PATH=/usr/local/mysql/lib ; export LD_LIBRARY_PATH
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do
if [ -x $i ]; then
. $i
fi
done
unset i
PATH=/usr/local/wxc2/bin:$PATH

View File

@@ -0,0 +1,26 @@
#SCCP Config file (R8V0_03)
[Local Node]
#ssn NetID msisdn ip0 ip1
4 2 - 172.18.128.1 172.18.129.1
6 2 8675557122002 172.18.199.1 -
7 2 8675557122001 172.18.198.1 -
8 2 8675599999999 172.18.234.3 172.18.99.1
9 2 86755920005 172.18.132.1 172.18.99.1
10 2 86755920004 172.18.132.1 172.18.99.1
11 2 86755920006 172.18.132.1 172.18.99.1
19 2 86755920007 172.18.132.1 172.18.99.1
20 2 86755920008 172.18.132.1 172.18.99.1
21 2 86755920009 172.18.132.1 172.18.99.1
22 2 867559000213 172.18.132.1 -
146 2 86755920011 172.18.132.1 172.18.99.1
147 2 86755920010 172.18.132.1 172.18.99.1
254 2 - 172.18.132.1 172.18.99.1
[GTT_Table]
#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep
0 6 460020000000000 460029999999999 2 000028 6 0 7
#1 1 8675590000000 8675599999998 2 000028 6 0 7
[RL_SSN]
#NetID DPC SSN

View File

@@ -0,0 +1,21 @@
# This file defines the SMSC CSTA row
# The max number of row is 20
# Attention: When you want to define the Entity name, the name of "MS" "All" and "Other" is reserved
# define the entity who send short message to SMSC
Receive from:
MS
PPS
VMS
#VMS+PPS
Other
#All
# define the entity who receive short message from SMSC
Send to:
MS
PPS
VMS
#VMS+PPS
Other
#All

Binary file not shown.

View File

@@ -0,0 +1,5 @@
#SMSC system configure file
#IP info of SMSC
wxc2-0=172.18.98.1;
wxc2-1=172.18.99.1;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
pps-1=172.18.98.1;

View File

@@ -0,0 +1,4 @@
WXC2 procedure exit log
Time: Fri Nov 5 05:27:51 2004
Now module: MSC

Binary file not shown.

View File

@@ -0,0 +1,2 @@
172.18.199.1
2000

View File

@@ -0,0 +1,652 @@
/* XAPP coding test function c file */
/* created by Liu Wei 2006-01-13 */
/* Version 1.0 */
/* ------------------------------------- */
#include "xapp_coding_test.h"
#include "xapp_main.h"
CAP_Message CAP_Com_OpenResponse = {
{0, 16}
,
CAP_FLAG,
{0, 0, 0}
,
{0, 0, 0}
,
CAP_O_OPEN, //CAP_O_OPEN,
CAP_RESPONSE, //RESPONSE,
{2, //RESULT=accept
1, //
1, //acn tag
2, //len
50, //acn
2, //acn version
0,} //end flag
};
CAP_Message CAP_Com_End = {
{0, 12}
,
CAP_FLAG,
{0, 0, 0}
,
{0, 0, 0}
,
CAP_O_END, //CAP_O_END,
CAP_REQUEST, //REQUEST,
{1, //release method
0, //optional part
0,}
};
int bcd_hton(BYTE * netbcd, const BYTE * hostbcd, BYTE max_octet)
{
int i;
BYTE bcd_h, bcd_l;
for(i = 0; i < max_octet; i++)
{
if((bcd_h = hostbcd[i] >> 4) == 0x0f)
return i * 2;
else if((bcd_l = hostbcd[i] & 0x0f) == 0x0f)
{
netbcd[i] = bcd_h & 0x0f;
return i * 2 + 1;
}
else
netbcd[i] = (bcd_l << 4) | bcd_h;
}
return i * 2;
}
/* end by "F" */
int bcd_ntoh(BYTE * hostbcd, const BYTE * netbcd, BYTE max_octet)
{
int i;
int bcd_h, bcd_l;
for(i = 0; i < max_octet; i++)
{
if((bcd_h = netbcd[i] & 0x0f) == 0x0f)
{
memset(&hostbcd[i], 0xff, max_octet - i);
return i * 2;
}
else if((bcd_l = netbcd[i] >> 4) == 0x0f)
{
hostbcd[i] = (bcd_h << 4) | 0x0f;
memset(&hostbcd[i + 1], 0xff, max_octet - i - 1);
return i * 2 + 1;
}
else
{
hostbcd[i] = (bcd_h << 4) | bcd_l;
}
}
return i * 2;
}
void isdn_aton(u8 *normal_isdn,u8 *anti_isdn)
{
u8 ii;
u8 aa=0,bb=0;
u8 isdn_len;
isdn_len = anti_isdn[0];
if (isdn_len > ISDN_LEN)
isdn_len = ISDN_LEN;
normal_isdn[0] = anti_isdn[1];
for (ii = 1;ii < isdn_len;ii ++)
{
if ((anti_isdn[ii+1] & 0x0f) >= 0x0e)
break;
aa = (anti_isdn[ii+1] & 0x0f0) >> 4;
if (aa > 0x0c)
aa = 0x0e;
bb = anti_isdn[ii+1] & 0x0f;
normal_isdn[ii] = (bb << 4) + aa;
}
for (;ii < ISDN_LEN;ii ++)
normal_isdn[ii] = 0x0ee;
}
void imsi_aton(u8 *normal_imsi,u8 *anti_imsi)
{ // the IMSI must 15 digits
u8 ii;
u8 aa,bb=0;
normal_imsi[0] = 0;
for (ii = 0;ii < IMSI_LEN*2;ii++)
{
if ((ii % 2) == 1)
{
aa = anti_imsi[ii/2] & 0x0f;
normal_imsi[ii/2] |= aa;
}
else
{
if (ii/2 != IMSI_LEN -1)
{
bb = anti_imsi[ii/2] & 0x0f0;
normal_imsi[ii/2+1] = bb;
}
}
}
}
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
/* transfer IMSI format from normal to anti sequence */
/* 0460022157127001 --> 64002251177200f1 */
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
void imsi_ntoa(u8 *anti_imsi,u8 *normal_imsi)
{
u8 ii;
u8 aa,bb=0;
for (ii = 1;ii <= IMSI_LEN*2;ii++)
{
if ((ii % 2) == 1)
bb = normal_imsi[ii/2] & 0x0f;
else
{
if (ii == IMSI_LEN * 2)
aa = 0x0f0;
else
aa = normal_imsi[ii/2] & 0x0f0;
anti_imsi[ii/2-1] = aa | bb;
}
}
}
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
/* transfer IMSI format from normal to ascii string */
/* 0460022157127001 --> "460022157127001" */
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
void imsi_ntos(u8 *str_imsi,u8 *normal_imsi)
{
u8 len;
u8 ii,jj;
str_imsi[0] = (normal_imsi[0] & 0x0f) + '0';
len = 1;
for (ii = 1;ii < IMSI_LEN;ii ++)
{
jj = (normal_imsi[ii] >> 4) & 0x0f;
str_imsi[len++] = jj + '0';
jj = normal_imsi[ii] & 0x0f;
str_imsi[len++] = jj + '0';
}
str_imsi[len] = '\0';
}
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
/* transfer IMSI format from ascii string to normal */
/* "460022157127001" --> 0460022157127001 */
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
void imsi_ston(u8 *normal_imsi,u8 *str_imsi)
{
if (strlen(str_imsi) != IMSI_LEN*2-1)
return;
normal_imsi[0] = str_imsi[0] - '0';
AsciiToBcd(normal_imsi+1,str_imsi+1,IMSI_LEN*2-2);
}
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
/* transfer ISDN format from normal to ascii string */
/* 918675557127001EEE --> "8675557127001" */
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
void isdn_ntos(u8 *str_isdn,u8 *normal_isdn)
{
u8 len = 0;
u8 ii,jj;
for (ii = 1;ii < ISDN_LEN;ii ++)
{
jj = (normal_isdn[ii] >> 4) & 0x0f;
if (jj > 0x0c)
break;
str_isdn[len++] = jj + '0';
jj = normal_isdn[ii] & 0x0f;
if (jj > 0x0c)
break;
str_isdn[len++] = jj + '0';
}
str_isdn[len] = '\0';
}
void isdn_ntoa(u8 * anti_isdn, u8 * normal_isdn)
{
u8 ii;
u8 aa = 0, bb = 0;
u8 len;
anti_isdn[1] = normal_isdn[0]; // nature of address and numbering plan indicator
len = 1;
for(ii = 1; ii < ISDN_LEN; ii++)
{
if(normal_isdn[ii] == 0xee)
break;
else
{
aa = (normal_isdn[ii] & 0x0f0) >> 4;
bb = normal_isdn[ii] & 0x0f;
if(bb > 0x0c)
bb = 0x0f;
anti_isdn[ii + 1] = (bb << 4) + aa;
len++;
}
}
anti_isdn[0] = len;
}
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
/* transfer ISDN format from ascii string to normal */
/* "8675557127001" --> 918675557127001EEE */
/* return value: 0--string has error; 1--success */
/* +++++++++++++++++++++++++++++++++++++++++++++++++ */
u8 isdn_ston(u8 *normal_isdn,u8 *str_isdn)
{
u8 ii;
u8 len;
len = strlen(str_isdn);
if (len > ISDN_LEN*2-2)
return 0;
if ((len % 2) == 1) // odd number
{
AsciiToBcd(normal_isdn+1,str_isdn,len-1);
ii = len/2 + 1;
normal_isdn[ii] = (str_isdn[len-1] - '0') << 4;
normal_isdn[ii] |= 0x0E;
}
else
{
AsciiToBcd(normal_isdn+1,str_isdn,len);
ii = len/2;
}
memset(normal_isdn+ii+1,0xEE,ISDN_LEN-ii-1);
normal_isdn[0] = 0x91; // default value
return 1;
}
u8 set_gtai_isdn(u8 * gtai, u8 * isdn)
{
u8 temp_buf[32];
u8 ii;
u8 len;
isdn_ntoa(temp_buf, isdn);
ii = temp_buf[0];
memcpy(gtai, temp_buf + 2, ii - 1);
if((temp_buf[ii] & 0x0f0) == 0x0f0)
len = ii * 2 - 3;
else
len = ii * 2 - 2;
return len;
}
void xapp_set_sccpadd(u8 ssn, u8 * gtt_num, struct SCCP_ADDRESS *sccp_add)
{
sccp_add->DPC = 0; // set SCCP address
sccp_add->NetID = 4;
sccp_add->SSN = ssn;
sccp_add->RI = 0;
sccp_add->GTI = 0x04;
sccp_add->TT = 0;
sccp_add->NAI = 4;
sccp_add->NP = 1; // MSISDN
sccp_add->len = set_gtai_isdn(sccp_add->GTAI, gtt_num);
}
u8 get_mapp_open(struct MapComSrv_struct *com_ptr, u8 ssn)
{
u8 data_flow[1024];
if(!map_get_open(data_flow, ssn))
return 0;
if(!map_com_ftos(com_ptr, data_flow))
return 0;
printf("-->>: Recv OpenInd !\r\n");
return 1;
}
u8 send_mapp_comdata(struct MapComSrv_struct * com_ptr, u8 DelimiterFlag)
{
u8 data_flow[1024];
map_com_stof(com_ptr, data_flow, DelimiterFlag);
return map_send_comdata(data_flow);
}
u8 recv_mapp_comdata(struct MapComSrv_struct * com_ptr, u32 did)
{
u8 data_flow[1024];
if(!map_get_comdata(data_flow, did))
return 0;
if(!map_com_ftos(com_ptr, data_flow))
return 0;
return 1;
}
int send_mapp_oprdata(struct MapOprData_struct *opr_ptr, u8 DelimiterFlag)
{
u8 data_flow[1024];
map_opr_stof(opr_ptr, data_flow, DelimiterFlag);
return map_send_oprdata(data_flow);
}
int recv_mapp_oprdata(struct MapOprData_struct *opr_ptr, u32 did)
{
u8 data_flow[1024];
if(!map_get_oprdata(data_flow, did))
return 0;
if(!map_opr_ftos(opr_ptr, data_flow))
return 0;
return 1;
}
int send_mapp_open_req(WORD dialog_id)
{
struct MapComSrv_struct map_com;
map_com.message_type = MAP_OPEN;
map_com.message_flag = MAP_REQUEST;
map_com.port_id = 0;
map_com.dialogue_id = test_xapp.did;
map_com.dlg_list.open_arg.acn_data.acn = 0;
map_com.dlg_list.open_arg.acn_data.acn_ver = 1;
memcpy(&map_com.dlg_list.open_arg.local_add, &test_xapp.local_add, sizeof(SCCP_ADDR));
memcpy(&map_com.dlg_list.open_arg.peer_add, &test_xapp.peer_add, sizeof(SCCP_ADDR));
map_com.dlg_list.open_arg.param_flag = 0x0b;
send_mapp_comdata(&map_com, 1);
printf("<<--: Send OpenReq !\r\n");
return 1;
}
int send_mapp_open_conf()
{
struct MapComSrv_struct map_com;
struct MapOpen_Res *open_res;
map_com.message_type = MAP_OPEN;
map_com.message_flag = MAP_RESPONSE;
map_com.port_id = 0;
map_com.dialogue_id = test_xapp.did;
map_com.dlg_list.open_arg.acn_data.acn = 0;
map_com.dlg_list.open_arg.acn_data.acn_ver = 1;
memcpy(&map_com.dlg_list.open_arg.local_add, &test_xapp.local_add, sizeof(SCCP_ADDR));
memcpy(&map_com.dlg_list.open_arg.peer_add, &test_xapp.peer_add, sizeof(SCCP_ADDR));
open_res = (MapOpen_Res *) & map_com.dlg_list.open_res;
open_res->result = OpenResultAccept;
open_res->param_flag = 0x08;
if(send_mapp_comdata(&map_com, 1))
{
printf("<<--: Send OpenConf !\r\n");
return 1;
}
return 0;
}
int send_mapp_close(WORD dialog_id)
{
struct MapComSrv_struct map_com;
map_com.message_type = MAP_CLOSE;
map_com.message_flag = MAP_REQUEST;
map_com.port_id = 0;
map_com.dialogue_id = test_xapp.did;
map_com.dlg_list.open_arg.acn_data.acn_ver = 1;
memcpy(&map_com.dlg_list.open_arg.local_add, &test_xapp.local_add, sizeof(SCCP_ADDR));
memcpy(&map_com.dlg_list.open_arg.peer_add, &test_xapp.peer_add, sizeof(SCCP_ADDR));
map_com.dlg_list.close_arg.release_method = NormalRelease;
map_com.dlg_list.close_arg.param_flag = 0x01;
send_mapp_comdata(&map_com, 1);
printf("<<--: Send Close !\r\n");
return 1;
}
u8 get_capp_open(struct MapComSrv_struct * com_ptr, u8 ssn)
{
u8 data_flow[1024];
if(!cap_get_open(data_flow, ssn))
return 0;
if(!cap_com_ftos(com_ptr, data_flow))
return 0;
printf("-->>: Recv OpenInd !\r\n");
return 1;
}
u8 send_capp_comdata(struct MapComSrv_struct * com_ptr, u8 DelimiterFlag)
{
u8 data_flow[1024];
cap_com_stof(com_ptr, data_flow, DelimiterFlag);
return cap_send_comdata(data_flow);
}
u8 recv_capp_comdata(struct MapComSrv_struct * com_ptr, u32 did)
{
u8 data_flow[1024];
if(!cap_get_comdata(data_flow, did))
return 0;
if(!cap_com_ftos(com_ptr, data_flow))
return 0;
return 1;
}
int send_capp_oprdata(struct MapOprData_struct *opr_ptr, u8 DelimiterFlag)
{
u8 data_flow[1024];
cap_opr_stof(opr_ptr, data_flow, DelimiterFlag);
return cap_send_oprdata(data_flow);
}
int recv_capp_oprdata(struct MapOprData_struct *opr_ptr, u32 did)
{
u8 data_flow[1024];
if(!cap_get_oprdata(data_flow, did))
return 0;
if(!cap_opr_ftos(opr_ptr, data_flow))
return 0;
return 1;
}
/*
u8 send_capp_oprdata(CAP_Message *pcapmsg , u8 len)
{
pcapmsg->msgOperaCode = test_xapp.operation_type;
pcapmsg->msgServiceCode = 0x8a;
pcapmsg->msgOperaType = MAP_REQUEST;
pcapmsg->msgContent[0] = test_xapp.invoke_id;
pcapmsg->msgContent[1] = 1; //pointer to paramter
pcapmsg->msgContent[2] = 1; //Tag of parameter
pcapmsg->msgContent[3] = 0; //length1
pcapmsg->msgContent[4] = len; //length2
pcapmsg->msgContent[5 + len] = 0x10; //delimiter
pcapmsg->msgContent[6 + len] = 0;
pcapmsg->msgContent[7 + len] = 0;
pcapmsg->msgLength[0] = 0;
pcapmsg->msgLength[1] = 17 + len;
if(!cap_send_oprdata((char *)pcapmsg))
{
return 0;
}
return 1;
}
u8 recv_capp_oprdata(CAP_Message *capmsg , u32 did)
{
return cap_get_oprdata((unsigned char *)capmsg, did);
}
*/
int send_capp_open_req(unsigned char acn, unsigned char acn_v, unsigned short dlgid)
{
struct MapComSrv_struct map_com;
map_com.message_type = CAP_O_OPEN;
map_com.message_flag = CAP_REQUEST;
map_com.port_id = 0;
map_com.dialogue_id = test_xapp.did;
map_com.dlg_list.open_arg.acn_data.acn = acn;
map_com.dlg_list.open_arg.acn_data.acn_ver = 1;
memcpy(&map_com.dlg_list.open_arg.local_add, &test_xapp.local_add, sizeof(SCCP_ADDR));
memcpy(&map_com.dlg_list.open_arg.peer_add, &test_xapp.peer_add, sizeof(SCCP_ADDR));
map_com.dlg_list.open_arg.param_flag = 0x0b;
send_capp_comdata(&map_com, 1);
printf("<<--: Send OpenReq !\r\n");
return 1;
}
void send_capp_open_conf(unsigned char acn, unsigned char acn_v, unsigned short dlgid)
{
CAP_Message capmsg;
memcpy(&capmsg, &CAP_Com_OpenResponse, 18);
capmsg.dialogue_id[0] = dlgid >> 8;
capmsg.dialogue_id[1] = dlgid;
capmsg.msgContent[4] = acn;
capmsg.msgContent[5] = acn_v;
cap_send_comdata((unsigned char *)&capmsg);
}
void send_capp_close(unsigned short dlgid)
{
CAP_Message capmsg;
memcpy(&capmsg, &CAP_Com_End, 14);
capmsg.dialogue_id[0] = dlgid >> 8;
capmsg.dialogue_id[1] = dlgid;
cap_send_comdata((unsigned char *)&capmsg);
}
int build_xapp_msg()
{
if(test_xapp.xapp_type)
{
int len;
struct CapArg *cap_opr;
struct MapOprData_struct *data_ptr;
u8 buf[1024];
cap_opr = &test_xapp.xapp.capp.cap_opr;
data_ptr = &test_xapp.xapp.capp.data_ptr;
data_ptr->port_id = cap_opr->port_id;
data_ptr->dialogue_id = cap_opr->dialogue_id;
data_ptr->invoke_id = cap_opr->invoke_id;
data_ptr->message_type = cap_opr->ocode;
data_ptr->message_flag = cap_opr->message_flag;
data_ptr->param_flag = 0x1f;
len = encode_capmsg(*cap_opr, buf, MAX_MAPPOPR_LEN);
if(len == 0 || len > MAX_MAPPOPR_LEN)
return 0;
data_ptr->param_len = len;
memcpy(data_ptr->param, buf, len);
data_ptr->param_flag |= 0x20;
return len;
}
else
{
struct MapOprData_struct *data_ptr;
struct MapOprSrv_struct *srv_ptr;
int len;
u8 buf[1024];
data_ptr = &test_xapp.xapp.mapp.data_ptr;
srv_ptr = &test_xapp.xapp.mapp.map_opr;
data_ptr->port_id = srv_ptr->port_id;
data_ptr->dialogue_id = srv_ptr->dialogue_id;
data_ptr->invoke_id = srv_ptr->invoke_id;
data_ptr->message_type = srv_ptr->message_type;
data_ptr->message_flag = srv_ptr->message_flag;
//data_ptr->linked_id =1;
data_ptr->param_flag = 0x1f;
len = build_mapparam(srv_ptr, buf);
if(len == 0 || len > MAX_MAPPOPR_LEN)
return 0;
data_ptr->param_len = len;
memcpy(data_ptr->param, buf, len);
data_ptr->param_flag |= 0x20;
return len;
}
return 0;
}
int extract_xapp_msg()
{
if(test_xapp.xapp_type)
{
int len;
struct CapArg *cap_opr;
struct MapOprData_struct *data_ptr;
data_ptr = &test_xapp.xapp.capp.data_ptr;
cap_opr = &test_xapp.xapp.capp.cap_opr;
cap_opr->port_id = data_ptr->port_id;
cap_opr->dialogue_id = data_ptr->dialogue_id;
cap_opr->invoke_id = data_ptr->invoke_id;
cap_opr->ocode = data_ptr->message_type;
cap_opr->message_flag = data_ptr->message_flag;
decode_capmsg(data_ptr->param, data_ptr->param_len, cap_opr->ocode, cap_opr->message_flag, cap_opr);
return len;
}
else
{
struct MapOprData_struct *data_ptr;
struct MapOprSrv_struct *srv_ptr;
data_ptr = &test_xapp.xapp.mapp.data_ptr;
srv_ptr = &test_xapp.xapp.mapp.map_opr;
srv_ptr->port_id = data_ptr->port_id;
srv_ptr->dialogue_id = data_ptr->dialogue_id;
srv_ptr->invoke_id = data_ptr->invoke_id;
srv_ptr->message_type = data_ptr->message_type;
srv_ptr->message_flag = data_ptr->message_flag;
if(!(data_ptr->param_flag & 0x20)) // has not parameter
return RER;
extract_mapparam(srv_ptr, data_ptr->message_type, data_ptr->message_flag, data_ptr->param_len, data_ptr->param);
return ROK;
}
return RER;
}
void extract_sri()
{
struct MapOprSrv_struct opr_ptr;
u8 opr_code = SndRoutInfo;
u8 opr_flag = MAP_CONFIRM;
u32 pre_param_len= 21;
u8 *pre_param;
u8 buf[256],temp_buf[256];
u8 str[256]="A313890864009200000083F10407916857951230F7";
Str2Bcd( buf ,str ,pre_param_len );
Bcd2Str_Space(temp_buf, str,pre_param_len);
printf("\r\nextract code :[%d] len :[%ld]\r\n%s\r\n",opr_code,pre_param_len,str);
pre_param = (u8*)&buf;
opr_ptr.version =3;
extract_mapparam( &opr_ptr, opr_code , opr_flag , pre_param_len , pre_param );
}

View File

@@ -0,0 +1,105 @@
/* XAPP coding test function head file */
/* created by Liu Wei 2006-01-13 */
/* Version 1.0 */
/* ------------------------------------- */
#include "xapp_main.h"
#ifndef _XAPP_CODING_TEST_
#define _XAPP_CODING_TEST_
struct mapp_struct
{
struct MapOprSrv_struct map_opr;
struct MapOprData_struct data_ptr;
//struct MapOprData_struct data_ptr_bak;
struct MapComSrv_struct com_ptr;
};
typedef struct _CAP_Message
{
unsigned char msgLength[2]; /* unsigned char0 is the higher part */
unsigned char msgServiceCode; /* fixed as 0xAF */
unsigned char port_id[3]; /* unsigned char 0 is the higher part,unsigned char 1 is the lower part ,and unsigned char 2 is reserved */
unsigned char dialogue_id[3];
unsigned char msgOperaCode; /* message type code ,e.g , InitialDP = 0x00 */
unsigned char msgOperaType; /* 1/2/3/4 = request, indicate, response, confirm */
unsigned char msgContent[CAP_CONTENT_LEN];
/* if the message if cap operation ,then the first unsigned char of msgContent is invoke id */
}
CAP_Message, *PCAP_Message;
struct capp_struct
{
struct CapArg cap_opr;
struct MapOprData_struct data_ptr;
struct MapComSrv_struct com_ptr;
//CAP_Message capmsg;
};
struct test_xapp_struct
{
int sock;
u8 fsm_state;
u8 did;
u8 invoke_id;
u8 xapp_type;
u8 ms_mode;
u8 test_result;
u8 operation_type;
u8 local_ssn;
u8 peer_ssn;
u8 peer_state;
u32 wait_time;
struct SCCP_ADDRESS local_add;
struct SCCP_ADDRESS peer_add;
union
{
struct mapp_struct mapp;
struct capp_struct capp;
}
xapp;
}
test_xapp;
enum XAPP_TEST_OP test_cmd;
int bcd_hton(BYTE * netbcd, const BYTE * hostbcd, BYTE max_octet);
int bcd_ntoh(BYTE * hostbcd, const BYTE * netbcd, BYTE max_octet);
void isdn_aton(u8 *normal_isdn,u8 *anti_isdn);
void imsi_aton(u8 *normal_imsi,u8 *anti_imsi);
void imsi_ntos(u8 *str_imsi,u8 *normal_imsi);
void imsi_ston(u8 *normal_imsi,u8 *str_imsi);
void isdn_ntos(u8 *str_isdn,u8 *normal_isdn);
void imsi_ntoa(u8 *anti_imsi,u8 *normal_imsi);
void isdn_ntoa(u8 * anti_isdn, u8 * normal_isdn);
u8 isdn_ston(u8 *normal_isdn,u8 *str_isdn);
void xapp_set_sccpadd(u8 ssn, u8 * gtt_num, struct SCCP_ADDRESS *sccp_add);
int build_xapp_msg();
int extract_xapp_msg();
u8 get_mapp_open(struct MapComSrv_struct *com_ptr, u8 ssn);
u8 send_mapp_comdata(struct MapComSrv_struct *com_ptr, u8 DelimiterFlag);
u8 recv_mapp_comdata(struct MapComSrv_struct *com_ptr, u32 did);
int send_mapp_oprdata(struct MapOprData_struct *opr_ptr, u8 DelimiterFlag);
int recv_mapp_oprdata(struct MapOprData_struct *opr_ptr, u32 did);
int send_mapp_open_req(WORD dialog_id);
int send_mapp_open_conf();
int send_mapp_close(WORD dialog_id);
u8 get_capp_open(struct MapComSrv_struct *com_ptr, u8 ssn);
u8 send_capp_comdata(struct MapComSrv_struct *com_ptr, u8 DelimiterFlag);
u8 recv_capp_comdata(struct MapComSrv_struct *com_ptr, u32 did);
int send_capp_oprdata(struct MapOprData_struct *opr_ptr, u8 DelimiterFlag);
int recv_capp_oprdata(struct MapOprData_struct *opr_ptr, u32 did);
int send_capp_open_req(unsigned char acn, unsigned char acn_v, unsigned short dlgid);
void send_capp_open_conf(unsigned char acn, unsigned char acn_v, unsigned short dlgid);
void send_capp_close(unsigned short dlgid);
void extract_sri();
#endif

View File

@@ -0,0 +1,372 @@
/* XAPP coding test function c file */
/* created by Liu Wei 2006-01-13 */
/* Version 1.0 */
/* ------------------------------------- */
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <termio.h>
#include <sys/stat.h>
#include <sys/io.h>
#include "xapp_coding_test.h"
#include "xapp_main.h"
static int sys_timer10ms = 0;
static char test_sync_cmd[6][32] = {
"XAPP_TEST",
"XAPP_RSP",
"XAPP_OK",
"XAPP_FAIL",
"XAPP_OK,NEXT",
"XAPP_FAIL,NEXT",
};
static char udp_contents = 0;
#define SYS_IT_INTERVAL_SEC 0
#define SYS_IT_INTERVAL_USEC (10*1000)
int remote_ip;
int test_port = 6999;
u8 time_count;
int get_socket(u_int32_t ip, int port)
{
int sock;
int on = 1;
u_long cmdarg = 1;
struct sockaddr_in sin_addr;
sin_addr.sin_family = AF_INET;
sin_addr.sin_port = htons(port);
sin_addr.sin_addr.s_addr = htonl(INADDR_ANY);
if(!(sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
perror("Get socket");
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
if(bind(sock, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr_in)) != 0)
{
perror("bind");
return 0;
}
ioctl(sock, FIONBIO, &cmdarg);
return (sock);
}
int Get_Peer_IP()
{
char s[16];
FILE *fp = NULL;
int i = 0;
char c;
fp = fopen("./conf/sccp_test.conf", "r");
if(fp != NULL)
{
while((c = fgetc(fp)) != EOF && c != ' ' && c != '\n' && c != '\t')
{
s[i++] = c;
if(i >= 16)
break;
}
s[i] = '\0';
printf("Remote ip :%s\r\n", s);
remote_ip = inet_addr(s);
i = 0;
while((c = fgetc(fp)) != EOF && c != ' ' && c != '\n' && c != '\t')
{
s[i++] = c;
if(i >= 5)
break;
}
s[i] = '\0';
test_xapp.wait_time = strtol(s, NULL, 10);
printf("Waiting start test time :%ld\r\n", test_xapp.wait_time);
return 1;
}
return 0;
}
void MS_mode_test()
{
memset(&test_xapp, 0, sizeof(struct test_xapp_struct));
//test_cmd=0;
//test_xapp.ms_mode = 0;
if(Get_Peer_IP())
{
test_xapp.sock = get_socket(remote_ip, test_port);
}
else
{
printf("Get Peer IP Fail!\r\n");
}
}
void next_case()
{
test_cmd++;
test_xapp.test_result = 0;
test_xapp.peer_state = 0;
printf("\r\n ------------------------>> Next Case %d<<------------------ \r\n",(int )test_cmd);
if(test_cmd == XAPP_TEST_LAST_IDLE)
{
printf("\r\n\r\nTest over !\r\n\r\n");
test_cmd = 0;
test_xapp.test_result = 7;
}
}
void MS_test_timer()
{
char msg[256];
struct sockaddr_in sin_addr;
int addr_len;
u8 isdn[ISDN_LEN];
u8 i;
char str[32];
sin_addr.sin_port = htons(test_port);
sin_addr.sin_addr.s_addr = remote_ip;
addr_len = sizeof(struct sockaddr_in);
udp_contents = 0;
memset(msg, 0, 256);
recvfrom(test_xapp.sock, (char *)msg, 256, 0, (struct sockaddr *)&sin_addr, &addr_len);
if(msg[0])
{
//printf("Recv Test sycn msg :%s \r\n",msg);
for(i = 0; i <= 6; i++)
{
sprintf(str, "%s", test_sync_cmd[i]);
if(i >= 2)
sprintf(str, "%s:%d", test_sync_cmd[i], test_cmd);
if(strcmp(msg, str) == 0)
{
udp_contents = i + 1;
break;
}
}
}
if(test_xapp.ms_mode == 0)
{
if(udp_contents == 0)
{
strcpy(msg, "XAPP_TEST");
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
}
if(udp_contents == 2)
{
test_xapp.local_ssn = 7;
test_xapp.peer_ssn = 6;
imap_reg_ssn(test_xapp.local_ssn);
AsciiToBcd(isdn, "918675557122001F", 16);
xapp_set_sccpadd(test_xapp.local_ssn, isdn, &test_xapp.local_add);
AsciiToBcd(isdn, "918675557122002F", 16);
xapp_set_sccpadd(test_xapp.peer_ssn, isdn, &test_xapp.peer_add);
printf(" XAPP Test Slave Started :%s\r\n", msg);
test_xapp.ms_mode = 2;
return;
}
else if(udp_contents == 1)
{
test_xapp.local_ssn = 6;
test_xapp.peer_ssn = 7;
imap_reg_ssn(test_xapp.local_ssn);
AsciiToBcd(isdn, "918675557122002F", 16);
xapp_set_sccpadd(test_xapp.local_ssn, isdn, &test_xapp.local_add);
AsciiToBcd(isdn, "918675557122001F", 16);
xapp_set_sccpadd(test_xapp.peer_ssn, isdn, &test_xapp.peer_add);
printf(" XAPP Test Master Started :%s\r\n", msg);
strcpy(msg, "XAPP_RSP");
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
test_xapp.ms_mode = 1;
return;
}
}
if(test_xapp.ms_mode)
{
switch (test_xapp.test_result)
{
case 0:
if(udp_contents == 4)
{
sprintf(msg, "XAPP_FAIL:%d,Next", test_cmd);
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
printf("[Test]:Fail!\r\n\r\n");
next_case();
return;
}
else if(udp_contents == 3)
{
printf("Peer Test OK !\r\n");
test_xapp.peer_state = 1;
}
break;
case 1: //OK
printf("Local Test OK !\r\n");
if(test_xapp.peer_state == 1)
{
sprintf(msg, "XAPP_OK,NEXT:%d", test_cmd);
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
printf("[Test]: OK!\r\n\r\n");
next_case();
return;
}
sprintf(msg, "XAPP_OK:%d", test_cmd);
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
printf("Send sycn msg : %s\r\n ",msg);
test_xapp.test_result = 3;
break;
case 2:
printf("Local Test Fail !\r\n");
if(test_xapp.peer_state == 1)
{
sprintf(msg, "XAPP_FAIL,NEXT:%d", test_cmd);
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
printf("[Test]:Fail!\r\n\r\n");
next_case();
return;
}
sprintf(msg, "XAPP_FAIL:%d", test_cmd);
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
printf("Send sycn msg : %s\r\n ",msg);
test_xapp.test_result = 4;
break;
case 3:
case 4:
if( msg[0] )
printf("udp recv pos 3:%s\r\n", msg);
if(udp_contents == 5 || udp_contents == 6)
{
(test_xapp.test_result == 3) ? printf("Peer Test OK !\r\n") : printf("Peer Test Fail !\r\n");
(test_xapp.test_result == 3) ? printf("[Test]: OK!\r\n\r\n") : printf("[Test]: Fail!\r\n\r\n");
next_case();
return;
}
else if(udp_contents == 3)
{
sprintf(msg, "XAPP_OK,NEXT:%d", test_cmd);
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
printf("Peer Test OK !\r\n");
printf("[Test]: OK!\r\n\r\n");
next_case();
return;
}
else if(udp_contents == 4)
{
sprintf(msg, "XAPP_FAIL,NEXT:%d", test_cmd);
sendto(test_xapp.sock, (char *)msg, 32, 0, (struct sockaddr *)&sin_addr, sizeof(struct sockaddr));
printf("Peer Test Fail !\r\n");
printf("[Test]:Fail!\r\n\r\n");
next_case();
return;
}
break;
default:
break;
}
}
}
void moduleInit()
{
//ioperm(0x27A,3,1);
MS_mode_test(); //master and slaver mode
debug_init();
//#ifdef NEW_PLATFORM
iptrMainInit();
/*#else
iptrans_init();
#endif */
mtp_shm_init();
snmp_init(4957);
sccp_init();
tcap_init(1024);
printf("MAP OP data size : %d\r\n,MAP OP Str size : %d\r\n",sizeof(MapOprData_struct),sizeof(MapOprSrv_struct));
//printf("send para res size : %d \r\nProvid_SSInfo_struct : %d \r\nOdbData_struct :%d \r\n" ,sizeof(MapSP_Res),
//sizeof(Provid_SSInfo_struct),sizeof(struct OdbData_struct));
printf("Sub_data_struct :%d ExtSsInfo_struct:%d \r\n",sizeof(Sub_data_struct),sizeof(ExtSsInfo_struct));
printf("MapISD_Arg :%d \r\n",sizeof(MapISD_Arg));
xap_init(1204);
extract_sri();
printf("\r\nWating Peer test message ... \r\n");
}
void sysTimer_IRQ()
{
sys_timer10ms = 1;
}
static void SigactionSystem()
{
struct sigaction action;
action.sa_handler = sysTimer_IRQ;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if(sigaction(SIGALRM, &action, NULL) < 0)
{
printf("sigactin sigalarm failed\n");
}
}
void SetFSMTimer()
{
struct itimerval *ptv, tv;
ptv = (struct itimerval *)&tv;
ptv->it_interval.tv_sec = 0;
ptv->it_interval.tv_usec = 10 * 1000;
ptv->it_value = ptv->it_interval;
setitimer(ITIMER_REAL, ptv, NULL);
}
void moduleProc()
{
iptrans_timer();
snmp_timer();
heartbeat_timer();
mtp3_proc();
sccp_timer();
debug_rt();
tcap_fsm();
xap_fsm();
Test_func();
MS_test_timer();
}
int main()
{
moduleInit();
SigactionSystem();
SetFSMTimer();
sys_timer10ms = 1;
while(1)
{
if(sys_timer10ms)
{
sys_timer10ms = 0;
moduleProc();
}
if(sys_timer10ms == 0)
usleep(1);
}
return 1;
}

View File

@@ -0,0 +1,32 @@
/* XAPP coding test function head file */
/* created by Liu Wei 2006-01-13 */
/* Version 1.0 */
/* ------------------------------------- */
#ifndef _XAPP_MAIN_
#define _XAPP_MAIN_
#include "../../public/asn1.h"
#include "../../public/includes.h"
#include "../../iptrans/iptrans.h"
#include "../../mtp3/mtp3.h"
#include "../../snmp/snmp.h"
#include "../../sccp/sccp.h"
#include "../../tcap/tcap_public.h"
#include "../../tcap/tcap_proc.h"
#include "../../xapp/mapp/map_const.h"
#include "../../xapp/mapp/map_code.h"
#include "../../xapp/mapp/map_acn.h"
#include "../../xapp/mapp/map_struct.h"
#include "../../xapp/mapp/map_public.h"
#include "../../xapp/capp/cap_public.h"
#include "../../xapp/ixap.h"
#include "../../debug/debug.h"
#include "../../snmp/snmp.h"
#include "../../xapp/capp/cap_msg.h"
#include "../../xapp/xap_provider.h"
#include "../../xapp/conv_prefix.h"
#include "xapp_op_test.h"
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
/* XAPP coding test function head file */
/* created by Liu Wei 2006-01-13 */
/* Version 1.0 */
/* ------------------------------------- */
#ifndef _XAPP_OP_TEST_
#define _XAPP_OP_TEST_
enum XAPP_TEST_OP
{
MAPP_TEST_SENDPARA =1,
MAPP_TEST_NOTSUBPRE,
MAPP_TEST_PROCUSSD,
MAPP_TEST_BEGINACT,
MAPP_TEST_REGISTERSS ,
MAPP_TEST_HANDOVER,
MAPP_TEST_PERFORMSUBSEQUENTHANDOVER,
MAPP_TEST_NOTEINERNALHANDOVER,
MAPP_TEST_TRACESUBSCRIBERACTIVITY,
MAPP_TEST_FOWARDSM,
MAPP_TEST_SENDROUTINGINFOFORSM,
MAPP_TEST_CANCELLOC,
MAPP_TEST_CANCELLOCv3,
CAPP_TEST_INITDP,
//CAPP_TEST_ACTTEST,
CAPP_TEST_CONNECT,
//CAPP_TEST_CONTINUE,
//CAPP_TEST_REPORTBCSM,
//CAPP_TEST_CALLREL,
CAPP_TEST_REQREPORTBCSM,
XAPP_TEST_LAST_IDLE,
//Please add here , add behind the XAPP_TEST_LAST_IDLE
};
void Test_func();
#endif