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
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);