Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-SMF
Commits
e20bc2a9
Commit
e20bc2a9
authored
May 17, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
process PDU Session Resource Setup Unsuccessful Transfer
parent
960dc473
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
1 deletion
+86
-1
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+43
-1
src/smf_app/smf_n1_n2.cpp
src/smf_app/smf_n1_n2.cpp
+31
-0
src/smf_app/smf_n1_n2.hpp
src/smf_app/smf_n1_n2.hpp
+12
-0
No files found.
src/smf_app/smf_context.cpp
View file @
e20bc2a9
...
...
@@ -48,6 +48,7 @@ extern "C" {
#include "Ngap_PDUSessionResourceSetupResponseTransfer.h"
#include "Ngap_PDUSessionResourceModifyResponseTransfer.h"
#include "Ngap_PDUSessionResourceReleaseResponseTransfer.h"
#include "Ngap_PDUSessionResourceSetupUnsuccessfulTransfer.h"
#include "Ngap_GTPTunnel.h"
#include "Ngap_AssociatedQosFlowItem.h"
#include "Ngap_QosFlowAddOrModifyResponseList.h"
...
...
@@ -1069,7 +1070,6 @@ void smf_context::handle_pdu_session_create_sm_context_request(
}
//pending session??
//Step 4. check if supi is authenticated
//TODO: if "Integrity Protection is required", check UE Integrity Protection Maximum Data Rate
//TODO: (Optional) Secondary authentication/authorization
...
...
@@ -1956,6 +1956,48 @@ void smf_context::handle_pdu_session_update_sm_context_request(
}
break
;
//PDU Session Establishment procedure
//PDU Session Resource Setup Unsuccessful Transfer
case
n2_sm_info_type_e
:
:
PDU_RES_SETUP_FAIL
:
{
Logger
::
smf_app
().
info
(
"PDU Session Resource Setup Unsuccessful Transfer"
);
//Ngap_PDUSessionResourceSetupUnsuccessfulTransfer
std
::
shared_ptr
<
Ngap_PDUSessionResourceSetupUnsuccessfulTransfer_t
>
decoded_msg
=
std
::
make_shared
<
Ngap_PDUSessionResourceSetupUnsuccessfulTransfer_t
>
();
int
decode_status
=
smf_n1_n2_inst
.
decode_n2_sm_information
(
decoded_msg
,
n2_sm_information
);
if
(
decode_status
==
RETURNerror
)
{
Logger
::
smf_app
().
warn
(
"Decode N2 SM (Ngap_PDUSessionResourceSetupUnsuccessfulTransfer) failed!"
);
problem_details
.
setCause
(
pdu_session_application_error_e2str
[
PDU_SESSION_APPLICATION_ERROR_N2_SM_ERROR
]);
smContextUpdateError
.
setError
(
problem_details
);
smf_n11_inst
->
send_pdu_session_update_sm_context_response
(
smreq
->
http_response
,
smContextUpdateError
,
Pistache
::
Http
::
Code
::
Forbidden
);
return
;
}
//Logger::smf_app().info("PDU Session Resource Setup Unsuccessful Transfer cause %d",decoded_msg->cause );
problem_details
.
setCause
(
pdu_session_application_error_e2str
[
PDU_SESSION_APPLICATION_ERROR_UE_NOT_RESPONDING
]);
smContextUpdateError
.
setError
(
problem_details
);
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextUpdateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject, 24.501 cause "#26 Insufficient resources"
smf_n1_n2_inst
.
create_n1_sm_container
(
smreq
->
req
,
PDU_SESSION_ESTABLISHMENT_REJECT
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_26_INSUFFICIENT_RESOURCES
);
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
smf_n11_inst
->
send_pdu_session_update_sm_context_response
(
smreq
->
http_response
,
smContextUpdateError
,
Pistache
::
Http
::
Code
::
Forbidden
,
n1_sm_msg_hex
);
//TODO: Need release established resources?
return
;
}
break
;
//PDU Session Modification procedure (UE-initiated, Section 4.3.3.2@3GPP TS 23.502 or SMF-Requested)(Step 2)
case
n2_sm_info_type_e
:
:
PDU_RES_MOD_RSP
:
{
Logger
::
smf_app
().
info
(
...
...
src/smf_app/smf_n1_n2.cpp
View file @
e20bc2a9
...
...
@@ -1684,3 +1684,34 @@ int smf_n1_n2::decode_n2_sm_information(
}
//---------------------------------------------------------------------------------------------
int
smf_n1_n2
::
decode_n2_sm_information
(
std
::
shared_ptr
<
Ngap_PDUSessionResourceSetupUnsuccessfulTransfer_t
>
&
ngap_IE
,
std
::
string
&
n2_sm_info
)
{
Logger
::
smf_app
().
info
(
"Decode NGAP message (Ngap_PDUSessionResourceSetupUnsuccessfulTransfer) from N2 SM Information"
);
unsigned
int
data_len
=
n2_sm_info
.
length
();
unsigned
char
*
data
=
(
unsigned
char
*
)
malloc
(
data_len
+
1
);
memset
(
data
,
0
,
data_len
+
1
);
memcpy
((
void
*
)
data
,
(
void
*
)
n2_sm_info
.
c_str
(),
data_len
);
//Ngap_PDUSessionResourceSetupUnsuccessfulTransfer
asn_dec_rval_t
rc
=
asn_decode
(
nullptr
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_Ngap_PDUSessionResourceSetupUnsuccessfulTransfer
,
(
void
**
)
&
ngap_IE
,
(
void
*
)
data
,
data_len
);
//free memory
free_wrapper
((
void
**
)
&
data
);
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
return
RETURNerror
;
}
return
RETURNok
;
}
src/smf_app/smf_n1_n2.hpp
View file @
e20bc2a9
...
...
@@ -57,6 +57,7 @@ extern "C" {
#include "Ngap_PDUSessionResourceSetupResponseTransfer.h"
#include "Ngap_PDUSessionResourceModifyResponseTransfer.h"
#include "Ngap_PDUSessionResourceReleaseResponseTransfer.h"
#include "Ngap_PDUSessionResourceSetupUnsuccessfulTransfer.h"
}
namespace
smf
{
...
...
@@ -132,6 +133,17 @@ class smf_n1_n2 {
std
::
shared_ptr
<
Ngap_PDUSessionResourceReleaseResponseTransfer_t
>
&
ngap_IE
,
std
::
string
&
n2_sm_info
);
/*
* Decode N2 SM Information Ngap_PDUSessionResourceSetupUnsuccessfulTransfer
* @param [std::shared_ptr<Ngap_PDUSessionResourceSetupUnsuccessfulTransfer_t>&] ngap_IE Store decoded NGAP message
* @param [std::string&] n2_sm_info N2 SM Information
* @return status of the decode process
*/
int
decode_n2_sm_information
(
std
::
shared_ptr
<
Ngap_PDUSessionResourceSetupUnsuccessfulTransfer_t
>
&
ngap_IE
,
std
::
string
&
n2_sm_info
);
};
}
// namespace smf
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment