X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Finc%2Fcaadapternetdtls.h;h=cbe19db66c312118b0eb438fea9e7c7398787450;hb=refs%2Ftags%2Ftizen_4.0.m2_release;hp=d9f6e81dba1f61d5f2b51d57c9887b36f3525a3a;hpb=45c364268c4f5d575d98f4cd88b571b536c6cb17;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/inc/caadapternetdtls.h b/resource/csdk/connectivity/inc/caadapternetdtls.h index d9f6e81..cbe19db 100644 --- a/resource/csdk/connectivity/inc/caadapternetdtls.h +++ b/resource/csdk/connectivity/inc/caadapternetdtls.h @@ -22,21 +22,21 @@ #include "dtls.h" #include "uarraylist.h" -#include "camutex.h" +#include "octhread.h" #include "caadapterutils.h" #include "cainterface.h" #include "cacommon.h" /** - * Currently DTLS supported adapters(2) WIFI and ETHENET for linux platform. + * Currently DTLS supported adapters(3) WIFI, ETHENET and BLE for linux platform. */ -#define MAX_SUPPORTED_ADAPTERS 2 +#define MAX_SUPPORTED_ADAPTERS 3 typedef void (*CAPacketReceivedCallback)(const CASecureEndpoint_t *sep, - const void *data, uint32_t dataLength); + const void *data, size_t dataLength); typedef void (*CAPacketSendCallback)(CAEndpoint_t *endpoint, - const void *data, uint32_t dataLength); + const void *data, size_t dataLength); /** * Data structure for holding the send and recv callbacks. @@ -89,6 +89,9 @@ typedef enum typedef struct { socklen_t size; /**< Size of address. */ +#ifdef _MSC_VER + __declspec(align(8)) +#endif union { struct sockaddr sa; @@ -129,12 +132,6 @@ void CADTLSSetAdapterCallbacks(CAPacketReceivedCallback recvCallback, void CADTLSSetHandshakeCallback(CAErrorCallback dtlsHandshakeCallback); /** - * Register callback to get DTLS PSK credentials. - * @param[in] credCallback callback to get DTLS PSK credentials. - */ -void CADTLSSetCredentialsCallback(CAGetDTLSPskCredentialsHandler credCallback); - -/** * Select the cipher suite for dtls handshake * * @param[in] cipher cipher suite @@ -253,6 +250,18 @@ CAResult_t CAAdapterNetDtlsDecrypt(const CASecureEndpoint_t *sep, uint8_t *data, uint32_t dataLen); + +/** + * API to get a secure connected peer information + * NOTE : This API use the mutex lock to access 'g_caDtlsContext', + * Please do not invoke this API for internal function of dtls adapter + * + * @param[in] peer peer information includs IP address and port. + * + * @ return secure connected peer information on success, otherwise NULL + */ +CASecureEndpoint_t *CAGetSecurePeerInfo(const CAEndpoint_t *peer); + #endif /* CA_ADAPTER_NET_DTLS_H_ */