Commit 643c367c authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Update action with support features

parent 8f92ce7c
...@@ -340,17 +340,17 @@ smf_app::smf_app(const std::string& config_file) ...@@ -340,17 +340,17 @@ smf_app::smf_app(const std::string& config_file)
throw; throw;
} }
// TODO: should be done when SMF select UPF for a particular UE (should be
// verified)
for (std::vector<pfcp::node_id_t>::const_iterator it = smf_cfg.upfs.begin();
it != smf_cfg.upfs.end(); ++it) {
start_upf_association(*it);
}
if (smf_cfg.discover_upf) { if (smf_cfg.discover_upf) {
// Trigger NFStatusNotify subscription to be noticed when a new UPF becomes // Trigger NFStatusNotify subscription to be noticed when a new UPF becomes
// available (if this option is enabled) // available (if this option is enabled)
trigger_upf_status_notification_subscribe(); trigger_upf_status_notification_subscribe();
} else {
// TODO: should be done when SMF select UPF for a particular UE (should be
// verified)
for (std::vector<pfcp::node_id_t>::const_iterator it = smf_cfg.upfs.begin();
it != smf_cfg.upfs.end(); ++it) {
start_upf_association(*it);
}
} }
// Register to NRF (if this option is enabled) // Register to NRF (if this option is enabled)
......
...@@ -635,223 +635,235 @@ int smf_config::load(const string& config_file) { ...@@ -635,223 +635,235 @@ int smf_config::load(const string& config_file) {
amf_addr.ipv4_addr = amf_ipv4_addr; amf_addr.ipv4_addr = amf_ipv4_addr;
amf_addr.port = amf_port; amf_addr.port = amf_port;
amf_addr.api_version = "v1"; // TODO: to get API version from DNS amf_addr.api_version = "v1"; // TODO: to get API version from DNS
amf_addr.fqdn = astring;
} }
} }
// UDM // UDM: Get UDM information if necessary
const Setting& udm_cfg = smf_cfg[SMF_CONFIG_STRING_UDM]; if (!use_local_subscription_info) {
struct in_addr udm_ipv4_addr = {}; const Setting& udm_cfg = smf_cfg[SMF_CONFIG_STRING_UDM];
unsigned int udm_port = {0}; struct in_addr udm_ipv4_addr = {};
std::string udm_api_version = {}; unsigned int udm_port = {0};
std::string udm_api_version = {};
if (!use_fqdn_dns) { if (!use_fqdn_dns) {
udm_cfg.lookupValue(SMF_CONFIG_STRING_UDM_IPV4_ADDRESS, astring); udm_cfg.lookupValue(SMF_CONFIG_STRING_UDM_IPV4_ADDRESS, astring);
IPV4_STR_ADDR_TO_INADDR(
util::trim(astring).c_str(), udm_ipv4_addr,
"BAD IPv4 ADDRESS FORMAT FOR UDM !");
udm_addr.ipv4_addr = udm_ipv4_addr;
if (!(udm_cfg.lookupValue(SMF_CONFIG_STRING_UDM_PORT, udm_port))) {
Logger::smf_app().error(SMF_CONFIG_STRING_UDM_PORT "failed");
throw(SMF_CONFIG_STRING_UDM_PORT "failed");
}
udm_addr.port = udm_port;
if (!(udm_cfg.lookupValue(
SMF_CONFIG_STRING_API_VERSION, udm_api_version))) {
Logger::smf_app().error(SMF_CONFIG_STRING_API_VERSION "failed");
throw(SMF_CONFIG_STRING_API_VERSION "failed");
}
udm_addr.api_version = udm_api_version;
} else {
udm_cfg.lookupValue(SMF_CONFIG_STRING_FQDN_DNS, astring);
uint8_t addr_type = {0};
std::string address = {};
fqdn::resolve(astring, address, udm_port, addr_type);
if (addr_type != 0) { // IPv6
// TODO:
throw("DO NOT SUPPORT IPV6 ADDR FOR UDM!");
} else { // IPv4
IPV4_STR_ADDR_TO_INADDR( IPV4_STR_ADDR_TO_INADDR(
util::trim(address).c_str(), udm_ipv4_addr, util::trim(astring).c_str(), udm_ipv4_addr,
"BAD IPv4 ADDRESS FORMAT FOR UDM !"); "BAD IPv4 ADDRESS FORMAT FOR UDM !");
udm_addr.ipv4_addr = udm_ipv4_addr; udm_addr.ipv4_addr = udm_ipv4_addr;
udm_addr.port = udm_port; if (!(udm_cfg.lookupValue(SMF_CONFIG_STRING_UDM_PORT, udm_port))) {
udm_addr.api_version = "v1"; // TODO: to get API version from DNS Logger::smf_app().error(SMF_CONFIG_STRING_UDM_PORT "failed");
} throw(SMF_CONFIG_STRING_UDM_PORT "failed");
}
// UPF list
unsigned char buf_in_addr[sizeof(struct in_addr) + 1];
const Setting& upf_list_cfg = smf_cfg[SMF_CONFIG_STRING_UPF_LIST];
count = upf_list_cfg.getLength();
for (int i = 0; i < count; i++) {
const Setting& upf_cfg = upf_list_cfg[i];
// TODO FQDN
string address = {};
if (!use_fqdn_dns) {
if (upf_cfg.lookupValue(SMF_CONFIG_STRING_UPF_IPV4_ADDRESS, address)) {
pfcp::node_id_t n = {};
n.node_id_type = pfcp::NODE_ID_TYPE_IPV4_ADDRESS; // actually
if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) ==
1) {
memcpy(&n.u1.ipv4_address, buf_in_addr, sizeof(struct in_addr));
} else {
Logger::smf_app().error(
"CONFIG: BAD IPV4 ADDRESS in " SMF_CONFIG_STRING_UPF_LIST
" item %d",
i);
throw("CONFIG: BAD ADDRESS in " SMF_CONFIG_STRING_UPF_LIST);
}
upfs.push_back(n);
} else { // TODO IPV6_ADDRESS, FQDN
throw(
"Bad value in section %s : item no %d in config file %s",
SMF_CONFIG_STRING_UPF_LIST, i, config_file.c_str());
} }
udm_addr.port = udm_port;
if (!(udm_cfg.lookupValue(
SMF_CONFIG_STRING_API_VERSION, udm_api_version))) {
Logger::smf_app().error(SMF_CONFIG_STRING_API_VERSION "failed");
throw(SMF_CONFIG_STRING_API_VERSION "failed");
}
udm_addr.api_version = udm_api_version;
} else { } else {
unsigned int upf_port = {0}; udm_cfg.lookupValue(SMF_CONFIG_STRING_FQDN_DNS, astring);
upf_cfg.lookupValue(SMF_CONFIG_STRING_FQDN_DNS, astring);
uint8_t addr_type = {0}; uint8_t addr_type = {0};
std::string address = {}; std::string address = {};
fqdn::resolve(astring, address, upf_port, addr_type, "");
fqdn::resolve(astring, address, udm_port, addr_type);
if (addr_type != 0) { // IPv6 if (addr_type != 0) { // IPv6
// TODO: // TODO:
throw("DO NOT SUPPORT IPV6 ADDR FOR NRF!"); throw("DO NOT SUPPORT IPV6 ADDR FOR UDM!");
} else { // IPv4 } else { // IPv4
pfcp::node_id_t n = {}; IPV4_STR_ADDR_TO_INADDR(
n.node_id_type = pfcp::NODE_ID_TYPE_IPV4_ADDRESS; // actually util::trim(address).c_str(), udm_ipv4_addr,
if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) == "BAD IPv4 ADDRESS FORMAT FOR UDM !");
1) { udm_addr.ipv4_addr = udm_ipv4_addr;
memcpy(&n.u1.ipv4_address, buf_in_addr, sizeof(struct in_addr)); udm_addr.port = udm_port;
} else { udm_addr.api_version = "v1"; // TODO: to get API version from DNS
Logger::smf_app().error(
"CONFIG: BAD IPV4 ADDRESS in " SMF_CONFIG_STRING_UPF_LIST
" item %d",
i);
throw("CONFIG: BAD ADDRESS in " SMF_CONFIG_STRING_UPF_LIST);
}
upfs.push_back(n);
} }
} }
} }
// NRF // UPF list
const Setting& nrf_cfg = smf_cfg[SMF_CONFIG_STRING_NRF]; if (!discover_upf) {
struct in_addr nrf_ipv4_addr = {}; unsigned char buf_in_addr[sizeof(struct in_addr) + 1];
unsigned int nrf_port = {0}; const Setting& upf_list_cfg = smf_cfg[SMF_CONFIG_STRING_UPF_LIST];
std::string nrf_api_version = {}; count = upf_list_cfg.getLength();
for (int i = 0; i < count; i++) {
const Setting& upf_cfg = upf_list_cfg[i];
// TODO FQDN
string address = {};
if (!use_fqdn_dns) {
if (upf_cfg.lookupValue(
SMF_CONFIG_STRING_UPF_IPV4_ADDRESS, address)) {
pfcp::node_id_t n = {};
n.node_id_type = pfcp::NODE_ID_TYPE_IPV4_ADDRESS; // actually
if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) ==
1) {
memcpy(&n.u1.ipv4_address, buf_in_addr, sizeof(struct in_addr));
} else {
Logger::smf_app().error(
"CONFIG: BAD IPV4 ADDRESS in " SMF_CONFIG_STRING_UPF_LIST
" item %d",
i);
throw("CONFIG: BAD ADDRESS in " SMF_CONFIG_STRING_UPF_LIST);
}
upfs.push_back(n);
} else { // TODO IPV6_ADDRESS, FQDN
throw(
"Bad value in section %s : item no %d in config file %s",
SMF_CONFIG_STRING_UPF_LIST, i, config_file.c_str());
}
if (!use_fqdn_dns) { } else {
nrf_cfg.lookupValue(SMF_CONFIG_STRING_NRF_IPV4_ADDRESS, astring); unsigned int upf_port = {0};
IPV4_STR_ADDR_TO_INADDR(
util::trim(astring).c_str(), nrf_ipv4_addr, upf_cfg.lookupValue(SMF_CONFIG_STRING_FQDN_DNS, astring);
"BAD IPv4 ADDRESS FORMAT FOR NRF !"); uint8_t addr_type = {0};
nrf_addr.ipv4_addr = nrf_ipv4_addr; std::string address = {};
if (!(nrf_cfg.lookupValue(SMF_CONFIG_STRING_NRF_PORT, nrf_port))) { fqdn::resolve(astring, address, upf_port, addr_type, "");
Logger::smf_app().error(SMF_CONFIG_STRING_NRF_PORT "failed"); if (addr_type != 0) { // IPv6
throw(SMF_CONFIG_STRING_NRF_PORT "failed"); // TODO:
throw("DO NOT SUPPORT IPV6 ADDR FOR NRF!");
} else { // IPv4
pfcp::node_id_t n = {};
n.node_id_type = pfcp::NODE_ID_TYPE_IPV4_ADDRESS; // actually
n.fqdn = astring;
if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) ==
1) {
memcpy(&n.u1.ipv4_address, buf_in_addr, sizeof(struct in_addr));
} else {
Logger::smf_app().error(
"CONFIG: BAD IPV4 ADDRESS in " SMF_CONFIG_STRING_UPF_LIST
" item %d",
i);
throw("CONFIG: BAD ADDRESS in " SMF_CONFIG_STRING_UPF_LIST);
}
upfs.push_back(n);
}
}
} }
nrf_addr.port = nrf_port; }
if (!(nrf_cfg.lookupValue( // NRF
SMF_CONFIG_STRING_API_VERSION, nrf_api_version))) { if (discover_upf or register_nrf) {
Logger::smf_app().error(SMF_CONFIG_STRING_API_VERSION "failed"); const Setting& nrf_cfg = smf_cfg[SMF_CONFIG_STRING_NRF];
throw(SMF_CONFIG_STRING_API_VERSION "failed"); struct in_addr nrf_ipv4_addr = {};
} unsigned int nrf_port = {0};
nrf_addr.api_version = nrf_api_version; std::string nrf_api_version = {};
} else {
nrf_cfg.lookupValue(SMF_CONFIG_STRING_FQDN_DNS, astring); if (!use_fqdn_dns) {
uint8_t addr_type = {0}; nrf_cfg.lookupValue(SMF_CONFIG_STRING_NRF_IPV4_ADDRESS, astring);
std::string address = {};
fqdn::resolve(astring, address, nrf_port, addr_type);
if (addr_type != 0) { // IPv6
// TODO:
throw("DO NOT SUPPORT IPV6 ADDR FOR NRF!");
} else { // IPv4
IPV4_STR_ADDR_TO_INADDR( IPV4_STR_ADDR_TO_INADDR(
util::trim(address).c_str(), nrf_ipv4_addr, util::trim(astring).c_str(), nrf_ipv4_addr,
"BAD IPv4 ADDRESS FORMAT FOR NRF !"); "BAD IPv4 ADDRESS FORMAT FOR NRF !");
nrf_addr.ipv4_addr = nrf_ipv4_addr; nrf_addr.ipv4_addr = nrf_ipv4_addr;
nrf_addr.port = nrf_port; if (!(nrf_cfg.lookupValue(SMF_CONFIG_STRING_NRF_PORT, nrf_port))) {
nrf_addr.api_version = "v1"; // TODO: to get API version from DNS Logger::smf_app().error(SMF_CONFIG_STRING_NRF_PORT "failed");
throw(SMF_CONFIG_STRING_NRF_PORT "failed");
}
nrf_addr.port = nrf_port;
if (!(nrf_cfg.lookupValue(
SMF_CONFIG_STRING_API_VERSION, nrf_api_version))) {
Logger::smf_app().error(SMF_CONFIG_STRING_API_VERSION "failed");
throw(SMF_CONFIG_STRING_API_VERSION "failed");
}
nrf_addr.api_version = nrf_api_version;
} else {
nrf_cfg.lookupValue(SMF_CONFIG_STRING_FQDN_DNS, astring);
uint8_t addr_type = {0};
std::string address = {};
fqdn::resolve(astring, address, nrf_port, addr_type);
if (addr_type != 0) { // IPv6
// TODO:
throw("DO NOT SUPPORT IPV6 ADDR FOR NRF!");
} else { // IPv4
IPV4_STR_ADDR_TO_INADDR(
util::trim(address).c_str(), nrf_ipv4_addr,
"BAD IPv4 ADDRESS FORMAT FOR NRF !");
nrf_addr.ipv4_addr = nrf_ipv4_addr;
nrf_addr.port = nrf_port;
nrf_addr.api_version = "v1"; // TODO: to get API version from DNS
nrf_addr.fqdn = astring;
}
} }
} }
// Local configuration // Local configuration
num_session_management_subscription = 0; if (use_local_subscription_info) {
const Setting& local_cfg = smf_cfg[SMF_CONFIG_STRING_LOCAL_CONFIGURATION]; num_session_management_subscription = 0;
const Setting& local_cfg = smf_cfg[SMF_CONFIG_STRING_LOCAL_CONFIGURATION];
const Setting& session_management_subscription_list_cfg =
local_cfg[SMF_CONFIG_STRING_SESSION_MANAGEMENT_SUBSCRIPTION_LIST]; const Setting& session_management_subscription_list_cfg =
count = session_management_subscription_list_cfg.getLength(); local_cfg[SMF_CONFIG_STRING_SESSION_MANAGEMENT_SUBSCRIPTION_LIST];
for (int i = 0; i < count; i++) { count = session_management_subscription_list_cfg.getLength();
const Setting& session_management_subscription_cfg = for (int i = 0; i < count; i++) {
session_management_subscription_list_cfg[i]; const Setting& session_management_subscription_cfg =
session_management_subscription_list_cfg[i];
unsigned int nssai_sst = 0;
string nssai_sd = {}; unsigned int nssai_sst = 0;
string dnn = {}; string nssai_sd = {};
string default_session_type = {}; string dnn = {};
unsigned int default_ssc_mode = 0; string default_session_type = {};
unsigned int qos_profile_5qi = 0; unsigned int default_ssc_mode = 0;
unsigned int qos_profile_priority_level = 0; unsigned int qos_profile_5qi = 0;
unsigned int qos_profile_arp_priority_level = 0; unsigned int qos_profile_priority_level = 0;
string qos_profile_arp_preemptcap = {}; unsigned int qos_profile_arp_priority_level = 0;
string qos_profile_arp_preemptvuln = {}; string qos_profile_arp_preemptcap = {};
string session_ambr_ul = {}; string qos_profile_arp_preemptvuln = {};
string session_ambr_dl = {}; string session_ambr_ul = {};
session_management_subscription_cfg.lookupValue( string session_ambr_dl = {};
SMF_CONFIG_STRING_NSSAI_SST, nssai_sst); session_management_subscription_cfg.lookupValue(
session_management_subscription_cfg.lookupValue( SMF_CONFIG_STRING_NSSAI_SST, nssai_sst);
SMF_CONFIG_STRING_NSSAI_SD, nssai_sd); session_management_subscription_cfg.lookupValue(
session_management_subscription_cfg.lookupValue( SMF_CONFIG_STRING_NSSAI_SD, nssai_sd);
SMF_CONFIG_STRING_DNN, dnn); session_management_subscription_cfg.lookupValue(
session_management_subscription_cfg.lookupValue( SMF_CONFIG_STRING_DNN, dnn);
SMF_CONFIG_STRING_DEFAULT_SESSION_TYPE, default_session_type); session_management_subscription_cfg.lookupValue(
session_management_subscription_cfg.lookupValue( SMF_CONFIG_STRING_DEFAULT_SESSION_TYPE, default_session_type);
SMF_CONFIG_STRING_DEFAULT_SSC_MODE, default_ssc_mode); session_management_subscription_cfg.lookupValue(
session_management_subscription_cfg.lookupValue( SMF_CONFIG_STRING_DEFAULT_SSC_MODE, default_ssc_mode);
SMF_CONFIG_STRING_QOS_PROFILE_5QI, qos_profile_5qi); session_management_subscription_cfg.lookupValue(
session_management_subscription_cfg.lookupValue( SMF_CONFIG_STRING_QOS_PROFILE_5QI, qos_profile_5qi);
SMF_CONFIG_STRING_QOS_PROFILE_PRIORITY_LEVEL, session_management_subscription_cfg.lookupValue(
qos_profile_priority_level); SMF_CONFIG_STRING_QOS_PROFILE_PRIORITY_LEVEL,
session_management_subscription_cfg.lookupValue( qos_profile_priority_level);
SMF_CONFIG_STRING_QOS_PROFILE_ARP_PRIORITY_LEVEL, session_management_subscription_cfg.lookupValue(
qos_profile_arp_priority_level); SMF_CONFIG_STRING_QOS_PROFILE_ARP_PRIORITY_LEVEL,
session_management_subscription_cfg.lookupValue( qos_profile_arp_priority_level);
SMF_CONFIG_STRING_QOS_PROFILE_ARP_PREEMPTCAP, session_management_subscription_cfg.lookupValue(
qos_profile_arp_preemptcap); SMF_CONFIG_STRING_QOS_PROFILE_ARP_PREEMPTCAP,
session_management_subscription_cfg.lookupValue( qos_profile_arp_preemptcap);
SMF_CONFIG_STRING_QOS_PROFILE_ARP_PREEMPTVULN, session_management_subscription_cfg.lookupValue(
qos_profile_arp_preemptvuln); SMF_CONFIG_STRING_QOS_PROFILE_ARP_PREEMPTVULN,
session_management_subscription_cfg.lookupValue( qos_profile_arp_preemptvuln);
SMF_CONFIG_STRING_SESSION_AMBR_UL, session_ambr_ul); session_management_subscription_cfg.lookupValue(
session_management_subscription_cfg.lookupValue( SMF_CONFIG_STRING_SESSION_AMBR_UL, session_ambr_ul);
SMF_CONFIG_STRING_SESSION_AMBR_DL, session_ambr_dl); session_management_subscription_cfg.lookupValue(
SMF_CONFIG_STRING_SESSION_AMBR_DL, session_ambr_dl);
session_management_subscription[i].single_nssai.sST = nssai_sst;
session_management_subscription[i].single_nssai.sD = nssai_sd; session_management_subscription[i].single_nssai.sST = nssai_sst;
session_management_subscription[i].session_type = default_session_type; session_management_subscription[i].single_nssai.sD = nssai_sd;
session_management_subscription[i].dnn = dnn; session_management_subscription[i].session_type = default_session_type;
session_management_subscription[i].ssc_mode = default_ssc_mode; session_management_subscription[i].dnn = dnn;
session_management_subscription[i].default_qos._5qi = qos_profile_5qi; session_management_subscription[i].ssc_mode = default_ssc_mode;
session_management_subscription[i].default_qos.priority_level = session_management_subscription[i].default_qos._5qi = qos_profile_5qi;
qos_profile_priority_level; session_management_subscription[i].default_qos.priority_level =
session_management_subscription[i].default_qos.arp.priority_level = qos_profile_priority_level;
qos_profile_arp_priority_level; session_management_subscription[i].default_qos.arp.priority_level =
session_management_subscription[i].default_qos.arp.preempt_cap = qos_profile_arp_priority_level;
qos_profile_arp_preemptcap; session_management_subscription[i].default_qos.arp.preempt_cap =
session_management_subscription[i].default_qos.arp.preempt_vuln = qos_profile_arp_preemptcap;
qos_profile_arp_preemptvuln; session_management_subscription[i].default_qos.arp.preempt_vuln =
session_management_subscription[i].session_ambr.downlink = qos_profile_arp_preemptvuln;
session_ambr_dl; session_management_subscription[i].session_ambr.downlink =
session_management_subscription[i].session_ambr.uplink = session_ambr_ul; session_ambr_dl;
num_session_management_subscription++; session_management_subscription[i].session_ambr.uplink =
session_ambr_ul;
num_session_management_subscription++;
}
} }
} catch (const SettingNotFoundException& nfex) { } catch (const SettingNotFoundException& nfex) {
Logger::smf_app().error("%s : %s", nfex.what(), nfex.getPath()); Logger::smf_app().error("%s : %s", nfex.what(), nfex.getPath());
return RETURNerror; return RETURNerror;
...@@ -980,6 +992,19 @@ void smf_config::display() { ...@@ -980,6 +992,19 @@ void smf_config::display() {
} }
} }
Logger::smf_app().info("- Supported Features:");
Logger::smf_app().info(
" Register to NRF............: %s", register_nrf ? "Yes" : "No");
Logger::smf_app().info(
" Discover UPF...............: %s", discover_upf ? "Yes" : "No");
Logger::smf_app().info(
" Use Local Subscription Info: %s",
use_local_subscription_info ? "Yes" : "No");
Logger::smf_app().info(
" Push PCO (DNS+MTU).........: %s", force_push_pco ? "Yes" : "No");
Logger::smf_app().info(
" Use FQDN ..................: %s", use_fqdn_dns ? "Yes" : "No");
Logger::smf_app().info("- AMF:"); Logger::smf_app().info("- AMF:");
Logger::smf_app().info( Logger::smf_app().info(
" IPv4 Addr ...........: %s", " IPv4 Addr ...........: %s",
...@@ -987,6 +1012,9 @@ void smf_config::display() { ...@@ -987,6 +1012,9 @@ void smf_config::display() {
Logger::smf_app().info(" Port ................: %lu ", amf_addr.port); Logger::smf_app().info(" Port ................: %lu ", amf_addr.port);
Logger::smf_app().info( Logger::smf_app().info(
" API version .........: %s", amf_addr.api_version.c_str()); " API version .........: %s", amf_addr.api_version.c_str());
if (use_fqdn_dns)
Logger::smf_app().info(
" FQDN ................: %s", amf_addr.fqdn.c_str());
if (!use_local_subscription_info) { if (!use_local_subscription_info) {
Logger::smf_app().info("- UDM:"); Logger::smf_app().info("- UDM:");
...@@ -996,9 +1024,12 @@ void smf_config::display() { ...@@ -996,9 +1024,12 @@ void smf_config::display() {
Logger::smf_app().info(" Port ................: %lu ", udm_addr.port); Logger::smf_app().info(" Port ................: %lu ", udm_addr.port);
Logger::smf_app().info( Logger::smf_app().info(
" API version .........: %s", udm_addr.api_version.c_str()); " API version .........: %s", udm_addr.api_version.c_str());
if (use_fqdn_dns)
Logger::smf_app().info(
" FQDN ................: %s", udm_addr.fqdn.c_str());
} }
if (register_nrf) { if (register_nrf or discover_upf) {
Logger::smf_app().info("- NRF:"); Logger::smf_app().info("- NRF:");
Logger::smf_app().info( Logger::smf_app().info(
" IPv4 Addr ...........: %s", " IPv4 Addr ...........: %s",
...@@ -1006,18 +1037,22 @@ void smf_config::display() { ...@@ -1006,18 +1037,22 @@ void smf_config::display() {
Logger::smf_app().info(" Port ................: %lu ", nrf_addr.port); Logger::smf_app().info(" Port ................: %lu ", nrf_addr.port);
Logger::smf_app().info( Logger::smf_app().info(
" API version .........: %s", nrf_addr.api_version.c_str()); " API version .........: %s", nrf_addr.api_version.c_str());
if (use_fqdn_dns)
Logger::smf_app().info(
" FQDN ................: %s", nrf_addr.fqdn.c_str());
} }
Logger::smf_app().info("- Supported Features:"); if (!discover_upf) {
Logger::smf_app().info( Logger::smf_app().info("- UPF:");
" Register to NRF............: %s", register_nrf ? "Yes" : "No"); for (auto u : upfs) {
Logger::smf_app().info( if (u.node_id_type == pfcp::NODE_ID_TYPE_IPV4_ADDRESS)
" Discover UPF...............: %s", discover_upf ? "Yes" : "No"); Logger::smf_app().info(
Logger::smf_app().info( " IPv4 Addr ...........: %s",
" Use Local Subscription Info: %s", inet_ntoa(*((struct in_addr*) &u.u1.ipv4_address)));
use_local_subscription_info ? "Yes" : "No"); if (use_fqdn_dns)
Logger::smf_app().info( Logger::smf_app().info(" FQDN ................: %s", u.fqdn.c_str());
" Push PCO (DNS+MTU).........: %s", force_push_pco ? "Yes" : "No"); }
}
if (use_local_subscription_info) { if (use_local_subscription_info) {
Logger::smf_app().info( Logger::smf_app().info(
......
...@@ -226,12 +226,14 @@ class smf_config { ...@@ -226,12 +226,14 @@ class smf_config {
struct in_addr ipv4_addr; struct in_addr ipv4_addr;
unsigned int port; unsigned int port;
std::string api_version; std::string api_version;
std::string fqdn;
} amf_addr; } amf_addr;
struct { struct {
struct in_addr ipv4_addr; struct in_addr ipv4_addr;
unsigned int port; unsigned int port;
std::string api_version; std::string api_version;
std::string fqdn;
} udm_addr; } udm_addr;
std::vector<pfcp::node_id_t> upfs; std::vector<pfcp::node_id_t> upfs;
...@@ -240,6 +242,7 @@ class smf_config { ...@@ -240,6 +242,7 @@ class smf_config {
struct in_addr ipv4_addr; struct in_addr ipv4_addr;
unsigned int port; unsigned int port;
std::string api_version; std::string api_version;
std::string fqdn;
} nrf_addr; } nrf_addr;
#define SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX 10 #define SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX 10
...@@ -299,13 +302,17 @@ class smf_config { ...@@ -299,13 +302,17 @@ class smf_config {
amf_addr.ipv4_addr.s_addr = INADDR_ANY; amf_addr.ipv4_addr.s_addr = INADDR_ANY;
amf_addr.port = 80; amf_addr.port = 80;
amf_addr.api_version = "v1"; amf_addr.api_version = "v1";
amf_addr.fqdn = {};
udm_addr.ipv4_addr.s_addr = INADDR_ANY; udm_addr.ipv4_addr.s_addr = INADDR_ANY;
udm_addr.port = 80; udm_addr.port = 80;
udm_addr.api_version = "v1"; udm_addr.api_version = "v1";
udm_addr.fqdn = {};
nrf_addr.ipv4_addr.s_addr = INADDR_ANY; nrf_addr.ipv4_addr.s_addr = INADDR_ANY;
nrf_addr.port = 80; nrf_addr.port = 80;
nrf_addr.api_version = "v1"; nrf_addr.api_version = "v1";
nrf_addr.fqdn = {};
num_session_management_subscription = 0; num_session_management_subscription = 0;
......
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