merge master code to build iotivity
[platform/upstream/iotivity.git] / resource / csdk / security / include / securevirtualresourcetypes.h
index 6df713b..2f69026 100644 (file)
@@ -58,7 +58,9 @@ extern "C" {
 #define SUBJECT_NOT_FOUND_DEF         (1 << 3)
 #define RESOURCE_NOT_FOUND_DEF        (1 << 4)
 #define POLICY_ENGINE_ERROR_DEF       (1 << 5)
+#define INVALID_PERIOD_DEF            (1 << 6)
 #define REASON_MASK_DEF               (INSUFFICIENT_PERMISSION_DEF | \
+                                       INVALID_PERIOD_DEF | \
                                        SUBJECT_NOT_FOUND_DEF | \
                                        RESOURCE_NOT_FOUND_DEF | \
                                        POLICY_ENGINE_ERROR_DEF)
@@ -102,6 +104,8 @@ typedef enum
 {
     ACCESS_GRANTED = ACCESS_GRANTED_DEF,
     ACCESS_DENIED = ACCESS_DENIED_DEF,
+    ACCESS_DENIED_INVALID_PERIOD = ACCESS_DENIED_DEF
+        | INVALID_PERIOD_DEF,
     ACCESS_DENIED_INSUFFICIENT_PERMISSION = ACCESS_DENIED_DEF
         | INSUFFICIENT_PERMISSION_DEF,
     ACCESS_DENIED_SUBJECT_NOT_FOUND = ACCESS_DENIED_DEF
@@ -208,6 +212,13 @@ typedef enum OicSecDpom
     SINGLE_SERVICE_CLIENT_DRIVEN    = 0x3,
 } OicSecDpom_t;
 
+typedef enum OicSecSvcType
+{
+    SERVICE_UNKNOWN                 = 0x0,
+    ACCESS_MGMT_SERVICE             = 0x1,  //urn:oic.sec.ams
+} OicSecSvcType_t;
+
+
 //TODO: Need more clarification on deviceIDFormat field type.
 #if 0
 typedef enum
@@ -222,7 +233,8 @@ typedef enum
     OIC_MODE_SWITCH                         = 0x1,
     OIC_RANDOM_DEVICE_PIN                   = 0x2,
     OIC_PRE_PROVISIONED_DEVICE_PIN          = 0x3,
-    OIC_PRE_PROVISION_STRONG_CREDENTIAL     = 0x4
+    OIC_PRE_PROVISION_STRONG_CREDENTIAL     = 0x4,
+    OIC_OXM_COUNT
 }OicSecOxm_t;
 
 typedef struct OicSecJwk OicSecJwk_t;
@@ -279,9 +291,9 @@ struct OicSecAcl
     size_t              resourcesLen;   // the number of elts in Resources
     char                **resources;    // 1:R:M:Y:String
     uint16_t            permission;     // 2:R:S:Y:UINT16
-    size_t              periodsLen;     // the number of elts in Periods
-    char                **periods;      // 3:R:M*:N:String (<--M*; see Spec)
-    char                *recurrences;   // 5:R:M:N:String
+    size_t              prdRecrLen;     // the number of elts in Periods
+    char                **periods;       // 3:R:M*:N:String (<--M*; see Spec)
+    char                **recurrences;   // 5:R:M:N:String
     size_t              ownersLen;      // the number of elts in Owners
     OicUuid_t           *owners;        // 8:R:M:Y:oic.uuid
     // NOTE: we are using UUID for Owners instead of Svc type for mid-April
@@ -302,13 +314,14 @@ struct OicSecAmacl
     size_t              resourcesLen;   // the number of elts in Resources
     char                **resources;    // 0:R:M:Y:String
     size_t              amssLen;        // the number of elts in Amss
-    OicSecSvc_t         *amss;          // 1:R:M:Y:acl
+    OicUuid_t           *amss;          // 1:R:M:Y:acl
     size_t              ownersLen;      // the number of elts in Owners
     OicUuid_t           *owners;        // 2:R:M:Y:oic.uuid
     // NOTE: we are using UUID for Owners instead of Svc type for mid-April
     // SRM version only; this will change to Svc type for full implementation.
     //TODO change Owners type to oic.sec.svc
     //OicSecSvc_t         *Owners;        // 2:R:M:Y:oic.sec.svc
+    OicSecAmacl_t         *next;
 };
 
 /**
@@ -408,7 +421,11 @@ struct OicSecSacl
 struct OicSecSvc
 {
     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
-    //TODO fill in from OIC Security Spec
+    OicUuid_t               svcdid;                 //0:R:S:Y:oic.uuid
+    OicSecSvcType_t         svct;                   //1:R:M:Y:OIC Service Type
+    size_t                  ownersLen;              //2:the number of elts in Owners
+    OicUuid_t               *owners;                //3:R:M:Y:oic.uuid
+    OicSecSvc_t             *next;
 };
 
 #ifdef __cplusplus