Commit 6d9342a0 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix issue with redundant profile IEs

parent 95b02ac8
......@@ -1017,6 +1017,7 @@ void amf_app::generate_amf_profile() {
nf_instance_profile.set_nf_heartBeat_timer(50);
nf_instance_profile.set_nf_priority(1);
nf_instance_profile.set_nf_capacity(100);
nf_instance_profile.delete_nf_ipv4_addresses();
nf_instance_profile.add_nf_ipv4_addresses(amf_cfg.n11.addr4);
// NF services
......@@ -1036,6 +1037,7 @@ void amf_app::generate_amf_profile() {
endpoint.port = amf_cfg.n11.port;
nf_service.ip_endpoints.push_back(endpoint);
nf_instance_profile.delete_nf_services();
nf_instance_profile.add_nf_service(nf_service);
// TODO: custom info
......
......@@ -151,6 +151,7 @@ void nf_profile::get_nf_snssais(std::vector<snssai_t>& s) const {
void nf_profile::add_snssai(const snssai_t& s) {
snssais.push_back(s);
}
//------------------------------------------------------------------------------
void nf_profile::set_nf_ipv4_addresses(const std::vector<struct in_addr>& a) {
ipv4_addresses = a;
......@@ -165,6 +166,10 @@ void nf_profile::get_nf_ipv4_addresses(std::vector<struct in_addr>& a) const {
a = ipv4_addresses;
}
//------------------------------------------------------------------------------
void nf_profile::delete_nf_ipv4_addresses() {
ipv4_addresses.clear();
}
//------------------------------------------------------------------------------
void nf_profile::display() const {
Logger::amf_app().debug("NF instance info");
......@@ -296,6 +301,11 @@ void amf_profile::get_nf_services(std::vector<nf_service_t>& n) const {
n = nf_services;
}
//------------------------------------------------------------------------------
void amf_profile::delete_nf_services() {
nf_services.clear();
}
//------------------------------------------------------------------------------
void amf_profile::set_custom_info(const nlohmann::json& c) {
custom_info = c;
......
......@@ -267,6 +267,12 @@ class nf_profile : public std::enable_shared_from_this<nf_profile> {
*/
void get_nf_ipv4_addresses(std::vector<struct in_addr>& a) const;
/*
* Remove all NF instance ipv4_addresses
* @param void
* @return void:
*/
void delete_nf_ipv4_addresses();
/*
* Print related-information for NF profile
* @param void
......@@ -349,6 +355,12 @@ class amf_profile : public nf_profile {
*/
void get_nf_services(std::vector<nf_service_t>& n) const;
/*
* Delete all NF services
* @param void
* @return void:
*/
void delete_nf_services();
/*
* Set custom info
* @param [const nlohmann::json &] c: custom info to be set
......
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