--- /dev/null
+//******************************************************************
+//
+// Copyright 2017 Samsung Electronics All Rights Reserved.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+#ifndef ACL_LOGGING_H_
+#define ACL_LOGGING_H_
+
+#include "logger.h"
+#include "oic_malloc.h"
+#include "ocrandom.h"
+#include "utlist.h"
+#include "securevirtualresourcetypes.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define ACL_TAG "ACL_LOG"
+
+#ifdef TB_LOG
+ #define OIC_LOG_ACL(level, acl) printACL((level),(acl))
+ #define OIC_LOG_ACE(level, ace) printACE((level),(ace))
+
+INLINE_API void printACE(LogLevel level, const OicSecAce_t *ace)
+{
+ OIC_LOG(level, ACL_TAG, "=================================================");
+ OIC_LOG_V(level, ACL_TAG, "ACE @ %p", ace);
+
+ if (NULL == ace)
+ {
+ return;
+ }
+
+ OIC_LOG_V(level, ACL_TAG, " permission = %#x", (uint32_t)ace->permission);
+
+ // Log the subjectuuid.
+ char uuidString[UUID_STRING_SIZE] = { 0 };
+ bool convertedUUID = OCConvertUuidToString(ace->subjectuuid.id, uuidString);
+ OIC_LOG_V(level, ACL_TAG, " subjectuuid = %s", convertedUUID ? uuidString : "incorrect format");
+
+ // Log all resources this ACE applies to.
+ OicSecRsrc_t *resource = NULL;
+ size_t resourceCount = 0;
+ LL_FOREACH(ace->resources, resource)
+ {
+ OIC_LOG_V(level, ACL_TAG, " resources[%" PRIuPTR "]:", resourceCount);
+ OIC_LOG_V(level, ACL_TAG, " href = %s", resource->href ? resource->href : "null");
+
+ for (size_t i = 0; i < resource->typeLen; i++)
+ {
+ OIC_LOG_V(level, ACL_TAG, " types[%" PRIuPTR "] = %s", i,
+ resource->types[i] ? resource->types[i] : "null");
+ }
+
+ for (size_t i = 0; i < resource->interfaceLen; i++)
+ {
+ OIC_LOG_V(level, ACL_TAG, " interfaces[%" PRIuPTR "] = %s", i,
+ resource->interfaces[i] ? resource->interfaces[i] : "null");
+ }
+
+ resourceCount++;
+ }
+
+ // Log the validities.
+ OicSecValidity_t *validity = NULL;
+ size_t validityCount = 0;
+ LL_FOREACH(ace->validities, validity)
+ {
+ OIC_LOG_V(level, ACL_TAG, " validities[%" PRIuPTR "]:", validityCount);
+ OIC_LOG_V(level, ACL_TAG, " period = %s", validity->period);
+ for (size_t i = 0; i < validity->recurrenceLen; i++)
+ {
+ OIC_LOG_V(level, ACL_TAG, " recurrences[%" PRIuPTR "] = %s", i,
+ validity->recurrences[i] ? validity->recurrences[i] : "null");
+ }
+ validityCount++;
+ }
+
+ OIC_LOG(level, ACL_TAG, "=================================================");
+}
+
+INLINE_API void printACL(LogLevel level, const OicSecAcl_t* acl)
+{
+ OIC_LOG_V(level, ACL_TAG, "Print ACL @ %p:", acl);
+
+ if (NULL == acl)
+ {
+ return;
+ }
+
+ char rowner[UUID_STRING_SIZE] = { 0 };
+ if (OCConvertUuidToString(acl->rownerID.id, rowner))
+ {
+ OIC_LOG_V(level, ACL_TAG, "rowner id = %s", rowner);
+ }
+ else
+ {
+ OIC_LOG(ERROR, ACL_TAG, "Can't convert rowner uuid to string");
+ }
+
+ const OicSecAce_t *ace = acl->aces;
+ size_t ace_count = 0;
+ while (ace)
+ {
+ OIC_LOG_V(level, ACL_TAG, "Print ace[%" PRIuPTR "]:", ace_count);
+ printACE(level, ace);
+ ace = ace->next;
+ ace_count++;
+ }
+}
+#else
+ #define OIC_LOG_ACL(level, acl)
+ #define OIC_LOG_ACE(level, ace)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
*/
OicSecAcl_t* CBORPayloadToAcl2(const uint8_t *cborPayload, const size_t size);
-/**
- * This function prints ACL to stdin
- * For debug purposes only
- *
- * @param acl acl to print
- */
-void printACL(const OicSecAcl_t* acl);
-
#ifdef __cplusplus
}
#endif
--- /dev/null
+//******************************************************************
+//
+// Copyright 2017 Samsung Electronics All Rights Reserved.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+#ifndef CRL_LOGGING_H_
+#define CRL_LOGGING_H_
+
+#include "logger.h"
+#include "securevirtualresourcetypes.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define CRL_TAG "CRL_LOG"
+
+#ifdef TB_LOG
+ #define OIC_LOG_CRL(level, crl) printCRL((level),(crl))
+
+INLINE_API void printCRL(LogLevel level, const OicSecCrl_t *crl)
+{
+ OIC_LOG_V(level, CRL_TAG, "Print CRL @ %p:", crl);
+
+ if (NULL == crl)
+ {
+ return;
+ }
+
+ OIC_LOG(level, CRL_TAG, "CRL object contains:");
+ OIC_LOG_V(level, CRL_TAG, "id = %d", crl->CrlId);
+ OIC_LOG_V(level, CRL_TAG, "this update = %s", crl->ThisUpdate.data);
+
+ OIC_LOG(level, CRL_TAG, "crl:");
+ OIC_LOG_V(level, CRL_TAG, "encoding = %d", crl->CrlData.encoding);
+ OIC_LOG_V(level, CRL_TAG, "data (length = %" PRIuPTR "):", crl->CrlData.len);
+ OIC_LOG_BUFFER(level, CRL_TAG, crl->CrlData.data, crl->CrlData.len);
+}
+#else
+ #define OIC_LOG_CRL(level, crl)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
*/
OCStackResult getLastUpdateFromDB(char **lastUpdate);
-/**
- * This function prints OicSecCrl_t object
- *
- * @param crl crl object
- */
-void printCrl(const OicSecCrl_t *crl);
-
#ifdef __cplusplus
}
#endif
extern "C" {
#endif // __cplusplus
-typedef void (*OCCloudResponseCB )(void* ctx, OCStackResult result, void* data);
+typedef void (*OCCloudResponseCB )(void* ctx, OCClientResponse* response, void* data);
typedef struct cloudAce cloudAce_t;
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
-OCStackResult OCCloudAclIndividualUpdateAce(void* ctx,
+OCStackResult OCCloudAclIndividualAclUpdate(void* ctx,
const char *aclId,
const cloudAce_t *aces,
const OCDevAddr *endPoint,
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
-OCStackResult OCCloudAclIndividualUpdate(void* ctx,
+OCStackResult OCCloudAclIndividualAceUpdate(void* ctx,
const char *aclId,
const char *aceId,
const cloudAce_t *aces,
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
-OCStackResult OCCloudAclIndividualDelete(void* ctx,
+OCStackResult OCCloudAclAcesDelete(void* ctx,
const char *aclId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
-OCStackResult OCCloudAclIndividualDeleteAce(void* ctx,
+OCStackResult OCCloudAclIndividualAceDelete(void* ctx,
const char *aclId,
const char *aceId,
const OCDevAddr *endPoint,
#include "ocpayload.h"
#include "payload_logging.h"
#include "aclresource.h"
+#include "acl_logging.h"
+#include "crl_logging.h"
#include "crlresource.h"
#include "ocprovisioningmanager.h"
#include "casecurityinterface.h"
* @param[in] result result
* @param[in] data data
*/
-static void handleCB(void* ctx, OCStackResult result, void* data)
+static void handleCB(void* ctx, OCClientResponse *response, void* data)
{
OC_UNUSED(ctx);
OC_UNUSED(data);
- OIC_LOG_V(INFO, TAG, "%s: Received result = %d", __func__, result);
+ if (response)
+ {
+ OIC_LOG_V(INFO, TAG, "%s: Received result = %d", __func__, response->result);
+
+ if (response->payload)
+ {
+ OIC_LOG(INFO, TAG, "Payload received:");
+ OIC_LOG_PAYLOAD(INFO, response->payload);
+ }
+ }
+ else
+ {
+ OIC_LOG_V(ERROR, TAG, "%s: Received NULL response", __func__);
+ }
unlockMenu(NULL);
}
* @param[in] result result
* @param[in] aclId acl id
*/
-static void handleAclIdCB(void* ctx, OCStackResult result, void* aclId)
+static void handleAclIdCB(void* ctx, OCClientResponse *response, void* aclId)
{
OIC_LOG_V(INFO, TAG, "Received Acl id = %s", (char *)aclId);
- handleCB(ctx, result, aclId);
+ handleCB(ctx, response, aclId);
OICFree(aclId);
}
* @param[in] result result
* @param[in] groupId group id
*/
-static void handleAclCreateGroupCB(void* ctx, OCStackResult result, void* groupId)
+static void handleAclCreateGroupCB(void* ctx, OCClientResponse *response, void* groupId)
{
OIC_LOG_V(INFO, TAG, "Received gid = %s", (char *)groupId);
- handleCB(ctx, result, groupId);
+ handleCB(ctx, response, groupId);
OICFree(groupId);
}
* @param[in] result result
* @param[in] gp group policy
*/
-static void handleAclPolicyCheckCB(void* ctx, OCStackResult result, void* gp)
+static void handleAclPolicyCheckCB(void* ctx, OCClientResponse *response, void* gp)
{
OIC_LOG_V(INFO, TAG, "Received gp = %s", (char *)gp);
- handleCB(ctx, result, gp);
+ handleCB(ctx, response, gp);
OICFree(gp);
}
* @param[in] result result
* @param[in] acl acl
*/
-static void handleAclIndividualGetInfoCB(void* ctx, OCStackResult result, void* acl)
+static void handleAclIndividualGetInfoCB(void* ctx, OCClientResponse *response, void* acl)
{
- printACL((OicSecAcl_t* )acl);
- handleCB(ctx, result, acl);
+ OIC_LOG_ACL(INFO, acl);
+ handleCB(ctx, response, acl);
//can't delete acl here because its ACE's were added to gAcl
//TODO: changes in aclresources.c required to fix that
}
* @param[in] result result
* @param[in] gidList group id list
*/
-static void handleAclFindMyGroupCB(void* ctx, OCStackResult result, void* gidList)
+static void handleAclFindMyGroupCB(void* ctx, OCClientResponse *response, void* gidList)
{
printStringArray((stringArray_t *)gidList);
- handleCB(ctx, result, gidList);
+ handleCB(ctx, response, gidList);
clearStringArray((stringArray_t *)gidList);
}
* @param[in] result result
* @param[in] crl crl
*/
-static void handleGetCrlCB(void* ctx, OCStackResult result, void* crl)
+static void handleGetCrlCB(void* ctx, OCClientResponse *response, void* crl)
{
- printCrl((OicSecCrl_t *)crl);
- handleCB(ctx, result, crl);
+ OIC_LOG_CRL(INFO, crl);
+ handleCB(ctx, response, crl);
DeleteCrl((OicSecCrl_t *)crl);
}
* @param[in] result result
* @param[in] invite invitation response (it has inviteResponse_t* type)
*/
-static void handleAclGetInvitationCB(void* ctx, OCStackResult result, void* invite)
+static void handleAclGetInvitationCB(void* ctx, OCClientResponse *response, void* invite)
{
printInviteResponse((inviteResponse_t *)invite);
- handleCB(ctx, result, invite);
+ handleCB(ctx, response, invite);
clearInviteResponse((inviteResponse_t *)invite);
OICFree(invite);
}
}
}
- result = OCCloudAclIndividualUpdateAce(NULL, aclid, aces, endPoint, callback);
+ result = OCCloudAclIndividualAclUpdate(NULL, aclid, aces, endPoint, callback);
exit:
deleteCloudAceList(aces);
return result;
}
- result = OCCloudAclIndividualUpdate(NULL, aclid,aceid, ace, endPoint, callback);
+ result = OCCloudAclIndividualAceUpdate(NULL, aclid,aceid, ace, endPoint, callback);
exit:
return result;
}
readString(aclid, sizeof(aclid), "acl id", ACL_ID_EXAMPLE);
- return OCCloudAclIndividualDelete(NULL, aclid, endPoint, callback);
+ return OCCloudAclAcesDelete(NULL, aclid, endPoint, callback);
}
OCStackResult OCWrapperAclIndividualDeleteAce(const OCDevAddr *endPoint, OCCloudResponseCB callback)
readString(aclid, sizeof(aclid), "acl id", ACL_ID_EXAMPLE);
readString(aceid, sizeof(aceid), "ace id", ACE_ID_EXAMPLE);
- return OCCloudAclIndividualDeleteAce(NULL, aclid, aceid, endPoint, callback);
+ return OCCloudAclIndividualAceDelete(NULL, aclid, aceid, endPoint, callback);
}
OCStackResult OCWrapperAclCreateGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback)
#include "cacommonutil.h"
#include "aclresource.h"
#include "ocpayloadcbor.h"
+#include "acl_logging.h"
#include "payload_logging.h"
#include "utlist.h"
goto exit;
}
- printACL(acl);
+ OIC_LOG_ACL(INFO, acl);
result = InstallACL(acl);
if (result != OC_STACK_OK)
CT_ADAPTER_TCP, OC_LOW_QOS, &cbData, NULL, 0);
}
-OCStackResult OCCloudAclIndividualUpdateAce(void* ctx,
+OCStackResult OCCloudAclIndividualAclUpdate(void* ctx,
const char *aclId,
const cloudAce_t *aces,
const OCDevAddr *endPoint,
return OC_STACK_NO_MEMORY;
}
-OCStackResult OCCloudAclIndividualUpdate(void* ctx,
+OCStackResult OCCloudAclIndividualAceUpdate(void* ctx,
const char *aclId,
const char *aceId,
const cloudAce_t *aces,
-OCStackResult OCCloudAclIndividualDelete(void* ctx,
+OCStackResult OCCloudAclAcesDelete(void* ctx,
const char *aclId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback)
CT_ADAPTER_TCP, OC_LOW_QOS, &cbData, NULL, 0);
}
-OCStackResult OCCloudAclIndividualDeleteAce(void* ctx,
+OCStackResult OCCloudAclIndividualAceDelete(void* ctx,
const char *aclId,
const char *aceId,
const OCDevAddr *endPoint,
*/
static OCStackApplicationResult handleResponse(void *ctx,
OCDoHandle handle,
- OCClientResponse *clientResponse)
+ OCClientResponse *response)
{
OC_UNUSED(handle);
- if (NULL == clientResponse)
+ if (NULL == response)
{
OIC_LOG_V(ERROR, TAG, "Received null response from client");
return OC_STACK_DELETE_TRANSACTION;
}
- OIC_LOG_V(DEBUG, TAG, "Received callback with response code: %d", clientResponse->result);
-
- if (clientResponse->payload)
- {
- OIC_LOG(DEBUG, TAG, "Payload received:");
- OIC_LOG_PAYLOAD(DEBUG, clientResponse->payload);
- }
-
if (ctx)
{
- OCStackResult result = clientResponse->result;
void *data = NULL;
ContextInfo_t *info = (ContextInfo_t *)ctx;
if (info->fn)
{
- result = ((UserFunctionCB)info->fn)(info->params, &data, clientResponse);
+ response->result = ((UserFunctionCB)info->fn)(info->params, &data, response);
}
if (info->cb)
{
- ((OCCloudResponseCB)info->cb)(info->ctx, result, data);
+ ((OCCloudResponseCB)info->cb)(info->ctx, response, data);
}
}
#include "ocrandom.h"
#include "ocpayload.h"
#include "utlist.h"
+#include "acl_logging.h"
#include "payload_logging.h"
#include "srmresourcestrings.h"
#include "aclresource.h"
return false;
}
-static void printACE(const OicSecAce_t *ace)
-{
-#ifndef TB_LOG
- OC_UNUSED(ace);
-#else
- OIC_LOG(INFO, TAG, "=================================================");
- OIC_LOG_V(INFO, TAG, "ACE @ %p", ace);
- OIC_LOG_V(INFO, TAG, " permission = %#x", (uint32_t)ace->permission);
-
- // Log the subjectuuid.
- char uuidString[UUID_STRING_SIZE];
- bool convertedUUID = OCConvertUuidToString(ace->subjectuuid.id, uuidString);
- OIC_LOG_V(INFO, TAG, " subjectuuid = %s", convertedUUID ? uuidString : "incorrect format");
-
- // Log all resources this ACE applies to.
- OicSecRsrc_t *resource = NULL;
- uint32_t resourceCount = 0;
- LL_FOREACH(ace->resources, resource)
- {
- OIC_LOG_V(INFO, TAG, " resources[%u]:", resourceCount);
- OIC_LOG_V(INFO, TAG, " href = %s", resource->href ? resource->href : "null");
-
- for (size_t i = 0; i < resource->typeLen; i++)
- {
- OIC_LOG_V(INFO, TAG, " types[%" PRIuPTR "] = %s", i,
- resource->types[i] ? resource->types[i] : "null");
- }
-
- for (size_t i = 0; i < resource->interfaceLen; i++)
- {
- OIC_LOG_V(INFO, TAG, " interfaces[%" PRIuPTR "] = %s", i,
- resource->interfaces[i] ? resource->interfaces[i] : "null");
- }
-
- resourceCount++;
- }
-
- // Log the validities.
- OicSecValidity_t *validity = NULL;
- uint32_t validityCount = 0;
- LL_FOREACH(ace->validities, validity)
- {
- OIC_LOG_V(INFO, TAG, " validities[%u]:", validityCount);
- OIC_LOG_V(INFO, TAG, " period = %s", validity->period);
- for (size_t i = 0; i < validity->recurrenceLen; i++)
- {
- OIC_LOG_V(INFO, TAG, " recurrences[%" PRIuPTR "] = %s", i,
- validity->recurrences[i] ? validity->recurrences[i] : "null");
- }
- validityCount++;
- }
-
- OIC_LOG(INFO, TAG, "=================================================");
-#endif
-}
-
-void printACL(const OicSecAcl_t* acl)
-{
-#ifndef TB_LOG
- OC_UNUSED(acl);
-#else
- OIC_LOG_V(INFO, TAG, "Print ACL @ %p:", acl);
-
- if (NULL == acl)
- {
- return;
- }
-
- char rowner[UUID_STRING_SIZE];
- if (OCConvertUuidToString(acl->rownerID.id, rowner))
- {
- OIC_LOG_V(INFO, TAG, "rowner id = %s", rowner);
- }
- else
- {
- OIC_LOG(ERROR, TAG, "Can't convert rowner uuid to string");
- }
-
- const OicSecAce_t *ace = acl->aces;
- int ace_count = 0;
- while (ace)
- {
- ace_count++;
- OIC_LOG_V(INFO, TAG, "Print ace[%d]:", ace_count);
- printACE(ace);
- ace = ace->next;
- }
-#endif
-}
-
/**
* Internal function to remove all ACL data on ACL resource and persistent storage
*
if(insertAce)
{
OIC_LOG(DEBUG, TAG, "Prepending new ACE:");
- printACE(insertAce);
+ OIC_LOG_ACE(DEBUG, insertAce);
LL_PREPEND(gAcl->aces, insertAce);
}
else
if (memcmp(&(ace->subjectuuid), subjectId, sizeof(OicUuid_t)) == 0)
{
OIC_LOG(DEBUG, TAG, "GetACLResourceData: found matching ACE:");
- printACE(ace);
+ OIC_LOG_ACE(DEBUG, ace);
*savePtr = ace;
return ace;
}
gAcl->aces = acl->aces;
}
- printACL(gAcl);
+ OIC_LOG_ACL(INFO, gAcl);
size_t size = 0;
uint8_t *payload = NULL;
if(insertAce)
{
OIC_LOG(DEBUG, TAG, "Prepending new ACE:");
- printACE(insertAce);
+ OIC_LOG_ACE(DEBUG, insertAce);
if (!newInstallAcl)
{
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "utlist.h"
+#include "crl_logging.h"
#include "payload_logging.h"
#include "psinterface.h"
#include "resourcemanager.h"
}
}
-void printCrl(const OicSecCrl_t *crl)
-{
- if (NULL == crl)
- {
- OIC_LOG(INFO, TAG, "Received NULL CRL");
- return;
- }
-
- OIC_LOG(INFO, TAG, "Crl object contain:");
- OIC_LOG_V(INFO, TAG, "id = %d", crl->CrlId);
- OIC_LOG_V(INFO, TAG, "this update = %s", crl->ThisUpdate.data);
-
- OIC_LOG(INFO, TAG, "crl:");
- OIC_LOG_V(INFO, TAG, "encoding = %d", crl->CrlData.encoding);
- OIC_LOG_V(INFO, TAG, "data (length = %" PRIuPTR "):", crl->CrlData.len);
- OIC_LOG_BUFFER(INFO, TAG, crl->CrlData.data, crl->CrlData.len);
-}
-
static bool copyByteArray(const uint8_t *in, size_t in_len, uint8_t **out, size_t *out_len)
{
OICFree(*out);
mapSize++;
}
- printCrl(crl);
+ OIC_LOG_CRL(INFO, crl);
OCStackResult ret = OC_STACK_ERROR;
cborFindResult = getPubDataType(&crlCbor, OC_RSRVD_CRL, &crl->CrlData);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to read CRL.");
- printCrl(crl);
+ OIC_LOG_CRL(INFO, crl);
*secCrl = crl;
ret = OC_STACK_OK;
OCCloudAclGroupGetInfo
OCCloudAclIdCreate
OCCloudAclIdDelete
-OCCloudAclIndividualDelete
-OCCloudAclIndividualDeleteAce
+OCCloudAclAcesDelete
+OCCloudAclIndividualAceDelete
OCCloudAclIndividualGetInfo
-OCCloudAclIndividualUpdate
-OCCloudAclIndividualUpdateAce
+OCCloudAclIndividualAceUpdate
+OCCloudAclIndividualAclUpdate
OCCloudAclInviteUser
OCCloudAclJoinToInvitedGroup
OCCloudAclObserveGroup
OCSaveTrustCertChain
OIC_RSRC_DOXM_URI
OIC_RSRC_PSTAT_URI
-printACL
-printCrl
setCoapPrefix
* @param result result of the request performed\r
* @param data response data\r
*/\r
- static void callbackWrapper(void* ctx, OCStackResult result, void* data);\r
+ static void callbackWrapper(void* ctx, OCClientResponse *response, void* data);\r
\r
/**\r
* Callback wrapper for Acl ID get request\r
* @param result result of the request performed\r
* @param data AclID for the device\r
*/\r
- static void aclIdResponseWrapper(void* ctx, OCStackResult result, void* data);\r
+ static void aclIdResponseWrapper(void* ctx, OCClientResponse *response, void* data);\r
};\r
}\r
#endif //OC_CLOUD_PROVISIONING_CXX_H_\r
static sessionObject_t sessionObject = {0,0,0,0,0,0,0,0};
-extern void handleCB(void* ctx, OCStackResult result, void* data);
+extern void handleCB(void* ctx, OCClientResponse *response, void* data);
/**
* Session free function
SessionParsePayload((OCRepPayload*)response->payload);
}
exit:
- handleCB(NULL, OC_STACK_OK, NULL);
+ response->result = OC_STACK_OK;
+ handleCB(NULL, response, NULL);
return OC_STACK_DELETE_TRANSACTION;
}
OIC_LOG_V(DEBUG, TAG, "OUT: %s", __func__);
exit:
- handleCB(NULL, OC_STACK_OK, NULL);
+ response->result = OC_STACK_OK;
+ handleCB(NULL, response, NULL);
return OC_STACK_DELETE_TRANSACTION;
}
OIC_LOG_V(DEBUG, TAG, "OUT: %s", __func__);
exit:
- handleCB(NULL, OC_STACK_OK, NULL);
+ response->result = OC_STACK_OK;
+ handleCB(NULL, response, NULL);
return OC_STACK_DELETE_TRANSACTION;
}
/**
* @param[in] result result
* @param[in] data data
*/
-void handleCB(void* ctx, OCStackResult result, void* data)
+void handleCB(void* ctx, OCClientResponse *response, void* data)
{
OC_UNUSED(ctx);
OC_UNUSED(data);
- printf("Cloud request Result is == %d", result);
+ printf("Cloud request Result is == %d", response->result);
oc_mutex_lock(mutex);
oc_cond_signal(cond);
oc_mutex_unlock(mutex);
}
}
- result = OCCloudAclIndividualUpdateAce(NULL, aclid, aces, endPoint, callback);
+ result = OCCloudAclIndividualAclUpdate(NULL, aclid, aces, endPoint, callback);
exit:
if (aces)
{
readString(aclid, sizeof(aclid), "acl id", ACL_ID_EXAMPLE);
- return OCCloudAclIndividualDelete(NULL, aclid, endPoint, callback);
+ return OCCloudAclAcesDelete(NULL, aclid, endPoint, callback);
}
OCStackResult OCWrapperAclCreateGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback)
namespace OC
{
void OCCloudProvisioning::callbackWrapper(void *ctx,
- OCStackResult result,
+ OCClientResponse *response,
void *data)
{
CloudProvisionContext* context = static_cast<CloudProvisionContext*>(ctx);
- std::thread exec(context->callback, result, data);
+ std::thread exec(context->callback, response->result, data);
exec.detach();
delete context;
}
void OCCloudProvisioning::aclIdResponseWrapper(void *ctx,
- OCStackResult result,
+ OCClientResponse *response,
void *data)
{
std::string aclId = "";
AclIdContext* context = static_cast<AclIdContext*>(ctx);
- if ((OC_STACK_OK == result) && data)
+ if ((OC_STACK_OK == response->result) && data)
{
aclId = (char *)data;
}
- std::thread exec(context->callback, result, aclId);
+ std::thread exec(context->callback, response->result, aclId);
exec.detach();
delete context;