X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fsecurity%2Finclude%2Finternal%2Fpolicyengine.h;h=83841c15d68f096bccece52ad097320576d34feb;hb=refs%2Ftags%2Ftizen_4.0.m2_release;hp=ba40d681c3f41c44ec833dd8dabcc9bda8596e7e;hpb=01be9765a95ede47003777ee576fe9a4de4229e5;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/security/include/internal/policyengine.h b/resource/csdk/security/include/internal/policyengine.h index ba40d68..83841c1 100644 --- a/resource/csdk/security/include/internal/policyengine.h +++ b/resource/csdk/security/include/internal/policyengine.h @@ -31,7 +31,6 @@ typedef struct AmsMgrContext AmsMgrContext_t; - typedef enum PEState { STOPPED = 0, //Policy engine state machine is not running @@ -40,29 +39,32 @@ typedef enum PEState BUSY //Can't process new request as processing other requests } PEState_t; - typedef struct PEContext { PEState_t state; OicUuid_t subject; char resource[MAX_URI_LENGTH]; + OicSecSvrType_t resourceType; uint16_t permission; - bool matchingAclFound; bool amsProcessing; SRMAccessResponse_t retVal; AmsMgrContext_t *amsMgrContext; + +#ifdef MULTIPLE_OWNER + uint8_t* payload; + size_t payloadSize; +#endif //MULTIPLE_OWNER } PEContext_t; /** * Check whether a request should be allowed. * - * @param context Pointer to Policy Engine context to use. - * @param subjectId Pointer to Id of the requesting entity. - * @param resource Pointer to URI of Resource being requested. - * @param permission Requested permission. + * @param context is the pointer to Policy Engine context to use. + * @param subjectId is the pointer to Id of the requesting entity. + * @param resource is the pointer to URI of Resource being requested. + * @param permission is the requested permission. * - * @return ACCESS_GRANTED if request should go through, - * otherwise some flavor of ACCESS_DENIED + * @return ::ACCESS_GRANTED if request should go through, otherwise some flavor of ACCESS_DENIED. */ SRMAccessResponse_t CheckPermission( PEContext_t *context, @@ -74,34 +76,38 @@ SRMAccessResponse_t CheckPermission( * Initialize the Policy Engine. Call this before calling CheckPermission(). * TODO Eventually this and DeInit() need to be called from a new * "SRMInit(SRMContext_t *)" function, TBD after BeachHead. - * @param context Pointer to Policy Engine context to initialize. - * @return OC_STACK_OK for Success, otherwise some error value + * @param context is the pointer to Policy Engine context to initialize. + * + * @return ::OC_STACK_OK for Success, otherwise some error value. */ OCStackResult InitPolicyEngine(PEContext_t *context); /** * De-Initialize the Policy Engine. Call this before exiting to allow Policy * Engine to do cleanup on context. - * @param context Pointer to Policy Engine context to de-initialize. - * @return none + * + * @param context is the pointer to Policy Engine context to de-initialize. */ void DeInitPolicyEngine(PEContext_t *context); /** - * Return the uint16_t CRUDN permission corresponding to passed CAMethod_t. + * Get CRUDN permission for a method. + * + * @param method is CRUDN permission being seeked. + * + * @return the uint16_t CRUDN permission . */ uint16_t GetPermissionFromCAMethod_t(const CAMethod_t method); - /* * This method reset Policy Engine context to default state and update * it's state to @param state. * - * @param context Policy engine context. - * @param state Set Policy engine state to this. - * - * @return none + * @param context is the policy engine context. + * @param state set Policy engine state to this. */ void SetPolicyEngineState(PEContext_t *context, const PEState_t state); +typedef OCStackResult (*GetSvrRownerId_t)(OicUuid_t *rowner); + #endif //IOTVT_SRM_PE_H