Commit e11c85c6 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Code cleanup for NSSF URI

parent 09adfb29
......@@ -851,4 +851,11 @@ std::string amf_config::get_udm_slice_selection_subscription_data_retrieval_uri(
":" + std::to_string(udm_addr.port) + "/nudm-sdm/" +
udm_addr.api_version + "/" + supi + "/nssai";
}
//------------------------------------------------------------------------------
std::string amf_config::get_nssf_network_slice_selection_information_uri() {
return std::string(inet_ntoa(*((struct in_addr*) &nssf_addr.ipv4_addr))) +
":" + std::to_string(nssf_addr.port) + "/nnssf-nsselection/" +
nssf_addr.api_version + "/network-slice-information";
}
} // namespace config
......@@ -208,6 +208,7 @@ class amf_config {
std::string get_nrf_nf_discovery_service_uri();
std::string get_udm_slice_selection_subscription_data_retrieval_uri(
const std::string& supi);
std::string get_nssf_network_slice_selection_information_uri();
void display();
unsigned int instance;
......
......@@ -634,11 +634,7 @@ void amf_n11::handle_itti_message(
"%d)",
itti_msg.http_version);
std::string url =
std::string(
inet_ntoa(*((struct in_addr*) &amf_cfg.nssf_addr.ipv4_addr))) +
":" + std::to_string(amf_cfg.nssf_addr.port) + "/nnssf-nsselection/" +
amf_cfg.nssf_addr.api_version + "/network-slice-information";
std::string url = amf_cfg.get_nssf_network_slice_selection_information_uri();
// slice-info-request-for-registration
nlohmann::json slice_info = {};
......@@ -653,8 +649,9 @@ void amf_n11::handle_itti_message(
"?slice-info-request-for-registration=" + slice_info.dump() +
"?home-plmn-id=" + home_plmn_id.dump();
url += parameters;
Logger::amf_n11().debug(
"Send Slice Selection Subscription Data Retrieval to UDM, URL %s",
"Send Slice Selection Information Retrieval to NSSF, URL %s",
url.c_str());
nlohmann::json response_data = {};
......@@ -785,13 +782,17 @@ bool amf_n11::discover_smf_from_nsi_info(
slice_info["roamingIndication"] = "NON_ROAMING";
// ToDo Add TAI
std::string url = std::string(inet_ntoa(
*((struct in_addr*) &amf_cfg.nssf_addr.ipv4_addr))) +
":" + std::to_string(amf_cfg.nssf_addr.port) +
"/nnssf-nsselection/" + amf_cfg.nssf_addr.api_version +
"/network-slice-information?nf-type=AMF&nf-id=abc&slice-"
"info-request-for-pdu-session=" +
slice_info.dump();
std::string url = amf_cfg.get_nssf_network_slice_selection_information_uri();
std::string parameters = {};
parameters = "?nf-type=AMF&nf-id=" + amf_app_inst->get_nf_instance() +
"&slice-info-request-for-pdu-session=" + slice_info.dump();
url += parameters;
Logger::amf_n11().debug(
"Send Network Slice Information Retrieval during PDU session "
"establishment procedure, URL %s",
url.c_str());
// TODO: use curl_http_client
......
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