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-Simple
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
CommunityXG
OpenXG-SMF-Simple
Commits
908e56da
Commit
908e56da
authored
May 10, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue to work with documentation
parent
44a7737f
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
311 additions
and
67 deletions
+311
-67
src/common/smf.h
src/common/smf.h
+2
-0
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+16
-6
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+219
-23
src/smf_app/smf_context.hpp
src/smf_app/smf_context.hpp
+12
-13
src/smf_app/smf_n10.cpp
src/smf_app/smf_n10.cpp
+0
-3
src/smf_app/smf_n10.hpp
src/smf_app/smf_n10.hpp
+17
-0
src/smf_app/smf_n11.hpp
src/smf_app/smf_n11.hpp
+14
-15
src/smf_app/smf_procedure.hpp
src/smf_app/smf_procedure.hpp
+31
-7
No files found.
src/common/smf.h
View file @
908e56da
...
...
@@ -189,5 +189,7 @@ static const std::vector<std::string> multipart_related_content_part_e2str = {
//for CURL
#define AMF_CURL_TIMEOUT_MS 100L
#define UDM_CURL_TIMEOUT_MS 100L
#define UDM_NUMBER_RETRIES 3
#endif
src/smf_app/smf_app.cpp
View file @
908e56da
...
...
@@ -1018,6 +1018,16 @@ bool smf_app::is_scid_2_smf_context(const scid_t &scid) const {
return
bool
{
scid2smf_context
.
count
(
scid
)
>
0
};
}
//------------------------------------------------------------------------------
bool
smf_app
::
scid_2_smf_context
(
const
scid_t
&
scid
,
std
::
shared_ptr
<
smf_context_ref
>
&
scf
)
const
{
std
::
shared_lock
lock
(
m_scid2smf_context
);
if
(
scid2smf_context
.
count
(
scid
)
>
0
)
{
scf
=
scid2smf_context
.
at
(
scid
);
return
true
;
}
return
false
;
}
//------------------------------------------------------------------------------
bool
smf_app
::
use_local_configuration_subscription_data
(
const
std
::
string
&
dnn_selection_mode
)
{
...
...
@@ -1069,7 +1079,7 @@ void smf_app::convert_string_2_hex(std::string &input_str,
}
//---------------------------------------------------------------------------------------------
unsigned
char
*
smf_app
::
format_string_as_hex
(
std
::
string
str
)
{
unsigned
char
*
smf_app
::
format_string_as_hex
(
std
::
string
&
str
)
{
unsigned
int
str_len
=
str
.
length
();
char
*
data
=
(
char
*
)
malloc
(
str_len
+
1
);
memset
(
data
,
0
,
str_len
+
1
);
...
...
@@ -1094,8 +1104,8 @@ unsigned char* smf_app::format_string_as_hex(std::string str) {
}
//---------------------------------------------------------------------------------------------
void
smf_app
::
update_pdu_session_status
(
const
scid_t
scid
,
const
pdu_session_status_e
status
)
{
void
smf_app
::
update_pdu_session_status
(
const
scid_t
&
scid
,
const
pdu_session_status_e
&
status
)
{
Logger
::
smf_app
().
info
(
"Update PDU Session Status"
);
//get the smf context
...
...
@@ -1150,8 +1160,8 @@ void smf_app::update_pdu_session_status(const scid_t scid,
}
//---------------------------------------------------------------------------------------------
void
smf_app
::
update_pdu_session_upCnx_state
(
const
scid_t
scid
,
const
upCnx_state_e
state
)
{
void
smf_app
::
update_pdu_session_upCnx_state
(
const
scid_t
&
scid
,
const
upCnx_state_e
&
state
)
{
Logger
::
smf_app
().
info
(
"Update UpCnx_State"
);
//get the smf context
...
...
@@ -1209,7 +1219,7 @@ void smf_app::timer_t3591_timeout(timer_id_t timer_id, uint64_t arg2_user) {
}
//---------------------------------------------------------------------------------------------
n2_sm_info_type_e
smf_app
::
n2_sm_info_type_str2e
(
std
::
string
n2_info_type
)
{
n2_sm_info_type_e
smf_app
::
n2_sm_info_type_str2e
(
std
::
string
&
n2_info_type
)
{
std
::
size_t
number_of_types
=
n2_sm_info_type_e2str
.
size
();
for
(
auto
i
=
0
;
i
<
number_of_types
;
++
i
)
{
if
(
n2_info_type
.
compare
(
n2_sm_info_type_e2str
[
i
])
==
0
)
{
...
...
src/smf_app/smf_app.hpp
View file @
908e56da
This diff is collapsed.
Click to expand it.
src/smf_app/smf_context.hpp
View file @
908e56da
...
...
@@ -86,7 +86,6 @@ class smf_qos_flow {
* @param void
* @return void
*/
void
deallocate_ressources
();
/*
...
...
@@ -129,7 +128,6 @@ class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> {
ipv4_address
.
s_addr
=
INADDR_ANY
;
ipv6_address
=
in6addr_any
;
pdn_type
=
{
};
default_bearer
.
ebi
=
EPS_BEARER_IDENTITY_UNASSIGNED
;
seid
=
0
;
up_fseid
=
{
};
qos_flows
.
clear
();
...
...
@@ -386,7 +384,6 @@ class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> {
struct
in_addr
ipv4_address
;
// IP Address(es): IPv4 address and/or IPv6 prefix
struct
in6_addr
ipv6_address
;
// IP Address(es): IPv4 address and/or IPv6 prefix
pdn_type_t
pdn_type
;
// IPv4, IPv6, IPv4v6 or Non-IP
ebi_t
default_bearer
;
//Default Bearer: Identifies the default bearer within the PDN connection by its EPS Bearer Id.
bool
released
;
//(release access bearers request)
...
...
@@ -402,16 +399,17 @@ class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> {
uint32_t
pdu_session_id
;
std
::
string
amf_id
;
std
::
map
<
uint8_t
,
smf_qos_flow
>
qos_flows
;
// QFI <-> QoS Flow
pfcp
::
qfi_t
default_qfi
;
std
::
map
<
uint8_t
,
QOSRulesIE
>
qos_rules
;
// QRI <-> QoS Rules
std
::
vector
<
uint8_t
>
qos_rules_to_be_synchronised
;
std
::
vector
<
uint8_t
>
qos_rules_to_be_removed
;
pdu_session_status_e
pdu_session_status
;
upCnx_state_e
upCnx_state
;
//N3 tunnel status (ACTIVATED, DEACTIVATED, ACTIVATING)
timer_id_t
timer_T3590
;
timer_id_t
timer_T3591
;
timer_id_t
timer_T3592
;
upCnx_state_e
upCnx_state
;
//N3 tunnel status (ACTIVATED, DEACTIVATED, ACTIVATING)
pfcp
::
qfi_t
default_qfi
;
//Default QFI for this session
std
::
map
<
uint8_t
,
smf_qos_flow
>
qos_flows
;
// QFI <-> QoS Flow
std
::
map
<
uint8_t
,
QOSRulesIE
>
qos_rules
;
// QRI <-> QoS Rules
std
::
vector
<
uint8_t
>
qos_rules_to_be_synchronised
;
std
::
vector
<
uint8_t
>
qos_rules_to_be_removed
;
//5GSM parameters and capabilities
uint8_t
maximum_number_of_supported_packet_filters
;
//TODO: 5GSM Capability (section 9.11.4.1@3GPP TS 24.501 V16.1.0)
...
...
@@ -446,6 +444,7 @@ class session_management_subscription {
*/
void
find_dnn_configuration
(
std
::
string
dnn
,
std
::
shared_ptr
<
dnn_configuration_t
>
&
dnn_configuration
);
private:
snssai_t
single_nssai
;
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
dnn_configuration_t
>>
dnn_configurations
;
//dnn <->dnn_configuration
...
...
@@ -753,19 +752,19 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
const
snssai_t
&
snssai
,
const
std
::
string
&
dnn
);
private:
std
::
vector
<
std
::
shared_ptr
<
dnn_context
>>
dnns
;
imsi_t
imsi
;
// IMSI (International Mobile Subscriber Identity) is the subscriber permanent identity.
bool
imsi_unauthenticated_indicator
;
// This is an IMSI indicator to show the IMSI is unauthenticated.
// TO BE CHECKED me_identity_t me_identity; // Mobile Equipment Identity (e.g. IMEI/IMEISV).
msisdn_t
msisdn
;
// The basic MSISDN of the UE. The presence is dictated by its storage in the HSS.
std
::
vector
<
std
::
shared_ptr
<
smf_procedure
>>
pending_procedures
;
// Big recursive lock
mutable
std
::
recursive_mutex
m_context
;
// snssai-sst <-> session management subscription
std
::
map
<
uint8_t
,
std
::
shared_ptr
<
session_management_subscription
>>
dnn_subscriptions
;
supi_t
supi
;
scid_t
scid
;
scid_t
scid
;
//SM Context ID
// Big recursive lock
mutable
std
::
recursive_mutex
m_context
;
};
}
...
...
src/smf_app/smf_n10.cpp
View file @
908e56da
...
...
@@ -39,9 +39,6 @@
#include "logger.hpp"
#include "smf_config.hpp"
#define UDM_CURL_TIMEOUT_MS 100L
#define UDM_NUMBER_RETRIES 3
using
namespace
smf
;
using
namespace
std
;
using
json
=
nlohmann
::
json
;
...
...
src/smf_app/smf_n10.hpp
View file @
908e56da
...
...
@@ -47,9 +47,26 @@ class smf_n10 {
smf_n10
();
smf_n10
(
smf_n10
const
&
)
=
delete
;
void
operator
=
(
smf_n10
const
&
)
=
delete
;
/*
* Get SM subscription data from UDM
* @param [supi64_t &] supi
* @param [std::string &] dnn
* @param [snssai_t &] snssai
* @param [std::shared_ptr<session_management_subscription>] subscription
* @return bool: True if successful, otherwise false
*
*/
bool
get_sm_data
(
supi64_t
&
supi
,
std
::
string
&
dnn
,
snssai_t
&
snssai
,
std
::
shared_ptr
<
session_management_subscription
>
subscription
);
/*
* Subscribe to be notify from UDM
* @param []
* @return void
*
*/
void
subscribe_sm_data
();
};
...
...
src/smf_app/smf_n11.hpp
View file @
908e56da
...
...
@@ -54,7 +54,7 @@ class smf_n11 {
/*
* Send N1N2 Message Transfer Request to AMF
* @param [std::shared_ptr<itti_n11_create_sm_context_response>] sm_context_res: Content of message to be sent
*
*
@return void
*/
void
send_n1n2_message_transfer_request
(
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>
sm_context_res
);
...
...
@@ -62,7 +62,7 @@ class smf_n11 {
/*
* Send N1N2 Message Transfer Request to AMF
* @param [std::shared_ptr<itti_nx_trigger_pdu_session_modification>] sm_context_res: Content of message to be sent
*
*
@return void
*/
void
send_n1n2_message_transfer_request
(
std
::
shared_ptr
<
itti_nx_trigger_pdu_session_modification
>
sm_context_res
);
...
...
@@ -70,16 +70,15 @@ class smf_n11 {
/*
* Send update session response to AMF
* @param [std::shared_ptr<itti_n11_update_sm_context_response> sm_context_res] sm_context_res
*
*
@return void
*/
void
send_pdu_session_update_sm_context_response
(
std
::
shared_ptr
<
itti_n11_update_sm_context_response
>
sm_context_res
);
/*
* Send N1N2 Message Transfer Request to AMF
* @param [std::shared_ptr<itti_n11_modify_session_request_smf_requested>] sm_context_mod: Content of message to be sent
*
*
@return void
*/
void
send_n1n2_message_transfer_request
(
std
::
shared_ptr
<
itti_n11_modify_session_request_smf_requested
>
sm_context_mod
);
...
...
@@ -89,7 +88,7 @@ class smf_n11 {
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [ oai::smf_server::model::SmContextUpdateError] SmContextUpdateError
* @param [Pistache::Http::Code] code, response code
*
*
@return void
*/
void
send_pdu_session_update_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
...
...
@@ -101,7 +100,7 @@ class smf_n11 {
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [ oai::smf_server::model::SmContextUpdatedData] smContextUpdatedData
* @param [Pistache::Http::Code] code, response code
*
*
@return void
*/
void
send_pdu_session_update_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
...
...
@@ -113,7 +112,7 @@ class smf_n11 {
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [ oai::smf_server::model::SmContextCreateError] smContextCreateError
* @param [Pistache::Http::Code] code, response code
*
*
@return void
*/
void
send_pdu_session_create_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
...
...
@@ -126,7 +125,7 @@ class smf_n11 {
* @param [ oai::smf_server::model::SmContextCreateError] smContextCreateError
* @param [Pistache::Http::Code] code, response code
* @param [std::string] n1_sm_msg, N1 SM message content
*
*
@return void
*/
void
send_pdu_session_create_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
...
...
@@ -139,7 +138,7 @@ class smf_n11 {
* @param [ oai::smf_server::model::SmContextUpdateError] smContextUpdateError
* @param [Pistache::Http::Code] code, response code
* @param [std::string] n1_sm_msg, N1 SM message content
*
*
@return void
*/
void
send_pdu_session_update_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
...
...
@@ -151,7 +150,7 @@ class smf_n11 {
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [ oai::smf_server::model::SmContextCreatedData] smContextCreatedData
* @param [Pistache::Http::Code] code, response code
*
*
@return void
*/
void
send_pdu_session_create_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
...
...
@@ -162,7 +161,7 @@ class smf_n11 {
* Send release session response to AMF
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [Pistache::Http::Code] code, response code
*
*
@return void
*/
void
send_pdu_session_release_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
Pistache
::
Http
::
Code
code
);
...
...
@@ -172,7 +171,7 @@ class smf_n11 {
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [oai::smf_server::model::ProblemDetails] problem
* @param [Pistache::Http::Code] code, response code
*
*
@return void
*/
void
send_pdu_session_release_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
...
...
@@ -186,7 +185,7 @@ class smf_n11 {
* @param [std::string] boundary: Boundary of multipart/related msg
* @param [std::string] n1_message: N1 (NAS) part
* @param [std::string] n2_message: N2 (NGAP) part
*
*
@return void
*/
void
create_multipart_related_content
(
std
::
string
&
body
,
std
::
string
&
json_part
,
...
...
@@ -201,7 +200,7 @@ class smf_n11 {
* @param [std::string] boundary: Boundary of multipart/related msg
* @param [std::string] message: N1 (NAS) or N2 (NGAP) part
* @param [uint8_t] content_type: 1 for NAS content, else NGAP content
*
*
@return void
*/
void
create_multipart_related_content
(
std
::
string
&
body
,
std
::
string
&
json_part
,
std
::
string
&
boundary
,
...
...
src/smf_app/smf_procedure.hpp
View file @
908e56da
...
...
@@ -71,7 +71,6 @@ class smf_procedure {
virtual
itti_msg_type_t
get_procedure_type
()
{
return
ITTI_MSG_TYPE_NONE
;
}
//virtual void handle_itti_msg (itti_n4_session_establishment_response& resp) {}
virtual
void
handle_itti_msg
(
itti_n4_session_establishment_response
&
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
pc
)
{
}
...
...
@@ -81,7 +80,6 @@ class smf_procedure {
virtual
void
handle_itti_msg
(
itti_n4_session_deletion_response
&
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
pc
)
{
}
//virtual void handle_itti_msg (itti_s5s8_downlink_data_notification_acknowledge& resp) {}
};
class
smf_qos_flow
;
...
...
@@ -100,10 +98,7 @@ class n4_session_restore_procedure : public smf_procedure {
}
int
run
();
//void handle_itti_msg (itti_n4_session_establishment_response& resp);
//~n4_session_restore_procedure() {}
std
::
set
<
pfcp
::
fseid_t
>
pending_sessions
;
std
::
set
<
pfcp
::
fseid_t
>
restored_sessions
;
};
...
...
@@ -121,10 +116,23 @@ class session_create_sm_context_procedure : public smf_procedure {
n11_trigger
()
{
}
/*
* Execute N11 Create SM Context Request procedure
* @param [itti_n11_create_sm_context_request] req
* @param [itti_n11_create_sm_context_response] resp
* @param [std::shared_ptr<smf::smf_context>] sc: smf context
* @return
*/
int
run
(
std
::
shared_ptr
<
itti_n11_create_sm_context_request
>
req
,
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
sc
);
/*
* Handle N4 Session Establishment Response from UPF
* @param [itti_n4_session_establishment_response] resp
* @param [std::shared_ptr<smf::smf_context>] sc smf context
* @return void
*/
void
handle_itti_msg
(
itti_n4_session_establishment_response
&
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
sc
);
...
...
@@ -149,11 +157,19 @@ class session_update_sm_context_procedure : public smf_procedure {
session_procedure_type
()
{
}
/*
* Execute N11 Update SM Context Request procedure
* @param [itti_n11_update_sm_context_request] req
* @param [itti_n11_update_sm_context_response] resp
* @param [std::shared_ptr<smf::smf_context>] sc: smf context
* @return
*/
int
run
(
std
::
shared_ptr
<
itti_n11_update_sm_context_request
>
req
,
std
::
shared_ptr
<
itti_n11_update_sm_context_response
>
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
sc
);
/*
* Handle N4
modification r
esponse from UPF
* Handle N4
Session Modification R
esponse from UPF
* @param [itti_n4_session_modification_response] resp
* @param [std::shared_ptr<smf::smf_context>] sc smf context
* @return void
...
...
@@ -184,11 +200,19 @@ class session_release_sm_context_procedure : public smf_procedure {
n11_trigger
()
{
}
/*
* Execute N11 Release SM Context Request procedure
* @param [itti_n11_release_sm_context_request] req
* @param [itti_n11_release_sm_context_response] resp
* @param [std::shared_ptr<smf::smf_context>] sc: smf context
* @return
*/
int
run
(
std
::
shared_ptr
<
itti_n11_release_sm_context_request
>
req
,
std
::
shared_ptr
<
itti_n11_release_sm_context_response
>
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
sc
);
/*
* Handle N4
modification r
esponse from UPF
* Handle N4
Session Modification R
esponse from UPF
* @param [itti_n4_session_modification_response] resp
* @param [std::shared_ptr<smf::smf_context>] sc smf context
* @return void
...
...
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