Unverified Commit af237e6c authored by kharade's avatar kharade

config file update

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