aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-09-13 17:25:18 +0200
committerAlexander Couzens <lynxis@fe80.eu>2020-09-17 23:29:16 +0200
commite0f7c543b75198a13bb587296333fa3d18425d5f (patch)
tree66f954b1ac9cd10eb1c7365e825cbd18a53322f0
parent60408e3f5752a5f4a77e34760e8a709621de2a0c (diff)
NS_Emulation: remove dependency on PCUIF_Types
The dependency of PCUIF_Types creates also a dependency on Replace the PCU_AddrType by an unix like address family defined in the Osmocom_Types to reduce the dependency. Change-Id: I0b4fda96accef401ffc009010f9f5621583fd6dd
-rw-r--r--library/NS_Emulation.ttcn4
-rw-r--r--library/Osmocom_Types.ttcn7
-rw-r--r--library/PCUIF_Types.ttcn11
-rw-r--r--pcu/PCU_Tests.ttcn2
-rw-r--r--pcu/SGSN_Components.ttcn2
-rw-r--r--sgsn/SGSN_Tests.ttcn3
6 files changed, 25 insertions, 4 deletions
diff --git a/library/NS_Emulation.ttcn b/library/NS_Emulation.ttcn
index b8807da5..0198da87 100644
--- a/library/NS_Emulation.ttcn
+++ b/library/NS_Emulation.ttcn
@@ -14,8 +14,8 @@ module NS_Emulation {
import from BSSGP_Types all;
import from Osmocom_Gb_Types all;
import from NS_Provider_IPL4 all;
+ import from Osmocom_Types all;
import from IPL4asp_Types all;
- import from PCUIF_Types all;
type record NsUnitdataRequest {
BssgpBvci bvci,
@@ -132,7 +132,7 @@ module NS_Emulation {
}
type record NSConfiguration {
- PCUIF_AddrType remote_proto,
+ AddressFamily address_family,
PortNumber local_udp_port,
charstring local_ip,
PortNumber remote_udp_port,
diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn
index 1993ae12..ee3b04a5 100644
--- a/library/Osmocom_Types.ttcn
+++ b/library/Osmocom_Types.ttcn
@@ -49,6 +49,13 @@ type record Arfcn {
uint15_t arfcn
} with { variant "" };
+/* based on Linux */
+type enumerated AddressFamily {
+ AF_UNSPEC ('00'O),
+ AF_INET ('02'O),
+ AF_INET6 ('0a'O)
+}
+
/* return random integer 0 <= ret < max. According to ETSI ES 201 873 C.6.1, rnd() returns *less* than 1, so
* the returned int will always be ret < max, or ret <= (max-1). */
function f_rnd_int(integer max) return integer {
diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index d73c32d7..079455fd 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -990,6 +990,17 @@ return bitstring {
}
}
+function f_PCUIF_AF2addr_type(AddressFamily address_family)
+return PCUIF_AddrType {
+ if (address_family == AF_INET) {
+ return PCUIF_ADDR_TYPE_IPV4;
+ } else if (address_family == AF_INET6) {
+ return PCUIF_ADDR_TYPE_IPV6;
+ } else {
+ return PCUIF_ADDR_TYPE_UNSPEC;
+ }
+}
+
/* TODO: second (redundant) NSVC connection is not (yet) supported */
function f_PCUIF_ver_INFO_RemoteAddr(PCUIF_AddrType addr_type,
charstring addr)
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index f5176d40..142cdcd4 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -93,7 +93,7 @@ friend template (value) PCUIF_info_ind ts_PCUIF_INFO_default := {
local_port := { mp_nsconfig.remote_udp_port, 0 },
remote_port := { mp_nsconfig.local_udp_port, 0 },
remote_addr := f_PCUIF_ver_INFO_RemoteAddr(
- mp_nsconfig.remote_proto, mp_nsconfig.local_ip)
+ f_PCUIF_AF2addr_type(mp_nsconfig.address_family), mp_nsconfig.local_ip)
}
type record lqual_range {
diff --git a/pcu/SGSN_Components.ttcn b/pcu/SGSN_Components.ttcn
index f2e69672..afd4ee99 100644
--- a/pcu/SGSN_Components.ttcn
+++ b/pcu/SGSN_Components.ttcn
@@ -35,7 +35,7 @@ modulepar {
};
NSConfiguration mp_nsconfig := {
- remote_proto := PCUIF_ADDR_TYPE_IPV4,
+ address_family := AF_INET,
local_udp_port := 23000,
local_ip := "127.0.0.1",
remote_udp_port := 21000,
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 870e66fe..abbcb648 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -68,6 +68,7 @@ modulepar {
NSConfigurations mp_nsconfig := {
{
+ address_family := AF_INET,
local_udp_port := 21010,
local_ip := "127.0.0.1",
remote_udp_port := 23000,
@@ -78,6 +79,7 @@ modulepar {
handle_sns := false
},
{
+ address_family := AF_INET,
local_udp_port := 21011,
local_ip := "127.0.0.1",
remote_udp_port := 23000,
@@ -88,6 +90,7 @@ modulepar {
handle_sns := false
},
{
+ address_family := AF_INET,
local_udp_port := 21012,
local_ip := "127.0.0.1",
remote_udp_port := 23000,