Commit 9abbc6e9 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Cleanup ausf_config

parent 4c8c76ec
......@@ -105,40 +105,6 @@ int ausf_config::load(const std::string& config_file) {
Logger::config().error(
"%s : %s, using defaults", nfex.what(), nfex.getPath());
}
// try {
// ausf_cfg.lookupValue(AUSF_CONFIG_STRING_STATISTICS_TIMER_INTERVAL,
// statistics_interval);
// } catch (const SettingNotFoundException &nfex) {
// Logger::config().error("%s : %s, using defaults", nfex.what(),
// nfex.getPath());
// }
// try {
// const Setting &plmn_list_cfg =
// ausf_cfg[AMF_CONFIG_STRING_PLMN_SUPPORT_LIST]; int count =
// plmn_list_cfg.getLength(); for (int i = 0; i < count; i++) {
// plmn_item_t plmn_item;
// const Setting &item = plmn_list_cfg[i];
// item.lookupValue(AMF_CONFIG_STRING_MCC, plmn_item.mcc);
// item.lookupValue(AMF_CONFIG_STRING_MNC, plmn_item.mnc);
// item.lookupValue(AMF_CONFIG_STRING_TAC, plmn_item.tac);
// const Setting &slice_list_cfg =
// plmn_list_cfg[i][AMF_CONFIG_STRING_SLICE_SUPPORT_LIST]; int numOfSlice
// = slice_list_cfg.getLength(); for (int j = 0; j < numOfSlice; j++) {
// slice_t slice;
// const Setting &slice_item = slice_list_cfg[j];
// slice_item.lookupValue(AMF_CONFIG_STRING_SST, slice.sST);
// slice_item.lookupValue(AMF_CONFIG_STRING_SD, slice.sD);
// plmn_item.slice_list.push_back(slice);
// }
// plmn_list.push_back(plmn_item);
// }
// } catch (const SettingNotFoundException &nfex) {
// Logger::config().error("%s : %s, using defaults", nfex.what(),
// nfex.getPath());
// }
try {
const Setting& new_if_cfg = ausf_cfg[AUSF_CONFIG_STRING_INTERFACES];
......@@ -152,59 +118,11 @@ int ausf_config::load(const std::string& config_file) {
const Setting& namf_cfg = new_if_cfg[AUSF_CONFIG_STRING_INTERFACE_NAMF];
load_interface(namf_cfg, namf);
// const Setting &udr_addr_pool =
// nudm_cfg[AUSF_CONFIG_STRING_UDR_INSTANCES_POOL]; int count =
// udr_addr_pool.getLength(); for (int i = 0; i < count; i++) {
// const Setting &udr_addr_item = udr_addr_pool[i];
// udr_inst_t udr_inst;
// std::string selected;
// udr_addr_item.lookupValue(AUSF_CONFIG_STRING_UDR_INSTANCE_ID,
// udr_inst.id);
// udr_addr_item.lookupValue(AUSF_CONFIG_STRING_IPV4_ADDRESS,
// udr_inst.ipv4);
// udr_addr_item.lookupValue(AUSF_CONFIG_STRING_UDR_INSTANCE_PORT,
// udr_inst.port);
// udr_addr_item.lookupValue(AUSF_CONFIG_STRING_UDR_INSTANCE_VERSION,
// udr_inst.version);
// udr_addr_item.lookupValue(AUSF_CONFIG_STRING_UDR_INSTANCE_SELECTED,
// selected); if (!selected.compare("true"))
// udr_inst.selected = true;
// else
// udr_inst.selected = false;
// udr_pool.push_back(udr_inst);
// }
} catch (const SettingNotFoundException& nfex) {
Logger::config().error(
"%s : %s, using defaults", nfex.what(), nfex.getPath());
return -1;
}
// try {
// const Setting &core_config =
// ausf_cfg[AUSF_CONFIG_STRING_CORE_CONFIGURATION];
// core_config.lookupValue(AUSF_CONFIG_STRING_EMERGENCY_SUPPORT,
// is_emergency_support);
// } catch (const SettingNotFoundException &nfex) {
// Logger::config().error("%s : %s, using defaults", nfex.what(),
// nfex.getPath()); return -1;
// }
// try {
// const Setting &auth = ausf_cfg[AUSF_CONFIG_STRING_AUTHENTICATION];
// auth.lookupValue(AUSF_CONFIG_STRING_AUTH_MYSQL_SERVER,
// auth_para.mysql_server);
// auth.lookupValue(AUSF_CONFIG_STRING_AUTH_MYSQL_USER,
// auth_para.mysql_user);
// auth.lookupValue(AUSF_CONFIG_STRING_AUTH_MYSQL_PASS,
// auth_para.mysql_pass); auth.lookupValue(AUSF_CONFIG_STRING_AUTH_MYSQL_DB,
// auth_para.mysql_db);
// auth.lookupValue(AUSF_CONFIG_STRING_AUTH_OPERATOR_KEY,
// auth_para.operator_key); auth.lookupValue(AUSF_CONFIG_STRING_AUTH_RANDOM,
// auth_para.random);
// } catch (const SettingNotFoundException &nfex) {
// Logger::config().error("%s : %s, using defaults", nfex.what(),
// nfex.getPath()); return -1;
// }
}
//------------------------------------------------------------------------------
......@@ -221,39 +139,6 @@ void ausf_config::display() {
"- AUSF NAME............................................: %s",
AUSF_Name.c_str());
// Logger::config().info("- GUAMI (MCC, MNC, Region ID, AMF Set ID, AMF
// pointer): "); Logger::config().info("-
// SERVED_GUAMI_LIST...................................: ");
// Logger::config().info("-
// PLMN_SUPPORT_LIST...................................: "); for (int i = 0; i
// < plmn_list.size(); i++) {
// Logger::config().info(" (MCC %s, MNC %s) ", plmn_list[i].mcc.c_str(),
// plmn_list[i].mnc.c_str()); Logger::config().info(" TAC: %d",
// plmn_list[i].tac); Logger::config().info(" SLICE_SUPPORT_LIST (SST, SD)
// ....................: "); for (int j = 0; j <
// plmn_list[i].slice_list.size(); j++) {
// Logger::config().info(" (%s, %s) ",
// plmn_list[i].slice_list[j].sST.c_str(),
// plmn_list[i].slice_list[j].sD.c_str());
// }
// }
// Logger::config().info("- Emergency Support...................
// ...............: %s", is_emergency_support.c_str());
// Logger::config().info("- MYSQL Server
// Addr...................................: %s",
// auth_para.mysql_server.c_str()); Logger::config().info("- MYSQL user
// .........................................: %s",
// auth_para.mysql_user.c_str()); Logger::config().info("- MYSQL pass
// .........................................: %s",
// auth_para.mysql_pass.c_str()); Logger::config().info("- MYSQL db
// ...........................................: %s",
// auth_para.mysql_db.c_str()); Logger::config().info("- operator key
// .......................................: %s",
// auth_para.operator_key.c_str()); Logger::config().info("- random
// .............................................: %s",
// auth_para.random.c_str());
Logger::config().info("- SBI Networking:");
Logger::config().info(" iface ................: %s", sbi.if_name.c_str());
Logger::config().info(" ip ...................: %s", inet_ntoa(sbi.addr4));
......@@ -270,21 +155,6 @@ void ausf_config::display() {
Logger::config().info(
" ip ...................: %s", inet_ntoa(namf.addr4));
Logger::config().info(" port .................: %d", namf.port);
// Logger::config().info(" HTTP2 port ............: %d", nudm_http2_port);
// Logger::config().info("- Remote udr
// Pool.....................................: "); for (int i = 0; i <
// udr_pool.size(); i++) {
// std::string selected;
// if (udr_pool[i].selected)
// selected = "true";
// else
// selected = "false";
// Logger::config().info(" udr_INSTANCE_ID %d (%s:%s, version %s) is
// selected: %s", udr_pool[i].id, udr_pool[i].ipv4.c_str(),
// udr_pool[i].port.c_str(), udr_pool[i].version.c_str(), selected.c_str());
// }
}
//------------------------------------------------------------------------------
......
......@@ -38,7 +38,6 @@
#include <mutex>
#include <vector>
#include <string>
//#include "thread_sched.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
......@@ -58,42 +57,6 @@
#define AUSF_CONFIG_STRING_PORT "PORT"
#define AUSF_CONFIG_STRING_PPID "PPID"
// #define AUSF_CONFIG_STRING_UDM_INSTANCES_POOL "UDM_INSTANCES_POOL"
// #define AUSF_CONFIG_STRING_UDM_INSTANCE_ID "UDM_INSTANCE_ID"
// #define AUSF_CONFIG_STRING_UDM_INSTANCE_PORT "PORT"
// #define AUSF_CONFIG_STRING_UDM_INSTANCE_VERSION "VERSION"
// #define AUSF_CONFIG_STRING_UDM_INSTANCE_SELECTED "SELECTED"
// #define AUSF_CONFIG_STRING_STATISTICS_TIMER_INTERVAL
// "STATISTICS_TIMER_INTERVAL"
// #define AUSF_CONFIG_STRING_GUAMI "GUAMI"
// #define AUSF_CONFIG_STRING_SERVED_GUAMI_LIST "SERVED_GUAMI_LIST"
// #define AUSF_CONFIG_STRING_RegionID "RegionID"
// #define AUSF_CONFIG_STRING_AMFSetID "AMFSetID"
// #define AUSF_CONFIG_STRING_AMFPointer "AMFPointer"
// #define AUSF_CONFIG_STRING_RELATIVE_AMF_CAPACITY "RELATIVE_CAPACITY"
// #define AUSF_CONFIG_STRING_TAC "TAC"
// #define AUSF_CONFIG_STRING_MCC "MCC"
// #define AUSF_CONFIG_STRING_MNC "MNC"
// #define AUSF_CONFIG_STRING_PLMN_SUPPORT_LIST "PLMN_SUPPORT_LIST"
// #define AUSF_CONFIG_STRING_SLICE_SUPPORT_LIST "SLICE_SUPPORT_LIST"
// #define AUSF_CONFIG_STRING_SST "SST"
// #define AUSF_CONFIG_STRING_SD "SD"
// #define AUSF_CONFIG_STRING_CORE_CONFIGURATION "CORE_CONFIGURATION"
// #define AUSF_CONFIG_STRING_EMERGENCY_SUPPORT "EMERGENCY_SUPPORT"
// #define AUSF_CONFIG_STRING_AUTHENTICATION "AUTHENTICATION"
// #define AUSF_CONFIG_STRING_AUTH_MYSQL_SERVER "MYSQL_server"
// #define AUSF_CONFIG_STRING_AUTH_MYSQL_USER "MYSQL_user"
// #define AUSF_CONFIG_STRING_AUTH_MYSQL_PASS "MYSQL_pass"
// #define AUSF_CONFIG_STRING_AUTH_MYSQL_DB "MYSQL_db"
// #define AUSF_CONFIG_STRING_AUTH_OPERATOR_KEY "OPERATOR_key"
// #define AUSF_CONFIG_STRING_AUTH_RANDOM "RANDOM"
using namespace libconfig;
namespace config {
......@@ -107,35 +70,6 @@ typedef struct interface_cfg_s {
unsigned int port;
} interface_cfg_t;
// typedef struct slice_s {
// std::string sST;
// std::string sD;
// } slice_t;
// typedef struct plmn_support_item_s {
// std::string mcc;
// std::string mnc;
// uint32_t tac;
// std::vector<slice_t> slice_list;
// } plmn_item_t;
// typedef struct {
// int id;
// std::string ipv4;
// std::string port;
// std::string version;
// bool selected;
// } udr_inst_t;
// typedef struct {
// std::string mysql_server;
// std::string mysql_user;
// std::string mysql_pass;
// std::string mysql_db;
// std::string operator_key;
// std::string random;
// } auth_conf;
class ausf_config {
public:
ausf_config();
......@@ -151,12 +85,6 @@ class ausf_config {
interface_cfg_t sbi;
interface_cfg_t nudm;
interface_cfg_t namf;
// unsigned int statistics_interval;
// std::vector<plmn_item_t> plmn_list;
// std::string is_emergency_support;
// auth_conf auth_para;
// std::vector<udr_inst_t> udr_pool;
};
} // namespace config
......
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