+ ctx->endPoint = endPoint;
+ ctx->requestInfo = requestInfo;
+ ctx->requestedPermission = GetPermissionFromCAMethod_t(requestInfo->method);
+
+ // Copy the subjectID.
+ memcpy(ctx->subjectUuid.id,
+ requestInfo->info.identity.id, sizeof(ctx->subjectUuid.id));
+ ctx->subjectIdType = SUBJECT_ID_TYPE_UUID; // only supported type for now
+
+ // Set secure channel boolean.
+ ctx->secureChannel = isRequestOverSecureChannel(ctx);
+
+ // Set resource URI and type.
+ SetResourceUriAndType(ctx);
+
+ // Initialize responseInfo.
+ memcpy(&(ctx->responseInfo.info), &(requestInfo->info),
+ sizeof(ctx->responseInfo.info));
+ ctx->responseInfo.info.payload = NULL;
+ ctx->responseInfo.result = CA_INTERNAL_SERVER_ERROR;
+ ctx->responseInfo.info.dataType = CA_RESPONSE_DATA;
+
+ // Before consulting ACL, check if this is a forbidden request type.
+ CheckRequestForSecResourceOverUnsecureChannel(ctx);
+
+ // If DENIED response wasn't sent already, then it's time to check ACL.
+ if(false == ctx->responseSent)
+ {
+#ifdef MULTIPLE_OWNER // TODO Samsung: please verify that these two calls belong
+ // here inside this conditional statement.
+ // In case of ACL and CRED, The payload required to verify the payload.
+ // Payload information will be used for subowner's permission verification.
+ ctx->payload = (uint8_t*)requestInfo->info.payload;
+ ctx->payloadSize = requestInfo->info.payloadSize;
+#endif //MULTIPLE_OWNER
+
+ OIC_LOG_V(DEBUG, TAG, "Processing request with uri, %s for method %d",
+ ctx->requestInfo->info.resourceUri, ctx->requestInfo->method);
+ CheckPermission(ctx);
+ OIC_LOG_V(DEBUG, TAG, "Request for permission %d received responseVal %d.",
+ ctx->requestedPermission, ctx->responseVal);
+
+ // Now that we have determined the correct response and set responseVal,
+ // we generate and send the response to the requester.
+ SRMGenerateResponse(ctx);
+ }