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

June 2024

  • 1 participants
  • 1566 discussions
[S] Change in ...osmo-s1gw[master]: rebar.{config,lock}: add pfcplib to deps[]
by pespin 21 Jun '24

21 Jun '24
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37267?usp=email ) Change subject: rebar.{config,lock}: add pfcplib to deps[] ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37267?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I4cf3b3b09b19ebabbaad082c616c31ffc1327fd7 Gerrit-Change-Number: 37267 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 21 Jun 2024 12:34:04 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in ...osmo-s1gw[master]: sctp_proxy: reduce 'connecting' state timeout: 2000s -> 2s
by pespin 21 Jun '24

21 Jun '24
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37266?usp=email ) Change subject: sctp_proxy: reduce 'connecting' state timeout: 2000s -> 2s ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37266?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I79b04c0bc087d598b3e322fd697508ac840402d5 Gerrit-Change-Number: 37266 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 21 Jun 2024 12:33:33 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in ...osmo-s1gw[master]: sctp_proxy: fix no-op 'connecting' state timeout
by pespin 21 Jun '24

21 Jun '24
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37265?usp=email ) Change subject: sctp_proxy: fix no-op 'connecting' state timeout ...................................................................... Patch Set 1: (2 comments) File src/sctp_proxy.erl: https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37265/comment/cd0d45a2_9fb1… PS1, Line 85: connecting(enter, OldState, tip: I find it useful to prefix these state functions with "st_", this way it's clearer they are part of the FSM https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37265/comment/003d8c0c_f7b9… PS1, Line 90: {next_state, connecting, S#{sock => Sock}, Reentering the state from withing the enter phase looks a bit werid to me tbh. I think it's totally fine and the proper thing to do to "keep_state" in here, I did that in osmo-pedg and it was working with ttcn3 tests afair. The problem I think is that in line 94 connecting_timeout, instead of shutting down you actually need to do "{next_state, connecting, ...}" Feel free to look at it or merge it if anyway it works for you... -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37265?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I45d874f3f73d5b9a8aa62c8a36e94e51497d6754 Gerrit-Change-Number: 37265 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 21 Jun 2024 12:33:23 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in ...osmo-s1gw[master]: fix Copyright year in *.erl files: 2021 -> 2024
by pespin 21 Jun '24

21 Jun '24
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37264?usp=email ) Change subject: fix Copyright year in *.erl files: 2021 -> 2024 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37264?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I610ced7d15a8a1652813c02978e2d7569c077337 Gerrit-Change-Number: 37264 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 21 Jun 2024 12:25:12 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: IPAd_Tests: respond to enableUsingDD
by dexter 21 Jun '24

21 Jun '24
dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37234?usp=email ) Change subject: IPAd_Tests: respond to enableUsingDD ...................................................................... IPAd_Tests: respond to enableUsingDD Since the IPAd we are testing now supports automatic profile enabeling, it will call the ES10b function enableUsingDD after the profile installation is complete. Our tests now need to expect this event. Related: SYS#6563 Change-Id: I892485368925f9713d1dc0d44bd34277fd992875 --- M ipad/IPAd_Tests.ttcn M library/euicc/SGP32Definitions_EncDec.cc M library/euicc/SGP32Definitions_Templates.ttcn M library/euicc/SGP32Definitions_Types.ttcn 4 files changed, 47 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/ipad/IPAd_Tests.ttcn b/ipad/IPAd_Tests.ttcn index c5ee412..1ede0b3 100644 --- a/ipad/IPAd_Tests.ttcn +++ b/ipad/IPAd_Tests.ttcn @@ -480,6 +480,9 @@ } } + /* Responds to the profile auto enable attempt by the iPAD */ + f_vpcd_transceive(enc_EnableUsingDDResponse(valueof(ts_enableUsingDDResponse))); + /* Receive ProfileInstallationResult from iPAD->eIM */ esipa_req := f_esipa_transceive_empty_response(); /* TODO: match response (we do not have a template yet) */ diff --git a/library/euicc/SGP32Definitions_EncDec.cc b/library/euicc/SGP32Definitions_EncDec.cc index a457943..3dbb4bf 100644 --- a/library/euicc/SGP32Definitions_EncDec.cc +++ b/library/euicc/SGP32Definitions_EncDec.cc @@ -117,6 +117,23 @@ return OCTETSTRING(buf.get_len(), buf.get_data()); } +EnableUsingDDResponse dec__EnableUsingDDResponse(const OCTETSTRING &stream) { + TTCN_Buffer buf; + EnableUsingDDResponse msg; + buf.put_os(stream); + + msg.decode(EnableUsingDDResponse_descr_, buf, TTCN_EncDec::CT_BER, BER_ACCEPT_ALL); + return msg; +} + +OCTETSTRING enc__EnableUsingDDResponse(const EnableUsingDDResponse &msg) { + TTCN_Buffer buf; + + buf.clear(); + msg.encode(EnableUsingDDResponse_descr_, buf, TTCN_EncDec::CT_BER, BER_ENCODE_DER); + return OCTETSTRING(buf.get_len(), buf.get_data()); +} + ProfileRollbackRequest dec__ProfileRollbackRequest(const OCTETSTRING &stream) { TTCN_Buffer buf; ProfileRollbackRequest msg; diff --git a/library/euicc/SGP32Definitions_Templates.ttcn b/library/euicc/SGP32Definitions_Templates.ttcn index 218f3ed..649545b 100644 --- a/library/euicc/SGP32Definitions_Templates.ttcn +++ b/library/euicc/SGP32Definitions_Templates.ttcn @@ -1179,6 +1179,16 @@ } } +/* GSMA SGP.32, section 5.9.15 */ +template (present) EnableUsingDDResponse +tr_enableUsingDDResponse := { + enableUsingDDResult := ? +} +template (value) EnableUsingDDResponse +ts_enableUsingDDResponse := { + enableUsingDDResult := 1 /* autoEnableNotAvailable */ +} + /* GSMA SGP.32, section 5.9.16 */ template (present) ProfileRollbackRequest tr_profileRollbackRequest := { diff --git a/library/euicc/SGP32Definitions_Types.ttcn b/library/euicc/SGP32Definitions_Types.ttcn index 4b68e67..492daef 100644 --- a/library/euicc/SGP32Definitions_Types.ttcn +++ b/library/euicc/SGP32Definitions_Types.ttcn @@ -18,6 +18,9 @@ external function dec_GetEimConfigurationDataResponse(in octetstring stream) return GetEimConfigurationDataResponse; external function enc_GetEimConfigurationDataResponse(in GetEimConfigurationDataResponse msg) return octetstring; +external function dec_EnableUsingDDResponse(in octetstring stream) return EnableUsingDDResponse; +external function enc_EnableUsingDDResponse(in EnableUsingDDResponse msg) return octetstring; + external function dec_ProfileRollbackRequest(in octetstring stream) return ProfileRollbackRequest; external function enc_ProfileRollbackRequest(in ProfileRollbackRequest msg) return octetstring; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37234?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: I892485368925f9713d1dc0d44bd34277fd992875 Gerrit-Change-Number: 37234 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in ...osmo-s1gw[master]: sctp_proxy: fix no-op 'connecting' state timeout
by fixeria 20 Jun '24

20 Jun '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37265?usp=email ) Change subject: sctp_proxy: fix no-op 'connecting' state timeout ...................................................................... sctp_proxy: fix no-op 'connecting' state timeout We need to perform a loop state transition if we want the timer to be scheduled for 'connecting'. Otherwise the timeout is no-op. Change-Id: I45d874f3f73d5b9a8aa62c8a36e94e51497d6754 --- M src/sctp_proxy.erl 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/65/37265/1 diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl index a40371d..82c697c 100644 --- a/src/sctp_proxy.erl +++ b/src/sctp_proxy.erl @@ -87,7 +87,7 @@ ?LOG_INFO("State change: ~p -> ~p", [OldState, ?FUNCTION_NAME]), %% Initiate connection establishment with the MME {ok, Sock} = sctp_client:connect(MmeAddr, MmePort), - {keep_state, S#{sock => Sock}, + {next_state, connecting, S#{sock => Sock}, [{state_timeout, 2_000_000, conn_est_timeout}]}; %% Handle connection establishment timeout -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37265?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I45d874f3f73d5b9a8aa62c8a36e94e51497d6754 Gerrit-Change-Number: 37265 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in ...osmo-s1gw[master]: fix Copyright year in *.erl files: 2021 -> 2024
by fixeria 20 Jun '24

20 Jun '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37264?usp=email ) Change subject: fix Copyright year in *.erl files: 2021 -> 2024 ...................................................................... fix Copyright year in *.erl files: 2021 -> 2024 Change-Id: I610ced7d15a8a1652813c02978e2d7569c077337 --- M src/osmo_s1gw.erl M src/osmo_s1gw_app.erl M src/osmo_s1gw_sup.erl M src/s1ap_proxy.erl M src/sctp_client.erl M src/sctp_proxy.erl M src/sctp_server.erl 7 files changed, 16 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/64/37264/1 diff --git a/src/osmo_s1gw.erl b/src/osmo_s1gw.erl index 422b3c7..71ac34c 100644 --- a/src/osmo_s1gw.erl +++ b/src/osmo_s1gw.erl @@ -1,4 +1,4 @@ -%% Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Copyright (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> %% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> %% %% All Rights Reserved diff --git a/src/osmo_s1gw_app.erl b/src/osmo_s1gw_app.erl index e41f5f5..c570804 100644 --- a/src/osmo_s1gw_app.erl +++ b/src/osmo_s1gw_app.erl @@ -1,4 +1,4 @@ -%% Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Copyright (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> %% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> %% %% All Rights Reserved diff --git a/src/osmo_s1gw_sup.erl b/src/osmo_s1gw_sup.erl index fe67f59..e13cd1a 100644 --- a/src/osmo_s1gw_sup.erl +++ b/src/osmo_s1gw_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Copyright (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> %% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> %% %% All Rights Reserved diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index 6c143e8..579df40 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -1,4 +1,4 @@ -%% Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Copyright (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> %% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> %% %% All Rights Reserved diff --git a/src/sctp_client.erl b/src/sctp_client.erl index 06ee31d..24ec75d 100644 --- a/src/sctp_client.erl +++ b/src/sctp_client.erl @@ -1,4 +1,4 @@ -%% Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Copyright (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> %% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> %% %% All Rights Reserved diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl index 7f389aa..a40371d 100644 --- a/src/sctp_proxy.erl +++ b/src/sctp_proxy.erl @@ -1,4 +1,4 @@ -%% Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Copyright (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> %% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> %% %% All Rights Reserved diff --git a/src/sctp_server.erl b/src/sctp_server.erl index 2c3893a..d0484e6 100644 --- a/src/sctp_server.erl +++ b/src/sctp_server.erl @@ -1,4 +1,4 @@ -%% Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Copyright (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> %% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> %% %% All Rights Reserved -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37264?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I610ced7d15a8a1652813c02978e2d7569c077337 Gerrit-Change-Number: 37264 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in ...osmo-s1gw[master]: sctp_proxy: reduce 'connecting' state timeout: 2000s -> 2s
by fixeria 20 Jun '24

20 Jun '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37266?usp=email ) Change subject: sctp_proxy: reduce 'connecting' state timeout: 2000s -> 2s ...................................................................... sctp_proxy: reduce 'connecting' state timeout: 2000s -> 2s 2000 seconds is waay too much. Change-Id: I79b04c0bc087d598b3e322fd697508ac840402d5 --- M src/sctp_proxy.erl 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/66/37266/1 diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl index 82c697c..350f655 100644 --- a/src/sctp_proxy.erl +++ b/src/sctp_proxy.erl @@ -88,7 +88,7 @@ %% Initiate connection establishment with the MME {ok, Sock} = sctp_client:connect(MmeAddr, MmePort), {next_state, connecting, S#{sock => Sock}, - [{state_timeout, 2_000_000, conn_est_timeout}]}; + [{state_timeout, 2_000, conn_est_timeout}]}; %% Handle connection establishment timeout connecting(state_timeout, conn_est_timeout, _S) -> -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37266?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I79b04c0bc087d598b3e322fd697508ac840402d5 Gerrit-Change-Number: 37266 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in ...osmo-s1gw[master]: rebar.{config,lock}: add pfcplib to deps[]
by fixeria 20 Jun '24

20 Jun '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37267?usp=email ) Change subject: rebar.{config,lock}: add pfcplib to deps[] ...................................................................... rebar.{config,lock}: add pfcplib to deps[] Change-Id: I4cf3b3b09b19ebabbaad082c616c31ffc1327fd7 --- M rebar.config M rebar.lock 2 files changed, 26 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/67/37267/1 diff --git a/rebar.config b/rebar.config index db88c7e..ab19052 100644 --- a/rebar.config +++ b/rebar.config @@ -5,7 +5,9 @@ {minimum_otp_vsn, "25.2.3"}. {deps, [{logger_color_formatter, - {git, "https://github.com/rlipscombe/logger_color_formatter.git", {tag, "0.5.0"}}} + {git, "https://github.com/rlipscombe/logger_color_formatter.git", {tag, "0.5.0"}}}, + {pfcplib, + {git, "https://github.com/travelping/pfcplib.git", {tag, "3.0.0"}}} ]}. {plugins, [{provider_asn1, ".*", diff --git a/rebar.lock b/rebar.lock index 0d93593..2b12fd6 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,4 +1,16 @@ -[{<<"logger_color_formatter">>, +{"1.2.0", +[{<<"cut">>,{pkg,<<"cut">>,<<"1.0.3">>},1}, + {<<"logger_color_formatter">>, {git,"https://github.com/rlipscombe/logger_color_formatter.git", {ref,"f1c96f979e6350f8cd787d27fe9ff003cbf3416b"}}, - 0}]. + 0}, + {<<"pfcplib">>, + {git,"https://github.com/travelping/pfcplib.git", + {ref,"975971b13f3c315c836ee6e1ffb502ca2fb037fc"}}, + 0}]}. +[ +{pkg_hash,[ + {<<"cut">>, <<"1577F2F3BC0F2BF3B97903B7426F8A3D79523687B6A444D0F59A095EF69A0E81">>}]}, +{pkg_hash_ext,[ + {<<"cut">>, <<"1A4A25DB2B7C5565FD28B314A4EEB898B1ED3CAFFA1AB09149345FB5731ED04B">>}]} +]. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37267?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I4cf3b3b09b19ebabbaad082c616c31ffc1327fd7 Gerrit-Change-Number: 37267 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in ...osmo-s1gw[master]: pfcp_peer: initial PFCP peer implementation
by fixeria 20 Jun '24

20 Jun '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37268?usp=email ) Change subject: pfcp_peer: initial PFCP peer implementation ...................................................................... pfcp_peer: initial PFCP peer implementation Change-Id: I7bad0069dca2111006039d12e744a2bd6d2cb86e --- M config/sys.config M src/osmo_s1gw.app.src M src/osmo_s1gw_sup.erl A src/pfcp_peer.erl 4 files changed, 253 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/68/37268/1 diff --git a/config/sys.config b/config/sys.config index 5ccd43d..20d409d 100644 --- a/config/sys.config +++ b/config/sys.config @@ -13,7 +13,9 @@ {osmo_s1gw, [{s1gw_bind_addr, "127.0.1.1"}, %% S1GW bind address for incoming eNB connections {mme_loc_addr, "127.0.2.1"}, %% local address for outgoing connections to the MME - {mme_rem_addr, "127.0.2.10"} %% remote address for outgoing connections to the MME + {mme_rem_addr, "127.0.2.10"}, %% remote address for outgoing connections to the MME + {upf_loc_addr, "127.0.1.1"}, %% local address for outgoing connections to the UPF + {upf_rem_addr, "127.0.1.2"} %% remote address for outgoing connections to the UPF ]}, %% ================================================================================ %% kernel config diff --git a/src/osmo_s1gw.app.src b/src/osmo_s1gw.app.src index 6fd8174..8bb89de 100644 --- a/src/osmo_s1gw.app.src +++ b/src/osmo_s1gw.app.src @@ -7,7 +7,8 @@ {applications, [ kernel, stdlib, - logger_color_formatter + logger_color_formatter, + pfcplib ]}, {modules, []}, {mod, {osmo_s1gw_app, []}}, diff --git a/src/osmo_s1gw_sup.erl b/src/osmo_s1gw_sup.erl index e13cd1a..a0652c3 100644 --- a/src/osmo_s1gw_sup.erl +++ b/src/osmo_s1gw_sup.erl @@ -47,6 +47,8 @@ -define(ENV_DEFAULT_MME_LOC_ADDR, "127.0.2.1"). -define(ENV_DEFAULT_MME_REM_ADDR, "127.0.2.10"). -define(ENV_DEFAULT_MME_REM_PORT, ?S1AP_PORT). +-define(ENV_DEFAULT_UPF_LOC_ADDR, "127.0.1.1"). +-define(ENV_DEFAULT_UPF_REM_ADDR, "127.0.1.2"). %% ------------------------------------------------------------------ %% supervisor API @@ -62,6 +64,9 @@ MmeLocAddr = get_env(mme_loc_addr, ?ENV_DEFAULT_MME_LOC_ADDR), MmeRemAddr = get_env(mme_rem_addr, ?ENV_DEFAULT_MME_REM_ADDR), MmeRemPort = get_env(mme_rem_port, ?ENV_DEFAULT_MME_REM_PORT), + UpfLocAddr = get_env(upf_loc_addr, ?ENV_DEFAULT_UPF_LOC_ADDR), + UpfRemPort = get_env(upf_rem_addr, ?ENV_DEFAULT_UPF_REM_ADDR), + SctpServer = {sctp_server, {sctp_server, start_link, [S1GWBindAddr, S1GWBindPort, {{MmeLocAddr, MmeRemAddr}, MmeRemPort}]}, @@ -69,7 +74,14 @@ 5000, worker, [sctp_server]}, - {ok, {{one_for_all, 5, 10}, [SctpServer]}}. + PfcpPeer = {pfcp_peer, {pfcp_peer, start_link, + [UpfLocAddr, UpfRemPort]}, + permanent, + 5000, + worker, + [pfcp_peer]}, + + {ok, {{one_for_all, 5, 10}, [SctpServer, PfcpPeer]}}. %% ------------------------------------------------------------------ diff --git a/src/pfcp_peer.erl b/src/pfcp_peer.erl new file mode 100644 index 0000000..ced3a5e --- /dev/null +++ b/src/pfcp_peer.erl @@ -0,0 +1,226 @@ +%% Copyright (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> +%% +%% All Rights Reserved +%% +%% SPDX-License-Identifier: AGPL-3.0-or-later +%% +%% 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 <https://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 https://www.erlang.org (or a modified version of these +%% libraries), containing parts covered by the terms of the Erlang Public +%% License (https://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(pfcp_peer). +-behaviour(gen_statem). + +-export([init/1, + callback_mode/0, + connecting/3, + connected/3, + code_change/4, + terminate/3]). +-export([start_link/2, + shutdown/0]). + +-include_lib("kernel/include/logger.hrl"). +-include_lib("pfcplib/include/pfcp_packet.hrl"). + +%% 3GPP TS 29.244, section 4.2 "UDP Header and Port Numbers" +-define(PFCP_PORT, 8805). + +-type pfcp_seq_nr() :: pos_integer(). +-type pfcp_msg_type() :: atom(). +-type pfcp_msg_ies() :: [term()] | map() | binary(). +-type pfcp_msg() :: {pfcp_msg_type(), pfcp_msg_ies()}. + +-record(peer_state, {sock :: gen_udp:socket(), + loc_addr :: inet:ip_address(), + rem_addr :: inet:ip_address(), + tx_seq_nr :: pfcp_seq_nr() + }). + +-type peer_state() :: #peer_state{}. + +%% ------------------------------------------------------------------ +%% public API +%% ------------------------------------------------------------------ + +start_link(LocAddr, RemAddr) -> + gen_statem:start_link({local, ?MODULE}, ?MODULE, + [LocAddr, RemAddr], + []). + + +shutdown() -> + gen_statem:stop(?MODULE). + + +%% ------------------------------------------------------------------ +%% gen_server API +%% ------------------------------------------------------------------ + +init([LocAddrStr, RemAddr]) when is_list(LocAddrStr) -> + {ok, LocAddr} = inet:parse_address(LocAddrStr), + init([LocAddr, RemAddr]); + +init([LocAddr, RemAddrStr]) when is_list(RemAddrStr) -> + {ok, RemAddr} = inet:parse_address(RemAddrStr), + init([LocAddr, RemAddr]); + +init([LocAddr, RemAddr]) -> + process_flag(trap_exit, true), + {ok, Sock} = gen_udp:open(?PFCP_PORT, [binary, + {ip, LocAddr}, + {reuseaddr, true}, + {active, true}]), + ?LOG_INFO("PFCP peer @ ~p will talk to UPF @ ~p", [LocAddr, RemAddr]), + {ok, connecting, #peer_state{sock = Sock, + loc_addr = LocAddr, + rem_addr = RemAddr, + tx_seq_nr = 0}}. + + +callback_mode() -> + [state_functions, state_enter]. + + +%% CONNECTING state +connecting(enter, OldState, + #peer_state{tx_seq_nr = TxSeqNr} = S) -> + ?LOG_INFO("State change: ~p -> ~p", [OldState, ?FUNCTION_NAME]), + %% Tx PFCP Association Setup + ok = send_assoc_setup(S), + {next_state, connecting, S#peer_state{tx_seq_nr = TxSeqNr + 1}, + [{state_timeout, 2_000, assoc_setup_timeout}]}; + +%% Handle Association Setup timeout +connecting(state_timeout, assoc_setup_timeout, _S) -> + {stop, {shutdown, assoc_setup_timeout}}; + +%% Handle incoming PFCP PDU(s) +connecting(info, {udp, Sock, _FromIp, _FromPort, Data}, + #peer_state{sock = Sock} = S) -> + case decode_pdu(S, Data) of + {association_setup_response, #{pfcp_cause := 'Request accepted'}} -> + ?LOG_INFO("Rx Association Setup Response (Request accepted)"), + {next_state, connected, S}; + {association_setup_response, #{pfcp_cause := Cause}} -> + ?LOG_ERROR("Rx Association Setup Response (~p)", [Cause]), + {stop, {shutdown, assoc_setup_nack}}; + PDU -> + ?LOG_NOTICE("Rx unexpected PFCP PDU: ~p", [PDU]), + {keep_state, S} + end; + +connecting(Event, EventData, S) -> + ?LOG_ERROR("Unexpected event ~p: ~p", [Event, EventData]), + {keep_state, S}. + + +%% CONNECTED state +connected(enter, OldState, S) -> + ?LOG_INFO("State change: ~p -> ~p", [OldState, ?FUNCTION_NAME]), + {keep_state, S}; + +%% Catch-all handler for this state +connected(Event, EventData, S) -> + ?LOG_ERROR("Unexpected event ~p: ~p", [Event, EventData]), + {keep_state, S}. + + +code_change(_Vsn, State, S, _Extra) -> + {ok, State, S}. + + +terminate(Reason, State, S) -> + ?LOG_NOTICE("Terminating in state ~p, reason ~p", [State, Reason]), + case State of + connected -> + send_assoc_release(S); + _ -> + nop + end, + gen_udp:close(S#peer_state.sock), + ok. + + +%% ------------------------------------------------------------------ +%% private API +%% ------------------------------------------------------------------ + +-spec decode_pdu(peer_state(), binary()) -> pfcp_msg(). +decode_pdu(_S, Data) -> + ?LOG_DEBUG("Rx encoded PFCP PDU: ~p", [Data]), + PDU = pfcp_packet:decode(Data), + ?LOG_DEBUG("Rx PFCP PDU: ~p", [PDU]), + %% TODO: check PDU#pfcp.seq_no + %% TODO: there can be batched PDUs + {PDU#pfcp.type, PDU#pfcp.ie}. + + +-spec send_data(peer_state(), binary()) -> ok | {error, term()}. +send_data(#peer_state{sock = Sock, rem_addr = RemAddr}, Data) -> + ?LOG_DEBUG("Tx encoded PFCP PDU: ~p", [Data]), + gen_udp:send(Sock, RemAddr, ?PFCP_PORT, Data). + + +-spec send_pdu(peer_state(), pfcp_msg()) -> ok | {error, term()}. +send_pdu(S, {MsgType, IEs}) -> + TxSeqNr = S#peer_state.tx_seq_nr, + PDU = #pfcp{version = v1, + type = MsgType, + seid = undefined, + seq_no = TxSeqNr, + ie = IEs}, + ?LOG_DEBUG("Tx PFCP PDU: ~p", [PDU]), + Data = pfcp_packet:encode(PDU), + send_data(S, Data). + + +-spec get_node_id(peer_state()) -> binary(). +get_node_id(#peer_state{loc_addr = LocAddr}) -> + list_to_binary(tuple_to_list(LocAddr)). + + +-spec get_recovery_timestamp() -> pos_integer(). +get_recovery_timestamp() -> + {NowMS, NowS, _NowUS} = erlang:timestamp(), + %% erlang:timestamp() returns time relative to the UNIX epoch (1970), + %% but for PFCP we need time relative to the NTP era 0 (1900). + %% 2208988800 is the diff between 1900 and 1970. + NowMS * 1_000_000 + NowS + 2208988800. + + +send_assoc_setup(S) -> + IEs = #{node_id => #node_id{id = get_node_id(S)}, + recovery_time_stamp => #recovery_time_stamp{time = get_recovery_timestamp()}}, + send_pdu(S, {association_setup_request, IEs}). + + +send_assoc_release(S) -> + IEs = #{node_id => #node_id{id = get_node_id(S)}}, + send_pdu(S, {association_release_request, IEs}). + +%% vim:set ts=4 sw=4 et: -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37268?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I7bad0069dca2111006039d12e744a2bd6d2cb86e Gerrit-Change-Number: 37268 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.