neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30928 )
Change subject: PFCP: add support for Network Instance IE ......................................................................
PFCP: add support for Network Instance IE
Related: SYS#6192 Change-Id: Iba8d423cd91e73ea40139a5b58c4e22f1a741dc1 --- M library/PFCP_Templates.ttcn 1 file changed, 24 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/28/30928/1
diff --git a/library/PFCP_Templates.ttcn b/library/PFCP_Templates.ttcn index a0d5235..a5f83ec 100644 --- a/library/PFCP_Templates.ttcn +++ b/library/PFCP_Templates.ttcn @@ -274,15 +274,34 @@ choose_id := choose_id }
+/* Convert plain Network Instance name to encoded (length-byte + "name") format. + * Works only for single-label names, i.e. no dots in the name. */ +private function f_netinst_str_to_qname(charstring name) return octetstring +{ + var octetstring qname := int2oct(lengthof(name), 1) & char2oct(name); + return qname; +} + +function ts_PFCP_Network_Instance(charstring netinst_name) return Network_Instance +{ + var Network_Instance netinst := { + elementIdentifier := 22, + lengthIndicator := 0, + pdn_instance := f_netinst_str_to_qname(netinst_name) + } + return netinst; +} + template (value) PDI_IE ts_PFCP_PDI(e_PFCP_Src_Iface src_iface, template (omit) F_TEID local_F_TEID := omit, - template (omit) UE_IP_Address ue_addr_v4 := omit) := { + template (omit) UE_IP_Address ue_addr_v4 := omit, + template (omit) Network_Instance network_instance := omit) := { elementIdentifier := 2, lengthIndicator := 0, grouped_ie := { source_interface := ts_PFCP_Src_Iface(src_iface), local_F_TEID := local_F_TEID, - pdn_instance := omit, + pdn_instance := network_instance, ue_ip_address := ue_addr_v4, traffic_endpoint_id := omit, sdf_filter_list := omit, @@ -356,13 +375,14 @@
template (value) Forwarding_Parameters ts_PFCP_Forwarding_Parameters( e_PFCP_Dest_Iface dest_iface, - template (omit) Outer_Header_Creation outer_header_creation := omit + template (omit) Outer_Header_Creation outer_header_creation := omit, + template (omit) Network_Instance network_instance := omit ) := { elementIdentifier := 4, lengthIndicator := 0, grouped_ie := { destination_interface := ts_PFCP_Destination_Interface(dest_iface), - pdn_Instance := omit, + pdn_Instance := network_instance, redirect_information := omit, outer_header_creation := outer_header_creation, transport_level_marking := omit,