Commit 026e4651 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Code cleanup for N11

parent 7b10d6a8
......@@ -85,6 +85,7 @@ amf_config::amf_config() {
smf_pool = {};
support_features.enable_nf_registration = false;
support_features.enable_nrf_selection = false;
support_features.enable_external_nrf = false;
support_features.enable_smf_selection = false;
support_features.enable_external_ausf = false;
support_features.enable_external_udm = false;
......@@ -261,6 +262,14 @@ int amf_config::load(const std::string& config_file) {
support_features.enable_nrf_selection = false;
}
support_features_cfg.lookupValue(
AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_NRF, opt);
if (boost::iequals(opt, "yes")) {
support_features.enable_external_nrf = true;
} else {
support_features.enable_external_nrf = false;
}
support_features_cfg.lookupValue(
AMF_CONFIG_STRING_SUPPORT_FEATURES_SMF_SELECTION, opt);
if (boost::iequals(opt, "yes")) {
......@@ -532,7 +541,7 @@ int amf_config::load(const std::string& config_file) {
}
// NSSF
if (support_features.enable_nrf_selection) {
if (support_features.enable_external_nssf) {
const Setting& nssf_cfg = new_if_cfg[AMF_CONFIG_STRING_NSSF];
struct in_addr nssf_ipv4_addr = {};
unsigned int nssf_port = {};
......@@ -723,7 +732,7 @@ void amf_config::display() {
" API version ...........: %s", nrf_addr.api_version.c_str());
}
if (support_features.enable_nrf_selection) {
if (support_features.enable_external_nssf) {
Logger::config().info("- NSSF:");
Logger::config().info(
" IP Addr ...............: %s", inet_ntoa(nssf_addr.ipv4_addr));
......@@ -774,6 +783,9 @@ void amf_config::display() {
Logger::config().info(
" SMF Selection .........: %s",
support_features.enable_smf_selection ? "Yes" : "No");
Logger::config().info(
" External NRF ..........: %s",
support_features.enable_external_nrf ? "Yes" : "No");
Logger::config().info(
" External AUSF .........: %s",
support_features.enable_external_ausf ? "Yes" : "No");
......@@ -858,4 +870,5 @@ std::string amf_config::get_nssf_network_slice_selection_information_uri() {
":" + std::to_string(nssf_addr.port) + "/nnssf-nsselection/" +
nssf_addr.api_version + "/network-slice-information";
}
} // namespace config
......@@ -105,6 +105,7 @@
#define AMF_CONFIG_STRING_SUPPORT_FEATURES "SUPPORT_FEATURES"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_NF_REGISTRATION "NF_REGISTRATION"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_NRF_SELECTION "NRF_SELECTION"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_NRF "EXTERNAL_NRF"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_SMF_SELECTION "SMF_SELECTION"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_AUSF "EXTERNAL_AUSF"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_UDM "EXTERNAL_UDM"
......@@ -233,6 +234,7 @@ class amf_config {
struct {
bool enable_nf_registration;
bool enable_nrf_selection;
bool enable_external_nrf;
bool enable_smf_selection;
bool enable_external_ausf;
bool enable_external_udm;
......
......@@ -1608,11 +1608,12 @@ bool amf_n1::_5g_aka_confirmation_from_ausf(
msgBody = confirmationdata_j.dump();
// TODO: Should be updated
uint8_t http_version = 1;
uint8_t http_version = 1;
uint32_t response_code = 0;
if (amf_cfg.support_features.use_http2) http_version = 2;
amf_n11_inst->curl_http_client(
remoteUri, "PUT", msgBody, response, http_version);
remoteUri, "PUT", msgBody, response, response_code, http_version);
free_wrapper((void**) &resStar_s);
try {
......
This diff is collapsed.
......@@ -83,7 +83,8 @@ class amf_n11 {
void curl_http_client(
std::string remote_uri, std::string method, std::string msg_body,
nlohmann::json& response_json, uint8_t http_version = 1);
nlohmann::json& response_json, uint32_t& response_code,
uint8_t http_version = 1);
void curl_http_client(
std::string& remote_uri, std::string& json_data, std::string& n1sm_msg,
......@@ -106,6 +107,8 @@ class amf_n11 {
bool send_ue_authentication_request(
oai::amf::model::AuthenticationInfo& auth_info,
oai::amf::model::UEAuthenticationCtx& ue_auth_ctx, uint8_t http_version);
void get_nrf_uri(std::string& nrf_uri);
};
} // namespace amf_application
......
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