#define TIMER_H_
#include "iotivity_config.h"
-#ifdef HAVE_SYS_TIME_H
+#ifdef HAVE_TIME_H
+#include <time.h>
+#elif defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
-#endif
-#ifdef HAVE_ARDUINO_TIME_H
+#elif defined(HAVE_ARDUINO_TIME_H)
#include <Time.h>
#endif
* This internal callback is used by CA layer to
* retrieve all credential types from SRM
*
- * @param[out] list of enabled credential types for CA handshake
+ * @param[out] list of enabled credential types for CA handshake.
+ * @param[in] device uuid.
*
*/
-typedef void (*CAgetCredentialTypesHandler)(bool * list);
+typedef void (*CAgetCredentialTypesHandler)(bool * list, const char* deviceId);
/**
* Binary structure containing PKIX related info
* own certificate chain, public key, CA's and CRL's
OIC_LOG_V(DEBUG, NET_SSL_TAG, "Out %s", __func__);
return 0;
}
-static void SetupCipher(mbedtls_ssl_config * config, CATransportAdapter_t adapter)
+static void SetupCipher(mbedtls_ssl_config * config, CATransportAdapter_t adapter,
+ const char* deviceId)
{
int index = 0;
OIC_LOG_V(DEBUG, NET_SSL_TAG, "In %s", __func__);
return;
}
- g_getCredentialTypesCallback(g_caSslContext->cipherFlag);
+ g_getCredentialTypesCallback(g_caSslContext->cipherFlag, deviceId);
+
// Retrieve the PSK credential from SRM
if (true == g_caSslContext->cipherFlag[0] && 0 != InitPskIdentity(config))
{
}
//Load allowed SVR suites from SVR DB
- SetupCipher(config, endpoint->adapter);
+ SetupCipher(config, endpoint->adapter, endpoint->remoteId);
ret = u_arraylist_add(g_caSslContext->peerList, (void *) tep);
if (!ret)
return CA_STATUS_FAILED;
}
//Load allowed TLS suites from SVR DB
- SetupCipher(config, sep->endpoint.adapter);
+ SetupCipher(config, sep->endpoint.adapter, sep->endpoint.remoteId);
ret = u_arraylist_add(g_caSslContext->peerList, (void *) peer);
if (!ret)
OIC_LOG(ERROR, TAG, "Out of memory");
return OC_INVALID_SOCKET;
}
- memcpy(svritem->sep.endpoint.addr, endpoint->addr, sizeof(svritem->sep.endpoint.addr));
- svritem->sep.endpoint.adapter = endpoint->adapter;
- svritem->sep.endpoint.port = endpoint->port;
- svritem->sep.endpoint.flags = endpoint->flags;
- svritem->sep.endpoint.ifindex = endpoint->ifindex;
+ svritem->sep.endpoint = *endpoint;
svritem->state = CONNECTING;
svritem->isClient = true;
#include "iotivity_config.h"
#include "gtest/gtest.h"
#include "time.h"
+#include "octypes.h"
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
OC_CLOSE_SOCKET(sockfd);
}
-static void clutch(bool * list)
+static void clutch(bool * list, const char *deviceId)
{
+ OC_UNUSED(deviceId);
+
list[1] = true;
}
static void * test0CAinitiateSslHandshake(void * arg)
{
CAEndpoint_t serverAddr;
+ memset(&serverAddr, 0, sizeof(serverAddr));
serverAddr.adapter = CA_ADAPTER_TCP;
serverAddr.flags = CA_SECURE;
serverAddr.port = 4433;
{
int ret = 0;
CAEndpoint_t serverAddr;
+ memset(&serverAddr, 0, sizeof(serverAddr));
serverAddr.adapter = CA_ADAPTER_TCP;
serverAddr.flags = CA_SECURE;
serverAddr.port = 4433;
int buflen = 0;
CAEndpoint_t serverAddr;
+ memset(&serverAddr, 0, sizeof(serverAddr));
serverAddr.adapter = CA_ADAPTER_TCP;
serverAddr.flags = CA_SECURE;
serverAddr.port = 4433;
{
int ret = 0;
CAEndpoint_t serverAddr;
+ memset(&serverAddr, 0, sizeof(serverAddr));
serverAddr.adapter = CA_ADAPTER_TCP;
serverAddr.flags = CA_SECURE;
serverAddr.port = 4433;
/**
* Used by CA to retrieve credential types
*
- * @param[out] key key to be filled.
+ * @param[out] list list of suites to be filled.
* @param[in] usage credential usage string.
+ * @param[in] device uuid.
*/
-void InitCipherSuiteListInternal(bool *list, const char * usage);
+void InitCipherSuiteListInternal(bool *list, const char * usage, const char* deviceId);
#endif // __WITH_TLS__
// Helpers shared by cred and roles resources
* Used by CA to retrieve credential types
*
* @param[out] list TLS suites boolean map.
+ * @param[in] device uuid.
*/
-void InitCipherSuiteList(bool * list);
+void InitCipherSuiteList(bool * list, const char* deviceId);
/**
* Used by CA to retrieve manufacturer credential types
*
* @param[out] list TLS suites boolean map.
+ * @param[in] device uuid.
*/
-void InitManufacturerCipherSuiteList(bool * list);
+void InitManufacturerCipherSuiteList(bool * list, const char* deviceId);
#ifdef __cplusplus
}
#endif
#include "oxmpreconfpin.h"
#include "oxmrandompin.h"
#include "otmcontextlist.h"
+#include "ocstackinternal.h"
#include "mbedtls/ssl_ciphersuites.h"
#include "ocrandom.h"
OCStackResult res = OC_STACK_ERROR;
CAEndpoint_t endpoint;
- memset(&endpoint, 0x00, sizeof(CAEndpoint_t));
- OICStrcpy(endpoint.addr, MAX_ADDR_STR_SIZE_CA, selectedDeviceInfo->endpoint.addr);
- endpoint.addr[MAX_ADDR_STR_SIZE_CA - 1] = '\0';
- endpoint.port = selectedDeviceInfo->securePort;
- endpoint.adapter = selectedDeviceInfo->endpoint.adapter;
+ CopyDevAddrToEndpoint(&selectedDeviceInfo->endpoint, &endpoint);
+
+ if (CA_ADAPTER_IP == endpoint.adapter)
+ {
+ endpoint.port = selectedDeviceInfo->securePort;
+ }
+#ifdef WITH_TCP
+ else if (CA_ADAPTER_TCP == endpoint.adapter)
+ {
+ endpoint.port = selectedDeviceInfo->tcpPort;
+ }
+#endif
OicUuid_t ownerDeviceID = {.id={0}};
if (OC_STACK_OK != GetDoxmDeviceID(&ownerDeviceID))
OCStackResult res = OC_STACK_ERROR;
CAEndpoint_t endpoint;
- memset(&endpoint, 0x00, sizeof(CAEndpoint_t));
- OICStrcpy(endpoint.addr, MAX_ADDR_STR_SIZE_CA, selectedDeviceInfo->endpoint.addr);
- endpoint.addr[MAX_ADDR_STR_SIZE_CA - 1] = '\0';
- endpoint.port = selectedDeviceInfo->securePort;
- endpoint.adapter = selectedDeviceInfo->endpoint.adapter;
- uint8_t ownerPSK[OWNER_PSK_LENGTH_128] = { 0 };
+ CopyDevAddrToEndpoint(&selectedDeviceInfo->endpoint, &endpoint);
+
+ if (CA_ADAPTER_IP == endpoint.adapter)
+ {
+ endpoint.port = selectedDeviceInfo->securePort;
+ }
+#ifdef WITH_TCP
+ else if (CA_ADAPTER_TCP == endpoint.adapter)
+ {
+ endpoint.port = selectedDeviceInfo->tcpPort;
+ }
+#endif
OicUuid_t ownerDeviceID = {.id={0}};
if (OC_STACK_OK != GetDoxmDeviceID(&ownerDeviceID))
OicSecKey_t ownerKey;
memset(&ownerKey, 0, sizeof(ownerKey));
+
+ uint8_t ownerPSK[OWNER_PSK_LENGTH_128] = { 0 };
ownerKey.data = ownerPSK;
ownerKey.len = OWNER_PSK_LENGTH_128;
ownerKey.encoding = OIC_ENCODING_RAW;
OicSecAcl_t* ownerAcl = NULL;
assert(deviceInfo->connType & CT_FLAG_SECURE);
+ CAEndpoint_t endpoint;
+ CopyDevAddrToEndpoint(&deviceInfo->endpoint, &endpoint);
+
+ if (CA_STATUS_OK != CAInitiateHandshake(&endpoint))
+ {
+ OIC_LOG(ERROR, TAG, "Failed to pass ssl handshake");
+ return OC_STACK_ERROR;
+ }
+
if(!PMGenerateQuery(true,
deviceInfo->endpoint.addr, deviceInfo->securePort,
deviceInfo->connType,
#include "logger.h"
#include "pmtypes.h"
#include "ownershiptransfermanager.h"
+#include "ocstackinternal.h"
#include "mbedtls/ssl_ciphersuites.h"
#define TAG "OIC_OXM_JustWorks"
}
OIC_LOG(INFO, TAG, "TLS_ECDH_anon_WITH_AES_128_CBC_SHA256 cipher suite selected.");
- OCProvisionDev_t *selDevInfo = otmCtx->selectedDeviceInfo;
CAEndpoint_t endpoint;
- memcpy(&endpoint, &selDevInfo->endpoint, sizeof(CAEndpoint_t));
+ OCProvisionDev_t *selDevInfo = otmCtx->selectedDeviceInfo;
+ CopyDevAddrToEndpoint(&selDevInfo->endpoint, &endpoint);
- if(CA_ADAPTER_IP == endpoint.adapter)
+ if (CA_ADAPTER_IP == endpoint.adapter)
{
endpoint.port = selDevInfo->securePort;
- caresult = CAInitiateHandshake(&endpoint);
}
- else if (CA_ADAPTER_GATT_BTLE == endpoint.adapter)
- {
- caresult = CAInitiateHandshake(&endpoint);
- }
-#ifdef __WITH_TLS__
- else
+#ifdef WITH_TCP
+ else if (CA_ADAPTER_TCP == endpoint.adapter)
{
endpoint.port = selDevInfo->tcpPort;
- caresult = CAinitiateSslHandshake(&endpoint);
}
#endif
+
+ caresult = CAInitiateHandshake(&endpoint);
if (CA_STATUS_OK != caresult)
{
OIC_LOG_V(ERROR, TAG, "DTLS/TLS handshake failure.");
#include "srmresourcestrings.h"
#include "pkix_interface.h"
#include "mbedtls/ssl_ciphersuites.h"
+#include "ocstackinternal.h"
#define TAG "OXM_MCertificate"
}
OIC_LOG(INFO, TAG, "MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 cipher suite selected.");
+ CAEndpoint_t endpoint;
OCProvisionDev_t* selDevInfo = otmCtx->selectedDeviceInfo;
- CAEndpoint_t *endpoint = (CAEndpoint_t *)OICCalloc(1, sizeof (CAEndpoint_t));
- if (NULL == endpoint)
+ CopyDevAddrToEndpoint(&selDevInfo->endpoint, &endpoint);
+
+ if (CA_ADAPTER_IP == endpoint.adapter)
+ {
+ endpoint.port = selDevInfo->securePort;
+ }
+#ifdef WITH_TCP
+ else if (CA_ADAPTER_TCP == endpoint.adapter)
{
- return OC_STACK_NO_MEMORY;
+ endpoint.port = selDevInfo->tcpPort;
}
- memcpy(endpoint,&selDevInfo->endpoint,sizeof(CAEndpoint_t));
- endpoint->port = selDevInfo->securePort;
- caresult = CAInitiateHandshake(endpoint);
- OICFree(endpoint);
+#endif
+
+ caresult = CAInitiateHandshake(&endpoint);
if (CA_STATUS_OK != caresult)
{
OIC_LOG_V(ERROR, TAG, "DTLS handshake failure.");
#include "ownershiptransfermanager.h"
#include "pinoxmcommon.h"
#include "srmresourcestrings.h"
+#include "ocstackinternal.h"
#include "mbedtls/ssl_ciphersuites.h"
#define TAG "OIC_OXM_PreconfigPIN"
}
OIC_LOG(INFO, TAG, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 cipher suite selected.");
+ CAEndpoint_t endpoint;
OCProvisionDev_t* selDevInfo = otmCtx->selectedDeviceInfo;
- CAEndpoint_t *endpoint = (CAEndpoint_t *)OICCalloc(1, sizeof (CAEndpoint_t));
- if (NULL == endpoint)
+ CopyDevAddrToEndpoint(&selDevInfo->endpoint, &endpoint);
+
+ if (CA_ADAPTER_IP == endpoint.adapter)
+ {
+ endpoint.port = selDevInfo->securePort;
+ }
+#ifdef WITH_TCP
+ else if (CA_ADAPTER_TCP == endpoint.adapter)
{
- return OC_STACK_NO_MEMORY;
+ endpoint.port = selDevInfo->tcpPort;
}
- memcpy(endpoint,&selDevInfo->endpoint,sizeof(CAEndpoint_t));
- endpoint->port = selDevInfo->securePort;
- caresult = CAInitiateHandshake(endpoint);
- OICFree(endpoint);
+#endif
+
+ caresult = CAInitiateHandshake(&endpoint);
if (CA_STATUS_OK != caresult)
{
OIC_LOG_V(ERROR, TAG, "DTLS handshake failure.");
#include "oxmrandompin.h"
#include "ownershiptransfermanager.h"
#include "pinoxmcommon.h"
+#include "ocstackinternal.h"
#include "mbedtls/ssl_ciphersuites.h"
#define TAG "OIC_OXM_RandomPIN"
}
OIC_LOG(INFO, TAG, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 cipher suite selected.");
- OCProvisionDev_t* selDevInfo = otmCtx->selectedDeviceInfo;
CAEndpoint_t endpoint;
- memcpy(&endpoint, &selDevInfo->endpoint, sizeof(CAEndpoint_t));
+ OCProvisionDev_t* selDevInfo = otmCtx->selectedDeviceInfo;
+ CopyDevAddrToEndpoint(&selDevInfo->endpoint, &endpoint);
- if(CA_ADAPTER_IP == endpoint.adapter)
+ if (CA_ADAPTER_IP == endpoint.adapter)
{
endpoint.port = selDevInfo->securePort;
- caresult = CAInitiateHandshake(&endpoint);
}
- else if (CA_ADAPTER_GATT_BTLE == endpoint.adapter)
- {
- caresult = CAInitiateHandshake(&endpoint);
- }
-#ifdef __WITH_TLS__
- else
+#ifdef WITH_TCP
+ else if (CA_ADAPTER_TCP == endpoint.adapter)
{
endpoint.port = selDevInfo->tcpPort;
- caresult = CAinitiateSslHandshake(&endpoint);
}
#endif
+
+ caresult = CAInitiateHandshake(&endpoint);
if (CA_STATUS_OK != caresult)
{
OIC_LOG_V(ERROR, TAG, "DTLS handshake failure.");
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
}
-void InitCipherSuiteListInternal(bool * list, const char * usage)
+void InitCipherSuiteListInternal(bool * list, const char * usage, const char *deviceId)
{
OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
if (NULL == list || NULL == usage)
}
case SYMMETRIC_PAIR_WISE_KEY:
{
- list[0] = true;
- OIC_LOG(DEBUG, TAG, "SYMMETRIC_PAIR_WISE_KEY found");
+ OicUuid_t uuid;
+
+ if (NULL == deviceId ||
+ OC_STACK_OK != ConvertStrToUuid(deviceId, &uuid) ||
+ 0 == memcmp(uuid.id, temp->subject.id, sizeof(uuid.id)))
+ {
+ list[0] = true;
+ OIC_LOG(DEBUG, TAG, "SYMMETRIC_PAIR_WISE_KEY found");
+ }
break;
}
case SIGNED_ASYMMETRIC_KEY:
#include "pmtypes.h"
#include "pmutility.h"
#include "srmutility.h"
+#include "ocstackinternal.h"
#if defined(__WITH_DTLS__) || defined (__WITH_TLS__)
#include <mbedtls/ssl_ciphersuites.h>
#endif
VERIFY_SUCCESS(TAG, CA_STATUS_OK == caresult, ERROR);
// initiate dtls
- CAEndpoint_t *endpoint = (CAEndpoint_t *)OICCalloc(1, sizeof (CAEndpoint_t));
- VERIFY_NOT_NULL(TAG, endpoint, FATAL);
- memcpy(endpoint,&dpairData->peer->endpoint,sizeof(CAEndpoint_t));
- endpoint->port = dpairData->peer->securePort;
- OIC_LOG_V(INFO, TAG, "Initiate DTLS handshake to %s(%d)", endpoint->addr,
- endpoint->port);
-
- caresult = CAInitiateHandshake(endpoint);
- OICFree(endpoint);
+ CAEndpoint_t endpoint;
+ CopyDevAddrToEndpoint(&dpairData->peer->endpoint, &endpoint);
+ endpoint.port = dpairData->peer->securePort;
+ OIC_LOG_V(INFO, TAG, "Initiate DTLS handshake to %s(%d)", endpoint.addr,
+ endpoint.port);
+ caresult = CAInitiateHandshake(&endpoint);
VERIFY_SUCCESS(TAG, CA_STATUS_OK == caresult, ERROR);
#endif // __WITH_DTLS__ or __WITH_TLS__
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
}
-void InitCipherSuiteList(bool * list)
+void InitCipherSuiteList(bool * list, const char* deviceId)
{
OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
if (NULL == list)
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
return;
}
- InitCipherSuiteListInternal(list, TRUST_CA);
+ InitCipherSuiteListInternal(list, TRUST_CA, deviceId);
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
}
-void InitManufacturerCipherSuiteList(bool * list)
+void InitManufacturerCipherSuiteList(bool * list, const char* deviceId)
{
OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
if (NULL == list)
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
return;
}
- InitCipherSuiteListInternal(list, MF_TRUST_CA);
+ InitCipherSuiteListInternal(list, MF_TRUST_CA, deviceId);
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
}
static char DISCOVERY_QUERY[] = "%s/oic/res";
OCConnectivityType discoveryReqConnType = CT_ADAPTER_IP;
-static OCDevAddr endpoint;
static std::string coapServerResource;
static int coapSecureResource;
OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
ocConnType = clientResponse->connType;
- endpoint = clientResponse->devAddr;
if (parseClientResponse(clientResponse) != -1)
{
switch (TestCase)
{
case TEST_NON_CON_OP:
- InitGetRequest(OC_LOW_QOS);
- InitPutRequest(OC_LOW_QOS);
- InitPostRequest(OC_LOW_QOS);
+ InitGetRequest(&clientResponse->devAddr, OC_LOW_QOS);
+ InitPutRequest(&clientResponse->devAddr, OC_LOW_QOS);
+ InitPostRequest(&clientResponse->devAddr, OC_LOW_QOS);
break;
case TEST_CON_OP:
- InitGetRequest(OC_HIGH_QOS);
- InitPutRequest(OC_HIGH_QOS);
- InitPostRequest(OC_HIGH_QOS);
+ InitGetRequest(&clientResponse->devAddr, OC_HIGH_QOS);
+ InitPutRequest(&clientResponse->devAddr, OC_HIGH_QOS);
+ InitPostRequest(&clientResponse->devAddr, OC_HIGH_QOS);
break;
}
}
return (UnicastDiscovery) ? OC_STACK_DELETE_TRANSACTION : OC_STACK_KEEP_TRANSACTION ;
}
-int InitPutRequest(OCQualityOfService qos)
+int InitPutRequest(OCDevAddr *endpoint, OCQualityOfService qos)
{
OIC_LOG_V(INFO, TAG, "Executing %s", __func__);
std::ostringstream query;
query << coapServerResource;
- if (WithTcp)
- {
- endpoint.adapter = OC_ADAPTER_TCP;
- }
- endpoint.flags = (OCTransportFlags)(endpoint.flags | OC_SECURE);
- return (InvokeOCDoResource(query, OC_REST_PUT, &endpoint,
+
+ return (InvokeOCDoResource(query, OC_REST_PUT, endpoint,
((qos == OC_HIGH_QOS) ? OC_HIGH_QOS : OC_LOW_QOS), putReqCB, NULL, 0));
}
-int InitPostRequest(OCQualityOfService qos)
+int InitPostRequest(OCDevAddr *endpoint, OCQualityOfService qos)
{
OCStackResult result;
std::ostringstream query;
query << coapServerResource;
- if (WithTcp)
- {
- endpoint.adapter = OC_ADAPTER_TCP;
- }
- endpoint.flags = (OCTransportFlags)(endpoint.flags | OC_SECURE);
-
// First POST operation (to create an LED instance)
- result = InvokeOCDoResource(query, OC_REST_POST, &endpoint,
+ result = InvokeOCDoResource(query, OC_REST_POST, endpoint,
((qos == OC_HIGH_QOS) ? OC_HIGH_QOS : OC_LOW_QOS),
postReqCB, NULL, 0);
if (OC_STACK_OK != result)
}
// Second POST operation (to create an LED instance)
- result = InvokeOCDoResource(query, OC_REST_POST, &endpoint,
+ result = InvokeOCDoResource(query, OC_REST_POST, endpoint,
((qos == OC_HIGH_QOS) ? OC_HIGH_QOS : OC_LOW_QOS),
postReqCB, NULL, 0);
if (OC_STACK_OK != result)
// This POST operation will update the original resourced /a/led (as long as
// the server is set to max 2 /lcd resources)
- result = InvokeOCDoResource(query, OC_REST_POST, &endpoint,
+ result = InvokeOCDoResource(query, OC_REST_POST, endpoint,
((qos == OC_HIGH_QOS) ? OC_HIGH_QOS : OC_LOW_QOS),
postReqCB, NULL, 0);
if (OC_STACK_OK != result)
return result;
}
-int InitGetRequest(OCQualityOfService qos)
+int InitGetRequest(OCDevAddr *endpoint, OCQualityOfService qos)
{
OIC_LOG_V(INFO, TAG, "Executing %s", __func__);
std::ostringstream query;
query << coapServerResource;
- if (WithTcp)
- {
- endpoint.adapter = OC_ADAPTER_TCP;
- }
- endpoint.flags = (OCTransportFlags)(endpoint.flags | OC_SECURE);
- return (InvokeOCDoResource(query, OC_REST_GET, &endpoint,
+ return (InvokeOCDoResource(query, OC_REST_GET, endpoint,
((qos == OC_HIGH_QOS) ? OC_HIGH_QOS : OC_LOW_QOS),
getReqCB, NULL, 0));
}
res = res->next;
continue;
}
+ OCDevAddr *endpoint = &clientResponse->devAddr;
+ if (WithTcp)
+ {
+#ifdef TCP_ADAPTER
+ endpoint->adapter = OC_ADAPTER_TCP;
+#endif
+ }
if (res->secure)
{
+ endpoint->flags = (OCTransportFlags)(endpoint->flags | OC_SECURE);
if (WithTcp)
{
#ifdef TCP_ADAPTER
OIC_LOG_V(INFO, TAG, "SECUREPORT tcp: %d", res->tcpPort);
- endpoint.port = res->tcpPort;
+ endpoint->port = res->tcpPort;
#endif
}
else
{
OIC_LOG_V(INFO, TAG, "SECUREPORT udp: %d", res->port);
- endpoint.port = res->port;
+ endpoint->port = res->port;
}
coapSecureResource = 1;
}
/* Following are initialization functions for GET, PUT
* POST & Discovery operations
*/
-int InitPutRequest(OCQualityOfService qos);
-int InitGetRequest(OCQualityOfService qos);
-int InitPostRequest(OCQualityOfService qos);
+int InitPutRequest(OCDevAddr *endpoint, OCQualityOfService qos);
+int InitGetRequest(OCDevAddr *endpoint, OCQualityOfService qos);
+int InitPostRequest(OCDevAddr *endpoint, OCQualityOfService qos);
int InitDiscovery();
/* Function to retrieve ip address, port no. of the server
out->adapter = (OCTransportAdapter)in->adapter;
out->flags = CAToOCTransportFlags(in->flags);
OICStrcpy(out->addr, sizeof(out->addr), in->addr);
+ OICStrcpy(out->remoteId, sizeof(out->remoteId), in->remoteId);
out->port = in->port;
out->ifindex = in->ifindex;
#if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
entry->mode = mode;
entry->timeStamp = OICGetCurrentTime(TIME_IN_US);
- entry->remoteAddr.adapter = endpoint->adapter;
- entry->remoteAddr.flags = endpoint->flags;
- entry->remoteAddr.ifindex = endpoint->ifindex;
- entry->remoteAddr.port = endpoint->port;
- strncpy(entry->remoteAddr.addr, endpoint->addr, sizeof(entry->remoteAddr.addr));
-
+ entry->remoteAddr = *endpoint;
entry->intervalSize = DEFAULT_INTERVAL_COUNT;
entry->intervalInfo = intervalInfo;
if (!entry->intervalInfo)