Revert "[CONPRO-1568] Ignoring duplicate IPv6/Ipv4 messages"
[platform/upstream/iotivity.git] / resource / csdk / connectivity / api / cacommon.h
index fe713ba..d1e53f7 100755 (executable)
@@ -27,6 +27,9 @@
 #define CA_COMMON_H_
 
 #include "iotivity_config.h"
+#ifdef WITH_PROCESS_EVENT
+#include "ocevent.h"
+#endif
 
 #ifndef WITH_ARDUINO
 #ifdef TCP_ADAPTER
@@ -95,6 +98,11 @@ extern "C"
 #define CA_MAX_TOKEN_LEN (8)
 
 /**
+* Max interface name length.
+*/
+#define CA_MAX_INTERFACE_NAME_LEN (16)
+
+/**
  * Max URI length.
  */
 #ifdef ARDUINO
@@ -374,6 +382,7 @@ typedef enum
     CA_NOT_ACCEPTABLE = 406,                /**< Not Acceptable */
     CA_REQUEST_ENTITY_INCOMPLETE = 408,     /**< Request Entity Incomplete */
     CA_REQUEST_ENTITY_TOO_LARGE = 413,      /**< Request Entity Too Large */
+    CA_TOO_MANY_REQUESTS = 429,             /**< Too Many Requests */
     CA_INTERNAL_SERVER_ERROR = 500,         /**< Internal Server Error */
     CA_NOT_IMPLEMENTED = 501,               /**< Not Implenented */
     CA_BAD_GATEWAY = 502,                   /**< Bad Gateway */
@@ -394,7 +403,9 @@ typedef enum
     CA_RESPONSE_DATA,
     CA_ERROR_DATA,
     CA_RESPONSE_FOR_RES,
-    CA_NETWORK_COMMAND
+    CA_NETWORK_COMMAND,
+    CA_REQUEST_DATA_SERVER_INIT,
+    CA_RESPONSE_DATA_CLIENT_INIT
 } CADataType_t;
 
 typedef enum
@@ -605,7 +616,6 @@ typedef struct
 #endif
 #endif
         int selectTimeout;          /**< in seconds */
-        int maxfd;                  /**< highest fd (for select) */
         bool started;               /**< the IP adapter has started */
         bool terminate;             /**< the IP adapter needs to stop */
         bool ipv6enabled;           /**< IPv6 enabled by OCInit flags */
@@ -646,9 +656,9 @@ typedef struct
         int shutdownFds[2];     /**< shutdown pipe */
 #endif
         int connectionFds[2];   /**< connection pipe */
-        int maxfd;              /**< highest fd (for select) */
         bool started;           /**< the TCP adapter has started */
         bool terminate;         /**< the TCP adapter needs to stop */
+        bool bindenabled;       /**< binding of TCP socket enabled */
         bool ipv4tcpenabled;    /**< IPv4 TCP enabled by OCInit flags */
         bool ipv6tcpenabled;    /**< IPv6 TCP enabled by OCInit flags */
     } tcp;
@@ -696,6 +706,14 @@ typedef void (*CAErrorCallback)(const CAEndpoint_t *object,
  */
 typedef void (*CANetworkMonitorCallback)(const CAEndpoint_t *info, CANetworkStatus_t status);
 
+/**
+ * Callback function type for editing bluetooth advertisement data before starting bluetooth advertisement.
+ * param[in]   max_data_size    Maximal size of advertisement data array
+ * param[out]  data             Advertisement data array
+ * param[out]  data_size        Actual Data size of advertisement data array
+ */
+typedef void (*CAAdvertisementDataGetterCB)(int max_data_size, char *data, int *data_size);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif