Commit 2ef6dbad authored by jihwan.seo's avatar jihwan.seo Committed by Jon A. Cruz

replaced OC_LOG with OIC_LOG in security

Change-Id: I38ba90586d9ea5fb978c2a1cc8a925dbf1e59f9c
Signed-off-by: default avatarjihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4861Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarJon A. Cruz <jonc@osg.samsung.com>
parent 7dd09424
......@@ -65,7 +65,7 @@ struct OicParseQueryIter
*
*/
#define VERIFY_SUCCESS(tag, op, logLevel) do{ if (!(op)) \
{OC_LOG((logLevel), tag, #op " failed!!"); goto exit; } }while(0)
{OIC_LOG((logLevel), tag, #op " failed!!"); goto exit; } }while(0)
/**
* @def VERIFY_NON_NULL
......@@ -75,7 +75,7 @@ struct OicParseQueryIter
*
*/
#define VERIFY_NON_NULL(tag, arg, logLevel) do{ if (NULL == (arg)) \
{ OC_LOG((logLevel), tag, #arg " is NULL"); goto exit; } }while(0)
{ OIC_LOG((logLevel), tag, #arg " is NULL"); goto exit; } }while(0)
/**
* This method initializes the OicParseQueryIter_t struct
......
......@@ -98,7 +98,7 @@ int parseClientResponse(OCClientResponse * clientResponse)
while (res)
{
coapServerResource.assign(res->uri);
OC_LOG_V(INFO, TAG, "Uri -- %s", coapServerResource.c_str());
OIC_LOG_V(INFO, TAG, "Uri -- %s", coapServerResource.c_str());
if (res->secure)
{
......@@ -106,7 +106,7 @@ int parseClientResponse(OCClientResponse * clientResponse)
coapSecureResource = 1;
}
OC_LOG_V(INFO, TAG, "Secure -- %s", coapSecureResource == 1 ? "YES" : "NO");
OIC_LOG_V(INFO, TAG, "Secure -- %s", coapSecureResource == 1 ? "YES" : "NO");
// If we discovered a secure resource, exit from here
if (coapSecureResource)
......@@ -125,7 +125,7 @@ OCRepPayload* getPayload(const char* uri, int64_t state, char* openDuration, boo
OCRepPayload* payload = OCRepPayloadCreate();
if (!payload)
{
OC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
OIC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
return nullptr;
}
......@@ -142,7 +142,7 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest)
{
if(ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
{
OC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
OIC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
return nullptr;
}
......@@ -171,7 +171,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
OCEntityHandlerRequest *entityHandlerRequest,
void* /*callbackParam*/)
{
OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
OIC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
OCEntityHandlerResult ehResult = OC_EH_ERROR;
OCEntityHandlerResponse response;
......@@ -179,7 +179,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
// Validate pointer
if (!entityHandlerRequest)
{
OC_LOG (ERROR, TAG, "Invalid request pointer");
OIC_LOG (ERROR, TAG, "Invalid request pointer");
return OC_EH_ERROR;
}
......@@ -187,7 +187,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
if (flag & OC_REQUEST_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
OIC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
if (entityHandlerRequest)
{
......@@ -195,13 +195,13 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
{
case OC_REST_GET:
{
OC_LOG (INFO, TAG, "Received OC_REST_GET from client");
OIC_LOG (INFO, TAG, "Received OC_REST_GET from client");
ehResult = ProcessGetRequest (entityHandlerRequest, &payload);
}
break;
default:
{
OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
entityHandlerRequest->method);
ehResult = OC_EH_ERROR;
}
......@@ -224,7 +224,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
// Send the response
if (OCDoResponse(&response) != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "Error sending response");
OIC_LOG(ERROR, TAG, "Error sending response");
ehResult = OC_EH_ERROR;
}
}
......@@ -331,7 +331,7 @@ int createDoorResource (const char *uri, DoorResource *doorResource)
{
if (!uri)
{
OC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
OIC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
}
......@@ -347,7 +347,7 @@ int createDoorResource (const char *uri, DoorResource *doorResource)
NULL,
OC_DISCOVERABLE | OC_OBSERVABLE | OC_SECURE);
OC_LOG_V(INFO, TAG, "Created Door resource with result: %s", getResult(res));
OIC_LOG_V(INFO, TAG, "Created Door resource with result: %s", getResult(res));
return 0;
}
......@@ -355,17 +355,17 @@ OCStackApplicationResult putReqCB(void * ctx, OCDoHandle /*handle*/, OCClientRes
{
if (ctx == (void *)DEFAULT_CONTEXT_VALUE)
{
OC_LOG(INFO, TAG, "Callback Context for PUT recvd successfully");
OIC_LOG(INFO, TAG, "Callback Context for PUT recvd successfully");
}
if (clientResponse)
{
OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
OC_LOG_PAYLOAD(INFO, clientResponse->payload);
OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
if ((OCSecurityPayload*)clientResponse->payload)
{
OC_LOG_V(INFO, TAG, "=============> Put Response",
OIC_LOG_V(INFO, TAG, "=============> Put Response",
((OCSecurityPayload*)clientResponse->payload)->securityData);
}
}
......@@ -374,16 +374,16 @@ OCStackApplicationResult putReqCB(void * ctx, OCDoHandle /*handle*/, OCClientRes
OCStackApplicationResult getReqCB(void * /*ctx*/, OCDoHandle /*handle*/, OCClientResponse *clientResponse)
{
OC_LOG(INFO, TAG, "Callback Context for GET query recvd successfully");
OIC_LOG(INFO, TAG, "Callback Context for GET query recvd successfully");
if (clientResponse)
{
OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
OC_LOG_PAYLOAD(INFO, clientResponse->payload);
OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
if ((OCSecurityPayload*)clientResponse->payload)
{
OC_LOG(INFO, TAG, PCF("=============> Get Response"));
OIC_LOG(INFO, TAG, PCF("=============> Get Response"));
}
}
return OC_STACK_DELETE_TRANSACTION;
......@@ -393,19 +393,19 @@ OCStackApplicationResult getReqCB(void * /*ctx*/, OCDoHandle /*handle*/, OCClien
OCStackApplicationResult discoveryReqCB(void* /*ctx*/, OCDoHandle /*handle*/,
OCClientResponse * clientResponse)
{
OC_LOG(INFO, TAG, "Callback Context for DISCOVER query recvd successfully");
OIC_LOG(INFO, TAG, "Callback Context for DISCOVER query recvd successfully");
if (clientResponse)
{
OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OC_LOG_V(INFO, TAG,
OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OIC_LOG_V(INFO, TAG,
"Device =============> Discovered @ %s:%d",
clientResponse->devAddr.addr,
clientResponse->devAddr.port);
if (clientResponse->result == OC_STACK_OK)
{
OC_LOG_PAYLOAD(INFO, clientResponse->payload);
OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
ocConnType = clientResponse->connType;
parseClientResponse(clientResponse);
}
......@@ -422,9 +422,9 @@ void initAddress()
static bool initFlag = false;
if (!initFlag)
{
OC_LOG(INFO, TAG, "Enter IP address (with optional port) of the Server hosting resource\n");
OC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
OC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
OIC_LOG(INFO, TAG, "Enter IP address (with optional port) of the Server hosting resource\n");
OIC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
OIC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
std::cin >> address;
}
......@@ -435,7 +435,7 @@ void initAddress()
void SendGetRequest()
{
OCStackResult ret;
OC_LOG(INFO, TAG, "Send Get REQ to Light server");
OIC_LOG(INFO, TAG, "Send Get REQ to Light server");
initAddress();
......@@ -445,13 +445,13 @@ void SendGetRequest()
cbData.cb = getReqCB;
cbData.context = (void *)DEFAULT_CONTEXT_VALUE;
cbData.cd = NULL;
OC_LOG_V(INFO, TAG, "Get payload from Door sample = /a/light ");
OIC_LOG_V(INFO, TAG, "Get payload from Door sample = /a/light ");
snprintf(szQueryUri, sizeof(szQueryUri), "coaps://%s/a/light", const_cast<char*> (address.c_str())); // lightPortNu);
ret = OCDoResource(&handle, OC_REST_GET, szQueryUri, 0, NULL, ocConnType, OC_LOW_QOS,
&cbData, NULL, 0);
if (ret != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack resource error");
OIC_LOG(ERROR, TAG, "OCStack resource error");
}
}
......@@ -477,7 +477,7 @@ void *input_function(void * /*data*/)
case 'd':
if (isUpdated == false)
{
OC_LOG(INFO, TAG, "isUpdated is false...");
OIC_LOG(INFO, TAG, "isUpdated is false...");
OCDoResource(&handle, OC_REST_DISCOVER, szQueryUri, 0, 0, CT_DEFAULT, OC_LOW_QOS, &cbData, NULL, 0);
}
......@@ -487,7 +487,7 @@ void *input_function(void * /*data*/)
isUpdated = true;
if (isUpdated == true)
{
OC_LOG(INFO, TAG, "isUpdated is true...");
OIC_LOG(INFO, TAG, "isUpdated is true...");
SendGetRequest();
}
break;
......@@ -503,22 +503,22 @@ void *input_function(void * /*data*/)
static void PrintUsage()
{
OC_LOG(INFO, TAG, "*******************************************");
OC_LOG(INFO, TAG, "Input D or d to discover Resources");
OC_LOG(INFO, TAG, "Input G or g to initiate Get Request");
OC_LOG(INFO, TAG, "Input Q or q to exit");
OC_LOG(INFO, TAG, "*******************************************");
OIC_LOG(INFO, TAG, "*******************************************");
OIC_LOG(INFO, TAG, "Input D or d to discover Resources");
OIC_LOG(INFO, TAG, "Input G or g to initiate Get Request");
OIC_LOG(INFO, TAG, "Input Q or q to exit");
OIC_LOG(INFO, TAG, "*******************************************");
}
int main()
{
OC_LOG(INFO, TAG, "OCServer is starting...");
OIC_LOG(INFO, TAG, "OCServer is starting...");
SetPersistentHandler(&ps);
//PrintUsage();
if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack init error");
OIC_LOG(ERROR, TAG, "OCStack init error");
return 0;
}
......@@ -536,14 +536,14 @@ int main()
timeout.tv_nsec = 100000000L;
// Break from loop with Ctrl-C
OC_LOG(INFO, TAG, "Entering ocserver main loop...");
OIC_LOG(INFO, TAG, "Entering ocserver main loop...");
signal(SIGINT, handleSigInt);
int thr_id;
pthread_t p_thread;
thr_id = pthread_create(&p_thread, NULL, input_function, (void *)NULL);
if (thr_id < 0)
{
OC_LOG(ERROR, TAG, "create thread error");
OIC_LOG(ERROR, TAG, "create thread error");
return 0;
}
......@@ -552,7 +552,7 @@ int main()
if (OCProcess() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
return 0;
}
......@@ -562,11 +562,11 @@ int main()
pthread_join(p_thread, NULL);
OC_LOG(INFO, TAG, "Exiting ocserver main loop...");
OIC_LOG(INFO, TAG, "Exiting ocserver main loop...");
if (OCStop() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
}
return 0;
......
......@@ -61,7 +61,7 @@ OCRepPayload* getPayload(const char* uri, int64_t brightness)
OCRepPayload* payload = OCRepPayloadCreate();
if(!payload)
{
OC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
OIC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
return nullptr;
}
......@@ -81,7 +81,7 @@ OCRepPayload* constructResponse(OCEntityHandlerRequest *ehRequest)
if(ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
{
OC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
OIC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
return nullptr;
}
......@@ -109,7 +109,7 @@ OCEntityHandlerResult OCEntityHandlerCb (OCEntityHandlerFlag flag,
OCEntityHandlerRequest *entityHandlerRequest,
void* /*callbackParam*/)
{
OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
OIC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
OCEntityHandlerResult ehResult = OC_EH_ERROR;
OCEntityHandlerResponse response;
......@@ -117,7 +117,7 @@ OCEntityHandlerResult OCEntityHandlerCb (OCEntityHandlerFlag flag,
// Validate pointer
if (!entityHandlerRequest)
{
OC_LOG (ERROR, TAG, "Invalid request pointer");
OIC_LOG (ERROR, TAG, "Invalid request pointer");
return OC_EH_ERROR;
}
......@@ -125,20 +125,20 @@ OCEntityHandlerResult OCEntityHandlerCb (OCEntityHandlerFlag flag,
if (flag & OC_REQUEST_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
OIC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
if (entityHandlerRequest)
{
switch(entityHandlerRequest->method)
{
case OC_REST_GET:
{
OC_LOG (INFO, TAG, "Received OC_REST_GET from client");
OIC_LOG (INFO, TAG, "Received OC_REST_GET from client");
ehResult = ProcessGetRequest (entityHandlerRequest, &payload);
}
break;
default:
{
OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
entityHandlerRequest->method);
ehResult = OC_EH_ERROR;
}
......@@ -161,7 +161,7 @@ OCEntityHandlerResult OCEntityHandlerCb (OCEntityHandlerFlag flag,
// Send the response
if (OCDoResponse(&response) != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "Error sending response");
OIC_LOG(ERROR, TAG, "Error sending response");
ehResult = OC_EH_ERROR;
}
}
......@@ -270,7 +270,7 @@ int createLightResource (const char *uri, LightResource *lightResource)
{
if (!uri)
{
OC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
OIC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
}
......@@ -283,18 +283,18 @@ int createLightResource (const char *uri, LightResource *lightResource)
NULL,
OC_DISCOVERABLE|OC_OBSERVABLE | OC_SECURE);
OC_LOG_V(INFO, TAG, "Created Light resource with result: %s", getResult(res));
OIC_LOG_V(INFO, TAG, "Created Light resource with result: %s", getResult(res));
return 0;
}
int main()
{
OC_LOG(DEBUG, TAG, "OCServer is starting...");
OIC_LOG(DEBUG, TAG, "OCServer is starting...");
SetPersistentHandler(&ps);
if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack init error");
OIC_LOG(ERROR, TAG, "OCStack init error");
return 0;
}
......@@ -310,24 +310,24 @@ int main()
timeout.tv_nsec = 100000000L;
// Break from loop with Ctrl-C
OC_LOG(INFO, TAG, "Entering ocserver main loop...");
OIC_LOG(INFO, TAG, "Entering ocserver main loop...");
signal(SIGINT, handleSigInt);
while (!gQuitFlag)
{
if (OCProcess() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
return 0;
}
nanosleep(&timeout, NULL);
}
OC_LOG(INFO, TAG, "Exiting ocserver main loop...");
OIC_LOG(INFO, TAG, "Exiting ocserver main loop...");
if (OCStop() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
}
return 0;
......
......@@ -222,7 +222,7 @@ static int InputACL(OicSecAcl_t *acl)
acl->resources = (char **)OICCalloc(acl->resourcesLen, sizeof(char *));
if (NULL == acl->resources)
{
OC_LOG(ERROR, TAG, "Error while memory allocation");
OIC_LOG(ERROR, TAG, "Error while memory allocation");
return -1;
}
for (size_t i = 0; i < acl->resourcesLen; i++)
......@@ -244,7 +244,7 @@ static int InputACL(OicSecAcl_t *acl)
if (NULL == acl->resources[i])
{
OC_LOG(ERROR, TAG, "Error while memory allocation");
OIC_LOG(ERROR, TAG, "Error while memory allocation");
return -1;
}
}
......@@ -277,7 +277,7 @@ static int InputACL(OicSecAcl_t *acl)
acl->owners = (OicUuid_t *)OICCalloc(acl->ownersLen, sizeof(OicUuid_t));
if (NULL == acl->owners)
{
OC_LOG(ERROR, TAG, "Error while memory allocation");
OIC_LOG(ERROR, TAG, "Error while memory allocation");
return -1;
}
for (size_t i = 0; i < acl->ownersLen; i++)
......@@ -493,12 +493,12 @@ int main()
if (OC_STACK_OK != OCInit(NULL, 0, OC_CLIENT_SERVER))
{
OC_LOG(ERROR, TAG, "OCStack init error");
OIC_LOG(ERROR, TAG, "OCStack init error");
goto error;
}
if(OC_STACK_OK != OCInitPM(PRVN_DB_FILE_NAME))
{
OC_LOG(ERROR, TAG, "OC_PM init error");
OIC_LOG(ERROR, TAG, "OC_PM init error");
goto error;
}
......@@ -506,7 +506,7 @@ int main()
res = OCDiscoverUnownedDevices(PREDEFINED_TIMEOUT, &pDeviceList);
if(OC_STACK_OK != res)
{
OC_LOG_V(ERROR, TAG, "Failed to PMDeviceDiscovery : %d", res);
OIC_LOG_V(ERROR, TAG, "Failed to PMDeviceDiscovery : %d", res);
goto error;
}
......@@ -538,11 +538,11 @@ int main()
res = OCDoOwnershipTransfer((void*)myContext, pDeviceList, OwnershipTransferCB);
if(OC_STACK_OK == res)
{
OC_LOG(INFO, TAG, "Request for ownership transfer is sent successfully.");
OIC_LOG(INFO, TAG, "Request for ownership transfer is sent successfully.");
}
else
{
OC_LOG_V(ERROR, TAG, "Failed to OCDoOwnershipTransfer : %d", res);
OIC_LOG_V(ERROR, TAG, "Failed to OCDoOwnershipTransfer : %d", res);
}
gOwnershipState = 0;
......@@ -550,7 +550,7 @@ int main()
{
if (OCProcess() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
goto error;
}
sleep(1);
......@@ -581,7 +581,7 @@ int main()
}
else
{
OC_LOG(ERROR, TAG, "Error while Owned Device Discovery");
OIC_LOG(ERROR, TAG, "Error while Owned Device Discovery");
}
int Device1 = 0;
......@@ -597,13 +597,13 @@ int main()
gAcl = (OicSecAcl_t *)OICCalloc(1,sizeof(OicSecAcl_t));
if (NULL == gAcl)
{
OC_LOG(ERROR, TAG, "Error while memory allocation");
OIC_LOG(ERROR, TAG, "Error while memory allocation");
goto error;
}
if (PKI_SUCCESS != InitCA())
{
OC_LOG(ERROR, TAG, "CA init error");
OIC_LOG(ERROR, TAG, "CA init error");
goto error;
}
......@@ -612,13 +612,13 @@ int main()
res = OCProvisionCredentials(ctx, SIGNED_ASYMMETRIC_KEY, 0, pOwnedDevices[Device1],
NULL, ProvisionCertCB);
if (OC_STACK_OK != res) OC_LOG_V(ERROR, TAG, "Failed to provision Device 1 : %d", res);
if (OC_STACK_OK != res) OIC_LOG_V(ERROR, TAG, "Failed to provision Device 1 : %d", res);
gOwnershipState = 0;
while ( gOwnershipState == 0 )
{
if (OCProcess() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
goto error;
}
sleep(1);
......@@ -628,7 +628,7 @@ int main()
NULL, ProvisionCertCB);
if (OC_STACK_OK != res)
{
OC_LOG_V(ERROR, TAG, "Failed to provision Device 2 : %d", res);
OIC_LOG_V(ERROR, TAG, "Failed to provision Device 2 : %d", res);
}
gOwnershipState = 0;
......@@ -636,7 +636,7 @@ int main()
{
if (OCProcess() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
goto error;
}
sleep(1);
......@@ -649,13 +649,13 @@ int main()
}
else
{
OC_LOG(ERROR, TAG, "InputACL error");
OIC_LOG(ERROR, TAG, "InputACL error");
goto error;
}
res = OCProvisionACL(ctx, pOwnedDevices[Device2], gAcl, &ProvisionAclCB);
if (OC_STACK_OK != res)
{
OC_LOG_V(ERROR, TAG, "Failed to ACL provision Device 2 : %d", res);
OIC_LOG_V(ERROR, TAG, "Failed to ACL provision Device 2 : %d", res);
}
gOwnershipState = 0;
......@@ -663,7 +663,7 @@ int main()
{
if (OCProcess() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
goto error;
}
sleep(1);
......@@ -671,21 +671,21 @@ int main()
gCrl = (OicSecCrl_t *)OICMalloc(sizeof(OicSecCrl_t));
if (PKI_SUCCESS != InputCRL(gCrl))
{
OC_LOG(ERROR, TAG, "CA init error");
OIC_LOG(ERROR, TAG, "CA init error");
goto error;
}
PRINT_BYTE_ARRAY("gCrl = \n", gCrl->CrlData);
res = OCProvisionCRL(ctx, pOwnedDevices[Device2], gCrl, &ProvisionCrlCB);
if (OC_STACK_OK != res) OC_LOG_V(ERROR, TAG, "Failed to CRL provision Device 2 : %d", res);
if (OC_STACK_OK != res) OIC_LOG_V(ERROR, TAG, "Failed to CRL provision Device 2 : %d", res);
gOwnershipState = 0;
while (gOwnershipState == 0)
{
if (OCProcess() !=