Commit 387abb6b authored by Niuhaiwen's avatar Niuhaiwen

add nrf cfg

parent 87db9a23
{
"files.associations": {
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"valarray": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
}
}
\ No newline at end of file
...@@ -99,7 +99,11 @@ int ausf_config::load(const std::string &config_file) { ...@@ -99,7 +99,11 @@ int ausf_config::load(const std::string &config_file) {
} catch (const SettingNotFoundException &nfex) { } catch (const SettingNotFoundException &nfex) {
Logger::config().error("%s : %s, using defaults", nfex.what(), nfex.getPath()); Logger::config().error("%s : %s, using defaults", nfex.what(), nfex.getPath());
} }
try {
ausf_cfg.lookupValue(AUSF_CONFIG_STRING_NF_REGISTRATION, nf_registion);
} catch (const SettingNotFoundException &nfex) {
Logger::config().error("%s : %s, using defaults", nfex.what(), nfex.getPath());
}
// try { // try {
// ausf_cfg.lookupValue(AUSF_CONFIG_STRING_STATISTICS_TIMER_INTERVAL, statistics_interval); // ausf_cfg.lookupValue(AUSF_CONFIG_STRING_STATISTICS_TIMER_INTERVAL, statistics_interval);
// } catch (const SettingNotFoundException &nfex) { // } catch (const SettingNotFoundException &nfex) {
...@@ -130,7 +134,6 @@ int ausf_config::load(const std::string &config_file) { ...@@ -130,7 +134,6 @@ int ausf_config::load(const std::string &config_file) {
// Logger::config().error("%s : %s, using defaults", nfex.what(), nfex.getPath()); // Logger::config().error("%s : %s, using defaults", nfex.what(), nfex.getPath());
// } // }
try { try {
const Setting &new_if_cfg = ausf_cfg[AUSF_CONFIG_STRING_INTERFACES]; const Setting &new_if_cfg = ausf_cfg[AUSF_CONFIG_STRING_INTERFACES];
...@@ -143,6 +146,9 @@ int ausf_config::load(const std::string &config_file) { ...@@ -143,6 +146,9 @@ int ausf_config::load(const std::string &config_file) {
const Setting &namf_cfg = new_if_cfg[AUSF_CONFIG_STRING_INTERFACE_NAMF]; const Setting &namf_cfg = new_if_cfg[AUSF_CONFIG_STRING_INTERFACE_NAMF];
load_interface(namf_cfg, namf); load_interface(namf_cfg, namf);
const Setting &nnrf_cfg = new_if_cfg[AUSF_CONFIG_STRING_INTERFACE_NNRF];
load_interface(nnrf_cfg, nnrf);
// const Setting &udr_addr_pool = nudm_cfg[AUSF_CONFIG_STRING_UDR_INSTANCES_POOL]; // const Setting &udr_addr_pool = nudm_cfg[AUSF_CONFIG_STRING_UDR_INSTANCES_POOL];
// int count = udr_addr_pool.getLength(); // int count = udr_addr_pool.getLength();
// for (int i = 0; i < count; i++) { // for (int i = 0; i < count; i++) {
...@@ -195,6 +201,7 @@ void ausf_config::display() { ...@@ -195,6 +201,7 @@ void ausf_config::display() {
Logger::config().info("- Instance ...........................................: %d", instance); Logger::config().info("- Instance ...........................................: %d", instance);
Logger::config().info("- PID dir ............................................: %s", pid_dir.c_str()); Logger::config().info("- PID dir ............................................: %s", pid_dir.c_str());
Logger::config().info("- AUSF NAME............................................: %s", AUSF_Name.c_str()); Logger::config().info("- AUSF NAME............................................: %s", AUSF_Name.c_str());
Logger::config().info("- NF_REGISTRATION......................................: %s", nf_registion.c_str());
// Logger::config().info("- GUAMI (MCC, MNC, Region ID, AMF Set ID, AMF pointer): "); // Logger::config().info("- GUAMI (MCC, MNC, Region ID, AMF Set ID, AMF pointer): ");
// Logger::config().info("- SERVED_GUAMI_LIST...................................: "); // Logger::config().info("- SERVED_GUAMI_LIST...................................: ");
...@@ -231,6 +238,11 @@ void ausf_config::display() { ...@@ -231,6 +238,11 @@ void ausf_config::display() {
Logger::config().info(" ip ...................: %s", inet_ntoa(namf.addr4)); Logger::config().info(" ip ...................: %s", inet_ntoa(namf.addr4));
Logger::config().info(" port .................: %d", namf.port); Logger::config().info(" port .................: %d", namf.port);
Logger::config().info("- Nnrf Networking:");
Logger::config().info(" iface ................: %s", nnrf.if_name.c_str());
Logger::config().info(" ip ...................: %s", inet_ntoa(nnrf.addr4));
Logger::config().info(" port .................: %d", nnrf.port);
// Logger::config().info(" HTTP2 port ............: %d", nudm_http2_port); // Logger::config().info(" HTTP2 port ............: %d", nudm_http2_port);
// Logger::config().info("- Remote udr Pool.....................................: "); // Logger::config().info("- Remote udr Pool.....................................: ");
...@@ -245,7 +257,7 @@ void ausf_config::display() { ...@@ -245,7 +257,7 @@ void ausf_config::display() {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int ausf_config::load_interface(const libconfig::Setting &if_cfg, interface_cfg_t &cfg) { int ausf_config:::load_interface(const libconfig::Setting &if_cfg, interface_cfg_t &cfg) {
if_cfg.lookupValue(AUSF_CONFIG_STRING_INTERFACE_NAME, cfg.if_name); if_cfg.lookupValue(AUSF_CONFIG_STRING_INTERFACE_NAME, cfg.if_name);
util::trim(cfg.if_name); util::trim(cfg.if_name);
if (not boost::iequals(cfg.if_name, "none")) { if (not boost::iequals(cfg.if_name, "none")) {
......
...@@ -54,10 +54,12 @@ ...@@ -54,10 +54,12 @@
#define AUSF_CONFIG_STRING_INTERFACE_SBI_AUSF "SBI_AUSF" #define AUSF_CONFIG_STRING_INTERFACE_SBI_AUSF "SBI_AUSF"
#define AUSF_CONFIG_STRING_INTERFACE_NUDM "NUDM" #define AUSF_CONFIG_STRING_INTERFACE_NUDM "NUDM"
#define AUSF_CONFIG_STRING_INTERFACE_NAMF "NAMF" #define AUSF_CONFIG_STRING_INTERFACE_NAMF "NAMF"
#define AUSF_CONFIG_STRING_INTERFACE_NNRF "NNRF"
#define AUSF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME" #define AUSF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define AUSF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS" #define AUSF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
#define AUSF_CONFIG_STRING_PORT "PORT" #define AUSF_CONFIG_STRING_PORT "PORT"
#define AUSF_CONFIG_STRING_PPID "PPID" #define AUSF_CONFIG_STRING_PPID "PPID"
#define AUSF_CONFIG_STRING_NF_REGISTRATION "NF_REGISTRATION"
// #define AUSF_CONFIG_STRING_UDM_INSTANCES_POOL "UDM_INSTANCES_POOL" // #define AUSF_CONFIG_STRING_UDM_INSTANCES_POOL "UDM_INSTANCES_POOL"
...@@ -109,6 +111,7 @@ typedef struct interface_cfg_s { ...@@ -109,6 +111,7 @@ typedef struct interface_cfg_s {
unsigned int port; unsigned int port;
} interface_cfg_t; } interface_cfg_t;
// typedef struct slice_s { // typedef struct slice_s {
// std::string sST; // std::string sST;
// std::string sD; // std::string sD;
...@@ -138,6 +141,7 @@ typedef struct interface_cfg_s { ...@@ -138,6 +141,7 @@ typedef struct interface_cfg_s {
// std::string random; // std::string random;
// } auth_conf; // } auth_conf;
class ausf_config { class ausf_config {
public: public:
ausf_config(); ausf_config();
...@@ -149,10 +153,13 @@ class ausf_config { ...@@ -149,10 +153,13 @@ class ausf_config {
unsigned int instance; unsigned int instance;
std::string pid_dir; std::string pid_dir;
std::string AUSF_Name; std::string AUSF_Name;
std::string nf_registion;
interface_cfg_t sbi; interface_cfg_t sbi;
interface_cfg_t nudm; interface_cfg_t nudm;
interface_cfg_t namf; interface_cfg_t namf;
interface_cfg_t nnrf;
//unsigned int statistics_interval; //unsigned int statistics_interval;
//std::vector<plmn_item_t> plmn_list; //std::vector<plmn_item_t> plmn_list;
......
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