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
d432fdab
Commit
d432fdab
authored
Dec 15, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup for smf context
parent
ccce0744
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
92 deletions
+28
-92
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+4
-38
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+21
-52
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+3
-2
No files found.
src/smf_app/smf_app.cpp
View file @
d432fdab
...
...
@@ -464,7 +464,6 @@ void smf_app::handle_itti_msg(
http_response_codes_e
::
HTTP_RESPONSE_CODE_OK
)
and
(
static_cast
<
http_response_codes_e
>
(
m
.
response_code
)
!=
http_response_codes_e
::
HTTP_RESPONSE_CODE_ACCEPTED
))
{
// send failure indication to UPF
Logger
::
smf_app
().
debug
(
"Send failure indication to UPF"
);
// TODO: to be completed
pfcp
::
node_id_t
up_node_id
=
{};
...
...
@@ -591,16 +590,13 @@ void smf_app::handle_pdu_session_create_sm_context_request(
return
;
}
//
Extended protocol discriminator (Mandatory)
//
Fill the mandatory IEs
smreq
->
req
.
set_epd
(
decoded_nas_msg
.
header
.
extended_protocol_discriminator
);
// PDUSessionIdentity
pdu_session_id_t
pdu_session_id
=
decoded_nas_msg
.
plain
.
sm
.
header
.
pdu_session_identity
;
// ProcedureTransactionIdentity
procedure_transaction_id_t
pti
=
{
.
procedure_transaction_id
=
decoded_nas_msg
.
plain
.
sm
.
header
.
procedure_transaction_identity
};
// Message type (Mandatory)
smreq
->
req
.
set_message_type
(
decoded_nas_msg
.
plain
.
sm
.
header
.
message_type
);
// TODO: Integrity protection maximum data rate (Mandatory)
...
...
@@ -739,8 +735,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(
Logger
::
smf_app
().
warn
(
"Invalid request type (request type = %s)"
,
request_type
.
c_str
());
//"Existing PDU Session", AMF should use PDUSession_UpdateSMContext instead
//(see step 3, section 4.3.2.2.1 @ 3GPP TS 23.502 v16.0.0) ignore the
// message
//(see step 3, section 4.3.2.2.1 @ 3GPP TS 23.502 v16.0.0) ignore the message
return
;
}
...
...
@@ -754,8 +749,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(
"Received a PDU Session Create SM Context Request: unknown requested "
"DNN %s, ignore message!"
,
dnn
.
c_str
());
// PDU Session Establishment Reject, 24.501 cause "#27 Missing or unknown
// DNN"
// PDU Session Establishment Reject
if
(
smf_n1
::
get_instance
().
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_27_MISSING_OR_UNKNOWN_DNN
))
{
...
...
@@ -846,8 +840,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(
"Received a PDU Session Create SM Context Request, couldn't "
"retrieve the Session Management Subscription from UDM, ignore "
"message!"
);
// PDU Session Establishment Reject, with cause "29 User authentication
// or authorization failed"
// PDU Session Establishment Reject
if
(
smf_n1
::
get_instance
().
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
...
...
@@ -973,8 +966,6 @@ void smf_app::handle_pdu_session_update_sm_context_request(
if
(
!
sc
.
get
()
->
find_dnn_context
(
scf
.
get
()
->
nssai
,
scf
.
get
()
->
dnn
,
sd
))
{
if
(
nullptr
==
sd
.
get
())
{
// Error, DNN context doesn't exist, send PDUSession_SMUpdateContext
// Response to AMF
Logger
::
smf_app
().
warn
(
"Received PDU Session Update SM Context Request, couldn't retrieve "
"the corresponding SMF context, ignore message!"
);
...
...
@@ -982,7 +973,6 @@ void smf_app::handle_pdu_session_update_sm_context_request(
trigger_update_context_error_response
(
http_status_code_e
::
HTTP_STATUS_CODE_404_NOT_FOUND
,
PDU_SESSION_APPLICATION_ERROR_CONTEXT_NOT_FOUND
,
smreq
->
pid
);
return
;
}
}
...
...
@@ -1094,20 +1084,6 @@ void smf_app::trigger_pdu_session_modification(
itti_msg
->
http_version
=
http_version
;
// step 1. collect the necessary information
/*
//For testing purpose
supi_t supi = { };
std::string dnn("default");
pdu_session_id_t pdu_session_id = { 1 };
snssai_t snssai = { };
pfcp::qfi_t qfi = { };
qfi.qfi = 7;
std::string supi_str("200000000000001");
smf_string_to_supi(&supi, supi_str.c_str());
snssai.sST = 222;
snssai.sD = "0000D4";
*/
itti_msg
->
msg
.
set_supi
(
supi
);
itti_msg
->
msg
.
set_dnn
(
dnn
);
itti_msg
->
msg
.
set_pdu_session_id
(
pdu_session_id
);
...
...
@@ -1143,7 +1119,6 @@ evsub_id_t smf_app::handle_event_exposure_subscription(
// Generate a subscription ID Id and store the corresponding information in a
// map (subscription id, info)
evsub_id_t
evsub_id
=
generate_ev_subscription_id
();
// std::string evsubid_str = "SubId" + std::to_string(evsub_id);
std
::
shared_ptr
<
smf_subscription
>
ss
=
std
::
shared_ptr
<
smf_subscription
>
(
new
smf_subscription
());
...
...
@@ -1230,13 +1205,6 @@ bool smf_app::scid_2_smf_context(const scid_t &scid,
return
false
;
}
//------------------------------------------------------------------------------
// void smf_app::set_evsubid_2_smf_subscription(const evsub_id_t &id,
// std::shared_ptr<smf_subscription> ss) {
// std::unique_lock lock(m_evsubid2smf_context);
// evsub_id2smf_subscription[id] = ss;
//}
//------------------------------------------------------------------------------
bool
smf_app
::
use_local_configuration_subscription_data
(
const
std
::
string
&
dnn_selection_mode
)
{
...
...
@@ -1324,7 +1292,6 @@ void smf_app::update_pdu_session_status(const scid_t &scid,
if
(
!
sc
.
get
()
->
find_dnn_context
(
scf
.
get
()
->
nssai
,
scf
.
get
()
->
dnn
,
sd
))
{
if
(
nullptr
==
sd
.
get
())
{
// Error, DNN context doesn't exist
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding DNN context!"
);
}
...
...
@@ -1381,7 +1348,6 @@ void smf_app::update_pdu_session_upCnx_state(const scid_t &scid,
if
(
!
sc
.
get
()
->
find_dnn_context
(
scf
.
get
()
->
nssai
,
scf
.
get
()
->
dnn
,
sd
))
{
if
(
nullptr
==
sd
.
get
())
{
// Error, DNN context doesn't exist
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding DNN context!"
);
}
...
...
src/smf_app/smf_context.cpp
View file @
d432fdab
This diff is collapsed.
Click to expand it.
src/smf_app/smf_procedure.cpp
View file @
d432fdab
...
...
@@ -33,6 +33,7 @@
#include "3gpp_29.244.h"
#include "3gpp_29.274.h"
#include "3gpp_29.500.h"
#include "3gpp_29.502.h"
#include "3gpp_conversions.hpp"
#include "SmContextCreatedData.h"
#include "common_defs.h"
...
...
@@ -432,7 +433,7 @@ void session_create_sm_context_procedure::handle_itti_msg(
n11_triggered_pending
->
res
.
get_pdu_session_id
();
// N2InfoContent (section 6.1.6.2.27@3GPP TS 29.518)
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"n2InfoContent"
][
"ngapIeType"
]
=
"PDU_RES_SETUP_REQ"
;
// NGAP message type
"PDU_RES_SETUP_REQ"
;
// NGAP message type
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"n2InfoContent"
][
"ngapData"
]
[
"contentId"
]
=
N2_SM_CONTENT_ID
;
// NGAP part
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"sNssai"
][
"sst"
]
=
...
...
@@ -1093,7 +1094,7 @@ void session_update_sm_context_procedure::handle_itti_msg(
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"n2InfoContent"
][
"ngapData"
]
[
"contentId"
]
=
N2_SM_CONTENT_ID
;
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"n2InfoContent"
][
"ngapIeType"
]
=
"PDU_RES_SETUP_REQ"
;
// NGAP message
"PDU_RES_SETUP_REQ"
;
// NGAP message
json_data
[
"upCnxState"
]
=
"ACTIVATING"
;
n11_triggered_pending
->
res
.
set_json_data
(
json_data
);
// TODO: verify whether cause is needed (as in 23.502 but not in 3GPP
...
...
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