summaryrefslogtreecommitdiffstats
path: root/ggsn_tests/GGSN_Tests.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-18 22:53:30 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-19 11:50:08 +0200
commitddeecbb4eded046f7a03f6012a1af20e7e3b7e13 (patch)
treef20bc98e9db4c73cad44f11f6f594e3aff13715a /ggsn_tests/GGSN_Tests.ttcn
parent99ef9a446c8af63df0e66686d683304e0780dad0 (diff)
GGSN_Tests: Make SGSN and GGSN addresses configurable via modulepar
Diffstat (limited to 'ggsn_tests/GGSN_Tests.ttcn')
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn26
1 files changed, 18 insertions, 8 deletions
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index b3e26d5..ecc7d7a 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -10,12 +10,19 @@ module GGSN_Tests {
import from GTPU_Types all;
import from IP_Types all;
import from ICMPv6_Types all;
+ import from Native_Functions all;
const integer GTP0_PORT := 3386;
const integer GTP1C_PORT := 2123;
const integer GTP1U_PORT := 2152;
- const charstring g_bind_ip_c := "127.23.42.1";
- const charstring g_bind_ip_u := g_bind_ip_c;
+
+ modulepar {
+ charstring m_bind_ip_gtpc := "127.23.42.1";
+ charstring m_bind_ip_gtpu := "127.23.42.1";
+
+ charstring m_ggsn_ip_gtpc := "127.0.0.6";
+ charstring m_ggsn_ip_gtpu := "127.0.0.6";
+ }
type set PdpContext {
hexstring imsi,
@@ -44,11 +51,11 @@ module GGSN_Tests {
var OCT1 g_restart_ctr := '01'O;
/* FIXME: unify with g_bind_ip + parse from config file */
- var OCT4 g_sgsn_ip_c := '7f172a01'O;
- var OCT4 g_sgsn_ip_u := '7f172a01'O;
+ var OCT4 g_sgsn_ip_c;
+ var OCT4 g_sgsn_ip_u;
/* FIXME: parse remName from config file */
- var GtpPeer g_peer_c := { connId := 0, remName := "127.0.0.6", remPort := GTP1C_PORT };
- var GtpPeer g_peer_u := { connId := 0, remName := "127.0.0.6", remPort := GTP1U_PORT };
+ var GtpPeer g_peer_c := { connId := 0, remName := m_ggsn_ip_gtpc, remPort := GTP1C_PORT };
+ var GtpPeer g_peer_u := { connId := 0, remName := m_ggsn_ip_gtpu, remPort := GTP1U_PORT };
timer T_default := 3.0;
/* next to-be-sent GTP-C sequence number */
@@ -63,14 +70,17 @@ module GGSN_Tests {
}
g_initialized := true;
+ g_sgsn_ip_c := f_inet_addr(m_bind_ip_gtpc);
+ g_sgsn_ip_u := f_inet_addr(m_bind_ip_gtpu);
+
var Result res;
map(self:GTPC, system:GTPC);
- res := GTP_CodecPort_CtrlFunct.f_IPL4_listen(GTPC, g_bind_ip_c, GTP1C_PORT, {udp:={}});
+ res := GTP_CodecPort_CtrlFunct.f_IPL4_listen(GTPC, m_bind_ip_gtpc, GTP1C_PORT, {udp:={}});
log("GTP1C ConnectionID: ", res.connId);
g_peer_c.connId := res.connId;
map(self:GTPU, system:GTPU);
- res := GTP_CodecPort_CtrlFunct.f_GTPU_listen(GTPU, g_bind_ip_u, GTP1U_PORT, {udp:={}});
+ res := GTP_CodecPort_CtrlFunct.f_GTPU_listen(GTPU, m_bind_ip_gtpu, GTP1U_PORT, {udp:={}});
g_peer_u.connId:= res.connId;
g_restart_ctr := f_rnd_octstring(1);