Commit 8bff2009 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Code cleanup

parent 1ef4ef71
...@@ -667,8 +667,7 @@ int smf_config::load(const string& config_file) { ...@@ -667,8 +667,7 @@ int smf_config::load(const string& config_file) {
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 NRF!");
} else { // IPv4 } else { // IPv4
// pfcp::node_id_t n = {};
n.node_id_type = pfcp::NODE_ID_TYPE_IPV4_ADDRESS; // actually n.node_id_type = pfcp::NODE_ID_TYPE_IPV4_ADDRESS; // actually
n.fqdn = astring; n.fqdn = astring;
if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) == if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) ==
...@@ -745,7 +744,6 @@ int smf_config::load(const string& config_file) { ...@@ -745,7 +744,6 @@ int smf_config::load(const string& config_file) {
"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; // nrf_addr.port = nrf_port;
// We hardcode nrf port from config for the moment // We hardcode nrf port from config for the moment
if (!(nrf_cfg.lookupValue(SMF_CONFIG_STRING_NRF_PORT, nrf_port))) { if (!(nrf_cfg.lookupValue(SMF_CONFIG_STRING_NRF_PORT, nrf_port))) {
Logger::smf_app().error(SMF_CONFIG_STRING_NRF_PORT "failed"); Logger::smf_app().error(SMF_CONFIG_STRING_NRF_PORT "failed");
...@@ -760,7 +758,6 @@ int smf_config::load(const string& config_file) { ...@@ -760,7 +758,6 @@ int smf_config::load(const string& config_file) {
// Local configuration // Local configuration
if (use_local_subscription_info) { if (use_local_subscription_info) {
// num_session_management_subscription = 0;
const Setting& local_cfg = smf_cfg[SMF_CONFIG_STRING_LOCAL_CONFIGURATION]; const Setting& local_cfg = smf_cfg[SMF_CONFIG_STRING_LOCAL_CONFIGURATION];
const Setting& session_management_subscription_list_cfg = const Setting& session_management_subscription_list_cfg =
...@@ -783,6 +780,7 @@ int smf_config::load(const string& config_file) { ...@@ -783,6 +780,7 @@ int smf_config::load(const string& config_file) {
string qos_profile_arp_preemptvuln = {}; string qos_profile_arp_preemptvuln = {};
string session_ambr_ul = {}; string session_ambr_ul = {};
string session_ambr_dl = {}; string session_ambr_dl = {};
session_management_subscription_cfg.lookupValue( session_management_subscription_cfg.lookupValue(
SMF_CONFIG_STRING_NSSAI_SST, nssai_sst); SMF_CONFIG_STRING_NSSAI_SST, nssai_sst);
session_management_subscription_cfg.lookupValue( session_management_subscription_cfg.lookupValue(
...@@ -825,7 +823,6 @@ int smf_config::load(const string& config_file) { ...@@ -825,7 +823,6 @@ int smf_config::load(const string& config_file) {
sub_item.default_qos.arp.preempt_vuln = qos_profile_arp_preemptvuln; sub_item.default_qos.arp.preempt_vuln = qos_profile_arp_preemptvuln;
sub_item.session_ambr.downlink = session_ambr_dl; sub_item.session_ambr.downlink = session_ambr_dl;
sub_item.session_ambr.uplink = session_ambr_ul; sub_item.session_ambr.uplink = session_ambr_ul;
// num_session_management_subscription++;
session_management_subscriptions.push_back(sub_item); session_management_subscriptions.push_back(sub_item);
} }
} }
...@@ -833,7 +830,6 @@ int smf_config::load(const string& config_file) { ...@@ -833,7 +830,6 @@ int smf_config::load(const string& config_file) {
Logger::smf_app().error("%s : %s", nfex.what(), nfex.getPath()); Logger::smf_app().error("%s : %s", nfex.what(), nfex.getPath());
return RETURNerror; return RETURNerror;
} }
// return finalize();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -194,20 +194,6 @@ typedef struct session_management_subscription_s { ...@@ -194,20 +194,6 @@ typedef struct session_management_subscription_s {
session_ambr_t session_ambr; session_ambr_t session_ambr;
} session_management_subscription_t; } session_management_subscription_t;
/*
#define SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX 10
struct {
snssai_t single_nssai;
std::string session_type;
std::string dnn;
uint8_t ssc_mode;
subscribed_default_qos_t default_qos;
session_ambr_t session_ambr;
} session_management_subscription
[SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX];
uint8_t num_session_management_subscription;
*/
class smf_config { class smf_config {
private: private:
int load_itti(const libconfig::Setting& itti_cfg, itti_cfg_t& cfg); int load_itti(const libconfig::Setting& itti_cfg, itti_cfg_t& cfg);
...@@ -321,12 +307,6 @@ class smf_config { ...@@ -321,12 +307,6 @@ class smf_config {
nrf_addr.api_version = "v1"; nrf_addr.api_version = "v1";
nrf_addr.fqdn = {}; nrf_addr.fqdn = {};
/* num_session_management_subscription = 0;
for (int i = 0; i < SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX; i++) {
session_management_subscription[i] = {};
}
*/
sbi_http2_port = 8080; sbi_http2_port = 8080;
sbi_api_version = "v1"; sbi_api_version = "v1";
http_version = 1; http_version = 1;
......
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