From 004f5fbca3dd61bb5766505aca885abff51457b1 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 16 Dec 2017 17:54:40 +0100 Subject: BSSMAP_Emulation: use BSSAP_CodecPort So far, BSSMAP_Emulation used the SCCPasp_SP_PORT directly, explicitly calling BSSAP encode/decode functions while processing the primitives. Let's clean this up and use the BSSAP_CodecPort which has meanwhile been developed as a dual-faced port that can be stacked between SCCPasp and the user to avoid any manual encode/decode function calls. Change-Id: Icded789d18f3469f74e16f552df2c7ac44ac4294 --- bsc-nat/BSC_MS_ConnectionHandler.ttcn | 3 ++- bsc-nat/BSC_MS_Simulation.ttcn | 3 ++- bsc-nat/MSC_ConnectionHandler.ttcn | 3 ++- bsc-nat/MSC_Simulation.ttcn | 2 +- bsc-nat/gen_links.sh | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) (limited to 'bsc-nat') diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index a3855253..876d2ec1 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -4,6 +4,7 @@ import from General_Types all; import from Osmocom_Types all; import from SCCPasp_Types all; import from BSSAP_Types all; +import from BSSAP_CodecPort all; import from BSSMAP_Emulation all; import from BSSMAP_Templates all; @@ -28,7 +29,7 @@ type component BSC_MS_ConnHdlr extends BSSAP_ConnHdlr { /* Callback function from general BSSMAP_Emulation whenever a new incoming * SCCP connection arrivces. Must create + start a new component */ -private function CreateCallback(ASP_SCCP_N_CONNECT_ind conn_ind, charstring id) +private function CreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { log("Incoming SCCP Connection on BSC ?!?"); self.stop; diff --git a/bsc-nat/BSC_MS_Simulation.ttcn b/bsc-nat/BSC_MS_Simulation.ttcn index eab7fe9d..b9414a3b 100644 --- a/bsc-nat/BSC_MS_Simulation.ttcn +++ b/bsc-nat/BSC_MS_Simulation.ttcn @@ -8,6 +8,7 @@ import from SCCP_Types all; import from SCCPasp_Types all; import from SCCP_Emulation all; +import from BSSAP_CodecPort all; import from BSSMAP_Emulation all; import from BSC_MS_ConnectionHandler all; @@ -53,7 +54,7 @@ function main(charstring remote_ip, PortNumber remote_port, connect(vc_IPA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); /* connect BSSMAP dispatcher to upper side of SCCP */ - connect(vc_BSSMAP:SCCP, vc_SCCP:SCCP_SP_PORT); + connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT); /* connect BSSMAP dispatcher to IPA_Emulation MGCP */ connect(vc_BSSMAP:MGCP, vc_IPA:IPA_MGCP_PORT); diff --git a/bsc-nat/MSC_ConnectionHandler.ttcn b/bsc-nat/MSC_ConnectionHandler.ttcn index 3fc11e9b..b038ce5b 100644 --- a/bsc-nat/MSC_ConnectionHandler.ttcn +++ b/bsc-nat/MSC_ConnectionHandler.ttcn @@ -4,6 +4,7 @@ import from General_Types all; import from Osmocom_Types all; import from SCCPasp_Types all; import from BSSAP_Types all; +import from BSSAP_CodecPort all; import from BSSMAP_Emulation all; import from BSSMAP_Templates all; @@ -26,7 +27,7 @@ type component MSC_ConnHdlr extends BSSAP_ConnHdlr { /* Callback function from general BSSMAP_Emulation whenever a new incoming * SCCP connection arrivces. Must create + start a new component */ -private function CreateCallback(ASP_SCCP_N_CONNECT_ind conn_ind, charstring id) +private function CreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { var MSC_ConnHdlr vc_conn; /* Create a new BSSAP_ConnHdlr component */ diff --git a/bsc-nat/MSC_Simulation.ttcn b/bsc-nat/MSC_Simulation.ttcn index f9fb0d42..7e39ca13 100755 --- a/bsc-nat/MSC_Simulation.ttcn +++ b/bsc-nat/MSC_Simulation.ttcn @@ -51,7 +51,7 @@ function main(charstring local_ip, PortNumber local_port, connect(vc_IPA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); /* connect BSSNAP dispatcher to upper side of SCCP */ - connect(vc_BSSMAP:SCCP, vc_SCCP:SCCP_SP_PORT); + connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT); if (mp_mgcp_uses_udp == false) { /* connect BSSMAP dispatcher to IPA_Emulation MGCP */ diff --git a/bsc-nat/gen_links.sh b/bsc-nat/gen_links.sh index 9846d9a3..9a45c890 100755 --- a/bsc-nat/gen_links.sh +++ b/bsc-nat/gen_links.sh @@ -55,5 +55,5 @@ FILES="RTP_EncDec.cc RTP_Types.ttcn" gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" gen_links $DIR $FILES -- cgit v1.2.3