Commit 8b9e891a authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

polish the code for config/context

parent f7ff6e2f
......@@ -451,8 +451,8 @@ int smf_config::load(const string& config_file)
IPV4_STR_ADDR_TO_INADDR (util::trim(astring).c_str(), amf_ipv4_addr, "BAD IPv4 ADDRESS FORMAT FOR AMF !");
amf_addr.ipv4_addr = amf_ipv4_addr;
if (!(amf_cfg.lookupValue(SMF_CONFIG_STRING_AMF_PORT, amf_port))) {
Logger::smf_app().error(SMF_CONFIG_STRING_AMF_PORT "failed");
throw (SMF_CONFIG_STRING_AMF_PORT "failed");
Logger::smf_app().error(SMF_CONFIG_STRING_AMF_PORT "failed");
throw (SMF_CONFIG_STRING_AMF_PORT "failed");
}
amf_addr.port = amf_port;
......@@ -463,8 +463,8 @@ int smf_config::load(const string& config_file)
IPV4_STR_ADDR_TO_INADDR (util::trim(astring).c_str(), udm_ipv4_addr, "BAD IPv4 ADDRESS FORMAT FOR UDM !");
udm_addr.ipv4_addr = udm_ipv4_addr;
if (!(udm_cfg.lookupValue(SMF_CONFIG_STRING_UDM_PORT, udm_port))) {
Logger::smf_app().error(SMF_CONFIG_STRING_UDM_PORT "failed");
throw (SMF_CONFIG_STRING_UDM_PORT "failed");
Logger::smf_app().error(SMF_CONFIG_STRING_UDM_PORT "failed");
throw (SMF_CONFIG_STRING_UDM_PORT "failed");
}
udm_addr.port = udm_port;
......@@ -563,7 +563,7 @@ void smf_config::display ()
std::string range_low(inet_ntoa (ue_pool_range_low[apn[i].pool_id_iv4]));
std::string range_high(inet_ntoa (ue_pool_range_high[apn[i].pool_id_iv4]));
Logger::smf_app().info( " " SMF_CONFIG_STRING_IPV4_POOL ": %d ( %s - %s)",
apn[i].pool_id_iv4, range_low.c_str(), range_high.c_str());
apn[i].pool_id_iv4, range_low.c_str(), range_high.c_str());
}
if (apn[i].pool_id_iv6 >= 0) {
Logger::smf_app().info( " " SMF_CONFIG_STRING_IPV6_POOL ": %d", apn[i].pool_id_iv6);
......@@ -642,11 +642,11 @@ bool smf_config::is_dotted_dnn_handled(const std::string& dnn, const pdu_session
{
Logger::smf_app().debug( "requested dnn: %s", dnn.c_str());
for (int i = 0; i < smf_cfg.num_apn; i++) {
Logger::smf_app().debug( "apn_label: %s, apn: %s", smf_cfg.apn[i].apn_label.c_str(),smf_cfg.apn[i].apn.c_str() );
Logger::smf_app().debug( "apn_label: %s, apn: %s", smf_cfg.apn[i].apn_label.c_str(),smf_cfg.apn[i].apn.c_str() );
//if (0 == dnn.compare(smf_cfg.apn[i].apn_label)) {
if (0 == dnn.compare(smf_cfg.apn[i].apn)) {
Logger::smf_app().debug( "DNN matched! \n");
Logger::smf_app().debug( "pdu session type %d, pdn_type %d \n", pdn_session_type.pdu_session_type, smf_cfg.apn[i].pdn_type.pdn_type);
if (0 == dnn.compare(smf_cfg.apn[i].apn)) {
Logger::smf_app().debug( "DNN matched! \n");
Logger::smf_app().debug( "pdu session type %d, pdn_type %d \n", pdn_session_type.pdu_session_type, smf_cfg.apn[i].pdn_type.pdn_type);
if (pdn_session_type.pdu_session_type == smf_cfg.apn[i].pdn_type.pdn_type) {
return true;
}
......@@ -655,5 +655,12 @@ bool smf_config::is_dotted_dnn_handled(const std::string& dnn, const pdu_session
return false;
}
//------------------------------------------------------------------------------
std::string smf_config::get_default_dnn()
{
Logger::smf_app().debug( "Default DNN: %s", smf_cfg.apn[0].apn.c_str());
return smf_cfg.apn[0].apn;
}
......@@ -20,12 +20,12 @@
*/
/*! \file smf_config.hpp
* \brief
* \brief
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
*/
#ifndef FILE_SMF_CONFIG_HPP_SEEN
#define FILE_SMF_CONFIG_HPP_SEEN
......@@ -214,13 +214,13 @@ public:
} pcef;
struct {
struct in_addr ipv4_addr;
unsigned int port;
struct in_addr ipv4_addr;
unsigned int port;
} amf_addr;
struct {
struct in_addr ipv4_addr;
unsigned int port;
struct in_addr ipv4_addr;
unsigned int port;
} udm_addr;
smf_config() : m_rw_lock(), pcef(), num_apn(0), pid_dir(), instance(0), sx(), n4(), n11(), itti() {
......@@ -245,13 +245,13 @@ public:
}
force_push_pco = true;
ue_mtu = 1500;
itti.itti_timer_sched_params.sched_priority = 85;
itti.sx_sched_params.sched_priority = 84;
itti.s5s8_sched_params.sched_priority = 84;
itti.smf_app_sched_params.sched_priority = 84;
itti.async_cmd_sched_params.sched_priority = 84;
sx.thread_rd_sched_params.sched_priority = 90;
sx.port = pfcp::default_port;
......@@ -277,6 +277,7 @@ public:
int get_pfcp_node_id(pfcp::node_id_t& node_id);
int get_pfcp_fseid(pfcp::fseid_t& fseid);
bool is_dotted_dnn_handled(const std::string& apn, const pdu_session_type_t& pdn_session_type);
std::string get_default_dnn();
};
} // namespace smf
......
This diff is collapsed.
This diff is collapsed.
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