PCU: add IPv6 support for SNS
With PCUIF 10 the remote can be IPv4 or IPv6.
Add all missing parts including SNS IPv6 elements,
the support to omit IPv4 elements and a PCU_Tests_SNSv6.cfg
configuration to run all tests with IPv6
Change-Id: I43d64caca600fff78f3fbbb3e8179f447f235d46
diff --git a/pcu/PCU_Tests_SNS.ttcn b/pcu/PCU_Tests_SNS.ttcn
index 471c758..86b83c2 100644
--- a/pcu/PCU_Tests_SNS.ttcn
+++ b/pcu/PCU_Tests_SNS.ttcn
@@ -27,9 +27,16 @@
runs on RAW_NS_CT {
log("f_incoming_sns_size(idx=", idx, ")");
var PDU_NS rx;
- /* expect one single SNS-SIZE with RESET flag; one remote v4 EP; no v6 EP */
- rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 8,
- num_v4 := 4, num_v6 := omit), idx);
+
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ /* expect one single SNS-SIZE with RESET flag; 4x v4 EP; no v6 EP */
+ rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 8,
+ num_v4 := 4, num_v6 := omit), idx);
+ } else {
+ /* expect one single SNS-SIZE with RESET flag; no v4 EP; 4x v6 EP */
+ rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 8,
+ num_v4 := omit, num_v6 := 4), idx);
+ }
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE_ACK(g_nsconfig[idx].nsei, cause)));
}
@@ -38,10 +45,16 @@
runs on RAW_NS_CT {
log("f_outgoing_sns_size(idx=", idx, ")");
var PDU_NS rx;
- NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 1,
- num_v4 := 1, num_v6 := omit)
- ));
- /* expect one single SNS-SIZE with RESET flag; one remote v4 EP; no v6 EP */
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 1,
+ num_v4 := 1, num_v6 := omit)
+ ));
+ } else {
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 1,
+ num_v4 := omit, num_v6 := 1)
+ ));
+ }
+ /* expect one single SNS-SIZE with RESET flag; 4x v4 EP; no v6 EP */
rx := f_ns_exp(tr_SNS_SIZE_ACK(g_nsconfig[idx].nsei, cause), idx);
}
@@ -50,9 +63,17 @@
runs on RAW_NS_CT {
log("f_incoming_sns_config(idx=", idx, ")");
var PDU_NS rx;
- var template IP4_Elements v4_elem := { tr_SNS_IPv4(mp_nsconfig.provider.ip.remote_ip,
- mp_nsconfig.provider.ip.remote_udp_port) };
- rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig[idx].nsei, end_flag := true, v4 := v4_elem), idx);
+
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ var template IP4_Elements v4_elem := { tr_SNS_IPv4(mp_nsconfig.provider.ip.remote_ip,
+ mp_nsconfig.provider.ip.remote_udp_port) };
+ rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig[idx].nsei, end_flag := true, v4 := v4_elem), idx);
+ } else {
+ var template IP6_Elements v6_elem := { tr_SNS_IPv6(mp_nsconfig.provider.ip.remote_ip,
+ mp_nsconfig.provider.ip.remote_udp_port) };
+ rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig[idx].nsei, end_flag := true, v6 := v6_elem), idx);
+ }
+
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause)));
}
@@ -61,9 +82,15 @@
runs on RAW_NS_CT {
log("f_outgoing_sns_config(idx=", idx, ")");
var PDU_NS rx;
- var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx].provider.ip.local_ip,
- g_nsconfig[idx].provider.ip.local_udp_port) }
- NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx].provider.ip.local_ip,
+ g_nsconfig[idx].provider.ip.local_udp_port) }
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
+ } else {
+ var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[idx].provider.ip.local_ip,
+ g_nsconfig[idx].provider.ip.local_udp_port) }
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6)));
+ }
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx);
}
@@ -72,11 +99,19 @@
runs on RAW_NS_CT {
log("f_outgoing_sns_config_1c1u(idx=", idx, ")");
var PDU_NS rx;
- var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[0].provider.ip.local_ip,
- g_nsconfig[0].provider.ip.local_udp_port, 1, 0),
- ts_SNS_IPv4(g_nsconfig[1].provider.ip.local_ip,
- g_nsconfig[1].provider.ip.local_udp_port, 0, 1) };
- NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[0].provider.ip.local_ip,
+ g_nsconfig[0].provider.ip.local_udp_port, 1, 0),
+ ts_SNS_IPv4(g_nsconfig[1].provider.ip.local_ip,
+ g_nsconfig[1].provider.ip.local_udp_port, 0, 1) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
+ } else {
+ var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[0].provider.ip.local_ip,
+ g_nsconfig[0].provider.ip.local_udp_port, 1, 0),
+ ts_SNS_IPv6(g_nsconfig[1].provider.ip.local_ip,
+ g_nsconfig[1].provider.ip.local_udp_port, 0, 1) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6)));
+ }
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx);
}
@@ -85,11 +120,19 @@
runs on RAW_NS_CT {
log("f_outgoing_sns_config_1c1u_separate(idx=", idx, ")");
var PDU_NS rx;
- var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[1].provider.ip.local_ip,
- g_nsconfig[1].provider.ip.local_udp_port, 1, 0),
- ts_SNS_IPv4(g_nsconfig[2].provider.ip.local_ip,
- g_nsconfig[2].provider.ip.local_udp_port, 0, 1) };
- NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[1].provider.ip.local_ip,
+ g_nsconfig[1].provider.ip.local_udp_port, 1, 0),
+ ts_SNS_IPv4(g_nsconfig[2].provider.ip.local_ip,
+ g_nsconfig[2].provider.ip.local_udp_port, 0, 1) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
+ } else {
+ var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[1].provider.ip.local_ip,
+ g_nsconfig[1].provider.ip.local_udp_port, 1, 0),
+ ts_SNS_IPv6(g_nsconfig[2].provider.ip.local_ip,
+ g_nsconfig[2].provider.ip.local_udp_port, 0, 1) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6)));
+ }
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx);
}
@@ -97,33 +140,57 @@
runs on RAW_NS_CT {
log("f_outgoing_sns_add(idx_add=", idx_add, ")");
var PDU_NS rx;
- var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_add].provider.ip.local_ip,
- g_nsconfig[idx_add].provider.ip.local_udp_port,
- w_sig, w_user) };
- NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, v4)));
- rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, omit, v4));
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_add].provider.ip.local_ip,
+ g_nsconfig[idx_add].provider.ip.local_udp_port,
+ w_sig, w_user) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, v4)));
+ rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, omit, v4));
+ } else {
+ var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[idx_add].provider.ip.local_ip,
+ g_nsconfig[idx_add].provider.ip.local_udp_port,
+ w_sig, w_user) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, omit, v6)));
+ rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, omit, omit, v6));
+ }
}
function f_outgoing_sns_del(integer idx_del, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0)
runs on RAW_NS_CT {
log("f_outgoing_sns_del(idx_del=", idx_del, ")");
var PDU_NS rx;
- var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_del].provider.ip.local_ip,
- g_nsconfig[idx_del].provider.ip.local_udp_port,
- w_sig, w_user) };
- NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_DEL(g_nsconfig[idx].nsei, 24, omit, v4)));
- rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, v4));
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_del].provider.ip.local_ip,
+ g_nsconfig[idx_del].provider.ip.local_udp_port,
+ w_sig, w_user) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_DEL(g_nsconfig[idx].nsei, 24, omit, v4)));
+ rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, v4));
+ } else {
+ var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[idx_del].provider.ip.local_ip,
+ g_nsconfig[idx_del].provider.ip.local_udp_port,
+ w_sig, w_user) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_DEL(g_nsconfig[idx].nsei, 24, omit, omit, v6)));
+ rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, omit, v6));
+ }
}
function f_outgoing_sns_chg_weight(integer idx_chg, uint8_t w_sig, uint8_t w_user, integer idx := 0)
runs on RAW_NS_CT {
log("f_outgoing_sns_chg_weight(idx_chg=", idx_chg, ")");
var PDU_NS rx;
- var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_chg].provider.ip.local_ip,
- g_nsconfig[idx_chg].provider.ip.local_udp_port,
- w_sig, w_user) };
- NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, v4)));
- rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, v4));
+ if (mp_nsconfig.provider.ip.address_family == AF_INET) {
+ var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_chg].provider.ip.local_ip,
+ g_nsconfig[idx_chg].provider.ip.local_udp_port,
+ w_sig, w_user) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, v4)));
+ rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, v4));
+ } else {
+ var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[idx_chg].provider.ip.local_ip,
+ g_nsconfig[idx_chg].provider.ip.local_udp_port,
+ w_sig, w_user) };
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, omit, v6)));
+ rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, omit, v6));
+ }
}