*/
static CAErrorHandleCallback g_errorCallback = NULL;
-static void CATCPPacketReceivedCB(const CAEndpoint_t *endpoint,
+static void CATCPPacketReceivedCB(const CASecureEndpoint_t *sep,
const void *data, uint32_t dataLength);
static CAResult_t CATCPInitializeQueueHandles();
(void)status;
}
-void CATCPPacketReceivedCB(const CAEndpoint_t *endpoint, const void *data,
+void CATCPPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data,
uint32_t dataLength)
{
- VERIFY_NON_NULL_VOID(endpoint, TAG, "endpoint is NULL");
+ VERIFY_NON_NULL_VOID(sep, TAG, "sep is NULL");
VERIFY_NON_NULL_VOID(data, TAG, "data is NULL");
- OIC_LOG_V(DEBUG, TAG, "Address: %s, port:%d", endpoint->addr, endpoint->port);
+ OIC_LOG_V(DEBUG, TAG, "Address: %s, port:%d", sep->endpoint.addr, sep->endpoint.port);
if (g_networkPacketCallback)
{
- g_networkPacketCallback(endpoint, data, dataLength);
+ g_networkPacketCallback(sep, data, dataLength);
}
}
svritem->fd = sockfd;
CAConvertAddrToName((struct sockaddr_storage *)&clientaddr, clientlen,
- (char *) &svritem->endpoint.addr, &svritem->endpoint.port);
+ (char *) &svritem->sep.endpoint.addr, &svritem->sep.endpoint.port);
ca_mutex_lock(g_mutexObjectList);
bool result = u_arraylist_add(caglobals.tcp.svrlist, svritem);
// #5. pass the received data information to upper layer.
if ((svritem->totalDataLen == svritem->recvDataLen) && g_packetReceivedCallback)
{
- svritem->endpoint.adapter = CA_ADAPTER_TCP;
- g_packetReceivedCallback(&svritem->endpoint, svritem->recvData, svritem->recvDataLen);
+ svritem->sep.endpoint.adapter = CA_ADAPTER_TCP;
+ g_packetReceivedCallback(&svritem->sep, svritem->recvData, svritem->recvDataLen);
OIC_LOG_V(DEBUG, TAG, "total received data len:%d", svritem->recvDataLen);
// initialize data info to receive next message.
}
struct sockaddr_storage sa = { .ss_family = family };
- CAConvertNameToAddr(tcpServerInfo->endpoint.addr, tcpServerInfo->endpoint.port, &sa);
+ CAConvertNameToAddr(tcpServerInfo->sep.endpoint.addr, tcpServerInfo->sep.endpoint.port, &sa);
socklen_t socklen = sizeof (struct sockaddr_in);
// connect to TCP server
OIC_LOG(ERROR, TAG, "Out of memory");
return NULL;
}
- memcpy(svritem->endpoint.addr, endpoint->addr, sizeof(svritem->endpoint.addr));
- svritem->endpoint.port = endpoint->port;
+ memcpy(svritem->sep.endpoint.addr, endpoint->addr, sizeof(svritem->sep.endpoint.addr));
+ svritem->sep.endpoint.port = endpoint->port;
// #2. create the socket and connect to TCP server
if (caglobals.tcp.ipv4tcpenabled)
continue;
}
- if (!strncmp(svritem->endpoint.addr, endpoint->addr, sizeof(svritem->endpoint.addr))
- && (svritem->endpoint.port == endpoint->port))
+ if (!strncmp(svritem->sep.endpoint.addr, endpoint->addr, sizeof(svritem->sep.endpoint.addr))
+ && (svritem->sep.endpoint.port == endpoint->port))
{
*index = i;
return svritem;