Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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-AMF
Commits
98900aa5
Commit
98900aa5
authored
Apr 15, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add function headers for the rest
parent
ea5d7006
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
329 additions
and
60 deletions
+329
-60
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+49
-0
src/amf-app/amf_module_from_config.hpp
src/amf-app/amf_module_from_config.hpp
+11
-2
src/amf-app/amf_msg.hpp
src/amf-app/amf_msg.hpp
+5
-5
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+21
-19
src/amf-app/amf_n11.hpp
src/amf-app/amf_n11.hpp
+195
-31
src/amf-app/amf_statistics.cpp
src/amf-app/amf_statistics.cpp
+1
-1
src/amf-app/amf_statistics.hpp
src/amf-app/amf_statistics.hpp
+41
-2
src/amf-app/amf_subscription.hpp
src/amf-app/amf_subscription.hpp
+6
-0
No files found.
src/amf-app/amf_config.hpp
View file @
98900aa5
...
@@ -203,16 +203,65 @@ class amf_config {
...
@@ -203,16 +203,65 @@ class amf_config {
public:
public:
amf_config
();
amf_config
();
~
amf_config
();
~
amf_config
();
/*
* Load AMF configuration file
* @param [const std::string&] config_file: Configuration file
* @return RETURNclear/RETURNerror/RETURNok
*/
int
load
(
const
std
::
string
&
config_file
);
int
load
(
const
std
::
string
&
config_file
);
/*
* Read the network interface configuration
* @param [const Setting&] if_cfg: Configuration for the network interface
* @param [interface_cfg_t&] cfg: Interface config
* @return RETURNclear/RETURNerror/RETURNok
*/
int
load_interface
(
const
Setting
&
if_cfg
,
interface_cfg_t
&
cfg
);
int
load_interface
(
const
Setting
&
if_cfg
,
interface_cfg_t
&
cfg
);
/*
* Get the URI of NRF NF Discovery Service
* @param void
* @return URI in string format
*/
std
::
string
get_nrf_nf_discovery_service_uri
();
std
::
string
get_nrf_nf_discovery_service_uri
();
/*
* Get the URI of NRF NF Registration Service
* @param [const std::string&] nf_instance_id: NF instance ID
* @return URI in string format
*/
std
::
string
get_nrf_nf_registration_uri
(
const
std
::
string
&
nf_instance_id
);
std
::
string
get_nrf_nf_registration_uri
(
const
std
::
string
&
nf_instance_id
);
/*
* Get the URI of UDM Slice Selection Subscription Data Retrieval Service
* @param [const std::string&] supi: UE SUPI
* @return URI in string format
*/
std
::
string
get_udm_slice_selection_subscription_data_retrieval_uri
(
std
::
string
get_udm_slice_selection_subscription_data_retrieval_uri
(
const
std
::
string
&
supi
);
const
std
::
string
&
supi
);
/*
* Get the URI of NSSF Network Slice Selection Information Service
* @param void
* @return URI in string format
*/
std
::
string
get_nssf_network_slice_selection_information_uri
();
std
::
string
get_nssf_network_slice_selection_information_uri
();
/*
* Get the URI of AUSF UE Authentication Service
* @param void
* @return URI in string format
*/
std
::
string
get_ausf_ue_authentications_uri
();
std
::
string
get_ausf_ue_authentications_uri
();
/*
* Display the AMF configuration parameters
* @param void
* @return void
*/
void
display
();
void
display
();
unsigned
int
instance
;
unsigned
int
instance
;
std
::
string
pid_dir
;
std
::
string
pid_dir
;
interface_cfg_t
n2
;
interface_cfg_t
n2
;
...
...
src/amf-app/amf_module_from_config.hpp
View file @
98900aa5
...
@@ -50,15 +50,24 @@ namespace config {
...
@@ -50,15 +50,24 @@ namespace config {
class
amf_modules
{
class
amf_modules
{
public:
public:
/*
* Load AMF modules configuration
* @param [const std::string&] config_file: Configuration file
* @return RETURNclear/RETURNerror/RETURNok
*/
int
load
(
const
std
::
string
&
config_file
);
int
load
(
const
std
::
string
&
config_file
);
/*
* Display the AMF modules configuration parameters
* @param void
* @return void
*/
void
display
();
void
display
();
void
makeModulesAlive
();
private:
private:
std
::
string
msgName
;
// vector to store more msgs
std
::
string
msgName
;
// vector to store more msgs
Ngap_NGAP_PDU_PR
typeOfMsg
;
Ngap_NGAP_PDU_PR
typeOfMsg
;
Ngap_ProcedureCode_t
procedureCode
;
Ngap_ProcedureCode_t
procedureCode
;
// NGSetupRequestMsg *ngSetupRequest;
};
};
}
// namespace config
}
// namespace config
...
...
src/amf-app/amf_msg.hpp
View file @
98900aa5
...
@@ -75,11 +75,11 @@ class event_exposure_msg {
...
@@ -75,11 +75,11 @@ class event_exposure_msg {
bool
m_supi_is_set
;
bool
m_supi_is_set
;
bool
m_any_ue
;
// anyUE, Conditional
bool
m_any_ue
;
// anyUE, Conditional
// subsChangeNotifyUri
:
// subsChangeNotifyUri
// subsChangeNotifyCorrelationId
:
// subsChangeNotifyCorrelationId
// groupId
:
// groupId
// gpsi
:
// gpsi
// pei
:
// pei
// options: AmfEventMode
// options: AmfEventMode
};
};
...
...
src/amf-app/amf_n11.cpp
View file @
98900aa5
...
@@ -437,8 +437,8 @@ void amf_n11::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) {
...
@@ -437,8 +437,8 @@ void amf_n11::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
amf_n11
::
send_pdu_session_update_sm_context_request
(
void
amf_n11
::
send_pdu_session_update_sm_context_request
(
std
::
string
supi
,
std
::
shared_ptr
<
pdu_session_context
>
psc
,
const
std
::
string
&
supi
,
std
::
shared_ptr
<
pdu_session_context
>&
psc
,
std
::
string
smf_addr
,
bstring
sm_msg
,
std
::
string
dnn
)
{
const
std
::
string
&
smf_addr
,
bstring
sm_msg
,
const
std
::
string
&
dnn
)
{
Logger
::
amf_n11
().
debug
(
Logger
::
amf_n11
().
debug
(
"Send PDU Session Update SM Context Request to SMF (SUPI %s, PDU Session "
"Send PDU Session Update SM Context Request to SMF (SUPI %s, PDU Session "
"ID %d, %s)"
,
"ID %d, %s)"
,
...
@@ -479,9 +479,9 @@ void amf_n11::send_pdu_session_update_sm_context_request(
...
@@ -479,9 +479,9 @@ void amf_n11::send_pdu_session_update_sm_context_request(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
amf_n11
::
handle_pdu_session_initial_request
(
void
amf_n11
::
handle_pdu_session_initial_request
(
std
::
string
supi
,
std
::
shared_ptr
<
pdu_session_context
>
psc
,
const
std
::
string
&
supi
,
std
::
shared_ptr
<
pdu_session_context
>&
psc
,
std
::
string
smf_addr
,
std
::
string
smf_api_version
,
std
::
string
smf_port
,
const
std
::
string
&
smf_addr
,
const
std
::
string
&
smf_api_version
,
bstring
sm_msg
,
std
::
string
dnn
)
{
const
std
::
string
&
smf_port
,
bstring
sm_msg
,
const
std
::
string
&
dnn
)
{
Logger
::
amf_n11
().
debug
(
Logger
::
amf_n11
().
debug
(
"Handle PDU Session Establishment Request (SUPI %s, PDU Session ID %d)"
,
"Handle PDU Session Establishment Request (SUPI %s, PDU Session ID %d)"
,
supi
.
c_str
(),
psc
.
get
()
->
pdu_session_id
);
supi
.
c_str
(),
psc
.
get
()
->
pdu_session_id
);
...
@@ -827,8 +827,8 @@ bool amf_n11::smf_selection_from_configuration(
...
@@ -827,8 +827,8 @@ bool amf_n11::smf_selection_from_configuration(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
amf_n11
::
handle_post_sm_context_response_error
(
void
amf_n11
::
handle_post_sm_context_response_error
(
long
code
,
std
::
string
cause
,
bstring
n1sm
,
std
::
string
supi
,
const
long
code
,
const
std
::
string
&
cause
,
bstring
n1sm
,
uint8_t
pdu_session_id
)
{
const
std
::
string
&
supi
,
const
uint8_t
pdu_session_id
)
{
comUt
::
print_buffer
(
comUt
::
print_buffer
(
"amf_n11"
,
"n1 sm"
,
(
uint8_t
*
)
bdata
(
n1sm
),
blength
(
n1sm
));
"amf_n11"
,
"n1 sm"
,
(
uint8_t
*
)
bdata
(
n1sm
),
blength
(
n1sm
));
itti_n1n2_message_transfer_request
*
itti_msg
=
itti_n1n2_message_transfer_request
*
itti_msg
=
...
@@ -851,7 +851,7 @@ void amf_n11::handle_post_sm_context_response_error(
...
@@ -851,7 +851,7 @@ void amf_n11::handle_post_sm_context_response_error(
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
bool
amf_n11
::
discover_smf
(
bool
amf_n11
::
discover_smf
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_port
,
std
::
string
&
smf_api_version
,
std
::
string
&
smf_addr
,
std
::
string
&
smf_port
,
std
::
string
&
smf_api_version
,
const
snssai_t
snssai
,
const
plmn_t
plmn
,
const
std
::
string
dnn
,
const
snssai_t
&
snssai
,
const
plmn_t
&
plmn
,
const
std
::
string
&
dnn
,
const
std
::
string
&
nrf_uri
)
{
const
std
::
string
&
nrf_uri
)
{
Logger
::
amf_n11
().
debug
(
Logger
::
amf_n11
().
debug
(
"Send NFDiscovery to NRF to discover the available SMFs"
);
"Send NFDiscovery to NRF to discover the available SMFs"
);
...
@@ -996,8 +996,9 @@ void amf_n11::register_nf_instance(
...
@@ -996,8 +996,9 @@ void amf_n11::register_nf_instance(
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
bool
amf_n11
::
send_ue_authentication_request
(
bool
amf_n11
::
send_ue_authentication_request
(
oai
::
amf
::
model
::
AuthenticationInfo
&
auth_info
,
const
oai
::
amf
::
model
::
AuthenticationInfo
&
auth_info
,
oai
::
amf
::
model
::
UEAuthenticationCtx
&
ue_auth_ctx
,
uint8_t
http_version
)
{
oai
::
amf
::
model
::
UEAuthenticationCtx
&
ue_auth_ctx
,
const
uint8_t
&
http_version
)
{
Logger
::
amf_n11
().
debug
(
Logger
::
amf_n11
().
debug
(
"Send UE Authentication Request to AUSF (HTTP version %d)"
,
http_version
);
"Send UE Authentication Request to AUSF (HTTP version %d)"
,
http_version
);
...
@@ -1040,9 +1041,10 @@ bool amf_n11::send_ue_authentication_request(
...
@@ -1040,9 +1041,10 @@ bool amf_n11::send_ue_authentication_request(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
amf_n11
::
curl_http_client
(
void
amf_n11
::
curl_http_client
(
std
::
string
remote_uri
,
std
::
string
json_data
,
std
::
string
n1sm_msg
,
const
std
::
string
&
remote_uri
,
const
std
::
string
&
json_data
,
std
::
string
n2sm_msg
,
std
::
string
supi
,
uint8_t
pdu_session_id
,
const
std
::
string
&
n1sm_msg
,
const
std
::
string
&
n2sm_msg
,
uint8_t
http_version
,
uint32_t
promise_id
)
{
const
std
::
string
&
supi
,
const
uint8_t
&
pdu_session_id
,
const
uint8_t
&
http_version
,
const
uint32_t
&
promise_id
)
{
Logger
::
amf_n11
().
debug
(
"Call SMF service: %s"
,
remote_uri
.
c_str
());
Logger
::
amf_n11
().
debug
(
"Call SMF service: %s"
,
remote_uri
.
c_str
());
uint8_t
number_parts
=
0
;
uint8_t
number_parts
=
0
;
...
@@ -1316,9 +1318,9 @@ void amf_n11::curl_http_client(
...
@@ -1316,9 +1318,9 @@ void amf_n11::curl_http_client(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
amf_n11
::
curl_http_client
(
void
amf_n11
::
curl_http_client
(
std
::
string
&
remote_uri
,
std
::
string
&
json_data
,
std
::
string
&
n1sm_msg
,
const
std
::
string
&
remote_uri
,
std
::
string
&
json_data
,
std
::
string
&
n
2sm_msg
,
uint8_t
http_version
,
uint32_t
&
response_code
,
std
::
string
&
n
1sm_msg
,
std
::
string
&
n2sm_msg
,
const
uint8_t
&
http_version
,
uint32_t
promise_id
)
{
uint32_t
&
response_code
,
const
uint32_t
&
promise_id
)
{
Logger
::
amf_n11
().
debug
(
"Call SMF service: %s"
,
remote_uri
.
c_str
());
Logger
::
amf_n11
().
debug
(
"Call SMF service: %s"
,
remote_uri
.
c_str
());
uint8_t
number_parts
=
0
;
uint8_t
number_parts
=
0
;
...
@@ -1482,9 +1484,9 @@ void amf_n11::curl_http_client(
...
@@ -1482,9 +1484,9 @@ void amf_n11::curl_http_client(
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
void
amf_n11
::
curl_http_client
(
void
amf_n11
::
curl_http_client
(
std
::
string
remote_uri
,
std
::
string
method
,
std
::
string
msg_body
,
const
std
::
string
&
remote_uri
,
const
std
::
string
&
method
,
nlohmann
::
json
&
response_json
,
uint32_t
&
response_code
,
const
std
::
string
&
msg_body
,
nlohmann
::
json
&
response_json
,
uint
8_t
http_version
)
{
uint
32_t
&
response_code
,
const
uint8_t
&
http_version
)
{
Logger
::
amf_n11
().
info
(
"Send HTTP message to %s"
,
remote_uri
.
c_str
());
Logger
::
amf_n11
().
info
(
"Send HTTP message to %s"
,
remote_uri
.
c_str
());
Logger
::
amf_n11
().
info
(
"HTTP message Body: %s"
,
msg_body
.
c_str
());
Logger
::
amf_n11
().
info
(
"HTTP message Body: %s"
,
msg_body
.
c_str
());
...
...
src/amf-app/amf_n11.hpp
View file @
98900aa5
This diff is collapsed.
Click to expand it.
src/amf-app/amf_statistics.cpp
View file @
98900aa5
...
@@ -141,7 +141,7 @@ void statistics::update_5gmm_state(
...
@@ -141,7 +141,7 @@ void statistics::update_5gmm_state(
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
statistics
::
remove_gnb
(
const
uint32_t
gnb_id
)
{
void
statistics
::
remove_gnb
(
const
uint32_t
&
gnb_id
)
{
std
::
unique_lock
lock
(
m_gnbs
);
std
::
unique_lock
lock
(
m_gnbs
);
if
(
gnbs
.
count
(
gnb_id
)
>
0
)
{
if
(
gnbs
.
count
(
gnb_id
)
>
0
)
{
gnbs
.
erase
(
gnb_id
);
gnbs
.
erase
(
gnb_id
);
...
...
src/amf-app/amf_statistics.hpp
View file @
98900aa5
...
@@ -76,13 +76,52 @@ typedef struct ue_info_s {
...
@@ -76,13 +76,52 @@ typedef struct ue_info_s {
class
statistics
{
class
statistics
{
public:
public:
void
display
();
statistics
();
statistics
();
~
statistics
();
~
statistics
();
/*
* Display the AMF configuration parameters
* @param void
* @return void
*/
void
display
();
/*
* Update UE information
* @param [const ue_info_t&] ue_info: UE information
* @return void
*/
void
update_ue_info
(
const
ue_info_t
&
ue_info
);
void
update_ue_info
(
const
ue_info_t
&
ue_info
);
/*
* Update UE 5GMM state
* @param [const std::string&] imsi: UE IMSI
* @param [const std::string&] state: UE State
* @return void
*/
void
update_5gmm_state
(
const
std
::
string
&
imsi
,
const
std
::
string
&
state
);
void
update_5gmm_state
(
const
std
::
string
&
imsi
,
const
std
::
string
&
state
);
void
remove_gnb
(
const
uint32_t
gnb_id
);
/*
* Remove gNB from the list connected gNB to this AMF
* @param [const uint32_t] gnb_id: gNB ID
* @return void
*/
void
remove_gnb
(
const
uint32_t
&
gnb_id
);
/*
* Add gNB to the list connected gNB to this AMF
* @param [const uint32_t&] gnb_id: gNB ID
* @param [const gnb_infos&] gnb: gNB Info
* @return void
*/
void
add_gnb
(
const
uint32_t
&
gnb_id
,
const
gnb_infos
&
gnb
);
void
add_gnb
(
const
uint32_t
&
gnb_id
,
const
gnb_infos
&
gnb
);
/*
* Update gNB info
* @param [const uint32_t&] gnb_id: gNB ID
* @param [const gnb_infos&] gnb: gNB Info
* @return void
*/
void
update_gnb
(
const
uint32_t
&
gnb_id
,
const
gnb_infos
&
gnb
);
void
update_gnb
(
const
uint32_t
&
gnb_id
,
const
gnb_infos
&
gnb
);
public:
public:
...
...
src/amf-app/amf_subscription.hpp
View file @
98900aa5
...
@@ -47,6 +47,12 @@ class amf_subscription {
...
@@ -47,6 +47,12 @@ class amf_subscription {
nf_id
()
{
nf_id
()
{
supi_is_set
=
false
;
supi_is_set
=
false
;
}
}
/*
* Display the AMF Subscription information
* @param void
* @return void
*/
void
display
();
void
display
();
evsub_id_t
sub_id
;
evsub_id_t
sub_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