[L] Change in ...osmo-epdg[master]: Initial S6b support

2023-10-23 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?usp=email )

Change subject: Initial S6b support
..

Initial S6b support

So far only the Rx of AAR msg and Tx of AAA is supported.
This allows already going forward during the session creation, where PGW
sends AAR to the AAA server and expects AAA message.

Related: OS#6229
Change-Id: Ia2b138317cb291a95882853f5403949c5e6a5a1b
---
M config/sys.config
A src/aaa_diameter_s6b.erl
A src/aaa_diameter_s6b_cb.erl
M src/osmo_epdg_sup.erl
4 files changed, 305 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  lynxis lazus: Looks good to me, approved




diff --git a/config/sys.config b/config/sys.config
index 1b89e86..630a057 100755
--- a/config/sys.config
+++ b/config/sys.config
@@ -5,15 +5,22 @@
   [% GSUP Server connection parameters
{gsup_local_ip, "0.0.0.0"},
{gsup_local_port, 4222},
-   % Diameter Connection parameters
+   % Diameter SWx Connection parameters
{diameter_remote_ip, "127.0.0.1"},
{diameter_remote_port, 3868},
{diameter_proto, sctp},
-   % Diameter Server parameters
{vendor_id, 0},
{origin_host, "epdg.localdomain"},
{origin_realm, "localdomain"},
{context_id, "epdg@localdomain"},
+   % Diameter s6b Connection parameters
+   {dia_s6b_local_ip, "127.0.0.10"},
+   {dia_s6b_local_port, 3868},
+   {dia_s6b_proto, sctp},
+   {dia_s6b_vendor_id, 0},
+   {dia_s6b_origin_host, "aaa.localdomain"},
+   {dia_s6b_origin_realm, "localdomain"},
+   {dia_s6b_context_id, "aaa@localdomain"},
% GTPv2C Connection parameters
{gtpc_local_ip, "127.0.0.2"},
{gtpc_local_port, 2123},
diff --git a/src/aaa_diameter_s6b.erl b/src/aaa_diameter_s6b.erl
new file mode 100644
index 000..4ee0219
--- /dev/null
+++ b/src/aaa_diameter_s6b.erl
@@ -0,0 +1,203 @@
+% S6b: AAA side
+%
+% 3GPP TS 29.273 section 9
+%
+% (C) 2023 by sysmocom - s.f.m.c. GmbH 
+% Author: Pau Espin Pedrol 
+%
+% 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 .
+%
+% 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(aaa_diameter_s6b).
+-author('Pau Espin Pedrol ').
+
+-behaviour(gen_server).
+
+-include_lib("diameter_3gpp_ts29_273_s6b.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc6733.hrl").
+
+%% API Function Exports
+-export([start_link/0]).
+-export([start/0, stop/0, terminate/2]).
+%% gen_server Function Exports
+-export([init/1, handle_call/3, handle_cast/2, handle_info/2]).
+-export([code_change/3]).
+-export([multimedia_auth_request/6]).
+-export([server_assignment_request/3]).
+-export([test/0, test/1]).
+
+%% Diameter Application Definitions
+-define(SERVER, ?MODULE).
+-define(SVC_NAME, ?MODULE).
+-define(APP_ALIAS, ?MODULE).
+-define(CALLBACK_MOD, aaa_diameter_s6b_cb).
+-define(DIAMETER_DICT_S6b, diameter_3gpp_ts29_273_s6b).
+-define(ENV_APP_NAME, osmo_epdg).
+-define(ENV_DEFAULT_SESSION_ID, "aaa@localdomain").
+-define(ENV_DEFAULT_ORIG_REALM, "localdomain").
+-define(ENV_DEFAULT_ORIG_HOST, "aaa.localdomain").
+-define(ENV_DEFAULT_VENDOR_ID, 0).
+-define(ENV_DEFAULT_DIAMETER_PROTO, sctp).
+-define(ENV_DEFAULT_DIAMETER_REMOTE_IP, "127.0.0.10").
+-define(ENV_DEFAULT_DIAMETER_REMOTE_PORT, 3868).
+
+-define(VENDOR_ID_3GPP, 10415).
+-define(VENDOR_ID_3GPP2, 5535).
+-define(VENDOR_ID_ETSI, 13019).
+-define(DIAMETER_APP_ID_S6b, ?DIAMETER_DICT_S6b:id()).
+%% The service configuration. As in the server example, a client
+%% supporting multiple Diameter applications may or may not want to
+%% configure a common callback module on all applications.

[L] Change in ...osmo-epdg[master]: Initial S6b support

2023-10-23 Thread lynxis lazus
Attention is currently required from: pespin.

lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?usp=email )

Change subject: Initial S6b support
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?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: Ia2b138317cb291a95882853f5403949c5e6a5a1b
Gerrit-Change-Number: 34858
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 23 Oct 2023 14:43:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in ...osmo-epdg[master]: Initial S6b support

2023-10-23 Thread pespin
Attention is currently required from: lynxis lazus.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?usp=email )

Change subject: Initial S6b support
..


Patch Set 2:

(2 comments)

File src/aaa_diameter_s6b.erl:

https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858/comment/c8c2408b_dc21ac06
PS2, Line 138: % APN is optional and should be []
> old code?
Could be, I'm just submitting initial code base to have something answering, we 
can clean up later once everything is in place, with smaller incremental 
patches improving the code base.


https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858/comment/80e3de58_54b8e056
PS2, Line 148: SessionId = 
diameter:session_id(application:get_env(?ENV_APP_NAME, origin_host, 
?ENV_DEFAULT_ORIG_HOST)).
> It looks you're missing something here.
Yes, because AAA initiated procedures are not yet implemented here, only 
AAR+AAA initiated by PGW. We can add missing procedures as follow up, I'm for 
now fosucing on adding initial socket handling for each interface and 
implementing the minimum subset I need to go forward in a single ttcn3 test.



--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?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: Ia2b138317cb291a95882853f5403949c5e6a5a1b
Gerrit-Change-Number: 34858
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: lynxis lazus 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Mon, 23 Oct 2023 14:38:46 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: lynxis lazus 
Gerrit-MessageType: comment


[L] Change in ...osmo-epdg[master]: Initial S6b support

2023-10-23 Thread lynxis lazus
Attention is currently required from: pespin.

lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?usp=email )

Change subject: Initial S6b support
..


Patch Set 2:

(2 comments)

File src/aaa_diameter_s6b.erl:

https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858/comment/8b82f6f8_c96ac25c
PS2, Line 138: % APN is optional and should be []
old code?


https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858/comment/422af289_dd60ec07
PS2, Line 148: SessionId = 
diameter:session_id(application:get_env(?ENV_APP_NAME, origin_host, 
?ENV_DEFAULT_ORIG_HOST)).
It looks you're missing something here.



--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?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: Ia2b138317cb291a95882853f5403949c5e6a5a1b
Gerrit-Change-Number: 34858
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 23 Oct 2023 13:07:56 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[L] Change in ...osmo-epdg[master]: Initial S6b support

2023-10-23 Thread pespin
Attention is currently required from: pespin.

Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder


Change subject: Initial S6b support
..

Initial S6b support

So far only the Rx of AAR msg and Tx of AAA is supported.
This allows already going forward during the session creation, where PGW
sends AAR to the AAA server and expects AAA message.

Related: OS#6229
Change-Id: Ia2b138317cb291a95882853f5403949c5e6a5a1b
---
M config/sys.config
A src/aaa_diameter_s6b.erl
A src/aaa_diameter_s6b_cb.erl
M src/osmo_epdg_sup.erl
4 files changed, 305 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg 
refs/changes/58/34858/2
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?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: Ia2b138317cb291a95882853f5403949c5e6a5a1b
Gerrit-Change-Number: 34858
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset


[L] Change in ...osmo-epdg[master]: Initial S6b support

2023-10-23 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?usp=email )


Change subject: Initial S6b support
..

Initial S6b support

So far only the Rx of AAR msg and Tx of AAA is supported.
This allows already going forward during the session creation, where PGW
sends AAR to the AAA server and expects AAA message.

Related: OS#6229
Change-Id: Ia2b138317cb291a95882853f5403949c5e6a5a1b
---
M config/sys.config
A src/aaa_diameter_s6b.erl
A src/aaa_diameter_s6b_cb.erl
M src/osmo_epdg_sup.erl
4 files changed, 305 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg 
refs/changes/58/34858/1

diff --git a/config/sys.config b/config/sys.config
index 1b89e86..630a057 100755
--- a/config/sys.config
+++ b/config/sys.config
@@ -5,15 +5,22 @@
   [% GSUP Server connection parameters
{gsup_local_ip, "0.0.0.0"},
{gsup_local_port, 4222},
-   % Diameter Connection parameters
+   % Diameter SWx Connection parameters
{diameter_remote_ip, "127.0.0.1"},
{diameter_remote_port, 3868},
{diameter_proto, sctp},
-   % Diameter Server parameters
{vendor_id, 0},
{origin_host, "epdg.localdomain"},
{origin_realm, "localdomain"},
{context_id, "epdg@localdomain"},
+   % Diameter s6b Connection parameters
+   {dia_s6b_local_ip, "127.0.0.10"},
+   {dia_s6b_local_port, 3868},
+   {dia_s6b_proto, sctp},
+   {dia_s6b_vendor_id, 0},
+   {dia_s6b_origin_host, "aaa.localdomain"},
+   {dia_s6b_origin_realm, "localdomain"},
+   {dia_s6b_context_id, "aaa@localdomain"},
% GTPv2C Connection parameters
{gtpc_local_ip, "127.0.0.2"},
{gtpc_local_port, 2123},
diff --git a/src/aaa_diameter_s6b.erl b/src/aaa_diameter_s6b.erl
new file mode 100644
index 000..1348e70
--- /dev/null
+++ b/src/aaa_diameter_s6b.erl
@@ -0,0 +1,203 @@
+% S6b: AAA side
+%
+% 3GPP TS 29.273 section 9
+%
+% (C) 2023 by sysmocom - s.m.f.c. GmbH 
+% Author: Pau Espin Pedrol 
+%
+% 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 .
+%
+% 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(aaa_diameter_s6b).
+-author('Pau Espin Pedrol ').
+
+-behaviour(gen_server).
+
+-include_lib("diameter_3gpp_ts29_273_s6b.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc6733.hrl").
+
+%% API Function Exports
+-export([start_link/0]).
+-export([start/0, stop/0, terminate/2]).
+%% gen_server Function Exports
+-export([init/1, handle_call/3, handle_cast/2, handle_info/2]).
+-export([code_change/3]).
+-export([multimedia_auth_request/6]).
+-export([server_assignment_request/3]).
+-export([test/0, test/1]).
+
+%% Diameter Application Definitions
+-define(SERVER, ?MODULE).
+-define(SVC_NAME, ?MODULE).
+-define(APP_ALIAS, ?MODULE).
+-define(CALLBACK_MOD, aaa_diameter_s6b_cb).
+-define(DIAMETER_DICT_S6b, diameter_3gpp_ts29_273_s6b).
+-define(ENV_APP_NAME, osmo_epdg).
+-define(ENV_DEFAULT_SESSION_ID, "aaa@localdomain").
+-define(ENV_DEFAULT_ORIG_REALM, "localdomain").
+-define(ENV_DEFAULT_ORIG_HOST, "aaa.localdomain").
+-define(ENV_DEFAULT_VENDOR_ID, 0).
+-define(ENV_DEFAULT_DIAMETER_PROTO, sctp).
+-define(ENV_DEFAULT_DIAMETER_REMOTE_IP, "127.0.0.10").
+-define(ENV_DEFAULT_DIAMETER_REMOTE_PORT, 3868).
+
+-define(VENDOR_ID_3GPP, 10415).
+-define(VENDOR_ID_3GPP2, 5535).
+-define(VENDOR_ID_ETSI, 13019).
+-define(DIAMETER_APP_ID_S6b, ?DIAMETER_DICT_S6b:id()).
+%% The service configuration. As in the server example, a client
+%% supporting multiple Diameter applications may or may not want to
+%% configure a common callback module on all 

[L] Change in ...osmo-epdg[master]: Initial S6b support

2023-10-23 Thread Jenkins Builder
Jenkins Builder has posted comments on this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?usp=email )

Change subject: Initial S6b support
..


Patch Set 1:

(1 comment)

File src/aaa_diameter_s6b.erl:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12016):
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858/comment/5befadd7_4a1caf21
PS1, Line 5: % (C) 2023 by sysmocom - s.m.f.c. GmbH 
's.m.f.c.' may be misspelled - perhaps 's.f.m.c.'?



--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34858?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: Ia2b138317cb291a95882853f5403949c5e6a5a1b
Gerrit-Change-Number: 34858
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Mon, 23 Oct 2023 12:35:56 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment