Merge tizen_5.0 codes into tizen_4.0
[platform/upstream/iotivity.git] / resource / csdk / stack / include / octypes.h
index f1ed8b1..1a5797b 100644 (file)
@@ -39,9 +39,6 @@
 extern "C" {
 #endif // __cplusplus
 
-/** For the feature presence.*/
-#define WITH_PRESENCE
-
 #include "ocpresence.h"
 
 // TODO : need for secure psi
@@ -82,24 +79,18 @@ extern "C" {
 /** KeepAlive URI.*/
 #define OC_RSRVD_KEEPALIVE_URI                "/oic/ping"
 
-#ifdef WITH_PRESENCE
-/** Presence */
-
 /** Presence URI through which the OIC devices advertise their presence.*/
 #define OC_RSRVD_PRESENCE_URI                 "/oic/ad"
 
 /** Presence URI through which the OIC devices advertise their device presence.*/
 #define OC_RSRVD_DEVICE_PRESENCE_URI         "/oic/prs"
 
-#endif // WITH_PRESENCE
-
 /** For multicast Discovery mechanism.*/
 #define OC_MULTICAST_DISCOVERY_URI            "/oic/res"
 
 /** Separator for multiple query string.*/
 #define OC_QUERY_SEPARATOR                    "&;"
 
-#ifdef WITH_PRESENCE
 /**
  *  OC_DEFAULT_PRESENCE_TTL_SECONDS sets the default time to live (TTL) for presence.
  */
@@ -127,8 +118,6 @@ extern "C" {
 /** To delete.*/
 #define OC_RSRVD_TRIGGER_DELETE         "delete"
 
-#endif // WITH_PRESENCE
-
 /**
  *  Attributes used to form a proper OIC conforming JSON message.
  */
@@ -155,10 +144,8 @@ extern "C" {
 /** To represent resource type.*/
 #define OC_RSRVD_RESOURCE_TYPE          "rt"
 
-#ifdef WITH_PRESENCE
 /** To represent resource type with presence.*/
 #define OC_RSRVD_RESOURCE_TYPE_PRESENCE "oic.wk.ad"
-#endif
 
 /** To represent resource type with device.*/
 #define OC_RSRVD_RESOURCE_TYPE_DEVICE   "oic.wk.d"
@@ -848,11 +835,9 @@ typedef enum
     /** Register observe request for all notifications, including stale notifications.*/
     OC_REST_OBSERVE_ALL    = (1 << 5),
 
-#ifdef WITH_PRESENCE
     /** Subscribe for all presence notifications of a particular resource.*/
     OC_REST_PRESENCE       = (1 << 7),
 
-#endif
     /** Allows OCDoResource caller to do discovery.*/
     OC_REST_DISCOVER       = (1 << 8)
 } OCMethod;
@@ -1033,11 +1018,9 @@ typedef enum
     OC_STACK_NOT_ALLOWED_OXM,
 
     /** Insert all new error codes here!.*/
-#ifdef WITH_PRESENCE
     OC_STACK_PRESENCE_STOPPED = 128,
     OC_STACK_PRESENCE_TIMEOUT,
     OC_STACK_PRESENCE_DO_NOT_HANDLE,
-#endif
 
     /** Request is denied by the user*/
     OC_STACK_USER_DENIED_REQ,
@@ -1046,6 +1029,7 @@ typedef enum
 
     /** ERROR code from server */
     OC_STACK_FORBIDDEN_REQ,          /** 403*/
+    OC_STACK_TOO_MANY_REQUESTS,      /** 429*/
     OC_STACK_INTERNAL_SERVER_ERROR,  /** 500*/
     OC_STACK_NOT_IMPLEMENTED,        /** 501*/
     OC_STACK_BAD_GATEWAY,            /** 502*/
@@ -1170,6 +1154,7 @@ typedef enum
     OC_EH_NOT_ACCEPTABLE = 406,
     OC_EH_TOO_LARGE = 413,
     OC_EH_UNSUPPORTED_MEDIA_TYPE = 415,
+    OC_EH_TOO_MANY_REQUESTS = 429,
     OC_EH_INTERNAL_SERVER_ERROR = 500,
     OC_EH_NOT_IMPLEMENTED = 501,
     OC_EH_BAD_GATEWAY = 502,
@@ -1315,10 +1300,8 @@ typedef enum
     PAYLOAD_TYPE_REPRESENTATION,
     /** The payload is an OCSecurityPayload */
     PAYLOAD_TYPE_SECURITY,
-#ifdef WITH_PRESENCE
     /** The payload is an OCPresencePayload */
     PAYLOAD_TYPE_PRESENCE
-#endif
 } OCPayloadType;
 
 /**
@@ -1456,7 +1439,6 @@ typedef struct
     size_t payloadSize;
 } OCSecurityPayload;
 
-#ifdef WITH_PRESENCE
 typedef struct
 {
     OCPayload base;
@@ -1465,7 +1447,6 @@ typedef struct
     OCPresenceTrigger trigger;
     char* resourceType;
 } OCPresencePayload;
-#endif
 
 /**
  * Incoming requests handled by the server. Requests are passed in as a parameter to the
@@ -1542,7 +1523,7 @@ typedef struct
     uint8_t numRcvdVendorSpecificHeaderOptions;
 
     /** An array of the received vendor specific header options.*/
-    OCHeaderOption rcvdVendorSpecificHeaderOptions[MAX_HEADER_OPTIONS];
+    OCHeaderOption *rcvdVendorSpecificHeaderOptions;
 } OCClientResponse;
 
 /**