replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / stack / include / internal / ocresource.h
old mode 100644 (file)
new mode 100755 (executable)
index 0a30750..091381f
@@ -61,19 +61,6 @@ typedef struct PRESENCERESOURCE{
 struct rsrc_t;
 
 /**
- * Typedefs for stack interface
- * IF here stands for Interface
- */
-
-typedef enum {
-    STACK_IF_DEFAULT = 0,
-    STACK_IF_LL,
-    STACK_IF_BATCH,
-    STACK_IF_GROUP,
-    STACK_IF_INVALID
-} OCStackIfTypes;
-
-/**
  * following structure will be created in occollection.
  */
 
@@ -155,10 +142,10 @@ typedef struct attr_t {
     /** The name of the attribute; used to look up the attribute in list.
      *  for a given attribute SHOULD not be changed once assigned.
      */
-    const char *attrName;
+    char *attrName;
 
-    /** value of the attribute as string.*/
-    char *attrValue;
+    /** value of the attribute as void. To support both string and @OCStringLL value*/
+    void *attrValue;
 } OCAttribute;
 
 /**
@@ -183,6 +170,13 @@ typedef struct resourceinterface_t {
     /** Future placeholder for access control and policy.*/
 } OCResourceInterface;
 
+/**
+ * Data structure for holding child resources associated with a collection
+ */
+typedef struct OCChildResource {
+    struct OCResource *rsrcResource;
+    struct OCChildResource *next;
+} OCChildResource;
 
 /**
  * Data structure for holding data type and definition for OIC resource.
@@ -207,7 +201,8 @@ typedef struct OCResource {
     /** Array of pointers to resources; can be used to represent a container of resources.
      * (i.e. hierarchies of resources) or for reference resources (i.e. for a resource collection).*/
 
-    struct OCResource *rsrcResources[MAX_CONTAINED_RESOURCES];
+    /** Child resource(s); linked list.*/
+    OCChildResource *rsrcChildResourcesHead;
 
     /** Pointer to function that handles the entity bound to the resource.
      *  This handler has to be explicitly defined by the programmer.*/
@@ -232,6 +227,17 @@ typedef struct OCResource {
 
     /** Pointer of ActionSet which to support group action.*/
     OCActionSet *actionsetHead;
+
+    /** The instance identifier for this web link in an array of web links - used in links. */
+    union
+    {
+        /** An ordinal number that is not repeated - must be unique in the collection context. */
+        int64_t ins;
+        /** Any unique string including a URI. */
+        char *uniqueStr;
+        /** Use UUID for universal uniqueness - used in /oic/res to identify the device. */
+        OCIdentity uniqueUUID;
+    };
 } OCResource;