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
1c22f054
Commit
1c22f054
authored
May 26, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
46b7bb77
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
80 deletions
+87
-80
src/common/utils/3gpp_conversions.cpp
src/common/utils/3gpp_conversions.cpp
+2
-2
src/common/utils/3gpp_conversions.hpp
src/common/utils/3gpp_conversions.hpp
+2
-2
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+38
-45
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+26
-5
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+19
-23
src/smf_app/smf_context.hpp
src/smf_app/smf_context.hpp
+0
-3
No files found.
src/common/utils/3gpp_conversions.cpp
View file @
1c22f054
...
...
@@ -516,7 +516,7 @@ void xgpp_conv::sm_context_request_from_nas(
}
//------------------------------------------------------------------------------
void
xgpp_conv
::
create_sm_context_response_from_ct_request
(
void
xgpp_conv
::
create_sm_context_response_from_ct
x
_request
(
const
std
::
shared_ptr
<
itti_n11_create_sm_context_request
>&
ctx_request
,
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>&
ctx_response
)
{
ctx_response
->
http_version
=
ctx_request
->
http_version
;
...
...
@@ -535,7 +535,7 @@ void xgpp_conv::create_sm_context_response_from_ct_request(
}
//------------------------------------------------------------------------------
void
xgpp_conv
::
update_sm_context_response_from_ct_request
(
void
xgpp_conv
::
update_sm_context_response_from_ct
x
_request
(
const
std
::
shared_ptr
<
itti_n11_update_sm_context_request
>&
ct_request
,
std
::
shared_ptr
<
itti_n11_update_sm_context_response
>&
ct_response
)
{
ct_response
->
res
.
set_http_code
(
...
...
src/common/utils/3gpp_conversions.hpp
View file @
1c22f054
...
...
@@ -161,11 +161,11 @@ void smf_event_exposure_notification_from_openapi(
void
sm_context_request_from_nas
(
const
nas_message_t
&
nm
,
smf
::
pdu_session_create_sm_context_request
&
pcr
);
void
create_sm_context_response_from_ct_request
(
void
create_sm_context_response_from_ct
x
_request
(
const
std
::
shared_ptr
<
itti_n11_create_sm_context_request
>&
ct_request
,
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>&
ct_response
);
void
update_sm_context_response_from_ct_request
(
void
update_sm_context_response_from_ct
x
_request
(
const
std
::
shared_ptr
<
itti_n11_update_sm_context_request
>&
ct_request
,
std
::
shared_ptr
<
itti_n11_update_sm_context_response
>&
ct_response
);
...
...
src/smf_app/smf_app.cpp
View file @
1c22f054
This diff is collapsed.
Click to expand it.
src/smf_app/smf_app.hpp
View file @
1c22f054
...
...
@@ -43,9 +43,6 @@
#include "itti_msg_n11.hpp"
#include "itti_msg_n4.hpp"
#include "itti_msg_sbi.hpp"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#include "smf.h"
#include "smf_context.hpp"
#include "smf_msg.hpp"
...
...
@@ -732,7 +729,6 @@ class smf_app {
* @param [const uint32_t &] http_code: Status code of HTTP response
* @param [const uint8_t &] cause: Error cause
* @param [uint32_t &] promise_id: Promise Id
* @param [uint8_t] msg_type: Type of HTTP message (Update/Release)
* @return void
*/
void
trigger_update_context_error_response
(
...
...
@@ -745,7 +741,6 @@ class smf_app {
* @param [const uint8_t &] cause: cause
* @param [const std::string &] n1_sm_msg: N1 SM message
* @param [uint32_t &] promise_id: Promise Id
* @param [uint8_t] msg_type: Type of HTTP message (Update/Release)
* @return void
*/
void
trigger_update_context_error_response
(
...
...
@@ -763,12 +758,38 @@ class smf_app {
void
trigger_http_response
(
const
uint32_t
&
http_code
,
uint32_t
&
promise_id
,
uint8_t
msg_type
);
/*
* To trigger the session create sm context response by set the value of the
* corresponding promise to ready
* @param [pdu_session_create_sm_context_response&] sm_context_response:
* response message
* @param [uint32_t &] promise_id: Promise Id
* @return void
*/
void
trigger_session_create_sm_context_response
(
pdu_session_create_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
);
/*
* To trigger the session update sm context response by set the value of the
* corresponding promise to ready
* @param [pdu_session_update_sm_context_response&] sm_context_response:
* response message
* @param [uint32_t &] promise_id: Promise Id
* @return void
*/
void
trigger_session_update_sm_context_response
(
pdu_session_update_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
);
/*
* To trigger the session release sm context response by set the value of the
* corresponding promise to ready
* @param [pdu_session_release_sm_context_response&] sm_context_response:
* response message
* @param [uint32_t &] promise_id: Promise Id
* @return void
*/
void
trigger_session_release_sm_context_response
(
pdu_session_release_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
);
...
...
src/smf_app/smf_context.cpp
View file @
1c22f054
...
...
@@ -1223,13 +1223,13 @@ void smf_context::handle_pdu_session_create_sm_context_request(
std
::
string
n1_sm_message
,
n1_sm_msg_hex
;
bool
request_accepted
=
true
;
// Step 1.
g
et necessary information
// Step 1.
G
et necessary information
std
::
string
dnn
=
smreq
->
req
.
get_dnn
();
snssai_t
snssai
=
smreq
->
req
.
get_snssai
();
supi64_t
supi64
=
smf_supi_to_u64
(
smreq
->
req
.
get_supi
());
uint32_t
pdu_session_id
=
smreq
->
req
.
get_pdu_session_id
();
// Step 2.
c
heck the validity of the UE request, if valid send PDU Session
// Step 2.
C
heck the validity of the UE request, if valid send PDU Session
// Accept, otherwise send PDU Session Reject to AMF
if
(
!
verify_sm_context_request
(
smreq
))
{
Logger
::
smf_app
().
warn
(
...
...
@@ -1256,7 +1256,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
return
;
}
//
s
tore HttpResponse and session-related information to be used when
//
S
tore HttpResponse and session-related information to be used when
// receiving the response from UPF
itti_n11_create_sm_context_response
*
sm_context_resp
=
new
itti_n11_create_sm_context_response
(
...
...
@@ -1265,14 +1265,14 @@ void smf_context::handle_pdu_session_create_sm_context_request(
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>
(
sm_context_resp
);
// Assign necessary information for the response
xgpp_conv
::
create_sm_context_response_from_ct_request
(
xgpp_conv
::
create_sm_context_response_from_ct
x
_request
(
smreq
,
sm_context_resp_pending
);
// Step 3.
f
ind pdu_session
// Step 3.
F
ind pdu_session
std
::
shared_ptr
<
dnn_context
>
sd
=
{};
bool
find_dnn
=
find_dnn_context
(
snssai
,
dnn
,
sd
);
//
step 3.1. c
reate dnn context if not exist
//
Step 3.1. C
reate dnn context if not exist
// At this step, this context should be existed
if
(
nullptr
==
sd
.
get
())
{
Logger
::
smf_app
().
debug
(
...
...
@@ -1288,7 +1288,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
"DNN context (dnn_in_use %s) is already existed"
,
dnn
.
c_str
());
}
//
step 3.2. c
reate pdu session if not exist
//
Step 3.2. C
reate pdu session if not exist
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
bool
find_pdu
=
sd
.
get
()
->
find_pdu_session
(
pdu_session_id
,
sp
);
...
...
@@ -1345,7 +1345,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
Logger
::
smf_app
().
debug
(
"PDU Session Type IPv4v6, select PDU Session Type IPv4"
);
bool
paa_res
=
false
;
// TODO: Verif
ied
if use default session type or requested session type
// TODO: Verif
y
if use default session type or requested session type
std
::
shared_ptr
<
session_management_subscription
>
ss
=
{};
std
::
shared_ptr
<
dnn_configuration_t
>
sdc
=
{};
find_dnn_subscription
(
snssai
,
ss
);
...
...
@@ -1436,6 +1436,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
Logger
::
smf_app
().
info
(
"UE requests to use DHCPv4 for IPv4 address assignment, this "
"feature has not been supported yet!"
);
request_accepted
=
false
;
// TODO
}
...
...
@@ -1444,6 +1445,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
case
PDU_SESSION_TYPE_E_IPV6
:
{
// TODO:
Logger
::
smf_app
().
debug
(
"IPv6 has not been supported yet!"
);
request_accepted
=
false
;
}
break
;
default:
{
...
...
@@ -1607,16 +1609,12 @@ void smf_context::handle_pdu_session_create_sm_context_request(
conv
::
convert_string_2_hex
(
n1_sm_message
,
n1_sm_msg_hex
);
sm_context_resp_pending
->
res
.
set_n1_sm_message
(
n1_sm_msg_hex
);
//
g
et supi and put into URL
//
G
et supi and put into URL
std
::
string
supi_str
;
supi_t
supi
=
sm_context_resp_pending
->
res
.
get_supi
();
supi_str
=
sm_context_resp_pending
->
res
.
get_supi_prefix
()
+
"-"
+
smf_supi_to_string
(
supi
);
std
::
string
url
=
// std::string(
// inet_ntoa(*((struct in_addr*) &smf_cfg.amf_addr.ipv4_addr))) +
// ":" + std::to_string(smf_cfg.amf_addr.port) + NAMF_COMMUNICATION_BASE
// +
sp
.
get
()
->
get_amf_addr
()
+
NAMF_COMMUNICATION_BASE
+
smf_cfg
.
amf_addr
.
api_version
+
fmt
::
format
(
...
...
@@ -1632,7 +1630,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
sm_context_resp_pending
->
res
.
get_pdu_session_id
();
sm_context_resp_pending
->
res
.
set_json_data
(
json_data
);
//
s
end ITTI message to N11 to trigger N1N2MessageTransfer towards AMFs
//
S
end ITTI message to N11 to trigger N1N2MessageTransfer towards AMFs
Logger
::
smf_app
().
info
(
"Sending ITTI message %s to task TASK_SMF_SBI"
,
sm_context_resp_pending
->
get_msg_name
());
...
...
@@ -2344,7 +2342,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
sp
.
get
()
->
get_pdu_session_type
().
pdu_session_type
);
// Assign necessary information for the response
xgpp_conv
::
update_sm_context_response_from_ct_request
(
xgpp_conv
::
update_sm_context_response_from_ct
x
_request
(
smreq
,
sm_context_resp_pending
);
// Step 2.1. Decode N1 (if content is available)
...
...
@@ -2370,7 +2368,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
switch
(
message_type
)
{
case
PDU_SESSION_MODIFICATION_REQUEST
:
{
// PDU Session Modification procedure (UE-initiated, step 1.a,
// Section 4.3.3.2@3GPP TS 23.502)
UE initiated PDU session
// Section 4.3.3.2@3GPP TS 23.502)
.
UE initiated PDU session
// modification request (Step 1)
procedure_type
=
session_management_procedures_type_e
::
...
...
@@ -2382,9 +2380,8 @@ void smf_context::handle_pdu_session_update_sm_context_request(
}
break
;
case
PDU_SESSION_MODIFICATION_COMPLETE
:
{
// PDU Session Modification
// procedure (UE-initiated/Network-requested) (step 3) PDU Session
// Modification Command Complete
// PDU Session Modification procedure (UE-initiated/Network-requested)
// (step 3) PDU Session Modification Command Complete
Logger
::
smf_app
().
debug
(
"PDU_SESSION_MODIFICATION_COMPLETE"
);
procedure_type
=
session_management_procedures_type_e
::
...
...
@@ -2396,7 +2393,6 @@ void smf_context::handle_pdu_session_update_sm_context_request(
}
break
;
case
PDU_SESSION_MODIFICATION_COMMAND_REJECT
:
{
// PDU_SESSION_MODIFICATION_COMMAND_REJECT
// PDU Session Modification procedure (Section 4.3.3.2@3GPP TS 23.502)
Logger
::
smf_app
().
debug
(
"PDU_SESSION_MODIFICATION_COMMAND_REJECT"
);
...
...
@@ -2599,7 +2595,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
insert_procedure
(
sproc
);
if
(
proc
->
run
(
smreq
,
sm_context_resp_pending
,
shared_from_this
()))
{
// error
!
// error
Logger
::
smf_app
().
info
(
"PDU Update SM Context Request procedure failed (session procedure "
"type %s)"
,
...
...
@@ -2640,14 +2636,14 @@ void smf_context::handle_pdu_session_update_sm_context_request(
PDU_SESSION_RELEASE_AMF_INITIATED:
case
session_management_procedures_type_e
:
:
PDU_SESSION_RELEASE_UE_REQUESTED_STEP1:
{
// trigger t
o send
reply to AMF
// trigger t
he
reply to AMF
smf_app_inst
->
trigger_update_context_error_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING
,
smreq
->
pid
);
}
break
;
default:
{
// trigger t
o send
reply to AMF
// trigger t
he
reply to AMF
smf_app_inst
->
trigger_update_context_error_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING
,
smreq
->
pid
);
...
...
src/smf_app/smf_context.hpp
View file @
1c22f054
...
...
@@ -43,9 +43,6 @@
#include "common_root_types.h"
#include "itti.hpp"
#include "msg_pfcp.hpp"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#include "smf_event.hpp"
#include "smf_procedure.hpp"
#include "uint_generator.hpp"
...
...
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