Unverified Commit 03c5e7b5 authored by kharade's avatar kharade

add config parameter for nrf http version

parent 49a3ced2
...@@ -111,6 +111,7 @@ SMF = ...@@ -111,6 +111,7 @@ SMF =
{ {
IPV4_ADDRESS = "@NRF_IPV4_ADDRESS@"; # YOUR NRF CONFIG HERE IPV4_ADDRESS = "@NRF_IPV4_ADDRESS@"; # YOUR NRF CONFIG HERE
PORT = @NRF_PORT@; # YOUR NRF CONFIG HERE (default: 80) PORT = @NRF_PORT@; # YOUR NRF CONFIG HERE (default: 80)
HTTP_VERSION = @HTTP_VERSION@; # YOUR NRF CONFIG HERE (default: 1)
API_VERSION = "@NRF_API_VERSION@"; # YOUR NRF API VERSION FOR SBI CONFIG HERE API_VERSION = "@NRF_API_VERSION@"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
FQDN = "@NRF_FQDN@" # YOUR NRF FQDN CONFIG HERE FQDN = "@NRF_FQDN@" # YOUR NRF FQDN CONFIG HERE
}; };
......
...@@ -11,6 +11,7 @@ if [[ ${USE_FQDN_DNS} == "yes" ]];then ...@@ -11,6 +11,7 @@ if [[ ${USE_FQDN_DNS} == "yes" ]];then
UPF_IPV4_ADDRESS=${UPF_IPV4_ADDRESS:-0.0.0.0} UPF_IPV4_ADDRESS=${UPF_IPV4_ADDRESS:-0.0.0.0}
UDM_IPV4_ADDRESS=${UDM_IPV4_ADDRESS:-0.0.0.0} UDM_IPV4_ADDRESS=${UDM_IPV4_ADDRESS:-0.0.0.0}
fi fi
HTTP_VERSION=${HTTP_VERSION:-1}
for c in ${CONFIG_DIR}/*.conf; do for c in ${CONFIG_DIR}/*.conf; do
# grep variable names (format: ${VAR}) from template to be rendered # grep variable names (format: ${VAR}) from template to be rendered
......
...@@ -760,8 +760,16 @@ int smf_config::load(const string& config_file) { ...@@ -760,8 +760,16 @@ int smf_config::load(const string& config_file) {
const Setting& nrf_cfg = smf_cfg[SMF_CONFIG_STRING_NRF]; const Setting& nrf_cfg = smf_cfg[SMF_CONFIG_STRING_NRF];
struct in_addr nrf_ipv4_addr = {}; struct in_addr nrf_ipv4_addr = {};
unsigned int nrf_port = {0}; unsigned int nrf_port = {0};
unsigned int httpVersion = {0};
std::string nrf_api_version = {}; std::string nrf_api_version = {};
if (!(nrf_cfg.lookupValue(
SMF_CONFIG_STRING_NRF_HTTP_VERSION, httpVersion))) {
Logger::smf_app().error(SMF_CONFIG_STRING_NRF_HTTP_VERSION "failed");
throw(SMF_CONFIG_STRING_NRF_HTTP_VERSION "failed");
}
nrf_addr.http_version = httpVersion;
if (!use_fqdn_dns) { if (!use_fqdn_dns) {
nrf_cfg.lookupValue(SMF_CONFIG_STRING_NRF_IPV4_ADDRESS, astring); nrf_cfg.lookupValue(SMF_CONFIG_STRING_NRF_IPV4_ADDRESS, astring);
IPV4_STR_ADDR_TO_INADDR( IPV4_STR_ADDR_TO_INADDR(
......
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
#define SMF_CONFIG_STRING_NRF "NRF" #define SMF_CONFIG_STRING_NRF "NRF"
#define SMF_CONFIG_STRING_NRF_IPV4_ADDRESS "IPV4_ADDRESS" #define SMF_CONFIG_STRING_NRF_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_NRF_PORT "PORT" #define SMF_CONFIG_STRING_NRF_PORT "PORT"
#define SMF_CONFIG_STRING_NRF_HTTP_VERSION "HTTP_VERSION"
#define SMF_CONFIG_STRING_LOCAL_CONFIGURATION "LOCAL_CONFIGURATION" #define SMF_CONFIG_STRING_LOCAL_CONFIGURATION "LOCAL_CONFIGURATION"
#define SMF_CONFIG_STRING_SESSION_MANAGEMENT_SUBSCRIPTION_LIST \ #define SMF_CONFIG_STRING_SESSION_MANAGEMENT_SUBSCRIPTION_LIST \
...@@ -241,6 +242,7 @@ class smf_config { ...@@ -241,6 +242,7 @@ class smf_config {
struct { struct {
struct in_addr ipv4_addr; struct in_addr ipv4_addr;
unsigned int port; unsigned int port;
unsigned int http_version;
std::string api_version; std::string api_version;
std::string fqdn; std::string fqdn;
} nrf_addr; } nrf_addr;
......
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