neels has submitted this change. ( 
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(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/library/PFCP_Templates.ttcn b/library/PFCP_Templates.ttcn
index 4e58f32..3acc287 100644
--- a/library/PFCP_Templates.ttcn
+++ b/library/PFCP_Templates.ttcn
@@ -273,15 +273,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,
@@ -355,13 +374,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,

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30928
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iba8d423cd91e73ea40139a5b58c4e22f1a741dc1
Gerrit-Change-Number: 30928
Gerrit-PatchSet: 3
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to