Commit 98900aa5 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Add function headers for the rest

parent ea5d7006
......@@ -203,16 +203,65 @@ class amf_config {
public:
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);
/*
* 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);
/*
* Get the URI of NRF NF Discovery Service
* @param void
* @return URI in string format
*/
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);
/*
* 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(
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();
/*
* Get the URI of AUSF UE Authentication Service
* @param void
* @return URI in string format
*/
std::string get_ausf_ue_authentications_uri();
/*
* Display the AMF configuration parameters
* @param void
* @return void
*/
void display();
unsigned int instance;
std::string pid_dir;
interface_cfg_t n2;
......
......@@ -50,15 +50,24 @@ namespace config {
class amf_modules {
public:
/*
* Load AMF modules configuration
* @param [const std::string&] config_file: Configuration file
* @return RETURNclear/RETURNerror/RETURNok
*/
int load(const std::string& config_file);
/*
* Display the AMF modules configuration parameters
* @param void
* @return void
*/
void display();
void makeModulesAlive();
private:
std::string msgName; // vector to store more msgs
Ngap_NGAP_PDU_PR typeOfMsg;
Ngap_ProcedureCode_t procedureCode;
// NGSetupRequestMsg *ngSetupRequest;
};
} // namespace config
......
......@@ -75,11 +75,11 @@ class event_exposure_msg {
bool m_supi_is_set;
bool m_any_ue; // anyUE, Conditional
// subsChangeNotifyUri:
// subsChangeNotifyCorrelationId:
// groupId:
// gpsi:
// pei:
// subsChangeNotifyUri
// subsChangeNotifyCorrelationId
// groupId
// gpsi
// pei
// options: AmfEventMode
};
......
......@@ -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(
std::string supi, std::shared_ptr<pdu_session_context> psc,
std::string smf_addr, bstring sm_msg, std::string dnn) {
const std::string& supi, std::shared_ptr<pdu_session_context>& psc,
const std::string& smf_addr, bstring sm_msg, const std::string& dnn) {
Logger::amf_n11().debug(
"Send PDU Session Update SM Context Request to SMF (SUPI %s, PDU Session "
"ID %d, %s)",
......@@ -479,9 +479,9 @@ void amf_n11::send_pdu_session_update_sm_context_request(
//------------------------------------------------------------------------------
void amf_n11::handle_pdu_session_initial_request(
std::string supi, std::shared_ptr<pdu_session_context> psc,
std::string smf_addr, std::string smf_api_version, std::string smf_port,
bstring sm_msg, std::string dnn) {
const std::string& supi, std::shared_ptr<pdu_session_context>& psc,
const std::string& smf_addr, const std::string& smf_api_version,
const std::string& smf_port, bstring sm_msg, const std::string& dnn) {
Logger::amf_n11().debug(
"Handle PDU Session Establishment Request (SUPI %s, PDU Session ID %d)",
supi.c_str(), psc.get()->pdu_session_id);
......@@ -827,8 +827,8 @@ bool amf_n11::smf_selection_from_configuration(
//------------------------------------------------------------------------------
void amf_n11::handle_post_sm_context_response_error(
long code, std::string cause, bstring n1sm, std::string supi,
uint8_t pdu_session_id) {
const long code, const std::string& cause, bstring n1sm,
const std::string& supi, const uint8_t pdu_session_id) {
comUt::print_buffer(
"amf_n11", "n1 sm", (uint8_t*) bdata(n1sm), blength(n1sm));
itti_n1n2_message_transfer_request* itti_msg =
......@@ -851,7 +851,7 @@ void amf_n11::handle_post_sm_context_response_error(
//-----------------------------------------------------------------------------------------------------
bool amf_n11::discover_smf(
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) {
Logger::amf_n11().debug(
"Send NFDiscovery to NRF to discover the available SMFs");
......@@ -996,8 +996,9 @@ void amf_n11::register_nf_instance(
//-----------------------------------------------------------------------------------------------------
bool amf_n11::send_ue_authentication_request(
oai::amf::model::AuthenticationInfo& auth_info,
oai::amf::model::UEAuthenticationCtx& ue_auth_ctx, uint8_t http_version) {
const oai::amf::model::AuthenticationInfo& auth_info,
oai::amf::model::UEAuthenticationCtx& ue_auth_ctx,
const uint8_t& http_version) {
Logger::amf_n11().debug(
"Send UE Authentication Request to AUSF (HTTP version %d)", http_version);
......@@ -1040,9 +1041,10 @@ bool amf_n11::send_ue_authentication_request(
//------------------------------------------------------------------------------
void amf_n11::curl_http_client(
std::string remote_uri, std::string json_data, std::string n1sm_msg,
std::string n2sm_msg, std::string supi, uint8_t pdu_session_id,
uint8_t http_version, uint32_t promise_id) {
const std::string& remote_uri, const std::string& json_data,
const std::string& n1sm_msg, const std::string& n2sm_msg,
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());
uint8_t number_parts = 0;
......@@ -1316,9 +1318,9 @@ void amf_n11::curl_http_client(
//------------------------------------------------------------------------------
void amf_n11::curl_http_client(
std::string& remote_uri, std::string& json_data, std::string& n1sm_msg,
std::string& n2sm_msg, uint8_t http_version, uint32_t& response_code,
uint32_t promise_id) {
const std::string& remote_uri, std::string& json_data,
std::string& n1sm_msg, std::string& n2sm_msg, const uint8_t& http_version,
uint32_t& response_code, const uint32_t& promise_id) {
Logger::amf_n11().debug("Call SMF service: %s", remote_uri.c_str());
uint8_t number_parts = 0;
......@@ -1482,9 +1484,9 @@ void amf_n11::curl_http_client(
//-----------------------------------------------------------------------------------------------------
void amf_n11::curl_http_client(
std::string remote_uri, std::string method, std::string msg_body,
nlohmann::json& response_json, uint32_t& response_code,
uint8_t http_version) {
const std::string& remote_uri, const std::string& method,
const std::string& msg_body, nlohmann::json& response_json,
uint32_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("HTTP message Body: %s", msg_body.c_str());
......
This diff is collapsed.
......@@ -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);
if (gnbs.count(gnb_id) > 0) {
gnbs.erase(gnb_id);
......
......@@ -76,13 +76,52 @@ typedef struct ue_info_s {
class statistics {
public:
void display();
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);
/*
* 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 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);
/*
* 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);
public:
......
......@@ -47,6 +47,12 @@ class amf_subscription {
nf_id() {
supi_is_set = false;
}
/*
* Display the AMF Subscription information
* @param void
* @return void
*/
void display();
evsub_id_t sub_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment