Commit 4c2cfe07 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen
Browse files

cleanup smf config file

parent 28ac58cb
......@@ -123,7 +123,7 @@ int main(int argc, char **argv)
//SMF API server
Pistache::Address addr(std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.n11.addr4))) , Pistache::Port(smf_cfg.n11.port));
Pistache::Address addr(std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.sbi.addr4))) , Pistache::Port(smf_cfg.sbi.port));
SMFApiServer smfApiServer(addr, smf_app_inst);
smfApiServer.init(2);
std::thread smf_api_manager(&SMFApiServer::start, smfApiServer);
......
......@@ -273,8 +273,8 @@ int smf_config::load(const string& config_file)
const Setting& n4_cfg = nw_if_cfg[SMF_CONFIG_STRING_INTERFACE_N4];
load_interface(n4_cfg, n4);
const Setting& n11_cfg = nw_if_cfg[SMF_CONFIG_STRING_INTERFACE_N11];
load_interface(n11_cfg, n11);
const Setting& n11_cfg = nw_if_cfg[SMF_CONFIG_STRING_INTERFACE_SBI];
load_interface(n11_cfg, sbi);
} catch (const SettingNotFoundException &nfex) {
Logger::smf_app().error("%s : %s", nfex.what(), nfex.getPath());
......@@ -512,10 +512,10 @@ void smf_config::display ()
Logger::smf_app().info( " ip ...................: %s", inet_ntoa (n4.addr4));
Logger::smf_app().info( " port .................: %d", n4.port);
Logger::smf_app().info( "- N11 Networking:");
Logger::smf_app().info( " iface ................: %s", n11.if_name.c_str());
Logger::smf_app().info( " ip ...................: %s", inet_ntoa (n11.addr4));
Logger::smf_app().info( " port .................: %d", n11.port);
Logger::smf_app().info( "- SBI Networking:");
Logger::smf_app().info( " iface ................: %s", sbi.if_name.c_str());
Logger::smf_app().info( " ip ...................: %s", inet_ntoa (sbi.addr4));
Logger::smf_app().info( " port .................: %d", sbi.port);
Logger::smf_app().info( "- N4 Threading:");
Logger::smf_app().info( " CPU id............: %d", n4.thread_rd_sched_params.cpu_id);
......@@ -645,8 +645,6 @@ smf_config::~smf_config()
{
}
//------------------------------------------------------------------------------
bool smf_config::is_dotted_dnn_handled(const std::string& dnn, const pdu_session_type_t& pdn_session_type)
{
......
......@@ -54,7 +54,7 @@
#define SMF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_PORT "PORT"
#define SMF_CONFIG_STRING_INTERFACE_N4 "N4"
#define SMF_CONFIG_STRING_INTERFACE_N11 "N11"
#define SMF_CONFIG_STRING_INTERFACE_SBI "SBI"
#define SMF_CONFIG_STRING_SMF_MASQUERADE_SGI "PGW_MASQUERADE_SGI"
#define SMF_CONFIG_STRING_UE_TCP_MSS_CLAMPING "UE_TCP_MSS_CLAMPING"
......@@ -77,9 +77,6 @@
#define SMF_CONFIG_STRING_DEFAULT_DNS_SEC_IPV6_ADDRESS "DEFAULT_DNS_SEC_IPV6_ADDRESS"
#define SMF_CONFIG_STRING_UE_MTU "UE_MTU"
#define SMF_CONFIG_STRING_GTPV1U_REALIZATION "GTPV1U_REALIZATION"
#define SMF_CONFIG_STRING_NO_GTP_KERNEL_AVAILABLE "NO_GTP_KERNEL_AVAILABLE"
#define SMF_CONFIG_STRING_GTP_KERNEL_MODULE "GTP_KERNEL_MODULE"
#define SMF_CONFIG_STRING_GTP_KERNEL "GTP_KERNEL"
#define SMF_CONFIG_STRING_INTERFACE_DISABLED "none"
......@@ -100,16 +97,6 @@
#define SMF_ABORT_ON_ERROR true
#define SMF_WARN_ON_ERROR false
#define SMF_CONFIG_STRING_OVS_CONFIG "OVS"
#define SMF_CONFIG_STRING_OVS_BRIDGE_NAME "BRIDGE_NAME"
#define SMF_CONFIG_STRING_OVS_EGRESS_PORT_NUM "EGRESS_PORT_NUM"
#define SMF_CONFIG_STRING_OVS_GTP_PORT_NUM "GTP_PORT_NUM"
#define SMF_CONFIG_STRING_OVS_L2_EGRESS_PORT "L2_EGRESS_PORT"
#define SMF_CONFIG_STRING_OVS_UPLINK_MAC "UPLINK_MAC"
#define SMF_CONFIG_STRING_OVS_SGI_ARP_CACHE "SGI_ARP_CACHE"
#define SMF_CONFIG_STRING_IP "IP"
#define SMF_CONFIG_STRING_MAC "MAC"
#define SMF_CONFIG_STRING_SCHED_PARAMS "SCHED_PARAMS"
#define SMF_CONFIG_STRING_THREAD_RD_CPU_ID "CPU_ID"
#define SMF_CONFIG_STRING_THREAD_RD_SCHED_POLICY "SCHED_POLICY"
......@@ -123,20 +110,20 @@
#define SMF_CONFIG_STRING_ASYNC_CMD_SCHED_PARAMS "ASYNC_CMD_SCHED_PARAMS"
#define SMF_CONFIG_STRING_AMF "AMF"
#define SMF_CONFIG_STRING_AMF_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_AMF_PORT "PORT"
#define SMF_CONFIG_STRING_UDM "UDM"
#define SMF_CONFIG_STRING_UDM_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_UDM_PORT "PORT"
#define SMF_CONFIG_STRING_AMF "AMF"
#define SMF_CONFIG_STRING_AMF_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_AMF_PORT "PORT"
#define SMF_CONFIG_STRING_UDM "UDM"
#define SMF_CONFIG_STRING_UDM_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_UDM_PORT "PORT"
//test_upf
#define SMF_CONFIG_STRING_TEST_UPF "TEST_UPF"
#define SMF_CONFIG_STRING_TEST_UPF_IS_TEST "IS_TEST"
#define SMF_CONFIG_STRING_TEST_UPF_GNB_IPV4_ADDRESS "GNB_IPV4_ADDRESS"
#define SMF_CONFIG_STRING_TEST_UPF "TEST_UPF"
#define SMF_CONFIG_STRING_TEST_UPF_IS_TEST "IS_TEST"
#define SMF_CONFIG_STRING_TEST_UPF_GNB_IPV4_ADDRESS "GNB_IPV4_ADDRESS"
#define SMF_CONFIG_STRING_UPF_LIST "UPF_LIST"
#define SMF_CONFIG_STRING_UPF_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_UPF_LIST "UPF_LIST"
#define SMF_CONFIG_STRING_UPF_IPV4_ADDRESS "IPV4_ADDRESS"
#define PGW_MAX_ALLOCATED_PDN_ADDRESSES 1024
......@@ -178,7 +165,7 @@ public:
unsigned int instance = 0;
interface_cfg_t n4;
interface_cfg_t n11;
interface_cfg_t sbi;
itti_cfg_t itti;
test_upf_cfg_t test_upf_cfg;
......@@ -235,7 +222,7 @@ public:
std::vector<pfcp::node_id_t> upfs;
smf_config() : m_rw_lock(), pcef(), num_apn(0), pid_dir(), instance(0), n4(), n11(), itti(), upfs() {
smf_config() : m_rw_lock(), pcef(), num_apn(0), pid_dir(), instance(0), n4(), sbi(), itti(), upfs() {
for (int i = 0; i < PGW_NUM_APN_MAX; i++) {
apn[i] = {};
}
......@@ -266,8 +253,8 @@ public:
n4.thread_rd_sched_params.sched_priority = 90;
n4.port = pfcp::default_port;
n11.thread_rd_sched_params.sched_priority = 90;
n11.port = 80;
sbi.thread_rd_sched_params.sched_priority = 90;
sbi.port = 80;
amf_addr.ipv4_addr.s_addr = INADDR_ANY;
amf_addr.port = 80;
......
......@@ -904,7 +904,8 @@ void smf_context::handle_pdu_session_create_sm_context_request (std::shared_ptr<
std::string supi_str;
supi_t supi = sm_context_resp_pending->res.get_supi();
supi_str = sm_context_resp_pending->res.get_supi_prefix() + "-" + smf_supi_to_string (supi);
std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.amf_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.amf_addr.port) + "/namf-comm/v2/ue-contexts/" + supi_str.c_str() +"/n1-n2-messages";
//std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.amf_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.amf_addr.port) + "/namf-comm/v2/ue-contexts/" + supi_str.c_str() +"/n1-n2-messages";
std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.amf_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.amf_addr.port) + fmt::format(NAMF_COMMUNICATION_N1N2_MESSAGE_TRANSFER_URL, supi_str.c_str());
sm_context_resp_pending->res.set_amf_url(url);
//Fill the json part
......
......@@ -67,7 +67,6 @@ static std::size_t callback(
//------------------------------------------------------------------------------
void smf_n10_task (void *args_p)
{
const task_id_t task_id = TASK_SMF_N10;
......@@ -129,7 +128,8 @@ bool smf_n10::get_sm_data(supi64_t& supi, std::string& dnn, snssai_t& snssai, st
headers = curl_slist_append(headers, "charsets: utf-8");
CURL *curl = curl_easy_init();
std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.udm_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.udm_addr.port) + "/nudm-sdm/v2/" + std::to_string(supi) +"/sm-data";
// std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.udm_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.udm_addr.port) + "/nudm-sdm/v2/" + std::to_string(supi) +"/sm-data";
std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.udm_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.udm_addr.port) + fmt::format(NUDM_SDM_GET_SM_DATA_URL, std::to_string(supi));
Logger::smf_n10().debug("[get_sm_data] UDM's URL: %s ", url.c_str());
if (curl) {
......@@ -179,13 +179,8 @@ bool smf_n10::get_sm_data(supi64_t& supi, std::string& dnn, snssai_t& snssai, st
Logger::smf_n10().debug("[get_sm_data] GET response from UDM %s", jsonData.dump().c_str());
//retrieve SessionManagementSubscription and store in the context
for (nlohmann::json::iterator it = jsonData["dnnConfigurations"].begin(); it != jsonData["dnnConfigurations"].end(); ++it ){
for (nlohmann::json::iterator it = jsonData["dnnConfigurations"].begin(); it != jsonData["dnnConfigurations"].end(); ++it ) {
Logger::smf_n10().debug("[get_sm_data] DNN %s", it.key().c_str());
//dnn_configuration_t *dnn_configuration = new (dnn_configuration_t);
//std::shared_ptr<dnn_configuration_t> sdc = {};
//subscription->find_dnn_configuration(it.key(), sdc);
try {
std::shared_ptr<dnn_configuration_t> dnn_configuration = std::make_shared<dnn_configuration_t>();
//PDU Session Type
......
......@@ -372,7 +372,8 @@ void session_create_sm_context_procedure::handle_itti_msg (itti_n4_session_estab
//get supi and put into URL
supi_t supi = n11_triggered_pending->res.get_supi();
std::string supi_str = n11_triggered_pending->res.get_supi_prefix() + "-" + smf_supi_to_string (supi);
std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.amf_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.amf_addr.port) + "/namf-comm/v2/ue-contexts/" + supi_str.c_str() +"/n1-n2-messages";
//std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.amf_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.amf_addr.port) + "/namf-comm/v2/ue-contexts/" + supi_str.c_str() +"/n1-n2-messages";
std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.amf_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.amf_addr.port) + fmt::format(NAMF_COMMUNICATION_N1N2_MESSAGE_TRANSFER_URL, supi_str.c_str());
n11_triggered_pending->res.set_amf_url(url);
Logger::smf_n11().debug("N1N2MessageTransfer will be sent to AMF with URL: %s", url.c_str());
......
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