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
c3fa4c4b
Commit
c3fa4c4b
authored
Apr 22, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix PTI mismatch, add function to decode PDUSessionResourceReleaseResponseTransfer
parent
64f0b314
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
15 deletions
+71
-15
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+1
-1
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+27
-14
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
+11
-0
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+1
-0
No files found.
src/smf_app/smf_app.cpp
View file @
c3fa4c4b
...
...
@@ -566,7 +566,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(
Pistache
::
Http
::
Code
::
Forbidden
,
n1_sm_message_hex
);
}
context_req_msg
.
set_pti
(
pti
);
smreq
->
req
.
set_pti
(
pti
);
//check pdu session id
if
((
pdu_session_id
==
PDU_SESSION_IDENTITY_UNASSIGNED
)
...
...
src/smf_app/smf_context.cpp
View file @
c3fa4c4b
...
...
@@ -47,6 +47,7 @@
extern
"C"
{
#include "Ngap_PDUSessionResourceSetupResponseTransfer.h"
#include "Ngap_PDUSessionResourceModifyResponseTransfer.h"
#include "Ngap_PDUSessionResourceReleaseResponseTransfer.h"
#include "Ngap_GTPTunnel.h"
#include "Ngap_AssociatedQosFlowItem.h"
#include "Ngap_QosFlowAddOrModifyResponseList.h"
...
...
@@ -289,7 +290,7 @@ void smf_pdu_session::deallocate_ressources(const std::string &apn) {
if
(
ipv4
)
{
paa_dynamic
::
get_instance
().
release_paa
(
apn
,
ipv4_address
);
}
clear
();
//including qos_flows.clear()
clear
();
//including qos_flows.clear()
Logger
::
smf_app
().
info
(
"Resources associated with this PDU Session have been released"
);
}
...
...
@@ -880,7 +881,9 @@ void smf_context::handle_pdu_session_create_sm_context_request(
sm_context_resp
->
res
.
set_pdu_session_id
(
pdu_session_id
);
sm_context_resp
->
res
.
set_snssai
(
snssai
);
sm_context_resp
->
res
.
set_dnn
(
dnn
);
sm_context_resp
->
res
.
set_pdu_session_type
(
sm_context_req_msg
.
get_pdu_session_type
());
sm_context_resp
->
res
.
set_pdu_session_type
(
sm_context_req_msg
.
get_pdu_session_type
());
sm_context_resp
->
res
.
set_pti
(
smreq
->
req
.
get_pti
());
sm_context_resp
->
set_scid
(
smreq
->
scid
);
//Step 3. find pdu_session
...
...
@@ -1450,11 +1453,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
//5GSM Cause
//Extended Protocol Configuration Options
//Release the resources related to this PDU Session
//The SMF releases the IP address / Prefix(es) that were allocated to the PDU Session and releases the
//corresponding User Plane resources
//SMF releases the IP address / Prefix(es) that were allocated to the PDU Session
//Release the resources related to this PDU Session (in Procedure)
//find DNN context
std
::
shared_ptr
<
dnn_context
>
sd
=
{
};
...
...
@@ -1523,8 +1522,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
itti_inst
->
timer_remove
(
sp
.
get
()
->
timer_T3592
);
//send response to AMF
//Verify, do we need this?
oai
::
smf_server
::
model
::
SmContextCreatedData
smContextCreatedData
;
oai
::
smf_server
::
model
::
SmContextCreatedData
smContextCreatedData
;
//Verify, do we need this?
smf_n11_inst
->
send_pdu_session_create_sm_context_response
(
smreq
->
http_response
,
smContextCreatedData
,
Pistache
::
Http
::
Code
::
Ok
);
...
...
@@ -1756,15 +1754,30 @@ void smf_context::handle_pdu_session_update_sm_context_request(
procedure_type
=
session_management_procedures_type_e
::
PDU_SESSION_RELEASE_UE_REQUESTED_STEP2
;
//TODO: SMF does nothing (Step 7, section 4.3.4.2@3GPP TS 23.502)
//SMF send response to AMF
//Verify, do we need this?
oai
::
smf_server
::
model
::
SmContextCreatedData
smContextCreatedData
;
//Ngap_PDUSessionResourceReleaseResponseTransfer
std
::
shared_ptr
<
Ngap_PDUSessionResourceReleaseResponseTransfer_t
>
decoded_msg
=
std
::
make_shared
<
Ngap_PDUSessionResourceReleaseResponseTransfer_t
>
();
int
decode_status
=
smf_n1_n2_inst
.
decode_n2_sm_information
(
decoded_msg
,
n2_sm_information
);
if
(
decode_status
==
RETURNerror
)
{
Logger
::
smf_api_server
().
warn
(
"asn_decode failed"
);
//send error to AMF
Logger
::
smf_app
().
warn
(
"Decode N2 SM (Ngap_PDUSessionResourceReleaseResponseTransfer) 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
;
}
//SMF send response to AMF
oai
::
smf_server
::
model
::
SmContextCreatedData
smContextCreatedData
;
//Verify, do we need this?
smf_n11_inst
->
send_pdu_session_create_sm_context_response
(
smreq
->
http_response
,
smContextCreatedData
,
Pistache
::
Http
::
Code
::
Ok
);
}
break
;
...
...
src/smf_app/smf_n1_n2.cpp
View file @
c3fa4c4b
...
...
@@ -1505,3 +1505,34 @@ int smf_n1_n2::decode_n2_sm_information(
}
//---------------------------------------------------------------------------------------------
int
smf_n1_n2
::
decode_n2_sm_information
(
std
::
shared_ptr
<
Ngap_PDUSessionResourceReleaseResponseTransfer_t
>
&
ngap_IE
,
std
::
string
&
n2_sm_info
)
{
Logger
::
smf_app
().
info
(
"Decode NGAP message (Ngap_PDUSessionResourceReleaseResponseTransfer) 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_PDUSessionResourceModifyResponseTransfer
asn_dec_rval_t
rc
=
asn_decode
(
nullptr
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_Ngap_PDUSessionResourceReleaseResponseTransfer
,
(
void
**
)
&
ngap_IE
,
(
void
*
)
data
,
data_len
);
//free memory
free_wrapper
((
void
**
)
&
data
);
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_api_server
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
return
RETURNerror
;
}
return
RETURNok
;
}
src/smf_app/smf_n1_n2.hpp
View file @
c3fa4c4b
...
...
@@ -56,6 +56,7 @@ extern "C" {
#include "Ngap_NGAP-PDU.h"
#include "Ngap_PDUSessionResourceSetupResponseTransfer.h"
#include "Ngap_PDUSessionResourceModifyResponseTransfer.h"
#include "Ngap_PDUSessionResourceReleaseResponseTransfer.h"
}
namespace
smf
{
...
...
@@ -121,6 +122,16 @@ class smf_n1_n2 {
std
::
shared_ptr
<
Ngap_PDUSessionResourceModifyResponseTransfer_t
>
&
ngap_IE
,
std
::
string
&
n2_sm_info
);
/*
* Decode N2 SM Information Ngap_PDUSessionResourceReleaseResponseTransfer_t
* @param [std::shared_ptr<Ngap_PDUSessionResourceReleaseResponseTransfer_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_PDUSessionResourceReleaseResponseTransfer_t
>
&
ngap_IE
,
std
::
string
&
n2_sm_info
);
};
}
// namespace smf
...
...
src/smf_app/smf_procedure.cpp
View file @
c3fa4c4b
...
...
@@ -1100,6 +1100,7 @@ void session_update_sm_context_procedure::handle_itti_msg(
cause_value_5gsm_e
::
CAUSE_26_INSUFFICIENT_RESOURCES
);
//TODO: check Cause
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
n11_triggered_pending
->
res
.
set_n1_sm_message
(
n1_sm_msg_hex
);
//N2 SM Information
smf_n1_n2_inst
.
create_n2_sm_information
(
n11_triggered_pending
->
res
,
1
,
n2_sm_info_type_e
::
PDU_RES_REL_CMD
,
...
...
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