diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2020-08-25 23:33:17 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-10-21 11:49:54 +0000 |
commit | 7b1e44f7919b0cc93fdfacd9457de1a31d78b997 (patch) | |
tree | 397df00e2615f0fe1598b650a4abc3e6e2408ec4 /library | |
parent | 02ce0b61fd3f5702e2eceb2b98e02d4c07af2a37 (diff) |
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
Diffstat (limited to 'library')
-rw-r--r-- | library/Osmocom_Gb_Types.ttcn | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn index bd2de10..5ffca7a 100644 --- a/library/Osmocom_Gb_Types.ttcn +++ b/library/Osmocom_Gb_Types.ttcn @@ -229,6 +229,40 @@ module Osmocom_Gb_Types { return e; } + template (value) IP6_Element ts_SNS_IPv6(charstring ip, integer udp_port, + uint8_t sig_weight := 1, uint8_t data_weight := 1) := { + ipAddress := f_inet6_addr(ip), + uDP_Port := int2oct(udp_port, 2), + signallingWeight := int2oct(sig_weight, 1), + dataWeight := int2oct(data_weight, 1) + } + function tr_SNS_IPv6(template charstring ip, template integer udp_port, + template uint8_t sig_weight := ?, template uint8_t data_weight := ?) + return template IP6_Element { + var template IP6_Element e; + if (istemplatekind(ip, "?")) { + e.ipAddress := ?; + } else { + e.ipAddress := f_inet6_addr(valueof(ip)); + } + if (istemplatekind(udp_port, "?")) { + e.uDP_Port := ?; + } else { + e.uDP_Port := int2oct(valueof(udp_port), 2); + } + if (istemplatekind(sig_weight, "?")) { + e.signallingWeight := ?; + } else { + e.signallingWeight := int2oct(valueof(sig_weight), 1); + } + if (istemplatekind(data_weight, "?")) { + e.dataWeight := ?; + } else { + e.dataWeight := int2oct(valueof(data_weight), 1); + } + return e; + } + template (value) PDU_NS ts_NS_RESET(NsCause cause, Nsvci nsvci, Nsei nsei) := { pDU_NS_Reset := { @@ -537,7 +571,7 @@ octetstring sdu) := { } template (value) PDU_NS ts_SNS_CONFIG(Nsei nsei, boolean end_flag, - template (omit) IP4_Elements v4, + template (omit) IP4_Elements v4 := omit, template (omit) IP6_Elements v6 := omit) := { pDU_SNS_Config := { nsPduType := '0F'O, @@ -548,7 +582,7 @@ octetstring sdu) := { } } template PDU_NS tr_SNS_CONFIG(template Nsei nsei, template boolean end_flag, - template IP4_Elements v4, + template IP4_Elements v4 := omit, template IP6_Elements v6 := omit) := { pDU_SNS_Config := { nsPduType := '0F'O, |