Commit 5c93577b authored by hyuna0213.jo's avatar hyuna0213.jo Committed by Ziran Sun

Support secure network info in CAGetNetworkInformation

Secured network interface information should be provided

Change-Id: I65fe446d84ed67e00486782901b8b9f07f47c32c
Signed-off-by: default avatarhyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18565Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarZiran Sun <ziran.sun@samsung.com>
parent d3b382c9
......@@ -1314,6 +1314,11 @@ CAResult_t CAGetTCPInterfaceInformation(CAEndpoint_t **info, size_t *size)
}
size_t len = u_arraylist_length(iflist);
size_t length = len;
#ifdef __WITH_TLS__
length = len * 2;
#endif
CAEndpoint_t *ep = (CAEndpoint_t *)OICCalloc(len, sizeof (CAEndpoint_t));
if (!ep)
......@@ -1349,6 +1354,25 @@ CAResult_t CAGetTCPInterfaceInformation(CAEndpoint_t **info, size_t *size)
continue;
}
OICStrcpy(ep[j].addr, sizeof(ep[j].addr), ifitem->addr);
#ifdef __WITH_TLS__
j++;
ep[j].adapter = CA_ADAPTER_TCP;
ep[j].ifindex = ifitem->index;
if (ifitem->family == AF_INET6)
{
ep[j].flags = CA_IPV6 | CA_SECURE;
ep[j].port = caglobals.tcp.ipv6s.port;
}
else
{
ep[j].flags = CA_IPV4 | CA_SECURE;
ep[j].port = caglobals.tcp.ipv4s.port;
}
OICStrcpy(ep[j].addr, sizeof(ep[j].addr), ifitem->addr);
#endif
j++;
}
......
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