Commit 598b67f4 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for NF registration to work with NRF

parent 13b8ab42
......@@ -404,13 +404,9 @@ void amf_app::generate_amf_profile() {
nf_service.nf_service_status = "REGISTERED";
// IP Endpoint
ip_endpoint_t endpoint = {};
std::vector<struct in_addr> addrs;
nf_instance_profile.get_nf_ipv4_addresses(addrs);
for (auto a : addrs) {
endpoint.ipv4_addresses.push_back(a);
}
endpoint.transport = "TCP";
endpoint.port = amf_cfg.n11.port;
endpoint.ipv4_address = amf_cfg.n11.addr4;
endpoint.transport = "TCP";
endpoint.port = amf_cfg.n11.port;
nf_service.ip_endpoints.push_back(endpoint);
nf_instance_profile.add_nf_service(nf_service);
......
......@@ -371,11 +371,9 @@ void amf_profile::to_json(nlohmann::json& data) const {
for (auto endpoint : service.ip_endpoints) {
nlohmann::json ep_tmp = {};
ep_tmp["ipv4Address"] = nlohmann::json::array();
for (auto address : endpoint.ipv4_addresses) {
ep_tmp["ipv4Address"].push_back(inet_ntoa(address));
}
ep_tmp["transport"] = endpoint.transport;
ep_tmp["port"] = endpoint.port;
ep_tmp["ipv4Address"] = inet_ntoa(endpoint.ipv4_address);
ep_tmp["transport"] = endpoint.transport;
ep_tmp["port"] = endpoint.port;
srv_tmp["ipEndPoints"].push_back(ep_tmp);
}
......
......@@ -276,16 +276,14 @@ typedef struct nf_service_version_s {
} nf_service_version_t;
typedef struct ip_endpoint_s {
std::vector<struct in_addr> ipv4_addresses;
// std::vector<struct in6_addr> ipv6_addresses;
struct in_addr ipv4_address;
// struct in6_addr ipv6_address;
std::string transport; // TCP
unsigned int port;
std::string to_string() const {
std::string s = {};
s.append("Ipv4 Addresses: ");
for (auto ipv4 : ipv4_addresses) {
s.append(inet_ntoa(ipv4));
}
s.append("Ipv4 Address: ");
s.append(inet_ntoa(ipv4_address));
s.append(", TransportProtocol: ");
s.append(transport);
s.append(", 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