dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33714 )


Change subject: GTP_Emulation: make GTPU optional
......................................................................

GTP_Emulation: make GTPU optional

When using the GTP_Emulation connection handler one has to configure a
GTPC and a GTPU link. However in some situations (e.g. when testing the
Gn interface of an 5g MME) only GTPC may be required. So lets make the
GTPU link optional.

Related: OS#5760
Change-Id: I509a229fcaf02ea5149df42816af27bba46d3bff
---
M library/GTP_Emulation.ttcn
M mme/gen_links.sh
M mme/regen_makefile.sh
3 files changed, 38 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/14/33714/1

diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn
index b67e828..4ea293c 100644
--- a/library/GTP_Emulation.ttcn
+++ b/library/GTP_Emulation.ttcn
@@ -30,8 +30,8 @@
 type record GtpEmulationCfg {
        HostName gtpc_bind_ip,
        PortNumber gtpc_bind_port,
-       HostName gtpu_bind_ip,
-       PortNumber gtpu_bind_port,
+       HostName gtpu_bind_ip optional,
+       PortNumber gtpu_bind_port optional,
        boolean sgsn_role
 };

@@ -168,10 +168,12 @@
                                                     cfg.gtpc_bind_port, 
{udp:={}});
        g_gtpc_id := res.connId;

-       map(self:GTPU, system:GTPU);
-       res := GTP_CodecPort_CtrlFunct.f_GTPU_listen(GTPU, cfg.gtpu_bind_ip,
-                                                    cfg.gtpu_bind_port, 
{udp:={}});
-       g_gtpu_id := res.connId;
+       if (isvalue(cfg.gtpu_bind_ip) and isvalue(cfg.gtpu_bind_port)) {
+               map(self:GTPU, system:GTPU);
+               res := GTP_CodecPort_CtrlFunct.f_GTPU_listen(GTPU, 
cfg.gtpu_bind_ip,
+                                                            
cfg.gtpu_bind_port, {udp:={}});
+               g_gtpu_id := res.connId;
+       }

        g_restart_ctr := f_rnd_octstring(1);
        g_c_seq_nr := f_rnd_int(65535);
diff --git a/mme/gen_links.sh b/mme/gen_links.sh
index b0ecf86..e0a038b 100755
--- a/mme/gen_links.sh
+++ b/mme/gen_links.sh
@@ -40,7 +40,15 @@
 gen_links $DIR $FILES

 DIR=$BASEDIR/titan.ProtocolModules.GTP_v13.5.0/src
-FILES="GTPC_EncDec.cc   GTPC_Types.ttcn  GTPU_EncDec.cc   GTPU_Types.ttcn"
+FILES="GTPC_EncDec.cc GTPC_Types.ttcn GTPU_EncDec.cc GTPU_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolModules.NS_v7.3.0/src
+FILES="NS_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolModules.BSSGP_v13.0.0/src
+FILES="BSSGP_EncDec.cc  BSSGP_Types.ttcn"
 gen_links $DIR $FILES
 
 DIR=$BASEDIR/titan.ProtocolModules.DIAMETER_ProtocolModule_Generator/src
@@ -54,12 +62,14 @@
 gen_links $DIR $FILES

 DIR=../library
-FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn 
Native_Functions.ttcn Native_FunctionDefs.cc "
+FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn 
Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn "
 FILES+="SGsAP_Templates.ttcn SGsAP_CodecPort.ttcn 
SGsAP_CodecPort_CtrlFunct.ttcn SGsAP_CodecPort_CtrlFunctDef.cc 
SGsAP_Emulation.ttcn DNS_Helpers.ttcn "
 FILES+="L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn "
 FILES+="S1AP_CodecPort.ttcn S1AP_CodecPort_CtrlFunctDef.cc 
S1AP_CodecPort_CtrlFunct.ttcn S1AP_Emulation.ttcn "
 FILES+="NAS_Templates.ttcn GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn "
 FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn 
DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc 
DIAMETER_Emulation.ttcn DIAMETER_Templates.ttcn "
+FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn 
GTP_CodecPort_CtrlFunctDef.cc GTP_Emulation.ttcn GTP_Templates.ttcn 
Osmocom_Gb_Types.ttcn "
+FILES+="BSSGP_Emulation.ttcnpp Osmocom_Gb_Types.ttcn "
 gen_links $DIR $FILES

 ignore_pp_results
diff --git a/mme/regen_makefile.sh b/mme/regen_makefile.sh
index 62956d8..df5151e 100755
--- a/mme/regen_makefile.sh
+++ b/mme/regen_makefile.sh
@@ -6,10 +6,12 @@
        *.asn
        *.c
        *.ttcn
+       BSSGP_EncDec.cc
        DIAMETER_CodecPort_CtrlFunctDef.cc
        DIAMETER_EncDec.cc
        GTPC_EncDec.cc
        GTPU_EncDec.cc
+       GTP_CodecPort_CtrlFunctDef.cc
        IPL4asp_PT.cc
        IPL4asp_discovery.cc
        LTE_CryptoFunctionDefs.cc
@@ -23,6 +25,7 @@
        TELNETasp_PT.cc
 "

+
 export CPPFLAGS_TTCN3="
 "


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33714
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I509a229fcaf02ea5149df42816af27bba46d3bff
Gerrit-Change-Number: 33714
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-MessageType: newchange

Reply via email to