Commit 4820f53b authored by chen2022's avatar chen2022

PPID问题

parent 37dbcaf7
...@@ -112,6 +112,8 @@ int amf_config::load(const std::string& config_file) { ...@@ -112,6 +112,8 @@ int amf_config::load(const std::string& config_file) {
} }
try { try {
amf_cfg.lookupValue(AMF_CONFIG_STRING_AMF_NAME, AMF_Name); amf_cfg.lookupValue(AMF_CONFIG_STRING_AMF_NAME, AMF_Name);
const Setting& NGAP_AMF = root[AMF_CONFIG_STRING_AMF_CONFIG][AMF_CONFIG_STRING_INTERFACES][AMF_CONFIG_STRING_INTERFACE_NGAP_AMF];
NGAP_AMF.lookupValue(AMF_CONFIG_STRING_PPID,N2_ppid);//NGAP_AMF与AMF_CONFIG_STRING_PPID父子关系
} catch (const SettingNotFoundException& nfex) { } catch (const SettingNotFoundException& nfex) {
Logger::amf_app().error( Logger::amf_app().error(
"%s : %s, using defaults", nfex.what(), nfex.getPath()); "%s : %s, using defaults", nfex.what(), nfex.getPath());
...@@ -181,12 +183,16 @@ int amf_config::load(const std::string& config_file) { ...@@ -181,12 +183,16 @@ int amf_config::load(const std::string& config_file) {
const Setting& new_if_cfg = amf_cfg[AMF_CONFIG_STRING_INTERFACES]; const Setting& new_if_cfg = amf_cfg[AMF_CONFIG_STRING_INTERFACES];
const Setting& n2_amf_cfg = const Setting& n2_amf_cfg =
new_if_cfg[AMF_CONFIG_STRING_INTERFACE_NGAP_AMF]; new_if_cfg[AMF_CONFIG_STRING_INTERFACE_NGAP_AMF];
load_interface(n2_amf_cfg, n2); load_interface(n2_amf_cfg, n2);
if (is_Nausf) { if (is_Nausf) {
const Setting& nausf_amf_cfg = const Setting& nausf_amf_cfg =
new_if_cfg[AMF_CONFIG_STRING_INTERFACE_NAUSF]; new_if_cfg[AMF_CONFIG_STRING_INTERFACE_NAUSF];
load_interface(nausf_amf_cfg, nausf); load_interface(nausf_amf_cfg, nausf);
} }
//
const Setting& n11_cfg = new_if_cfg[AMF_CONFIG_STRING_INTERFACE_N11]; const Setting& n11_cfg = new_if_cfg[AMF_CONFIG_STRING_INTERFACE_N11];
load_interface(n11_cfg, n11); load_interface(n11_cfg, n11);
const Setting& smf_addr_pool = const Setting& smf_addr_pool =
...@@ -278,6 +284,7 @@ int amf_config::load(const std::string& config_file) { ...@@ -278,6 +284,7 @@ int amf_config::load(const std::string& config_file) {
"%s : %s, using defaults", nfex.what(), nfex.getPath()); "%s : %s, using defaults", nfex.what(), nfex.getPath());
return -1; return -1;
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -426,7 +433,6 @@ int amf_config::load_interface( ...@@ -426,7 +433,6 @@ int amf_config::load_interface(
0xFFFFFFFF << (32 - std::stoi(util::trim(words.at(1))))); 0xFFFFFFFF << (32 - std::stoi(util::trim(words.at(1)))));
} }
if_cfg.lookupValue(AMF_CONFIG_STRING_PORT, cfg.port); if_cfg.lookupValue(AMF_CONFIG_STRING_PORT, cfg.port);
try { try {
const Setting& sched_params_cfg = if_cfg[AMF_CONFIG_STRING_SCHED_PARAMS]; const Setting& sched_params_cfg = if_cfg[AMF_CONFIG_STRING_SCHED_PARAMS];
load_thread_sched_params(sched_params_cfg, cfg.thread_rd_sched_params); load_thread_sched_params(sched_params_cfg, cfg.thread_rd_sched_params);
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
#define AMF_CONFIG_STRING_NAS_SUPPORTED_CIPHERING_ALGORITHM_LIST \ #define AMF_CONFIG_STRING_NAS_SUPPORTED_CIPHERING_ALGORITHM_LIST \
"ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST" "ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST"
using namespace libconfig; using namespace libconfig;
namespace config { namespace config {
...@@ -185,6 +186,8 @@ class amf_config { ...@@ -185,6 +186,8 @@ class amf_config {
std::vector<smf_inst_t> smf_pool; std::vector<smf_inst_t> smf_pool;
bool is_Nausf; bool is_Nausf;
uint32_t N2_ppid;
}; };
} // namespace config } // namespace config
......
...@@ -32,18 +32,22 @@ ...@@ -32,18 +32,22 @@
#include "amf_module_from_config.hpp" #include "amf_module_from_config.hpp"
#include "ngap_message_callback.hpp" #include "ngap_message_callback.hpp"
#include "amf_config.hpp"
extern "C" { extern "C" {
#include "Ngap_NGAP-PDU.h" #include "Ngap_NGAP-PDU.h"
#include "Ngap_InitiatingMessage.h" #include "Ngap_InitiatingMessage.h"
} }
using namespace sctp; using namespace sctp;
using namespace config; using namespace config;
using namespace ngap; using namespace ngap;
extern amf_config amf_cfg;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
ngap_app::ngap_app(const std::string& address, const uint16_t port_num) ngap_app::ngap_app(const std::string& address, const uint16_t port_num)
: ppid_(60), sctp_s_38412(address.c_str(), port_num) { : ppid_(getPpid()), sctp_s_38412(address.c_str(), port_num) {
sctp_s_38412.start_receive(this); sctp_s_38412.start_receive(this);
Logger::ngap().info( Logger::ngap().info(
"Set N2 AMF IPv4 Addr, port: %s, %d", address.c_str(), port_num); "Set N2 AMF IPv4 Addr, port: %s, %d", address.c_str(), port_num);
...@@ -119,7 +123,8 @@ void ngap_app::handle_sctp_new_association( ...@@ -119,7 +123,8 @@ void ngap_app::handle_sctp_new_association(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
uint32_t ngap_app::getPpid() { uint32_t ngap_app::getPpid() {
return ppid_; //return ppid_;
return amf_cfg.N2_ppid;
} }
// gnb context management // gnb context management
......
File mode changed from 100644 to 100755
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