Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame^] | 1 | module MSC_Simulation { |
| 2 | |
| 3 | import from IPL4asp_Types all; |
| 4 | |
| 5 | import from IPA_Emulation all; |
| 6 | |
| 7 | import from SCCP_Types all; |
| 8 | import from SCCPasp_Types all; |
| 9 | import from SCCP_Emulation all; |
| 10 | |
| 11 | /* |
| 12 | import from MobileL3_Types all; |
| 13 | import from MobileL3_CommonIE_Types all; |
| 14 | import from L3_Templates all; |
| 15 | |
| 16 | import from BSSAP_Types all; |
| 17 | import from BSSMAP_Templates all; |
| 18 | */ |
| 19 | import from BSSMAP_Emulation all; |
| 20 | |
| 21 | import from MSC_ConnectionHandler all; |
| 22 | |
| 23 | type component MSC_CT { |
| 24 | /* component references */ |
| 25 | var IPA_Emulation_CT vc_IPA; |
| 26 | var SCCP_CT vc_SCCP; |
| 27 | var BSSMAP_Emulation_CT vc_BSSMAP; |
| 28 | /* test port to SCCP emulation */ |
| 29 | port SCCPasp_PT SCCP; |
| 30 | } |
| 31 | |
| 32 | function main(charstring local_ip, PortNumber local_port, |
| 33 | MSC_SCCP_MTP3_parameters sccp_pars, |
| 34 | SCCP_PAR_Address sccp_addr_own) runs on MSC_CT |
| 35 | { |
| 36 | /* create components */ |
| 37 | vc_IPA := IPA_Emulation_CT.create; |
| 38 | vc_SCCP := SCCP_CT.create; |
| 39 | vc_BSSMAP := BSSMAP_Emulation_CT.create; |
| 40 | |
| 41 | map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT); |
| 42 | |
| 43 | /* connect MTP3 service provider (IPA) to lower side of SCCP */ |
| 44 | connect(vc_IPA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); |
| 45 | |
| 46 | /* connect BSSNAP dispatcher to upper side of SCCP */ |
| 47 | connect(vc_BSSMAP:SCCP, vc_SCCP:SCCP_SP_PORT); |
| 48 | |
| 49 | vc_IPA.start(IPA_Emulation.main_server(local_ip, local_port)); |
| 50 | vc_SCCP.start(SCCPStart(sccp_pars)); |
| 51 | vc_BSSMAP.start(BSSMAP_Emulation.main(MSC_BssmapOps)); |
| 52 | |
| 53 | /* wait until termination of respective components */ |
| 54 | vc_IPA.done; |
| 55 | vc_BSSMAP.done; |
| 56 | vc_SCCP.done; |
| 57 | } |
| 58 | |
| 59 | } |