size_t i;
if(NULL == ace)
{
- OC_LOG (INFO, TAG, "Invalid Parameter");
+ OC_LOG (ERROR, TAG, "Invalid Parameter");
return;
}
static OCStackResult RemoveACE(const OicUuid_t * subject,
const char * resource)
{
- OC_LOG(INFO, TAG, "IN RemoveACE");
+ OC_LOG(DEBUG, TAG, "IN RemoveACE");
OicSecAcl_t *acl = NULL;
OicSecAcl_t *tempAcl = NULL;
if(memcmp(subject->id, &WILDCARD_SUBJECT_ID, sizeof(subject->id)) == 0)
{
- OC_LOG_V (INFO, TAG, "%s received invalid parameter", __func__ );
+ OC_LOG_V (ERROR, TAG, "%s received invalid parameter", __func__ );
return OC_STACK_INVALID_PARAM;
}
// Process the REST querystring parameters
if(ehRequest->query)
{
- OC_LOG (INFO, TAG, "HandleACLGetRequest processing query");
+ OC_LOG (DEBUG, TAG, "HandleACLGetRequest processing query");
OicUuid_t subject = {.id={0}};
char resource[MAX_URI_LENGTH] = {0};
OICFree(jsonStr);
- OC_LOG_V (INFO, TAG, "%s RetVal %d", __func__ , ehRet);
+ OC_LOG_V (DEBUG, TAG, "%s RetVal %d", __func__ , ehRet);
return ehRet;
}
// Send payload to request originator
SendSRMResponse(ehRequest, ehRet, NULL);
- OC_LOG_V (INFO, TAG, "%s RetVal %d", __func__ , ehRet);
+ OC_LOG_V (DEBUG, TAG, "%s RetVal %d", __func__ , ehRet);
return ehRet;
}
static OCEntityHandlerResult HandleACLDeleteRequest(const OCEntityHandlerRequest *ehRequest)
{
- OC_LOG (INFO, TAG, "Processing ACLDeleteRequest");
+ OC_LOG (DEBUG, TAG, "Processing ACLDeleteRequest");
OCEntityHandlerResult ehRet = OC_EH_ERROR;
OicUuid_t subject = {.id={0}};
char resource[MAX_URI_LENGTH] = {0};
OCEntityHandlerRequest * ehRequest,
void* callbackParameter)
{
- OC_LOG(INFO, TAG, "Received request ACLEntityHandler");
+ OC_LOG(DEBUG, TAG, "Received request ACLEntityHandler");
(void)callbackParameter;
OCEntityHandlerResult ehRet = OC_EH_ERROR;
if (flag & OC_REQUEST_FLAG)
{
// TODO : Handle PUT method
- OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+ OC_LOG (DEBUG, TAG, "Flag includes OC_REQUEST_FLAG");
switch (ehRequest->method)
{
case OC_REST_GET:
OICFree(jsonStr);
- OC_LOG_V (INFO, TAG, "%s RetVal %d", __func__ , ehRet);
+ OC_LOG_V (DEBUG, TAG, "%s RetVal %d", __func__ , ehRet);
return ehRet;
}
// Send payload to request originator
SendSRMResponse(ehRequest, ehRet, NULL);
- OC_LOG_V (INFO, TAG, "%s RetVal %d", __func__ , ehRet);
+ OC_LOG_V (DEBUG, TAG, "%s RetVal %d", __func__ , ehRet);
return ehRet;
}
if (flag & OC_REQUEST_FLAG)
{
- OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+ OC_LOG (DEBUG, TAG, "Flag includes OC_REQUEST_FLAG");
switch (ehRequest->method)
{
case OC_REST_GET:
{
if(NULL == cred)
{
- OC_LOG (INFO, TAG, "Invalid Parameter");
+ OC_LOG (ERROR, TAG, "Invalid Parameter");
return;
}
//Note: Need further clarification on roleID data type
static OCEntityHandlerResult HandleDeleteRequest(const OCEntityHandlerRequest *ehRequest)
{
- OC_LOG(INFO, TAG, "Processing CredDeleteRequest");
+ OC_LOG(DEBUG, TAG, "Processing CredDeleteRequest");
OCEntityHandlerResult ehRet = OC_EH_ERROR;
}
if (flag & OC_REQUEST_FLAG)
{
- OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+ OC_LOG (DEBUG, TAG, "Flag includes OC_REQUEST_FLAG");
//TODO : Handle PUT/DEL methods
switch(ehRequest->method)
{
// access rules. Eventually, the PE and PM code will
// not send a request to the /doxm Entity Handler at all
// if it should not respond.
- OC_LOG (INFO, TAG, "In ValidateQuery");
+ OC_LOG (DEBUG, TAG, "In ValidateQuery");
if(NULL == gDoxm)
{
return false;
char* jsonStr = NULL;
OCEntityHandlerResult ehRet = OC_EH_OK;
- OC_LOG (INFO, TAG, "Doxm EntityHandle processing GET request");
+ OC_LOG (DEBUG, TAG, "Doxm EntityHandle processing GET request");
//Checking if Get request is a query.
if(ehRequest->query)
{
- OC_LOG (INFO, TAG, "HandleDoxmGetRequest processing query");
+ OC_LOG (DEBUG, TAG, "HandleDoxmGetRequest processing query");
if(!ValidateQuery(ehRequest->query))
{
ehRet = OC_EH_ERROR;
sizeof(base64Buff), &outLen);
VERIFY_SUCCESS(TAG, b64Ret == B64_OK, ERROR);
- OC_LOG (INFO, TAG, "Doxm EntityHandle generating Credential");
+ OC_LOG (DEBUG, TAG, "Doxm EntityHandle generating Credential");
cred = GenerateCredential(&ptDoxm->owner, SYMMETRIC_PAIR_WISE_KEY,
NULL, base64Buff, ownLen, &ptDoxm->owner);
VERIFY_NON_NULL(TAG, cred, ERROR);
static OCEntityHandlerResult HandleDoxmPutRequest (const OCEntityHandlerRequest * ehRequest)
{
- OC_LOG (INFO, TAG, "Doxm EntityHandle processing PUT request");
+ OC_LOG (DEBUG, TAG, "Doxm EntityHandle processing PUT request");
OCEntityHandlerResult ehRet = OC_EH_ERROR;
OicUuid_t emptyOwner = {.id = {0}};
{
#ifdef __WITH_DTLS__
CAEnableAnonECDHCipherSuite(false);
- OC_LOG(DEBUG, TAG, "ECDH_ANON CipherSuite is DISABLED");
+ OC_LOG(INFO, TAG, "ECDH_ANON CipherSuite is DISABLED");
CASelectCipherSuite(TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA_256);
char ranPin[OXM_RANDOM_PIN_SIZE + 1] = {0,};
{
if(tmpCredGenFlag)
{
- OC_LOG(DEBUG, TAG, "Corrupted PSK is detected!!!");
+ OC_LOG(INFO, TAG, "Corrupted PSK is detected!!!");
VERIFY_SUCCESS(TAG,
OC_STACK_RESOURCE_DELETED == RemoveCredential(&tmpCredId),
ERROR);
if (flag & OC_REQUEST_FLAG)
{
- OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+ OC_LOG (DEBUG, TAG, "Flag includes OC_REQUEST_FLAG");
switch (ehRequest->method)
{
case OC_REST_GET:
*/
static OicSecDoxm_t* GetDoxmDefault()
{
- OC_LOG (INFO, TAG, "GetDoxmToDefault");
+ OC_LOG (DEBUG, TAG, "GetDoxmToDefault");
return &gDefaultDoxm;
}
return true;
}
}
- OC_LOG(INFO, TAG, "Access request is in invalid time period");
+ OC_LOG(ERROR, TAG, "Access request is in invalid time period");
return false;
#else
*/
void ProcessAccessRequest(PEContext_t *context)
{
- OC_LOG(INFO, TAG, "Entering ProcessAccessRequest()");
+ OC_LOG(DEBUG, TAG, "Entering ProcessAccessRequest()");
if(NULL != context)
{
const OicSecAcl_t *currentAcl = NULL;
// ACL for this request.
do
{
- OC_LOG_V(INFO, TAG, "%s: getting ACL..." ,__func__);
+ OC_LOG_V(DEBUG, TAG, "%s: getting ACL..." ,__func__);
currentAcl = GetACLResourceData(&context->subject, &savePtr);
if(NULL != currentAcl)
{
// Found the subject, so how about resource?
- OC_LOG_V(INFO, TAG, "%s:found ACL matching subject" ,__func__);
+ OC_LOG_V(DEBUG, TAG, "%s:found ACL matching subject" ,__func__);
// Subject was found, so err changes to Rsrc not found for now.
context->retVal = ACCESS_DENIED_RESOURCE_NOT_FOUND;
- OC_LOG_V(INFO, TAG, "%s:Searching for resource..." ,__func__);
+ OC_LOG_V(DEBUG, TAG, "%s:Searching for resource..." ,__func__);
if(IsResourceInAcl(context->resource, currentAcl))
{
OC_LOG_V(INFO, TAG, "%s:found matching resource in ACL" ,__func__);
}
else
{
- OC_LOG_V(INFO, TAG, "%s:Leaving ProcessAccessRequest(context is NULL)", __func__);
+ OC_LOG_V(ERROR, TAG, "%s:Leaving ProcessAccessRequest(context is NULL)", __func__);
}
}
size_t bytesRead = ps->read(jsonStr, 1, size, fp);
jsonStr[bytesRead] = '\0';
- OC_LOG_V(INFO, TAG, "Read %d bytes from SVR database file", bytesRead);
+ OC_LOG_V(DEBUG, TAG, "Read %d bytes from SVR database file", bytesRead);
ps->close(fp);
fp = NULL;
}
ACL, PStat & Doxm resources at least have default entries in the database but
Cred resource may have no entries. The first cred resource entry (for provisioning tool)
is created when the device is owned by provisioning tool and it's ownerpsk is generated.*/
- if((strcmp(rsrcName, OIC_JSON_CRED_NAME) == 0 || strcmp(rsrcName, OIC_JSON_CRL_NAME) == 0)
+ if((strcmp(rsrcName, OIC_JSON_CRED_NAME) == 0 || strcmp(rsrcName, OIC_JSON_CRL_NAME) == 0)
&& (!jsonObj))
{
// Add the fist cred object in existing SVR database json
{
ret = OC_STACK_OK;
}
- OC_LOG_V(INFO, TAG, "Written %d bytes into SVR database file", bytesWritten);
+ OC_LOG_V(DEBUG, TAG, "Written %d bytes into SVR database file", bytesWritten);
ps->close(fp);
fp = NULL;
}
OCStackResult SendSRMResponse(const OCEntityHandlerRequest *ehRequest,
OCEntityHandlerResult ehRet, const char *rspPayload)
{
- OC_LOG (INFO, TAG, "SRM sending SRM response");
+ OC_LOG (DEBUG, TAG, "SRM sending SRM response");
OCEntityHandlerResponse response = {.requestHandle = NULL};
if (ehRequest)
{
void SRMSendResponse(SRMAccessResponse_t responseVal)
{
- OC_LOG(INFO, TAG, "Sending response to remote device");
+ OC_LOG(DEBUG, TAG, "Sending response to remote device");
if (IsAccessGranted(responseVal) && gRequestHandler)
{
*/
void SRMRequestHandler(const CAEndpoint_t *endPoint, const CARequestInfo_t *requestInfo)
{
- OC_LOG(INFO, TAG, "Received request from remote device");
+ OC_LOG(DEBUG, TAG, "Received request from remote device");
if (!endPoint || !requestInfo)
{
//New request are only processed if the policy engine state is AWAITING_REQUEST.
if(AWAITING_REQUEST == g_policyEngineContext.state)
{
- OC_LOG_V(INFO, TAG, "Processing request with uri, %s for method, %d",
+ OC_LOG_V(DEBUG, TAG, "Processing request with uri, %s for method, %d",
requestInfo->info.resourceUri, requestInfo->method);
response = CheckPermission(&g_policyEngineContext, &subjectId, newUri,
GetPermissionFromCAMethod_t(requestInfo->method));
*/
void SRMResponseHandler(const CAEndpoint_t *endPoint, const CAResponseInfo_t *responseInfo)
{
- OC_LOG(INFO, TAG, "Received response from remote device");
+ OC_LOG(DEBUG, TAG, "Received response from remote device");
// isProvResponse flag is to check whether response is catered by provisioning APIs or not.
// When token sent by CA response matches with token generated by provisioning request,
CAResponseCallback respHandler,
CAErrorCallback errHandler)
{
- OC_LOG(INFO, TAG, "SRMRegisterHandler !!");
+ OC_LOG(DEBUG, TAG, "SRMRegisterHandler !!");
if( !reqHandler || !respHandler || !errHandler)
{
OC_LOG(ERROR, TAG, "Callback handlers are invalid");
*/
OCStackResult SRMRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
{
- OC_LOG(INFO, TAG, "SRMRegisterPersistentStorageHandler !!");
+ OC_LOG(DEBUG, TAG, "SRMRegisterPersistentStorageHandler !!");
if(!persistentStorageHandler)
{
OC_LOG(ERROR, TAG, "The persistent storage handler is invalid");
OICFree(jsonStr);
- OC_LOG_V (INFO, TAG, "%s RetVal %d", __func__ , ehRet);
+ OC_LOG_V (DEBUG, TAG, "%s RetVal %d", __func__ , ehRet);
return ehRet;
}
// Send payload to request originator
SendSRMResponse(ehRequest, ehRet, NULL);
- OC_LOG_V (INFO, TAG, "%s RetVal %d", __func__ , ehRet);
+ OC_LOG_V (DEBUG, TAG, "%s RetVal %d", __func__ , ehRet);
return ehRet;
}
{
OCStackResult ret = OC_STACK_ERROR;
- OC_LOG_V (INFO, TAG, "Begin %s ", __func__ );
+ OC_LOG_V (DEBUG, TAG, "Begin %s ", __func__ );
// Read SVC resource from PS
char* jsonSVRDatabase = GetSVRDatabase();
DeInitSVCResource();
}
- OC_LOG_V (INFO, TAG, "%s RetVal %d", __func__ , ret);
+ OC_LOG_V (DEBUG, TAG, "%s RetVal %d", __func__ , ret);
return ret;
}