Commit 27b2451a authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Minor update for Ausf config

parent d9138e8f
## AUSF configuration file
AUSF =
{
INSTANCE_ID = 10; #10
PID_DIRECTORY = "/var/run";
AUSF_NAME = "OAI-AUSF";
##AUSF configuration file AUSF = {INSTANCE_ID = 10;
# 10 PID_DIRECTORY = "/var/run";
AUSF_NAME = "OAI-AUSF";
#STATISTICS_TIMER_INTERVAL = 20; #second
INTERFACES:{
# AUSF binded interface for SBI interface (e.g., communication with AMF, UDM)
SBI_AUSF:{
INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
PPID = 60;
};
};
# UDM Information
UDM:{
IPV4_ADDRESS = "192.168.66.8"; # YOUR NETWORK CONFIG HERE
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR AMF API VERSION FOR UDM CONFIG HERE
};
# AMF Information
AMF:{
IPV4_ADDRESS = "192.168.66.2"; # YOUR NETWORK CONFIG HERE (default: 80)
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR AMF API VERSION FOR UDM CONFIG HERE
};
#STATISTICS_TIMER_INTERVAL = 20; #second
INTERFACES : {
#AUSF binded interface for SBI interface(e.g., communication with AMF, UDM)
SBI : {
INTERFACE_NAME = "eth0";
#YOUR NETWORK CONFIG HERE IPV4_ADDRESS = "read";
PORT = 80;
#YOUR NETWORK CONFIG HERE(default : 80) PPID = 60;
};
};
#UDM Information
UDM : {
IPV4_ADDRESS = "192.168.66.8";
#YOUR NETWORK CONFIG HERE PORT = 80;
#YOUR NETWORK CONFIG HERE(default : 80) API_VERSION = "v1";
#YOUR AMF API VERSION FOR UDM CONFIG HERE
};
#AMF Information
AMF : {
IPV4_ADDRESS = "192.168.66.2";
#YOUR NETWORK CONFIG HERE(default : 80) PORT = 80;
#YOUR NETWORK CONFIG HERE(default : 80) API_VERSION = "v1";
#YOUR AMF API VERSION FOR UDM CONFIG HERE
};
}
;
......@@ -37,7 +37,6 @@
#include "string.hpp"
// C includes
#include <arpa/inet.h>
#include <stdbool.h>
#include <stdlib.h>
......@@ -56,11 +55,14 @@ using namespace libconfig;
namespace config {
//------------------------------------------------------------------------------
ausf_config::ausf_config() {
ausf_config::ausf_config() : sbi() {
udm_addr.ipv4_addr.s_addr = INADDR_ANY;
udm_addr.port = 80;
udm_addr.api_version = "v1";
// TODO:
amf_addr.ipv4_addr.s_addr = INADDR_ANY;
amf_addr.port = 80;
amf_addr.api_version = "v1";
}
//------------------------------------------------------------------------------
......@@ -117,9 +119,8 @@ int ausf_config::load(const std::string& config_file) {
try {
const Setting& new_if_cfg = ausf_cfg[AUSF_CONFIG_STRING_INTERFACES];
const Setting& sbi_ausf_cfg =
new_if_cfg[AUSF_CONFIG_STRING_INTERFACE_SBI_AUSF];
load_interface(sbi_ausf_cfg, sbi);
const Setting& sbi_cfg = new_if_cfg[AUSF_CONFIG_STRING_INTERFACE_SBI];
load_interface(sbi_cfg, sbi);
} catch (const SettingNotFoundException& nfex) {
Logger::config().error(
......@@ -180,42 +181,37 @@ int ausf_config::load(const std::string& config_file) {
Logger::ausf_app().error("%s : %s", nfex.what(), nfex.getPath());
return RETURNerror;
}
return RETURNok;
}
//------------------------------------------------------------------------------
void ausf_config::display() {
Logger::config().info(
"====================== AUSF =====================");
Logger::config().info("======== AUSF =======");
Logger::config().info("Configuration AUSF:");
Logger::config().info(
"- Instance ...........................................: %d", instance);
Logger::config().info(
"- PID dir ............................................: %s",
pid_dir.c_str());
Logger::config().info(
"- AUSF NAME............................................: %s",
ausf_name.c_str());
Logger::config().info("- Instance................: %d", instance);
Logger::config().info("- PID dir.................: %s", pid_dir.c_str());
Logger::config().info("- AUSF NAME...............: %s", ausf_name.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));
Logger::config().info(" port .................: %d", sbi.port);
Logger::config().info(" Iface ................: %s", sbi.if_name.c_str());
Logger::config().info(" IP ...................: %s", inet_ntoa(sbi.addr4));
Logger::config().info(" Port .................: %d", sbi.port);
Logger::config().info("- UDM:");
Logger::config().info(
" IPv4 Addr ...........: %s",
" IPv4 Addr.............: %s",
inet_ntoa(*((struct in_addr*) &udm_addr.ipv4_addr)));
Logger::config().info(" Port ................: %lu ", udm_addr.port);
Logger::config().info(" Port..................: %lu ", udm_addr.port);
Logger::config().info(
" API version .........: %s", udm_addr.api_version.c_str());
" API version...........: %s", udm_addr.api_version.c_str());
Logger::config().info("- AMF:");
Logger::config().info(
" IPv4 Addr ...........: %s",
" IPv4 Addr.............: %s",
inet_ntoa(*((struct in_addr*) &amf_addr.ipv4_addr)));
Logger::config().info(" Port ................: %lu ", amf_addr.port);
Logger::config().info(" Port.................: %lu ", amf_addr.port);
Logger::config().info(
" API version .........: %s", amf_addr.api_version.c_str());
" API version..........: %s", amf_addr.api_version.c_str());
}
//------------------------------------------------------------------------------
......
......@@ -49,7 +49,7 @@
#define AUSF_CONFIG_STRING_AUSF_NAME "AUSF_NAME"
#define AUSF_CONFIG_STRING_INTERFACES "INTERFACES"
#define AUSF_CONFIG_STRING_INTERFACE_SBI_AUSF "SBI_AUSF"
#define AUSF_CONFIG_STRING_INTERFACE_SBI "SBI"
#define AUSF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define AUSF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
......@@ -91,6 +91,7 @@ class ausf_config {
std::string ausf_name;
interface_cfg_t sbi;
struct {
struct in_addr ipv4_addr;
unsigned int port;
......
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