Commit 464226ba authored by Andrii Shtompel's avatar Andrii Shtompel Committed by Randeep

[IOT-1610] Add TCP secure port to CAGetAssignedPortNumber

Change-Id: Iedcedb015eeebf6ce8847a084f475c2c48ec4506
Signed-off-by: default avatarAndrii Shtompel <a.shtompel@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19717Reviewed-by: default avatarDmitriy Zhuravlev <d.zhuravlev@samsung.com>
Reviewed-by: default avatarOleksii Beketov <ol.beketov@samsung.com>
Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarKevin Kane <kkane@microsoft.com>
Reviewed-by: Randeep's avatarRandeep Singh <randeep.s@samsung.com>
parent 71a45d8c
......@@ -104,13 +104,27 @@ CAResult_t CASetPortNumberToAssign(CATransportAdapter_t adapter,
#ifdef TCP_ADAPTER
if (CA_ADAPTER_TCP & adapter)
{
if (CA_IPV6 & flag)
if (CA_SECURE & flag)
{
targetPort = &caglobals.ports.tcp.u6;
if (CA_IPV6 & flag)
{
targetPort = &caglobals.ports.tcp.u6s;
}
else if (CA_IPV4 & flag)
{
targetPort = &caglobals.ports.tcp.u4s;
}
}
else if (CA_IPV4 & flag)
else
{
targetPort = &caglobals.ports.tcp.u4;
if (CA_IPV6 & flag)
{
targetPort = &caglobals.ports.tcp.u6;
}
else if (CA_IPV4 & flag)
{
targetPort = &caglobals.ports.tcp.u4;
}
}
}
#endif
......@@ -156,13 +170,27 @@ uint16_t CAGetAssignedPortNumber(CATransportAdapter_t adapter, CATransportFlags_
#ifdef TCP_ADAPTER
if (CA_ADAPTER_TCP & adapter)
{
if (CA_IPV6 & flag)
if (CA_SECURE & flag)
{
return caglobals.tcp.ipv6.port;
if (CA_IPV6 & flag)
{
return caglobals.tcp.ipv6s.port;
}
else if (CA_IPV4 & flag)
{
return caglobals.tcp.ipv4s.port;
}
}
else if (CA_IPV4 & flag)
else
{
return caglobals.tcp.ipv4.port;
if (CA_IPV6 & flag)
{
return caglobals.tcp.ipv6.port;
}
else if (CA_IPV4 & flag)
{
return caglobals.tcp.ipv4.port;
}
}
}
#endif
......
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