X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=resource%2Fcsdk%2Fsecurity%2Finclude%2Finternal%2Fdoxmresource.h;h=d42dd73e9c0b5f416a336698e2c95ff8b317e13d;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=826c1875defc327b30893eaa283f1bfcb4fdc28f;hpb=ab62c8e15659e1b94259ac95b98e042383fc1cf9;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/security/include/internal/doxmresource.h b/resource/csdk/security/include/internal/doxmresource.h index 826c187..d42dd73 100644 --- a/resource/csdk/security/include/internal/doxmresource.h +++ b/resource/csdk/security/include/internal/doxmresource.h @@ -22,9 +22,9 @@ #define IOTVT_SRM_DOXM_H #include "octypes.h" -#ifdef _ENABLE_MULTIPLE_OWNER_ +#ifdef MULTIPLE_OWNER #include "cacommon.h" -#endif //_ENABLE_MULTIPLE_OWNER_ +#endif //MULTIPLE_OWNER #ifdef __cplusplus extern "C" { @@ -82,6 +82,18 @@ OCStackResult CBORPayloadToDoxm(const uint8_t *cborPayload, size_t size, OCStackResult DoxmToCBORPayload(const OicSecDoxm_t * doxm, uint8_t **cborPayload, size_t *cborSize, bool rwOnly); +#if defined(__WITH_DTLS__) || defined (__WITH_TLS__) +/** + * API to save the seed value to generate device UUID. + * + * @param seed buffer of seed value. + * @param seedSize byte length of seed + * + * @return ::OC_STACK_OK for Success, otherwise some error value. + */ +OCStackResult SetDoxmDeviceIDSeed(const uint8_t* seed, size_t seedSize); +#endif + /** * This method returns the SRM device ID for this device. * @@ -121,7 +133,7 @@ OCStackResult GetDoxmIsOwned(bool *isOwned); */ OCStackResult GetDoxmRownerId(OicUuid_t *rowneruuid); -#ifdef _ENABLE_MULTIPLE_OWNER_ +#ifdef MULTIPLE_OWNER /** * Compare the UUID to SubOwner. * @@ -130,7 +142,7 @@ OCStackResult GetDoxmRownerId(OicUuid_t *rowneruuid); * @return true if uuid exists in the SubOwner list of doxm, else false. */ bool IsSubOwner(const OicUuid_t* uuid); -#endif //_ENABLE_MULTIPLE_OWNER_ +#endif //MULTIPLE_OWNER /** This function deallocates the memory for OicSecDoxm_t . * @@ -144,7 +156,7 @@ void DeleteDoxmBinData(OicSecDoxm_t* doxm); */ void RestoreDoxmToInitState(); -#if defined(__WITH_DTLS__) && defined(_ENABLE_MULTIPLE_OWNER_) +#if defined(__WITH_DTLS__) && defined(MULTIPLE_OWNER) /** * Callback function to handle MOT DTLS handshake result. * @param[out] object remote device information. @@ -152,7 +164,44 @@ void RestoreDoxmToInitState(); */ void MultipleOwnerDTLSHandshakeCB(const CAEndpoint_t *object, const CAErrorInfo_t *errorInfo); -#endif //__WITH_DTLS__ && _ENABLE_MULTIPLE_OWNER_ +#endif //__WITH_DTLS__ && MULTIPLE_OWNER + +/** + * Internal function to change doxm resource to Ready for Normal Operation. + * + * @param newROwner new owner + * + * @retval ::OC_STACK_OK for Success, otherwise some error value + */ +OCStackResult SetDoxmSelfOwnership(const OicUuid_t* newROwner); + +/** + * Function to set a MOT status + * + * @param enable whether the MOT is enabled. (true=enable, false=disable) + * + * @retval ::OC_STACK_OK for Success, otherwise some error value + */ +OCStackResult SetMOTStatus(bool enable); + +/** + * Function to remove the Sub Owner (include ACL/Cred) + * + * @param subOwner UUID of Sub Owner to be removed. + * + * @retVal ::OC_STACK_OK for success, otherwise some error value. + */ +OCStackResult RemoveSubOwner(const OicUuid_t* subOwner); + +/** + * Function to set a max number of sub owner. + * + * @param maxSubOwner Max number of sub owner. + * + * @retVal ::OC_STACK_OK for success, otherwise some error value. + */ +OCStackResult SetNumberOfSubOwner(size_t maxSubOwner); + #ifdef __cplusplus }