Unverified Commit af237e6c authored by kharade's avatar kharade

config file update

parent b902581e
......@@ -2,13 +2,14 @@ UDR =
{
INSTANCE_ID = @INSTANCE@; # 0 is the default
PID_DIRECTORY = "@PID_DIRECTORY@"; # /var/run is the default
UDR_NAME = "@UDR_NAME@";
SUPPORT_FEATURES:{
# STRING, {"yes", "no"},
USE_FQDN_DNS = "@USE_FQDN_DNS@"; # Set to yes if AUSF will relying on a DNS to resolve UDM's FQDN
REGISTER_NRF = "@REGISTER_NRF@"; # Set to 'yes' if AUSF resgisters to an NRF
USE_HTTP2 = "@USE_HTTP2@"; # Set to yes to enable HTTP2 for AUSF server
USE_FQDN_DNS = "@USE_FQDN_DNS@"; # Set to yes if UDR will relying on a DNS to resolve UDM's FQDN
REGISTER_NRF = "@REGISTER_NRF@"; # Set to 'yes' if UDR resgisters to an NRF
USE_HTTP2 = "@USE_HTTP2@"; # Set to yes to enable HTTP2 for UDR server
}
INTERFACES:
......
......@@ -3,6 +3,7 @@
set -euo pipefail
CONFIG_DIR="/openair-udr/etc"
UDR_NAME=${UDR_NAME:-oai-udr}
UDR_INTERFACE_PORT_FOR_NUDR=${UDR_INTERFACE_PORT_FOR_NUDR:-80}
UDR_INTERFACE_HTTP2_PORT_FOR_NUDR=${UDR_INTERFACE_HTTP2_PORT_FOR_NUDR:-8080}
USE_HTTP2=${USE_HTTP2:-no}
......
......@@ -39,7 +39,7 @@ using namespace libconfig;
namespace oai::udr::config {
//------------------------------------------------------------------------------
udr_config::udr_config() : mysql(), instance(), pid_dir(), nudr() {
udr_config::udr_config() : mysql(), instance(), udr_name(), pid_dir(), nudr() {
nudr_http2_port = 8080;
nudr.api_version = "v1";
}
......@@ -87,7 +87,12 @@ int udr_config::load(const std ::string &config_file) {
Logger::udr_app().error("%s : %s, using defaults", nfex.what(),
nfex.getPath());
}
try {
udr_cfg.lookupValue(UDR_CONFIG_STRING_UDR_NAME, udr_name);
} catch (const SettingNotFoundException &nfex) {
Logger::config().error("%s : %s, using defaults", nfex.what(),
nfex.getPath());
}
try {
const Setting &new_if_cfg = udr_cfg[UDR_CONFIG_STRING_INTERFACES];
const Setting &nudr_cfg = new_if_cfg[UDR_CONFIG_STRING_INTERFACE_NUDR];
......@@ -276,6 +281,7 @@ void udr_config::display() {
Logger::config().info(
"- PID dir ............................................: %s",
pid_dir.c_str());
Logger::config().info("- UDR Name ..............: %s", udr_name.c_str());
Logger::config().info("- Nudr Networking:");
Logger::config().info(" Interface name ......: %s", nudr.if_name.c_str());
......
......@@ -29,6 +29,7 @@
#define UDR_CONFIG_STRING_UDR_CONFIG "UDR"
#define UDR_CONFIG_STRING_INSTANCE_ID "INSTANCE_ID"
#define UDR_CONFIG_STRING_UDR_NAME "UDR_NAME"
#define UDR_CONFIG_STRING_PID_DIRECTORY "PID_DIRECTORY"
#define UDR_CONFIG_STRING_INTERFACES "INTERFACES"
#define UDR_CONFIG_STRING_INTERFACE_NUDR "NUDR"
......@@ -87,6 +88,7 @@ public:
unsigned int instance;
std::string pid_dir;
std::string udr_name;
interface_cfg_t nudr;
unsigned int nudr_http2_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