lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2024

  • 1 participants
  • 1748 discussions
[S] Change in ...osmo-epdg[master]: config: Drop unused sasl section
by pespin 08 Feb '24

08 Feb '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35907?usp=email ) Change subject: config: Drop unused sasl section ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35907?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: Ie75c43fb92f4d1d9756943cf4432d32428d2fe8f Gerrit-Change-Number: 35907 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 08 Feb 2024 19:20:03 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in ...osmo-epdg[master]: Create PDP Context in tunnel after rx S6b CreateSessionResp
by pespin 08 Feb '24

08 Feb '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35906?usp=email ) Change subject: Create PDP Context in tunnel after rx S6b CreateSessionResp ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35906?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I911985743af6b3fa90fd78631a562b85ecacce15 Gerrit-Change-Number: 35906 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 08 Feb 2024 19:19:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in ...osmo-epdg[master]: Keep gtp2c specificities in its module file
by pespin 08 Feb '24

08 Feb '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35904?usp=email ) Change subject: Keep gtp2c specificities in its module file ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35904?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I03cfe86723e881013a3a745eb81f6d0d8b9cfe94 Gerrit-Change-Number: 35904 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 08 Feb 2024 19:19:57 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in ...osmo-epdg[master]: Add defines for PDP Address Type Nr
by pespin 08 Feb '24

08 Feb '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35903?usp=email ) Change subject: Add defines for PDP Address Type Nr ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35903?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I48e7064f598d6dfb0d4398500fb078b2d5da0226 Gerrit-Change-Number: 35903 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 08 Feb 2024 19:19:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in ...osmo-epdg[master]: Make PDP-Type and APN from GSUP AuthInfoReq available through all layers
by pespin 08 Feb '24

08 Feb '24
Attention is currently required from: laforge, lynxis lazus. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35901?usp=email ) Change subject: Make PDP-Type and APN from GSUP AuthInfoReq available through all layers ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35901?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I3f29b00f57f433f8623b9f0a5048c83985e5cced Gerrit-Change-Number: 35901 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Thu, 08 Feb 2024 19:19:54 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in ...osmo-epdg[master]: GTPv2/S2b: use correct instance id in the F-TEID
by lynxis lazus 08 Feb '24

08 Feb '24
lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35869?usp=email ) Change subject: GTPv2/S2b: use correct instance id in the F-TEID ...................................................................... GTPv2/S2b: use correct instance id in the F-TEID I've no idea why, but it seems the GTPu is the EBI, but the GTP-C is always 0. This way it works with open5gs. Change-Id: I053fe5661a38ce6fa7995964a0346129b56c823e --- M src/epdg_gtpc_s2b.erl 1 file changed, 15 insertions(+), 3 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/epdg_gtpc_s2b.erl b/src/epdg_gtpc_s2b.erl index bc1a076..0b76b6f 100644 --- a/src/epdg_gtpc_s2b.erl +++ b/src/epdg_gtpc_s2b.erl @@ -398,7 +398,7 @@ }, #v2_eps_bearer_id{eps_bearer_id = Bearer#gtp_bearer.ebi}, #v2_fully_qualified_tunnel_endpoint_identifier{ - instance = 0, + instance = Bearer#gtp_bearer.ebi, interface_type = 31, %% "S2b-U ePDG GTP-U" key = Bearer#gtp_bearer.local_data_tei, ipv4 = gtp_utils:ip_to_bin(LocalAddr) @@ -408,7 +408,7 @@ #v2_international_mobile_subscriber_identity{imsi = Imsi}, #v2_rat_type{rat_type = 3}, %% 3 = WLAN #v2_fully_qualified_tunnel_endpoint_identifier{ - instance = Bearer#gtp_bearer.ebi, + instance = 0, interface_type = 30, %% "S2b ePDG GTP-C" key = LocalCtlTEI, ipv4 = gtp_utils:ip_to_bin(LocalAddr) @@ -430,7 +430,7 @@ Bearer = gtp_session_default_bearer(Sess), IEs = [#v2_eps_bearer_id{eps_bearer_id = Bearer#gtp_bearer.ebi}, #v2_fully_qualified_tunnel_endpoint_identifier{ - instance = Bearer#gtp_bearer.ebi, + instance = 0, interface_type = 30, %% "S2b ePDG GTP-C" key = Bearer#gtp_bearer.local_data_tei, ipv4 = gtp_utils:ip_to_bin(LocalAddr) -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35869?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I053fe5661a38ce6fa7995964a0346129b56c823e Gerrit-Change-Number: 35869 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in ...osmo-epdg[master]: config: Drop unused sasl section
by pespin 08 Feb '24

08 Feb '24
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35907?usp=email ) Change subject: config: Drop unused sasl section ...................................................................... config: Drop unused sasl section Change-Id: Ie75c43fb92f4d1d9756943cf4432d32428d2fe8f --- M config/sys.config 1 file changed, 9 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/07/35907/2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35907?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: Ie75c43fb92f4d1d9756943cf4432d32428d2fe8f Gerrit-Change-Number: 35907 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in ...osmo-epdg[master]: config: Drop unused sasl section
by pespin 08 Feb '24

08 Feb '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35907?usp=email ) Change subject: config: Drop unused sasl section ...................................................................... config: Drop unused sasl section Change-Id: Ie75c43fb92f4d1d9756943cf4432d32428d2fe8f --- M config/sys.config 1 file changed, 9 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/07/35907/1 diff --git a/config/sys.config b/config/sys.config index 3f9d607..0fed8c8 100755 --- a/config/sys.config +++ b/config/sys.config @@ -37,17 +37,6 @@ {gtpc_remote_ip, "127.0.0.1"}, {gtpc_remote_port, 2123} ]}, - %% =========================================== - %% SASL config - %% =========================================== - {sasl, [{sasl_error_logger, false}]}, - % {sasl, [ - % {sasl_error_logger, {file, "log/sasl-error.log"}}, - % {errlog_type, error}, - % {error_logger_mf_dir, "log/sasl"}, % Log directory - % {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size - % {error_logger_mf_maxfiles, 5} % 5 files max - % ]}, % %% =========================================== %% Lager logging config %% =========================================== -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35907?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: Ie75c43fb92f4d1d9756943cf4432d32428d2fe8f Gerrit-Change-Number: 35907 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in ...osmo-epdg[master]: Create PDP Context in tunnel after rx S6b CreateSessionResp
by pespin 08 Feb '24

08 Feb '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35906?usp=email ) Change subject: Create PDP Context in tunnel after rx S6b CreateSessionResp ...................................................................... Create PDP Context in tunnel after rx S6b CreateSessionResp This refactoring is a preparation to call the gtp_u_kmod APIs. Change-Id: I911985743af6b3fa90fd78631a562b85ecacce15 --- M src/conv.erl M src/epdg_gtpc_s2b.erl M src/epdg_ue_fsm.erl A src/gtp_u_tun.erl M src/gtp_utils.erl 5 files changed, 145 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/06/35906/1 diff --git a/src/conv.erl b/src/conv.erl index a041847..95e103d 100644 --- a/src/conv.erl +++ b/src/conv.erl @@ -38,7 +38,27 @@ -include_lib("gtp_utils.hrl"). -include_lib("conv.hrl"). --export([cause_gtp2gsup/1, gtp2_paa_to_epdg_eua/1, epdg_eua_to_gsup_pdp_address/1]). +-export([ip_to_bin/1, bin_to_ip/1]). +-export([cause_gtp2gsup/1]). +-export([gtp2_paa_to_epdg_eua/1, epdg_eua_to_gsup_pdp_address/1]). + +% ergw_aaa/src/ergw_aaa_3gpp_dict.erl +% under GPLv2+ +ip_to_bin(IP) when is_binary(IP) -> + IP; + ip_to_bin({A, B, C, D}) -> + <<A, B, C, D>>; + ip_to_bin({A, B, C, D, E, F, G, H}) -> + <<A:16, B:16, C:16, D:16, E:16, F:16, G:16, H:16>>. + + bin_to_ip(<<A:8, B:8, C:8, D:8>> = IP) when is_binary(IP) -> + {A, B, C, D}; + bin_to_ip(<<A:16, B:16, C:16, D:16, E:16, F:16, G:16, H:16>> = IP) when is_binary(IP) -> + {A, B, C, D, E, F, G, H}; + bin_to_ip({_, _, _, _} = IP) -> + IP; + bin_to_ip({_, _, _, _, _, _, _, _} = IP) -> + IP. -spec cause_gtp2gsup(integer()) -> integer(). diff --git a/src/epdg_gtpc_s2b.erl b/src/epdg_gtpc_s2b.erl index b1c0627..c4ba4dc 100644 --- a/src/epdg_gtpc_s2b.erl +++ b/src/epdg_gtpc_s2b.erl @@ -258,6 +258,11 @@ lager:debug("Add bearer ~p to session ~p~n", [Bearer, Sess]), Sess#gtp_session{bearers = sets:add_element(Bearer, Sess#gtp_session.bearers)}. +gtp_session_update_bearer(Sess, OldBearer, NewBearer) -> + SetRemoved = sets:del_element(OldBearer, Sess#gtp_session.bearers), + SetUpdated = sets:add_element(NewBearer, SetRemoved), + Sess#gtp_session{bearers = SetUpdated}. + gtp_session_del_bearer(Sess, Bearer) -> lager:debug("Remove bearer ~p from session ~p~n", [Bearer, Sess]), Sess1 = Sess#gtp_session{bearers = sets:del_element(Bearer, Sess#gtp_session.bearers)}, @@ -269,25 +274,6 @@ gtp_session_default_bearer(Sess) -> gtp_session_find_bearer_by_ebi(Sess, Sess#gtp_session.default_bearer_id). - -update_gtp_session_from_create_session_response_ie(none, Sess) -> - Sess; -update_gtp_session_from_create_session_response_ie({_, - #v2_fully_qualified_tunnel_endpoint_identifier{ - interface_type = _Interface, - key = TEI, ipv4 = _IP4, ipv6 = _IP6}, - Next}, Sess) -> - update_gtp_session_from_create_session_response_ie(maps:next(Next), Sess#gtp_session{remote_control_tei = TEI}); -update_gtp_session_from_create_session_response_ie({_, _, Next}, - Sess) -> - update_gtp_session_from_create_session_response_ie(maps:next(Next), Sess). - -update_gtp_session_from_create_session_response_ies(#gtp{ie = IEs}, Sess) -> - update_gtp_session_from_create_session_response_ie(maps:next(maps:iterator(IEs)), Sess). - -update_gtp_session_from_create_session_response(Resp = #gtp{version = v2, type = create_session_response}, Sess) -> - update_gtp_session_from_create_session_response_ies(#gtp{ie = Resp#gtp.ie}, Sess). - % returns Sess if found, undefined it not find_gtp_session_by_local_teic(LocalControlTei, State) -> {LocalControlTei, Res} = sets:fold( @@ -313,13 +299,31 @@ lager:error("Rx unknown TEI ~p: ~p~n", [Resp#gtp.tei, Resp]), {noreply, State0}; Sess0 -> - Sess1 = update_gtp_session_from_create_session_response(Resp, Sess0), - lager:info("s2b: Updated Session after create_session_response: ~p~n", [Sess1]), - State1 = update_gtp_session(Sess0, Sess1, State0), % Do GTP specific msg parsing here, pass only relevant fields: - #{{v2_pdn_address_allocation,0} := Paa} = Resp#gtp.ie, + #{{v2_fully_qualified_tunnel_endpoint_identifier,1} := + #v2_fully_qualified_tunnel_endpoint_identifier{ + interface_type = 30, %% "S2b ePDG GTP-C" + key = RemoteTEIC, ipv4 = _IPc4, ipv6 = _IPc6}, + {v2_pdn_address_allocation,0} := Paa, + {v2_bearer_context,0} := #v2_bearer_context{instance = 0, group = BearerIE}} = Resp#gtp.ie, + % Parse BearerContext: + #{{v2_eps_bearer_id,0} := #v2_eps_bearer_id{instance = 0, eps_bearer_id = Ebi}, + {v2_fully_qualified_tunnel_endpoint_identifier,4} := + #v2_fully_qualified_tunnel_endpoint_identifier{ + interface_type = 31, %% "S2b-U ePDG GTP-U" + key = RemoteTEID, ipv4 = IPu4, ipv6 = IPu6} + } = BearerIE, + Bearer = gtp_session_find_bearer_by_ebi(Sess0, Ebi), + Sess1 = gtp_session_update_bearer(Sess0, Bearer, Bearer#gtp_bearer{remote_data_tei = RemoteTEID}), + Sess2 = Sess1#gtp_session{remote_control_tei = RemoteTEIC}, + lager:info("s2b: Updated Session after create_session_response: ~p~n", [Sess2]), + State1 = update_gtp_session(Sess0, Sess2, State0), ResInfo = #{ - eua => conv:gtp2_paa_to_epdg_eua(Paa) + eua => conv:gtp2_paa_to_epdg_eua(Paa), + local_teid => Bearer#gtp_bearer.local_data_tei, + remote_teid => RemoteTEID, + remote_ipv4 => IPu4, + remote_ipv6 => IPu6 }, epdg_ue_fsm:received_gtpc_create_session_response(Sess0#gtp_session.pid, {ok, ResInfo}), {noreply, State1} @@ -406,7 +410,7 @@ instance = 0, interface_type = 31, %% "S2b-U ePDG GTP-U" key = Bearer#gtp_bearer.local_data_tei, - ipv4 = gtp_utils:ip_to_bin(LocalAddr) + ipv4 = conv:ip_to_bin(LocalAddr) } ], IEs = [#v2_recovery{restart_counter = RCnt}, @@ -416,7 +420,7 @@ instance = Bearer#gtp_bearer.ebi, interface_type = 30, %% "S2b ePDG GTP-C" key = LocalCtlTEI, - ipv4 = gtp_utils:ip_to_bin(LocalAddr) + ipv4 = conv:ip_to_bin(LocalAddr) }, #v2_access_point_name{instance = 0, apn = [Apn]}, #v2_selection_mode{mode = 0}, @@ -438,7 +442,7 @@ instance = Bearer#gtp_bearer.ebi, interface_type = 30, %% "S2b ePDG GTP-C" key = Bearer#gtp_bearer.local_data_tei, - ipv4 = gtp_utils:ip_to_bin(LocalAddr) + ipv4 = conv:ip_to_bin(LocalAddr) } ], #gtp{version = v2, type = delete_session_request, tei = RemoteCtlTEI, seq_no = SeqNo, ie = IEs}. @@ -461,7 +465,7 @@ instance = 0, interface_type = 31, %% "S2b-U ePDG GTP-U" key = Bearer#gtp_bearer.local_data_tei, - ipv4 = gtp_utils:ip_to_bin(LocalAddr) + ipv4 = conv:ip_to_bin(LocalAddr) } ], IEs = [#v2_cause{v2_cause = GtpCause}, diff --git a/src/epdg_ue_fsm.erl b/src/epdg_ue_fsm.erl index fa780e8..7568db0 100644 --- a/src/epdg_ue_fsm.erl +++ b/src/epdg_ue_fsm.erl @@ -244,6 +244,16 @@ state_authenticated({call, From}, {received_gtpc_create_session_response, Result}, Data) -> lager:info("ue_fsm state_authenticated event=received_gtpc_create_session_response, ~p~n", [Data]), + case Result of + {ok, ResInfo} -> + #{eua := EUA, + local_teid := LocalTEID, + remote_teid := RemoteTEID, + remote_ipv4 := RemoteIPv4 % TODO: remote_ipv6 + } = ResInfo, + gtp_u_tun:create_pdp_context(RemoteIPv4, EUA, LocalTEID, RemoteTEID); + _ -> ok + end, gsup_server:tunnel_response(Data#ue_fsm_data.imsi, Result), {keep_state, Data, [{reply,From,ok}]}; diff --git a/src/gtp_u_tun.erl b/src/gtp_u_tun.erl new file mode 100644 index 0000000..e08b804 --- /dev/null +++ b/src/gtp_u_tun.erl @@ -0,0 +1,70 @@ +% GTP-U tun related functionalities +% +% (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +% Author: Pau Espin Pedrol <pespin(a)sysmocom.de> +% +% All Rights Reserved +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU Affero General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU Affero General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% Additional Permission under GNU AGPL version 3 section 7: +% +% If you modify this Program, or any covered work, by linking or +% combining it with runtime libraries of Erlang/OTP as released by +% Ericsson on http://www.erlang.org (or a modified version of these +% libraries), containing parts covered by the terms of the Erlang Public +% License (http://www.erlang.org/EPLICENSE) the licensors of this +% Program grant you additional permission to convey the resulting work +% without the need to license the runtime libraries of Erlang/OTP under +% the GNU Affero General Public License. Corresponding Source for a +% non-source form of such a combination shall include the source code +% for the parts of the runtime libraries of Erlang/OTP used as well as +% that of the covered work. + +-module(gtp_u_tun). +-author('Pau Espin Pedrol <pespin(a)sysmocom.de>'). +-include("conv.hrl"). + +-export([create_pdp_context/4]). + +%%%%%%%%%%%%%%%%%%%%%% +%%% Internal API +%%%%%%%%%%%%%%%%%%%%%% + +% Obtain ServerRef of the gtp_u_kmod_port process spawned during startup based on +% gtp_u_kmod config: +get_env_gtp_u_kmod_server_ref() -> + GtpuKmodSockets = application:get_env(gtp_u_kmod, sockets, []), + [GtpuKmodSocket | _] = GtpuKmodSockets, + {GtpuKmodName, _GtpuKmodSockOpts} = GtpuKmodSocket, + GtpuKmodServRef = gtp_u_kmod_port:port_reg_name(GtpuKmodName), + GtpuKmodServRef. + + +%%%%%%%%%%%%%%%%%%%%%% +%%% Internal API +%%%%%%%%%%%%%%%%%%%%%% + +% Create a PDP Context on the GTP tundev +create_pdp_context(PeerAddr, EUA, LocalTEID, RemoteTEID) -> + %SGSNaddr = {127,0,0,1}, % TODO: This should be set to the GTP-U IP address provided by the PGW + %EUA = {127,0,0,1}, % TODO: This should be set to the EUA IP address provided by the PGW + %LocalTEID = 1234, % TODO: this should be set to our locally generated TEID. + %RemoteTEID = 56768, % TODO: this should be set to TEID obtained from CreateSessionResponse + PeerIP = conv:bin_to_ip(PeerAddr), % TODO: IPv6 + UEIP = conv:bin_to_ip(EUA#epdg_eua.ipv4), % TODO: IPv6. + ok. + % TODO: This will be enabled once we depend on the gtp_u_kmod module: + %ServRef = get_env_gtp_u_kmod_server_ref(), + %gen_server:call(ServRef, {PeerIP, UEIP, LocalTEID, RemoteTEID}). \ No newline at end of file diff --git a/src/gtp_utils.erl b/src/gtp_utils.erl index eb0a23a..6098da2 100644 --- a/src/gtp_utils.erl +++ b/src/gtp_utils.erl @@ -35,16 +35,8 @@ -module(gtp_utils). -author('Alexander Couzens <lynxis(a)fe80.eu>'). --export([ip_to_bin/1, plmn_to_bin/3, enum_v2_cause/1]). +-export([plmn_to_bin/3, enum_v2_cause/1]). -% ergw_aaa/src/ergw_aaa_3gpp_dict.erl -% under GPLv2+ -ip_to_bin(IP) when is_binary(IP) -> - IP; -ip_to_bin({A, B, C, D}) -> - <<A, B, C, D>>; -ip_to_bin({A, B, C, D, E, F, G, H}) -> - <<A:16, B:16, C:16, D:16, E:16, F:16, G:16, H:16>>. % ergw/apps/ergw/test/*.erl % under GPLv2+ -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35906?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I911985743af6b3fa90fd78631a562b85ecacce15 Gerrit-Change-Number: 35906 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: epdg: Fix instance in CreateSession Resp BearerCtx S2b-U PGW F-TEID IE
by pespin 08 Feb '24

08 Feb '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35905?usp=email ) Change subject: epdg: Fix instance in CreateSession Resp BearerCtx S2b-U PGW F-TEID IE ...................................................................... epdg: Fix instance in CreateSession Resp BearerCtx S2b-U PGW F-TEID IE According to 3GPP TS 29.274 Table 7.2.2-2, instance=4. Change-Id: Ie60605f39b4c43f186aee67f966708a1efe70412 --- M epdg/EPDG_Tests.ttcn 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/35905/1 diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn index aceedd4..03ea275 100644 --- a/epdg/EPDG_Tests.ttcn +++ b/epdg/EPDG_Tests.ttcn @@ -450,7 +450,7 @@ fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S2b_ePDG_GTPC, g_pars.teic_local, 0, f_inet_addr(mp_s2b_local_ip), omit); - fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S2bU_ePDG_GTPU, g_pars.bearer.teid_local, 2, + fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S2bU_ePDG_GTPU, g_pars.bearer.teid_local, 4, f_inet_addr(mp_s2b_local_ip), omit); paa := ts_GTP2C_PdnAddrAlloc_v4(f_inet_addr(g_pars.ue_ip)); bctx_ies := ts_GTP2C_BcContextIE(ebi := g_pars.bearer.ebi, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35905?usp=email 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: Ie60605f39b4c43f186aee67f966708a1efe70412 Gerrit-Change-Number: 35905 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • ...
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.