From b66c6ab7102eceb3da04ee8f12f0dcbcc060a302 Mon Sep 17 00:00:00 2001 From: Chul Lee Date: Tue, 20 Dec 2016 16:50:19 +0900 Subject: [PATCH] Change the MAX_VERSION_LEN to OIC_SEC_MAX_VER_LEN. MAX_VERSION_LEN is a very common name. This is not appropriate for use at the SDK level. So I changed as OIC specific name. Change-Id: Ia573dda8811f36a60999bbc63bb24cb3b3b04d93 Signed-off-by: Chul Lee Reviewed-on: https://gerrit.iotivity.org/gerrit/15827 Tested-by: jenkins-iotivity Reviewed-by: Kevin Kane Reviewed-by: Randeep Singh --- resource/csdk/security/include/securevirtualresourcetypes.h | 4 ++-- resource/csdk/security/provisioning/include/pmtypes.h | 2 +- resource/csdk/security/provisioning/src/pmutility.c | 8 ++++---- resource/csdk/security/src/verresource.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resource/csdk/security/include/securevirtualresourcetypes.h b/resource/csdk/security/include/securevirtualresourcetypes.h index 46b1af6..e2ec5f3 100644 --- a/resource/csdk/security/include/securevirtualresourcetypes.h +++ b/resource/csdk/security/include/securevirtualresourcetypes.h @@ -636,7 +636,7 @@ struct OicSecDpairing OicUuid_t rownerID; // 2:R:S:Y:oic.uuid }; -#define MAX_VERSION_LEN 16 // Security Version length. i.e., 00.00.000 + reserved space +#define OIC_SEC_MAX_VER_LEN 16 // Security Version length. i.e., 00.00.000 + reserved space /** * @brief security version data type @@ -649,7 +649,7 @@ typedef struct OicSecVer OicSecVer_t; struct OicSecVer { // :::: - char secv[MAX_VERSION_LEN]; // 0:R:S:Y:String + char secv[OIC_SEC_MAX_VER_LEN]; // 0:R:S:Y:String OicUuid_t deviceID; // 1:R:S:Y:oic.uuid }; diff --git a/resource/csdk/security/provisioning/include/pmtypes.h b/resource/csdk/security/provisioning/include/pmtypes.h index d75320e..6a46dd6 100644 --- a/resource/csdk/security/provisioning/include/pmtypes.h +++ b/resource/csdk/security/provisioning/include/pmtypes.h @@ -70,7 +70,7 @@ typedef struct OCProvisionDev #ifdef WITH_TCP uint16_t tcpPort; /**< tcp port **/ #endif - char secVer[MAX_VERSION_LEN]; /**< security version **/ + char secVer[OIC_SEC_MAX_VER_LEN]; /**< security version **/ DeviceStatus devStatus; /**< status of device **/ OCDoHandle handle; struct OCProvisionDev *next; /**< Next pointer. **/ diff --git a/resource/csdk/security/provisioning/src/pmutility.c b/resource/csdk/security/provisioning/src/pmutility.c index c02fd23..f5ed509 100644 --- a/resource/csdk/security/provisioning/src/pmutility.c +++ b/resource/csdk/security/provisioning/src/pmutility.c @@ -182,7 +182,7 @@ OCStackResult AddDevice(OCProvisionDev_t **ppDevicesList, OCDevAddr* endpoint, ptr->next = NULL; ptr->connType = connType; ptr->devStatus = DEV_STATUS_ON; //AddDevice is called when discovery(=alive) - OICStrcpy(ptr->secVer, MAX_VERSION_LEN, DEFAULT_SEC_VERSION); // version initialization + OICStrcpy(ptr->secVer, OIC_SEC_MAX_VER_LEN, DEFAULT_SEC_VERSION); // version initialization ptr->handle = NULL; LL_PREPEND(*ppDevicesList, ptr); @@ -280,7 +280,7 @@ OCStackResult UpdateSecVersionOfDevice(OCProvisionDev_t **ppDevicesList, const c return OC_STACK_ERROR; } - OICStrcpy(ptr->secVer, MAX_VERSION_LEN, secVer); + OICStrcpy(ptr->secVer, OIC_SEC_MAX_VER_LEN, secVer); return OC_STACK_OK; } @@ -345,11 +345,11 @@ OCProvisionDev_t* PMCloneOCProvisionDev(const OCProvisionDev_t* src) if (0 == strlen(src->secVer)) { - OICStrcpy(newDev->secVer, MAX_VERSION_LEN, DEFAULT_SEC_VERSION); + OICStrcpy(newDev->secVer, OIC_SEC_MAX_VER_LEN, DEFAULT_SEC_VERSION); } else { - OICStrcpy(newDev->secVer, MAX_VERSION_LEN, src->secVer); + OICStrcpy(newDev->secVer, OIC_SEC_MAX_VER_LEN, src->secVer); } newDev->securePort = src->securePort; diff --git a/resource/csdk/security/src/verresource.c b/resource/csdk/security/src/verresource.c index a4478e9..e2363ad 100644 --- a/resource/csdk/security/src/verresource.c +++ b/resource/csdk/security/src/verresource.c @@ -317,7 +317,7 @@ OCStackResult InitVerResource() { OCStackResult ret = OC_STACK_ERROR; - OICStrcpy(gVer.secv, MAX_VERSION_LEN, SECURITY_VERSION); + OICStrcpy(gVer.secv, OIC_SEC_MAX_VER_LEN, SECURITY_VERSION); //Read device id from doxm OicUuid_t deviceID = {.id={0}}; -- 2.7.4