fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37795?usp=email )


Change subject: erab_fsm: include Network Instance IE in PDRs and FARs
......................................................................

erab_fsm: include Network Instance IE in PDRs and FARs

TODO: make the actual values configurable via env params.

Change-Id: I4dbe8e0b1d14eed5fdb3f9f3f2543c44fd543d22
---
M src/erab_fsm.erl
1 file changed, 11 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw 
refs/changes/95/37795/1

diff --git a/src/erab_fsm.erl b/src/erab_fsm.erl
index 5635086..57a39e3 100644
--- a/src/erab_fsm.erl
+++ b/src/erab_fsm.erl
@@ -369,6 +369,10 @@
 -spec session_establish_req(erab_state()) -> pfcp_peer:pfcp_session_rsp().
 session_establish_req(#erab_state{seid_loc = F_SEID, %% used as F-SEID
                                   teid_from_access = TEID_FromAcc}) ->
+    %% Network Instance IE values for core/access
+    %% TODO: make those configurable via env variables
+    NI_Core = << 16#09, "core-side" >>,
+    NI_Access = << 16#0a, "radio-side" >>,
     %% Packet Detection Rules
     OHR = #outer_header_removal{header = 'GTP-U/UDP/IPv4'},
     PDRs = [#{pdr_id => {pdr_id, 1}, %% -- for Core -> Access
@@ -377,6 +381,7 @@
               outer_header_removal => OHR,
               pdi => #{f_teid => #f_teid{teid = choose,
                                          ipv4 = choose},
+                       network_instance => NI_Core,
                        source_interface => {source_interface, 'Core'}}},
             #{pdr_id => {pdr_id, 2}, %% -- for Access -> Core
               far_id => {far_id, 2}, %% see FARs below
@@ -384,6 +389,7 @@
               outer_header_removal => OHR,
               pdi => #{f_teid => #f_teid{teid = choose,
                                          ipv4 = choose},
+                       network_instance => NI_Access,
                        source_interface => {source_interface, 'Access'}}}],
     %% Forwarding Action Rules
     OHC = #outer_header_creation{n6 = false,
@@ -399,6 +405,7 @@
               apply_action => #{'FORW' => []},
               forwarding_parameters =>
                 #{outer_header_creation => OHC,
+                  network_instance => NI_Access,
                   destination_interface => {destination_interface, 'Core'}}}],
     pfcp_peer:session_establish_req(F_SEID, PDRs, FARs).
 
@@ -406,6 +413,9 @@
 -spec session_modify_req(erab_state()) -> pfcp_peer:pfcp_session_rsp().
 session_modify_req(#erab_state{seid_rem = SEID, %% SEID allocated to us
                                teid_from_core = TEID_FromCore}) ->
+    %% Network Instance IE value for access
+    %% TODO: make those configurable via env variables
+    NI_Access = << 16#0a, "radio-side" >>,
     %% Forwarding Action Rules
     OHC = #outer_header_creation{n6 = false,
                                  n19 = false,
@@ -418,6 +428,7 @@
               apply_action => #{'FORW' => []},
               forwarding_parameters =>
                 #{outer_header_creation => OHC,
+                  network_instance => NI_Access,
                   destination_interface => {destination_interface, 
'Access'}}}],
     pfcp_peer:session_modify_req(SEID, [], FARs).


--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37795?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I4dbe8e0b1d14eed5fdb3f9f3f2543c44fd543d22
Gerrit-Change-Number: 37795
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>

Reply via email to