Commit 0ad52e2d authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Support UPF - FQDN

parent a3f1f8c8
...@@ -134,6 +134,28 @@ bool pfcp_associations::add_association( ...@@ -134,6 +134,28 @@ bool pfcp_associations::add_association(
sa->function_features.first = true; sa->function_features.first = true;
sa->function_features.second = function_features; sa->function_features.second = function_features;
} else { } else {
if (node_id.node_id_type == pfcp::NODE_ID_TYPE_FQDN) {
Logger::smf_app().info("FQDN, NODE ID %s", node_id.fqdn.c_str());
}
struct hostent* record = gethostbyname(node_id.fqdn.c_str());
if (record == NULL) {
Logger::smf_app().info(
"Add association with %s: cannot resolve,"
" retrying later",
node_id.fqdn.c_str());
return false;
}
if (record->h_addrtype == AF_INET) {
in_addr* address = (struct in_addr*) record->h_addr;
node_id.node_id_type = pfcp::NODE_ID_TYPE_IPV4_ADDRESS;
node_id.u1.ipv4_address = *address;
} else if (record->h_addrtype == AF_INET6) {
// TODO
return false;
} else {
return false;
}
restore_n4_sessions = false; restore_n4_sessions = false;
pfcp_association* association = pfcp_association* association =
new pfcp_association(node_id, recovery_time_stamp, function_features); new pfcp_association(node_id, recovery_time_stamp, function_features);
......
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