summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-04-16 19:16:01 +0200
committerHarald Welte <laforge@gnumonks.org>2018-04-17 21:49:05 +0200
commit7ef51aa2a28d3d1e1d30efa39fc45f11fe06f510 (patch)
tree677e7f1bbbeac5f51b0ca8b9c4072ee27445adb0
parent6a50c7cae0d8b55b8131e882dac921bb53357b53 (diff)
BSSAP_Adapter: Introduce transport over IPA/SCCPlite
In addition to the existing 3GPP AoIP stacking, allow BSSAP to run on top of a SCCPlite stacking. Implement both the server and the client role for IPA. Related: OS#2544 Change-Id: Ie844c4de62e0ef5d5c4c366185968211a7f6d676
-rw-r--r--bsc/BSC_Tests.ttcn1
-rwxr-xr-xbsc/regen_makefile.sh2
-rw-r--r--library/BSSAP_Adapter.ttcn50
-rwxr-xr-xmsc/regen_makefile.sh2
4 files changed, 45 insertions, 10 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 8380175..0299026 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -100,6 +100,7 @@ modulepar {
charstring mp_test_ip := "127.0.0.1";
BSSAP_Configuration mp_bssap_cfg := {
+ transport := BSSAP_TRANSPORT_AoIP,
sccp_service_type := "mtp3_itu",
sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" },
own_pc := 185,
diff --git a/bsc/regen_makefile.sh b/bsc/regen_makefile.sh
index 1e52252..08629d2 100755
--- a/bsc/regen_makefile.sh
+++ b/bsc/regen_makefile.sh
@@ -4,6 +4,6 @@ MAIN=BSC_Tests.ttcn
FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc *.c"
-export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR"
+export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_MGCP -DIPA_EMULATION_SCCP -DUSE_MTP3_DISTRIBUTOR"
../regen-makefile.sh $MAIN $FILES
diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn
index 6c4f30e..1a9fdb4 100644
--- a/library/BSSAP_Adapter.ttcn
+++ b/library/BSSAP_Adapter.ttcn
@@ -13,6 +13,8 @@ import from M3UA_Emulation all;
import from MTP3asp_Types all;
import from MTP3asp_PortType all;
+import from IPA_Emulation all;
+
import from SCCP_Types all;
import from SCCPasp_Types all;
import from SCCP_Emulation all;
@@ -26,7 +28,8 @@ import from BSSMAP_Emulation all;
type record BSSAP_Adapter {
/* component references */
- M3UA_CT vc_M3UA,
+ M3UA_CT vc_M3UA, /* only in 3GPP AoIP */
+ IPA_Emulation_CT vc_IPA, /* only in SCCPliste */
SCCP_CT vc_SCCP,
MSC_SCCP_MTP3_parameters sccp_pars,
@@ -37,7 +40,14 @@ type record BSSAP_Adapter {
BSSMAP_Emulation_CT vc_BSSMAP
}
+type enumerated BSSAP_Transport {
+ BSSAP_TRANSPORT_AoIP, /* 3GPP AoIP: SCCP over M3UA over SCTP */
+ BSSAP_TRANSPORT_SCCPlite_SERVER, /* SCCPlite: SCCP over IPA over TCP */
+ BSSAP_TRANSPORT_SCCPlite_CLIENT /* SCCPlite: SCCP over IPA over TCP */
+};
+
type record BSSAP_Configuration {
+ BSSAP_Transport transport,
charstring sccp_service_type,
SCTP_Association_Address sctp_addr,
integer own_pc,
@@ -87,18 +97,42 @@ function f_bssap_init(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg, charst
ops.sccp_addr_peer := ba.sccp_addr_peer;
/* create components */
- ba.vc_M3UA := M3UA_CT.create(id & "-M3UA");
ba.vc_SCCP := SCCP_CT.create(id & "-SCCP");
if (isvalue(ops)) {
ba.vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP");
}
+ select (cfg.transport) {
+ case (BSSAP_TRANSPORT_AoIP) {
+ ba.vc_M3UA := M3UA_CT.create(id & "-M3UA");
+ map(ba.vc_M3UA:SCTP_PORT, system:sctp);
+ /* connect MTP3 service provider (M3UA) to lower side of SCCP */
+ connect(ba.vc_M3UA:MTP3_SP_PORT, ba.vc_SCCP:MTP3_SCCP_PORT);
+ ba.vc_M3UA.start(f_M3UA_Emulation(cfg.sctp_addr, cfg.rctx));
+ }
+ case (BSSAP_TRANSPORT_SCCPlite_SERVER) {
+ ba.vc_IPA := IPA_Emulation_CT.create(id & "-IPA");
+ map(ba.vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
+ /* connect MTP3 service provider (IPA) to lower side of SCCP */
+ connect(ba.vc_IPA:MTP3_SP_PORT, ba.vc_SCCP:MTP3_SCCP_PORT);
+ ba.vc_IPA.start(IPA_Emulation.main_server(cfg.sctp_addr.local_ip_addr,
+ cfg.sctp_addr.local_sctp_port));
+ }
+ case (BSSAP_TRANSPORT_SCCPlite_CLIENT) {
+ ba.vc_IPA := IPA_Emulation_CT.create(id & "-IPA");
+ map(ba.vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
+ /* connect MTP3 service provider (IPA) to lower side of SCCP */
+ connect(ba.vc_IPA:MTP3_SP_PORT, ba.vc_SCCP:MTP3_SCCP_PORT);
+ ba.vc_IPA.start(IPA_Emulation.main_client(cfg.sctp_addr.remote_ip_addr,
+ cfg.sctp_addr.remote_sctp_port,
+ cfg.sctp_addr.local_ip_addr,
+ cfg.sctp_addr.local_sctp_port));
+ }
+ case else {
+ setverdict(fail, "Unsuppored BSSAP_Transport");
+ self.stop;
+ }
+ }
- map(ba.vc_M3UA:SCTP_PORT, system:sctp);
-
- /* connect MTP3 service provider (M3UA) to lower side of SCCP */
- connect(ba.vc_M3UA:MTP3_SP_PORT, ba.vc_SCCP:MTP3_SCCP_PORT);
-
- ba.vc_M3UA.start(f_M3UA_Emulation(cfg.sctp_addr, cfg.rctx));
ba.vc_SCCP.start(SCCPStart(ba.sccp_pars));
if (isvalue(ops)) {
diff --git a/msc/regen_makefile.sh b/msc/regen_makefile.sh
index de8f7ab..fc4a29d 100755
--- a/msc/regen_makefile.sh
+++ b/msc/regen_makefile.sh
@@ -2,6 +2,6 @@
FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc SMPP_EncDec.cc SMPP_CodecPort_CtrlFunctDef.cc *.c"
-export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DUSE_MTP3_DISTRIBUTOR"
+export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DUSE_MTP3_DISTRIBUTOR"
../regen-makefile.sh MSC_Tests.ttcn $FILES