diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2023-07-12 14:03:52 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2023-07-17 12:37:53 +0000 |
commit | 5c1b5f2c04237f7c63eb5c022840b80ecc88818c (patch) | |
tree | 6e547f40e82a62a84084f747e471114e21900eb8 | |
parent | ce65a0f61a20f8a6bfdf6af244e5a3f5802e3475 (diff) |
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
-rw-r--r-- | library/GTP_Emulation.ttcn | 14 |
1 files 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); |