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
9c9b9f84
Commit
9c9b9f84
authored
Feb 24, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update N11/N10 and SMF messages
parent
2870865c
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
490 additions
and
116 deletions
+490
-116
src/smf_app/smf_msg.cpp
src/smf_app/smf_msg.cpp
+253
-3
src/smf_app/smf_msg.hpp
src/smf_app/smf_msg.hpp
+98
-6
src/smf_app/smf_n10.cpp
src/smf_app/smf_n10.cpp
+2
-3
src/smf_app/smf_n11.cpp
src/smf_app/smf_n11.cpp
+103
-102
src/smf_app/smf_n11.hpp
src/smf_app/smf_n11.hpp
+34
-2
No files found.
src/smf_app/smf_msg.cpp
View file @
9c9b9f84
This diff is collapsed.
Click to expand it.
src/smf_app/smf_msg.hpp
View file @
9c9b9f84
...
...
@@ -35,6 +35,7 @@
#include "3gpp_29.244.h"
#include "3gpp_24.007.h"
#include "3gpp_24.501.h"
#include "3gpp_29.571.h"
#include "Guami.h"
#include "RefToBinaryData.h"
#include "NgRanTargetId.h"
...
...
@@ -57,13 +58,30 @@ public:
void
set_cause
(
const
uint8_t
cause
);
void
set_qfi
(
const
pfcp
::
qfi_t
&
q
);
void
set_ul_fteid
(
const
fteid_t
&
teid
);
void
set_arp
(
const
arp_5gc_t
&
a
);
void
set_priority_level
(
uint8_t
p
);
private:
uint8_t
cause_value
;
pfcp
::
qfi_t
qfi
;
fteid_t
ul_fteid
;
arp_5gc_t
arp
;
uint8_t
priority_level
;
//1-127
};
class
qos_flow_context_modified
{
public:
void
set_cause
(
const
uint8_t
cause
);
void
set_qfi
(
const
pfcp
::
qfi_t
&
q
);
void
set_ul_fteid
(
const
fteid_t
&
teid
);
uint8_t
cause_value
;
pfcp
::
qfi_t
qfi
;
fteid_t
ul_fteid
;
};
class
pdu_session_msg
{
public:
pdu_session_msg
(){};
...
...
@@ -249,8 +267,26 @@ public:
paa_t
get_paa
();
void
set_http_code
(
Pistache
::
Http
::
Code
code
);
Pistache
::
Http
::
Code
get_http_code
();
void
set_qos_flow_context
(
const
qos_flow_context_created
qos_flow
);
void
set_qos_flow_context
(
const
qos_flow_context_created
&
qos_flow
);
qos_flow_context_created
get_qos_flow_context
()
const
;
nlohmann
::
json
n1n2_message_transfer_data
;
//N1N2MessageTransferReqData from oai::amf::model
std
::
string
get_n2_sm_information
()
const
;
void
set_n2_sm_information
(
std
::
string
const
&
value
);
std
::
string
get_n1_sm_message
()
const
;
void
set_n1_sm_message
(
std
::
string
const
&
value
);
bool
n1_sm_msg_is_set
()
const
;
bool
n2_sm_info_is_set
()
const
;
std
::
string
n1_sm_message
;
//N1 SM message
bool
m_n1_sm_msg_is_set
;
std
::
string
n2_sm_information
;
//N2 SM info
bool
m_n2_sm_info_is_set
;
void
set_amf_url
(
std
::
string
const
&
value
);
std
::
string
get_amf_url
()
const
;
private:
uint8_t
m_cause
;
paa_t
m_paa
;
...
...
@@ -258,6 +294,7 @@ private:
qos_flow_context_created
qos_flow_context
;
supi_t
m_supi
;
std
::
string
m_supi_prefix
;
std
::
string
amf_url
;
/* PDU Session establishment accept
ExtendedProtocolDiscriminator extendedprotocoldiscriminator;
...
...
@@ -298,17 +335,42 @@ private:
};
//see SmContextUpdateData (TS29502_Nsmf_PDUSession.yaml)
class
pdu_session_update_sm_context_request
:
public
pdu_session_msg
{
public:
pdu_session_update_sm_context_request
()
:
pdu_session_msg
(
PDU_SESSION_UPDATE_SM_CONTEXT_REQUEST
){
};
pdu_session_update_sm_context_request
()
:
pdu_session_msg
(
PDU_SESSION_UPDATE_SM_CONTEXT_REQUEST
){
m_n1_sm_msg_is_set
=
false
;
m_n2_sm_info_is_set
=
false
;
m_5gMm_cause_value
=
0
;
m_data_forwarding
=
false
;
};
std
::
string
get_n2_sm_information
()
const
;
void
set_n2_sm_information
(
std
::
string
const
&
value
);
std
::
string
get_n2_sm_info_type
()
const
;
void
set_n2_sm_info_type
(
std
::
string
const
&
value
);
std
::
string
get_n1_sm_message
()
const
;
void
set_n1_sm_message
(
std
::
string
const
&
value
);
bool
n1_sm_msg_is_set
()
const
;
bool
n2_sm_info_is_set
()
const
;
void
add_qfi
(
pfcp
::
qfi_t
const
&
qfi
);
void
get_qfis
(
std
::
vector
<
pfcp
::
qfi_t
>&
q
);
void
set_dl_fteid
(
fteid_t
const
&
t
);
void
get_dl_fteid
(
fteid_t
&
t
);
void
set_upCnx_state
(
std
::
string
const
&
value
);
bool
upCnx_state_is_set
()
const
;
void
set_rat_type
(
std
::
string
const
&
value
);
void
set_an_type
(
std
::
string
const
&
value
);
private:
std
::
string
n2_sm_information
;
std
::
vector
<
pfcp
::
qfi_t
>
qfis
;
fteid_t
dl_fteid
;
//AN Tunnel Info
std
::
string
n1_sm_message
;
//N1 SM message before decoding
bool
m_n1_sm_msg_is_set
;
std
::
string
n2_sm_information
;
//N2 SM before decoding
bool
m_n2_sm_info_is_set
;
std
::
string
n2_sm_info_type
;
//std::string m_Ppei;
std
::
string
m_nf_instanceId
;
...
...
@@ -351,6 +413,7 @@ private:
type: boolean
*/
std
::
string
m_upCnx_state
;
//'#/components/schemas/UpCnxState'
bool
m_upCnx_state_is_set
;
//'#/components/schemas/UpCnxState'
oai
::
smf_server
::
model
::
RefToBinaryData
m_n1_sm_msg
;
//n1SmMsg
oai
::
smf_server
::
model
::
RefToBinaryData
m_n2_sm_info
;
//n2SmInfo
...
...
@@ -396,7 +459,7 @@ private:
$ref: '#/components/schemas/Cause'
*/
//NgApCause m_ngAp_cause; // $ref: '../TS29571_CommonData.yaml#/components/schemas/NgApCause
unsigned
in
t
m_5gMm_cause_value
;
// 5GMmCause, $ref: '../TS29571_CommonData.yaml#/components/schemas/5GMmCause'
uint8_
t
m_5gMm_cause_value
;
// 5GMmCause, $ref: '../TS29571_CommonData.yaml#/components/schemas/5GMmCause'
/*
sNssai:
$ref: '../TS29571_CommonData.yaml#/components/schemas/Snssai'
...
...
@@ -426,8 +489,37 @@ public:
pdu_session_update_sm_context_response
()
:
pdu_session_msg
(
PDU_SESSION_UPDATE_SM_CONTEXT_RESPONSE
){
};
void
set_cause
(
uint8_t
cause
);
uint8_t
get_cause
();
std
::
string
get_n2_sm_information
()
const
;
void
set_n2_sm_information
(
std
::
string
const
&
value
);
std
::
string
get_n2_sm_info_type
()
const
;
void
set_n2_sm_info_type
(
std
::
string
const
&
value
);
std
::
string
get_n1_sm_message
()
const
;
void
set_n1_sm_message
(
std
::
string
const
&
value
);
std
::
string
get_n1_sm_msg_type
()
const
;
void
set_n1_sm_msg_type
(
std
::
string
const
&
value
);
bool
n1_sm_msg_is_set
()
const
;
bool
n2_sm_info_is_set
()
const
;
void
add_qos_flow_context_modified
(
const
qos_flow_context_modified
&
qos_flow
);
bool
get_qos_flow_context_modified
(
const
pfcp
::
qfi_t
&
qfi
,
qos_flow_context_modified
&
qos_flow
);
void
get_all_qos_flow_context_modifieds
(
std
::
map
<
uint8_t
,
qos_flow_context_modified
>&
all_flows
);
private:
uint8_t
m_cause
;
std
::
string
n1_sm_message
;
//N1 SM after decoding
bool
m_n1_sm_msg_is_set
;
std
::
string
n1_sm_msg_type
;
std
::
string
n2_sm_information
;
//N2 SM after decoding
bool
m_n2_sm_info_is_set
;
std
::
string
n2_sm_info_type
;
std
::
map
<
uint8_t
,
qos_flow_context_modified
>
qos_flow_context_modifieds
;
};
}
...
...
src/smf_app/smf_n10.cpp
View file @
9c9b9f84
...
...
@@ -40,7 +40,6 @@
#define UDM_CURL_TIMEOUT_MS 100L
#define UDM_NUMBER_RETRIES 3
#define HTTP_STATUS_OK 200
using
namespace
smf
;
using
namespace
std
;
...
...
@@ -125,7 +124,7 @@ bool smf_n10::get_sm_data(supi64_t& supi, std::string& dnn, snssai_t& snssai, st
nlohmann
::
json
jsonData
;
curl_global_init
(
CURL_GLOBAL_DEFAULT
);
struct
curl_slist
*
headers
=
NULL
;
struct
curl_slist
*
headers
=
nullptr
;
headers
=
curl_slist_append
(
headers
,
"Accept: application/json"
);
headers
=
curl_slist_append
(
headers
,
"Content-Type: application/json"
);
headers
=
curl_slist_append
(
headers
,
"charsets: utf-8"
);
...
...
@@ -156,7 +155,7 @@ bool smf_n10::get_sm_data(supi64_t& supi, std::string& dnn, snssai_t& snssai, st
curl_easy_getinfo
(
curl
,
CURLINFO_RESPONSE_CODE
,
&
httpCode
);
Logger
::
smf_n10
().
debug
(
"[get_sm_data] Response from UDM, Http Code: %d "
,
httpCode
);
if
(
httpCode
==
HTTP_STATUS
_OK
)
if
(
static_cast
<
http_response_codes_e
>
(
httpCode
)
==
http_response_codes_e
::
HTTP_RESPONSE_CODE
_OK
)
{
Logger
::
smf_n10
().
debug
(
"[get_sm_data] Got successful response from UDM, URL: %s "
,
url
.
c_str
());
//Logger::smf_n10().debug("[get_sm_data] Http Data from UDM: %s ", *httpData.get());
...
...
src/smf_app/smf_n11.cpp
View file @
9c9b9f84
This diff is collapsed.
Click to expand it.
src/smf_app/smf_n11.hpp
View file @
9c9b9f84
...
...
@@ -32,6 +32,7 @@
#include "smf.h"
#include "3gpp_29.503.h"
#include "smf_context.hpp"
#include "SmContextCreatedData.h"
#include <thread>
#include <map>
...
...
@@ -48,8 +49,39 @@ public:
smf_n11
();
smf_n11
(
smf_n11
const
&
)
=
delete
;
void
operator
=
(
smf_n11
const
&
)
=
delete
;
void
send_msg_to_amf
(
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>
sm_context_res
);
void
send_msg_to_amf
(
std
::
shared_ptr
<
itti_n11_update_sm_context_response
>
sm_context_res
);
void
send_n1n2_message_transfer_request
(
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>
sm_context_res
);
void
send_pdu_session_update_sm_context_response
(
std
::
shared_ptr
<
itti_n11_update_sm_context_response
>
sm_context_res
);
void
send_n1n2_message_transfer_request
(
std
::
shared_ptr
<
itti_n11_modify_session_request_smf_requested
>
sm_context_mod
);
/*
* 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_pdu_session_create_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
oai
::
smf_server
::
model
::
SmContextCreateError
&
smContextCreateError
,
Pistache
::
Http
::
Code
code
);
/*
* 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
* @param [std::string] n1_sm_msg, N1 SM message content
*
*/
void
send_pdu_session_create_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
oai
::
smf_server
::
model
::
SmContextCreateError
&
smContextCreateError
,
Pistache
::
Http
::
Code
code
,
std
::
string
&
n1_sm_msg
);
/*
* Send create session response to AMF
* @param [Pistache::Http::ResponseWriter] httpResponse
* @param [ oai::smf_server::model::SmContextCreatedData] smContextCreatedData
* @param [Pistache::Http::Code] code, response code
*
*/
void
send_pdu_session_create_sm_context_response
(
Pistache
::
Http
::
ResponseWriter
&
httpResponse
,
oai
::
smf_server
::
model
::
SmContextCreatedData
&
smContextCreatedData
,
Pistache
::
Http
::
Code
code
);
};
...
...
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