[L] Change in ...osmo-epdg[master]: Implement UE-initiated Detach

2024-01-25 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35676?usp=email )

Change subject: Implement UE-initiated Detach
..

Implement UE-initiated Detach

This commit is a first step towards implementing the full procedure. It
implements handling at the GSUP CEAI interface and operating on the
attached PGW to delete the session. No work towards the HSS from AAA
server now from PGW to the AAA is done yet.

Change-Id: I2e922f76c2fa601c5f61fa23d6df5fb62c3e133d
---
M .gitignore
A include/gtp_utils.hrl
A src/conv.erl
M src/epdg_gtpc_s2b.erl
M src/gsup_server.erl
M src/gtp_utils.erl
M src/ue_fsm.erl
7 files changed, 423 insertions(+), 10 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/.gitignore b/.gitignore
index 08ae348..253618b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
 _build/
-include/
+include/diameter_*
 log/

 *.beam
diff --git a/include/gtp_utils.hrl b/include/gtp_utils.hrl
new file mode 100644
index 000..453efb0
--- /dev/null
+++ b/include/gtp_utils.hrl
@@ -0,0 +1,113 @@
+% (C) 2023 by sysmocom
+%
+% 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.
+%
+-hrl_name('gtp_utils.hrl').
+
+-define(GTP2_CAUSE_RESERVED, 1).
+-define(GTP2_CAUSE_LOCAL_DETACH, 2).
+-define(GTP2_CAUSE_COMPLETE_DETACH, 3).
+-define(GTP2_CAUSE_RAT_CHANGED_FROM_3GPP_TO_NON_3GPP, 4).
+-define(GTP2_CAUSE_ISR_DEACTIVATION, 5).
+-define(GTP2_CAUSE_ERROR_INDICATION_RECEIVED_FROM_RNC_ENODEB_S4_SGSN, 6).
+-define(GTP2_CAUSE_IMSI_DETACH_ONLY, 7).
+-define(GTP2_CAUSE_REACTIVATION_REQUESTED, 8).
+-define(GTP2_CAUSE_PDN_RECONNECTION_TO_THIS_APN_DISALLOWED, 9).
+-define(GTP2_CAUSE_ACCESS_CHANGED_FROM_NON_3GPP_TO_3GPP, 10).
+-define(GTP2_CAUSE_PDN_CONNECTION_INACTIVITY_TIMER_EXPIRES, 11).
+-define(GTP2_CAUSE_PGW_NOT_RESPONDING, 12).
+-define(GTP2_CAUSE_NETWORK_FAILURE, 13).
+-define(GTP2_CAUSE_QOS_PARAMETER_MISMATCH, 14).
+-define(GTP2_CAUSE_REQUEST_ACCEPTED, 16).
+-define(GTP2_CAUSE_REQUEST_ACCEPTED_PARTIALLY, 17).
+-define(GTP2_CAUSE_NEW_PDN_TYPE_DUE_TO_NETWORK_PREFERENCE, 18).
+-define(GTP2_CAUSE_NEW_PDN_TYPE_DUE_TO_SINGLE_ADDRESS_BEARER_ONLY, 19).
+-define(GTP2_CAUSE_CONTEXT_NOT_FOUND, 64).
+-define(GTP2_CAUSE_INVALID_MESSAGE_FORMAT, 65).
+-define(GTP2_CAUSE_VERSION_NOT_SUPPORTED_BY_NEXT_PEER, 66).
+-define(GTP2_CAUSE_INVALID_LENGTH, 67).
+-define(GTP2_CAUSE_SERVICE_NOT_SUPPORTED, 68).
+-define(GTP2_CAUSE_MANDATORY_IE_INCORRECT, 69).
+-define(GTP2_CAUSE_MANDATORY_IE_MISSING, 70).
+-define(GTP2_CAUSE_SYSTEM_FAILURE, 72).
+-define(GTP2_CAUSE_NO_RESOURCES_AVAILABLE, 73).
+-define(GTP2_CAUSE_SEMANTIC_ERROR_IN_THE_TFT_OPERATION, 74).
+-define(GTP2_CAUSE_SYNTACTIC_ERROR_IN_THE_TFT_OPERATION, 75).
+-define(GTP2_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTER, 76).
+-define(GTP2_CAUSE_SYNTACTIC_ERRORS_IN_PACKET_FILTER, 77).
+-define(GTP2_CAUSE_MISSING_OR_UNKNOWN_APN, 78).
+-define(GTP2_CAUSE_GRE_KEY_NOT_FOUND, 80).
+-define(GTP2_CAUSE_RELOCATION_FAILURE, 81).
+-define(GTP2_CAUSE_DENIED_IN_RAT, 82).
+-define(GTP2_CAUSE_PREFERRED_PDN_TYPE_NOT_SUPPORTED, 83).
+-define(GTP2_CAUSE_ALL_DYNAMIC_ADDRESSES_ARE_OCCUPIED, 84).
+-define(GTP2_CAUSE_UE_CONTEXT_WITHOUT_TFT_ALREADY_ACTIVATED, 85).
+-define(GTP2_CAUSE_PROTOCOL_TYPE_NOT_SUPPORTED, 86).
+-define(GTP2_CAUSE_UE_NOT_RESPONDING, 87).
+-define(GTP2_CAUSE_UE_REFUSES, 88).
+-define(GTP2_CAUSE_SERVICE_DENIED, 89).
+-define(GTP2_CAUSE_UNABLE_TO_PAGE_UE, 90).
+-define(GTP2_CAUSE_NO_MEMORY_AVAILABLE, 91).

[L] Change in ...osmo-epdg[master]: Implement UE-initiated Detach

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

Change subject: Implement UE-initiated Detach
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35676?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: I2e922f76c2fa601c5f61fa23d6df5fb62c3e133d
Gerrit-Change-Number: 35676
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 25 Jan 2024 14:44:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in ...osmo-epdg[master]: Implement UE-initiated Detach

2024-01-24 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35676?usp=email )


Change subject: Implement UE-initiated Detach
..

Implement UE-initiated Detach

This commit is a first step towards implementing the full procedure. It
implements handling at the GSUP CEAI interface and operating on the
attached PGW to delete the session. No work towards the HSS from AAA
server now from PGW to the AAA is done yet.

Change-Id: I2e922f76c2fa601c5f61fa23d6df5fb62c3e133d
---
M .gitignore
A include/gtp_utils.hrl
A src/conv.erl
M src/epdg_gtpc_s2b.erl
M src/gsup_server.erl
M src/gtp_utils.erl
M src/ue_fsm.erl
7 files changed, 423 insertions(+), 10 deletions(-)



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

diff --git a/.gitignore b/.gitignore
index 08ae348..253618b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
 _build/
-include/
+include/diameter_*
 log/

 *.beam
diff --git a/include/gtp_utils.hrl b/include/gtp_utils.hrl
new file mode 100644
index 000..453efb0
--- /dev/null
+++ b/include/gtp_utils.hrl
@@ -0,0 +1,113 @@
+% (C) 2023 by sysmocom
+%
+% 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.
+%
+-hrl_name('gtp_utils.hrl').
+
+-define(GTP2_CAUSE_RESERVED, 1).
+-define(GTP2_CAUSE_LOCAL_DETACH, 2).
+-define(GTP2_CAUSE_COMPLETE_DETACH, 3).
+-define(GTP2_CAUSE_RAT_CHANGED_FROM_3GPP_TO_NON_3GPP, 4).
+-define(GTP2_CAUSE_ISR_DEACTIVATION, 5).
+-define(GTP2_CAUSE_ERROR_INDICATION_RECEIVED_FROM_RNC_ENODEB_S4_SGSN, 6).
+-define(GTP2_CAUSE_IMSI_DETACH_ONLY, 7).
+-define(GTP2_CAUSE_REACTIVATION_REQUESTED, 8).
+-define(GTP2_CAUSE_PDN_RECONNECTION_TO_THIS_APN_DISALLOWED, 9).
+-define(GTP2_CAUSE_ACCESS_CHANGED_FROM_NON_3GPP_TO_3GPP, 10).
+-define(GTP2_CAUSE_PDN_CONNECTION_INACTIVITY_TIMER_EXPIRES, 11).
+-define(GTP2_CAUSE_PGW_NOT_RESPONDING, 12).
+-define(GTP2_CAUSE_NETWORK_FAILURE, 13).
+-define(GTP2_CAUSE_QOS_PARAMETER_MISMATCH, 14).
+-define(GTP2_CAUSE_REQUEST_ACCEPTED, 16).
+-define(GTP2_CAUSE_REQUEST_ACCEPTED_PARTIALLY, 17).
+-define(GTP2_CAUSE_NEW_PDN_TYPE_DUE_TO_NETWORK_PREFERENCE, 18).
+-define(GTP2_CAUSE_NEW_PDN_TYPE_DUE_TO_SINGLE_ADDRESS_BEARER_ONLY, 19).
+-define(GTP2_CAUSE_CONTEXT_NOT_FOUND, 64).
+-define(GTP2_CAUSE_INVALID_MESSAGE_FORMAT, 65).
+-define(GTP2_CAUSE_VERSION_NOT_SUPPORTED_BY_NEXT_PEER, 66).
+-define(GTP2_CAUSE_INVALID_LENGTH, 67).
+-define(GTP2_CAUSE_SERVICE_NOT_SUPPORTED, 68).
+-define(GTP2_CAUSE_MANDATORY_IE_INCORRECT, 69).
+-define(GTP2_CAUSE_MANDATORY_IE_MISSING, 70).
+-define(GTP2_CAUSE_SYSTEM_FAILURE, 72).
+-define(GTP2_CAUSE_NO_RESOURCES_AVAILABLE, 73).
+-define(GTP2_CAUSE_SEMANTIC_ERROR_IN_THE_TFT_OPERATION, 74).
+-define(GTP2_CAUSE_SYNTACTIC_ERROR_IN_THE_TFT_OPERATION, 75).
+-define(GTP2_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTER, 76).
+-define(GTP2_CAUSE_SYNTACTIC_ERRORS_IN_PACKET_FILTER, 77).
+-define(GTP2_CAUSE_MISSING_OR_UNKNOWN_APN, 78).
+-define(GTP2_CAUSE_GRE_KEY_NOT_FOUND, 80).
+-define(GTP2_CAUSE_RELOCATION_FAILURE, 81).
+-define(GTP2_CAUSE_DENIED_IN_RAT, 82).
+-define(GTP2_CAUSE_PREFERRED_PDN_TYPE_NOT_SUPPORTED, 83).
+-define(GTP2_CAUSE_ALL_DYNAMIC_ADDRESSES_ARE_OCCUPIED, 84).
+-define(GTP2_CAUSE_UE_CONTEXT_WITHOUT_TFT_ALREADY_ACTIVATED, 85).
+-define(GTP2_CAUSE_PROTOCOL_TYPE_NOT_SUPPORTED, 86).
+-define(GTP2_CAUSE_UE_NOT_RESPONDING, 87).
+-define(GTP2_CAUSE_UE_REFUSES, 88).
+-define(GTP2_CAUSE_SERVICE_DENIED, 89).
+-define(GTP2_CAUSE_UNABLE_TO_PAGE_UE, 90).
+-define(GTP2_CAUSE_NO_MEMORY_AVAILABLE, 91).