X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fsecurity%2Finclude%2Finternal%2Famsmgr.h;h=e07b44290cfce0dd3240c6b8bb41065e592b3062;hb=390866079e285d2c74918432c0d597d5da52f8a0;hp=c83530f3ad9780fca32bd27082f4b0fd06621d09;hpb=3e9402ad71cb3e93266a77796f44d17bab9853fd;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/security/include/internal/amsmgr.h b/resource/csdk/security/include/internal/amsmgr.h index c83530f..e07b442 100644 --- a/resource/csdk/security/include/internal/amsmgr.h +++ b/resource/csdk/security/include/internal/amsmgr.h @@ -21,17 +21,18 @@ #ifndef IOTVT_SRM_AMSMGR_H #define IOTVT_SRM_AMSMGR_H +#include +#include + #include "ocstack.h" #include "logger.h" #include "policyengine.h" #include "securevirtualresourcetypes.h" #include "cainterface.h" -#include -#include typedef struct PEContext PEContext_t; /** - * @brief The AMS context.. + * The AMS context. */ typedef struct AmsMgrContext { @@ -40,96 +41,96 @@ typedef struct AmsMgrContext CARequestInfo_t *requestInfo; } AmsMgrContext_t; - /** - * @brief This method updates AmsMgr context's endpoint & requestInfo + * This method updates AmsMgr context's endpoint & requestInfo. * - * @param context Policy engine context. - * @param endpoint CA Endpoint info of the requester - * @param requestInfo CA RequestInfo of the requester + * @param context is the policy engine context. + * @param endpoint is the CA Endpoint info of the requester. + * @param requestInfo is the CA RequestInfo of the requester. + * + * @return ::OC_STACK_OK if successful, else other value in case of error. */ -OCStackResult UpdateAmsMgrContext(PEContext_t *context, const CAEndpoint_t *endpoint, - const CARequestInfo_t *requestInfo); +OCStackResult UpdateAmsMgrContext(PEContext_t *context, + const CAEndpoint_t *endpoint, + const CARequestInfo_t *requestInfo); /** - * * This method is called by PolicyEngine to Discover AMS service. * It sends muticast discovery request such as * /oic/sec/doxm?deviceid="AMSSrvcDeviceID" to discover AMS service - * with deviceId="AMSSrvcDeviceID" - * - * @param context Policy engine context. + * with deviceId="AMSSrvcDeviceID". * - * @retval - * OC_STACK_OK If able to successfully send multicast discovery request. - * OC_STACK_ERROR If unable to successfully send multicast discovery request due to error. + * @param context is the policy engine context. * + * @return ::OC_STACK_OK,If able to successfully send multicast discovery request. + * else ::OC_STACK_ERROR, If unable to successfully send multicast discovery request + * due to error. */ OCStackResult DiscoverAmsService(PEContext_t *context); - /** - * * This method sends unicast request to retrieve the secured port info of the * discovered AMS service. It sends unicast discovery request such as - * /oic/res?rt="oic.sec.doxm" to the discovered AMS service - * - * @param context Policy engine context. + * /oic/res?rt="oic.sec.doxm" to the discovered AMS service. * - * @retval - * OC_STACK_OK If able to successfully send unicast discovery request - * OC_STACK_ERROR If unable to successfully send unicast discovery request due to error + * @param context is the policy engine context. * + * @return ::OC_STACK_OK,If able to successfully send unicast discovery request. + * else ::OC_STACK_ERROR, If unable to successfully send unicast discovery request + * due to error. */ -OCStackResult SendUnicastSecurePortDiscovery(PEContext_t *context,OCDevAddr *devAddr, - OCConnectivityType connType); - +OCStackResult SendUnicastSecurePortDiscovery(PEContext_t *context, + OCDevAddr *devAddr, + OCConnectivityType connType); /** - * * This method sends unicast request to AMS service to get ACL for * the Subject and/or Resource. It sends unicast request such as * /oic/sec/acl?sub="subjectId";rsrc="/a/led" to get the ACL for - * the subject & resource + * the subject & resource. * - * @param context Policy engine context. + * @param context is the policy engine context. * - * @retval - * OC_STACK_OK If able to successfully send unicast ACL request - * OC_STACK_ERROR If unable to successfully send unicast ACL request due to error + * @return ::OC_STACK_OK, If able to successfully send unicast ACL request. + * ::OC_STACK_ERROR, If unable to successfully send unicast ACL request due to error. * */ -OCStackResult SendAclReq(PEContext_t *context, OCDevAddr *devAddr, OCConnectivityType connType, - uint16_t securedPort); - +OCStackResult SendAclReq(PEContext_t *context, + OCDevAddr *devAddr, + OCConnectivityType connType, + uint16_t securedPort); /* - * Cleanup CARequestInfo_t object - * @param requestInfo pointer to RequestInfo_t object + * Cleanup CARequestInfo_t object. + * + * @param requestInfo is the pointer to @ref CARequestInfo_t. */ void FreeCARequestInfo(CARequestInfo_t *requestInfo); - /* * This method is used by Policy engine to checks Amacl resource. * If Amacl is found then it fills up context->amsMgrContext->amsDeviceId * with amsID of the Amacl else leaves it empty. * - * @param context Policy engine context. + * @param context is the policy engine context. * - * @return true if AMacl for the resource is found - * false if AMacl for the resource is not found + * @return true, if Amacl for the resource is found. false, if Amacl for the + * resource is not found */ bool FoundAmaclForRequest(PEContext_t *context); - /* - * This method is used by Policy engine to process AMS request - * * - * @param context Policy engine context. + * This method is used by Policy engine to process AMS request. * - * @return None + * @param context is the policy engine context. */ void ProcessAMSRequest(PEContext_t *context); +/* + * This method is used by Policy engine to free AMS context requestInfo/ + * + * @param requestInfo is the pointer to @ref CARequestInfo_t. + */ +void FreeCARequestInfo(CARequestInfo_t *requestInfo); + #endif //IOTVT_SRM_AMSMGR_H