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
7b7ea0b4
Commit
7b7ea0b4
authored
May 23, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary ITTI to trigger Http response
parent
2a0dd9c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
11 deletions
+87
-11
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+77
-11
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+10
-0
No files found.
src/smf_app/smf_app.cpp
View file @
7b7ea0b4
...
@@ -1843,48 +1843,66 @@ void smf_app::trigger_http_response(
...
@@ -1843,48 +1843,66 @@ void smf_app::trigger_http_response(
"Send ITTI msg to SMF APP to trigger the response of HTTP Server"
);
"Send ITTI msg to SMF APP to trigger the response of HTTP Server"
);
switch
(
msg_type
)
{
switch
(
msg_type
)
{
case
N11_SESSION_RELEASE_SM_CONTEXT_RESPONSE
:
{
case
N11_SESSION_RELEASE_SM_CONTEXT_RESPONSE
:
{
std
::
shared_ptr
<
itti_n11_release_sm_context_response
>
itti_msg
=
/*
std::shared_ptr<itti_n11_release_sm_context_response> itti_msg =
std::make_shared<itti_n11_release_sm_context_response>(
std::make_shared<itti_n11_release_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
*/
pdu_session_release_sm_context_response
sm_context_response
=
{};
pdu_session_release_sm_context_response
sm_context_response
=
{};
sm_context_response
.
set_http_code
(
http_code
);
sm_context_response
.
set_http_code
(
http_code
);
trigger_session_release_sm_context_response
(
sm_context_response
,
promise_id
);
/*
itti_msg->res = sm_context_response;
itti_msg->res = sm_context_response;
int ret = itti_inst->send_msg(itti_msg);
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
if (RETURNok != ret) {
Logger::smf_app().error(
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_APP",
"Could not send ITTI message %s to task TASK_SMF_APP",
itti_msg->get_msg_name());
itti_msg->get_msg_name());
}
}*/
}
break
;
}
break
;
case
N11_SESSION_CREATE_SM_CONTEXT_RESPONSE
:
{
case
N11_SESSION_CREATE_SM_CONTEXT_RESPONSE
:
{
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>
itti_msg
=
/*
std::shared_ptr<itti_n11_create_sm_context_response> itti_msg =
std::make_shared<itti_n11_create_sm_context_response>(
std::make_shared<itti_n11_create_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
*/
pdu_session_create_sm_context_response
sm_context_response
=
{};
pdu_session_create_sm_context_response
sm_context_response
=
{};
sm_context_response
.
set_http_code
(
http_code
);
sm_context_response
.
set_http_code
(
http_code
);
trigger_session_create_sm_context_response
(
sm_context_response
,
promise_id
);
/*
itti_msg->res = sm_context_response;
itti_msg->res = sm_context_response;
int ret = itti_inst->send_msg(itti_msg);
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
if (RETURNok != ret) {
Logger::smf_app().error(
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_APP",
"Could not send ITTI message %s to task TASK_SMF_APP",
itti_msg->get_msg_name());
itti_msg->get_msg_name());
}
}*/
}
break
;
}
break
;
case
N11_SESSION_UPDATE_SM_CONTEXT_RESPONSE
:
{
case
N11_SESSION_UPDATE_SM_CONTEXT_RESPONSE
:
{
std
::
shared_ptr
<
itti_n11_update_sm_context_response
>
itti_msg
=
/*
std::shared_ptr<itti_n11_update_sm_context_response> itti_msg =
std::make_shared<itti_n11_update_sm_context_response>(
std::make_shared<itti_n11_update_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
*/
pdu_session_update_sm_context_response
sm_context_response
=
{};
pdu_session_update_sm_context_response
sm_context_response
=
{};
sm_context_response
.
set_http_code
(
http_code
);
sm_context_response
.
set_http_code
(
http_code
);
itti_msg
->
res
=
sm_context_response
;
trigger_session_update_sm_context_response
(
sm_context_response
,
promise_id
);
/* itti_msg->res = sm_context_response;
int ret = itti_inst->send_msg(itti_msg);
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
if (RETURNok != ret) {
Logger::smf_app().error(
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_APP",
"Could not send ITTI message %s to task TASK_SMF_APP",
itti_msg->get_msg_name());
itti_msg->get_msg_name());
}
}*/
}
break
;
}
break
;
default:
{
default:
{
...
@@ -1893,6 +1911,54 @@ void smf_app::trigger_http_response(
...
@@ -1893,6 +1911,54 @@ void smf_app::trigger_http_response(
}
}
}
}
//------------------------------------------------------------------------------
void
smf_app
::
trigger_session_create_sm_context_response
(
pdu_session_create_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
)
{
Logger
::
smf_app
().
debug
(
"Trigger PDU Session Create SM Context Response: Set promise with ID %d "
"to ready"
,
pid
);
std
::
unique_lock
lock
(
m_sm_context_create_promises
);
if
(
sm_context_create_promises
.
count
(
pid
)
>
0
)
{
sm_context_create_promises
[
pid
]
->
set_value
(
sm_context_response
);
// Remove this promise from list
sm_context_create_promises
.
erase
(
pid
);
}
}
//------------------------------------------------------------------------------
void
smf_app
::
trigger_session_update_sm_context_response
(
pdu_session_update_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
)
{
Logger
::
smf_app
().
debug
(
"Trigger PDU Session Update SM Context Response: Set promise with ID %d "
"to ready"
,
pid
);
std
::
unique_lock
lock
(
m_sm_context_update_promises
);
if
(
sm_context_update_promises
.
count
(
pid
)
>
0
)
{
sm_context_update_promises
[
pid
]
->
set_value
(
sm_context_response
);
// Remove this promise from list
sm_context_update_promises
.
erase
(
pid
);
}
}
//------------------------------------------------------------------------------
void
smf_app
::
trigger_session_release_sm_context_response
(
pdu_session_release_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
)
{
Logger
::
smf_app
().
debug
(
"Trigger PDU Session Release SM Context Response: Set promise with ID %d "
"to ready"
,
pid
);
std
::
unique_lock
lock
(
m_sm_context_release_promises
);
if
(
sm_context_release_promises
.
count
(
pid
)
>
0
)
{
sm_context_release_promises
[
pid
]
->
set_value
(
sm_context_response
);
// Remove this promise from list
sm_context_release_promises
.
erase
(
pid
);
}
}
//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
void
smf_app
::
add_event_subscription
(
void
smf_app
::
add_event_subscription
(
evsub_id_t
sub_id
,
smf_event_t
ev
,
std
::
shared_ptr
<
smf_subscription
>
ss
)
{
evsub_id_t
sub_id
,
smf_event_t
ev
,
std
::
shared_ptr
<
smf_subscription
>
ss
)
{
...
...
src/smf_app/smf_app.hpp
View file @
7b7ea0b4
...
@@ -772,6 +772,16 @@ class smf_app {
...
@@ -772,6 +772,16 @@ class smf_app {
void
trigger_http_response
(
void
trigger_http_response
(
const
uint32_t
&
http_code
,
uint32_t
&
promise_id
,
uint8_t
msg_type
);
const
uint32_t
&
http_code
,
uint32_t
&
promise_id
,
uint8_t
msg_type
);
void
trigger_session_create_sm_context_response
(
pdu_session_create_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
);
void
trigger_session_update_sm_context_response
(
pdu_session_update_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
);
void
trigger_session_release_sm_context_response
(
pdu_session_release_sm_context_response
&
sm_context_response
,
uint32_t
&
pid
);
/*
/*
* Add an Event Subscription to the list
* Add an Event Subscription to the list
* @param [const evsub_id_t&] sub_id: Subscription ID
* @param [const evsub_id_t&] sub_id: Subscription ID
...
...
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