From 5c1b5f2c04237f7c63eb5c022840b80ecc88818c Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 12 Jul 2023 14:03:52 +0200 Subject: 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 --- library/GTP_Emulation.ttcn | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn index b67e828c..4ea293c6 100644 --- a/library/GTP_Emulation.ttcn +++ b/library/GTP_Emulation.ttcn @@ -30,8 +30,8 @@ const integer GTP1U_PORT := 2152; 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 @@ private function f_init(GtpEmulationCfg cfg) runs on GTP_Emulation_CT { 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); -- cgit v1.2.3