X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Fapi%2Fcacommon.h;h=464f24bb387da3a55178a0f748222bd373de197a;hb=390866079e285d2c74918432c0d597d5da52f8a0;hp=b85364c8e0b0e3375bf762b9bba6ac76bc9bc4c8;hpb=3e9402ad71cb3e93266a77796f44d17bab9853fd;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/api/cacommon.h b/resource/csdk/connectivity/api/cacommon.h index b85364c..464f24b 100644 --- a/resource/csdk/connectivity/api/cacommon.h +++ b/resource/csdk/connectivity/api/cacommon.h @@ -26,10 +26,17 @@ #ifndef CA_COMMON_H_ #define CA_COMMON_H_ +#ifdef TCP_ADAPTER +#define HAVE_SYS_POLL_H +#endif + #include #include #include +#ifdef HAVE_SYS_POLL_H +#include +#endif #ifdef __cplusplus extern "C" @@ -141,7 +148,9 @@ typedef enum CA_ADAPTER_REMOTE_ACCESS = (1 << 3), // Remote Access over XMPP. #endif - CA_ADAPTER_TCP = (1 << 4), // CoAP over TCP + CA_ADAPTER_TCP = (1 << 4), // CoAP over TCP + CA_ADAPTER_NFC = (1 << 5), // NFC Adapter + CA_ALL_ADAPTERS = 0xffffffff } CATransportAdapter_t; @@ -276,6 +285,7 @@ typedef enum CA_DESTINATION_DISCONNECTED, /**< Destination is disconnected */ CA_NOT_SUPPORTED, /**< Not supported */ CA_STATUS_NOT_INITIALIZED, /**< Not Initialized*/ + CA_DTLS_AUTHENTICATION_FAILURE, /**< Decryption error in DTLS */ CA_STATUS_FAILED =255 /**< Failure */ /* Result code - END HERE */ } CAResult_t; @@ -424,22 +434,6 @@ typedef struct } CAErrorInfo_t; /** - * CA Remote Access information for XMPP Client - * - */ -typedef struct -{ - char *hostname; /**< XMPP server hostname */ - uint16_t port; /**< XMPP server serivce port */ - char *xmpp_domain; /**< XMPP login domain */ - char *username; /**< login username */ - char *password; /**< login password */ - char *resource; /**< specific resource for login */ - char *user_jid; /**< specific JID for login */ -} CARAInfo_t; - - -/** * Hold global variables for CA layer (also used by RI layer) */ typedef struct @@ -511,9 +505,6 @@ typedef struct struct calayer { CAHistory_t requestHistory; /**< filter IP family in requests */ - CAHistory_t responseHistory; /**< filter IP family in responses */ - CATransportFlags_t previousRequestFlags;/**< address family filtering */ - uint16_t previousRequestMessageId; /**< address family filtering */ } ca; #ifdef TCP_ADAPTER @@ -526,6 +517,8 @@ typedef struct void *svrlist; /**< unicast IPv4 TCP server information*/ int selectTimeout; /**< in seconds */ int listenBacklog; /**< backlog counts*/ + int shutdownFds[2]; /**< shutdown pipe */ + 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 */ @@ -536,6 +529,38 @@ typedef struct extern CAGlobals_t caglobals; +/** + * Callback function type for request delivery. + * @param[out] object Endpoint object from which the request is received. + * It contains endpoint address based on the connectivity type. + * @param[out] requestInfo Info for resource model to understand about the request. + */ +typedef void (*CARequestCallback)(const CAEndpoint_t *object, + const CARequestInfo_t *requestInfo); + +/** + * Callback function type for response delivery. + * @param[out] object Endpoint object from which the response is received. + * @param[out] responseInfo Identifier which needs to be mapped with response. + */ +typedef void (*CAResponseCallback)(const CAEndpoint_t *object, + const CAResponseInfo_t *responseInfo); +/** + * Callback function type for error. + * @param[out] object remote device information. + * @param[out] errorInfo CA Error information. + */ +typedef void (*CAErrorCallback)(const CAEndpoint_t *object, + const CAErrorInfo_t *errorInfo); + +/** + * Callback function type for network status changes delivery from CA common logic. + * @param[out] info Endpoint object from which the network status is changed. + * It contains endpoint address based on the connectivity type. + * @param[out] status Current network status info. + */ +typedef void (*CANetworkMonitorCallback)(const CAEndpoint_t *info, CANetworkStatus_t status); + #ifdef __cplusplus } /* extern "C" */ #endif