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
f7ff6e2f
Commit
f7ff6e2f
authored
Jan 31, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update pdu session create sm context request/clean the code
parent
00330c61
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
422 additions
and
318 deletions
+422
-318
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+372
-304
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+50
-14
No files found.
src/smf_app/smf_app.cpp
View file @
f7ff6e2f
This diff is collapsed.
Click to expand it.
src/smf_app/smf_app.hpp
View file @
f7ff6e2f
...
...
@@ -25,7 +25,7 @@
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
*/
#ifndef FILE_SMF_APP_HPP_SEEN
#define FILE_SMF_APP_HPP_SEEN
...
...
@@ -37,7 +37,9 @@
#include "smf_context.hpp"
#include "smf_pco.hpp"
#include "SmContextCreateData.h"
#include "SmContextUpdateData.h"
#include "SmContextCreateError.h"
#include "SmContextUpdateError.h"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
...
...
@@ -53,6 +55,28 @@ namespace smf {
class
smf_config
;
// same namespace
class
smf_context_ref
{
public:
smf_context_ref
()
{
clear
();
}
void
clear
()
{
supi
=
{};
nssai
=
{};
dnn
=
""
;
pdu_session_id
=
0
;
}
// std::string toString() const;
supi_t
supi
;
std
::
string
dnn
;
pdu_session_id_t
pdu_session_id
;
snssai_t
nssai
;
};
class
smf_app
{
private:
std
::
thread
::
id
thread_id
;
...
...
@@ -71,7 +95,7 @@ private:
util
::
uint_generator
<
uint32_t
>
sm_context_ref_generator
;
std
::
map
<
scid_t
,
std
::
tuple
<
supi_t
,
std
::
string
,
pdu_session_id_t
>>
scid2smf_context
;
std
::
map
<
scid_t
,
std
::
shared_ptr
<
smf_context_ref
>>
scid2smf_context
;
mutable
std
::
shared_mutex
m_scid2smf_context
;
...
...
@@ -99,9 +123,9 @@ public:
int
static_paa_get_pool_id
(
const
struct
in_addr
&
ue_addr
);
int
process_pco_request
(
const
protocol_configuration_options_t
&
pco_req
,
protocol_configuration_options_t
&
pco_resp
,
protocol_configuration_options_ids_t
&
pco_ids
);
const
protocol_configuration_options_t
&
pco_req
,
protocol_configuration_options_t
&
pco_resp
,
protocol_configuration_options_ids_t
&
pco_ids
);
void
handle_itti_msg
(
itti_n4_session_establishment_response
&
m
);
void
handle_itti_msg
(
itti_n4_session_modification_response
&
m
);
...
...
@@ -118,22 +142,24 @@ public:
void
generate_smf_context_ref
(
std
::
string
&
smf_ref
);
scid_t
generate_smf_context_ref
();
void
set_scid_2_smf_context
(
const
scid_t
&
id
,
supi_t
supi
,
std
::
string
dnn
,
pdu_session_id_t
pdu_session_id
);
std
::
tuple
<
supi_t
,
std
::
string
,
pdu_session_id_t
>
scid_2_smf_context
(
const
scid_t
&
scid
)
const
;
void
set_scid_2_smf_context
(
const
scid_t
&
id
,
std
::
shared_ptr
<
smf_context_ref
>
scf
);
std
::
shared_ptr
<
smf_context_ref
>
scid_2_smf_context
(
const
scid_t
&
scid
)
const
;
bool
is_scid_2_smf_context
(
const
scid_t
&
scid
)
const
;
/*
* Handle PDUSession_CreateSMContextRequest from AMF
* @param [std::shared_ptr<itti_n11_create_sm_context_request>&] Request message
* @return void
*/
void
handle_amf_msg
(
std
::
shared_ptr
<
itti_n11_create_sm_context_request
>
smreq
);
void
handle_amf_msg
(
std
::
shared_ptr
<
itti_n11_create_sm_context_request
>
smreq
);
/*
* Handle PDUSession_UpdateSMContextRequest from AMF
* @param [std::shared_ptr<itti_n11_update_sm_context_request>&] Request message
* @return void
*/
void
handle_amf_msg
(
std
::
shared_ptr
<
itti_n11_update_sm_context_request
>
smreq
);
/*
* Handle PDUSession_UpdateSMContextRequest from AMF
* @param [std::shared_ptr<itti_n11_update_sm_context_request>&] Request message
* @return void
*/
void
handle_amf_msg
(
std
::
shared_ptr
<
itti_n11_update_sm_context_request
>
smreq
);
/*
* Verify if SM Context is existed for this Supi
...
...
@@ -184,10 +210,20 @@ public:
* Send create session response to AMF
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [ oai::smf_server::model::SmContextCreateError] smContextCreateError
* @param [Pistache::Http::Code] code, response code
*
*/
void
send_create_session_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
oai
::
smf_server
::
model
::
SmContextCreateError
&
smContextCreateError
,
Pistache
::
Http
::
Code
code
);
/*
* Send update session response to AMF
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [ oai::smf_server::model::SmContextUpdateError] smContextUpdateError
* @param [Pistache::Http::Code] code, response code
*
*/
void
send_update_session_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
oai
::
smf_server
::
model
::
SmContextUpdateError
&
smContextUpdateError
,
Pistache
::
Http
::
Code
code
);
/*
* Convert a string to hex representing this string
* @param [std::string&] input_str Input string
...
...
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