Merge "Remove unused openssl-devel dependency" into tizen
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / ca_adapter_net_ssl.h
index a558137..a7e31bd 100644 (file)
 extern "C" {
 #endif //__cplusplus
 
-#include "caadapterutils.h"
-#include "cainterface.h"
+#include "cacommon.h"
+#include "casecurityinterface.h"
 
 /**
- * Currently TLS supported adapters(2) WIFI and ETHENET for linux platform.
+ * Currently TLS 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);
+typedef CAResult_t (*CAPacketReceivedCallback)(const CASecureEndpoint_t *sep,
+                                         const void *data, size_t dataLength);
 
-typedef void (*CAPacketSendCallback)(CAEndpoint_t *endpoint,
-                                         const void *data, uint32_t dataLength);
+typedef ssize_t (*CAPacketSendCallback)(CAEndpoint_t *endpoint,
+                                        const void *data, size_t dataLength);
 
 /**
  * Select the cipher suite for dtls handshake
  *
  * @param[in] cipher    cipher suite
- *                             0xC018 : TLS_ECDH_anon_WITH_AES_128_CBC_SHA_256
- *                             0xC0A8 : TLS_PSK_WITH_AES_128_CCM_8
- *                             0xC0AE : TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
+ *                        TLS_RSA_WITH_AES_256_CBC_SHA256          0x3D
+ *                        TLS_RSA_WITH_AES_128_GCM_SHA256          0x009C
+ *                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  0xC02B
+ *                        TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8       0xC0AE
+ *                        TLS_ECDHE_ECDSA_WITH_AES_128_CCM         0xC0AC
+ *                        TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256  0xC023
+ *                        TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384  0xC024
+ *                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384  0xC02C
+ *                        TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256    0xC037
+ *                        TLS_ECDH_anon_WITH_AES_128_CBC_SHA       0xC018
  *
  * @retval  ::CA_STATUS_OK for success, otherwise some error value
  */
@@ -82,6 +89,19 @@ void CAsetSslCredentialsCallback(CAgetPskCredentialsHandler credCallback);
  */
 CAResult_t CAcloseSslConnection(const CAEndpoint_t *endpoint);
 
+#ifdef __TIZEN__
+/**
+ * Close the DTLS session and free endpoint.
+ *
+ * @param[in] endpoint  information of network address;
+ *            CAcloseSslConnectionWrapper takes ownership of endpoint
+ *
+ * @retval  ::CA_STATUS_OK    Successful.
+ * @retval  ::CA_STATUS_FAILED Operation failed.
+ */
+CAResult_t CAcloseSslConnectionFreeEndpoint(CAEndpoint_t *endpoint);
+#endif //__TIZEN__
+
 /**
  * initialize mbedTLS library and other necessary initialization.
  *
@@ -171,6 +191,30 @@ CAResult_t CAsslGenerateOwnerPsk(const CAEndpoint_t *endpoint,
                     const uint8_t* rsrcServerDeviceId, const size_t rsrcServerDeviceIdLen,
                     const uint8_t* provServerDeviceId, const size_t provServerDeviceIdLen,
                     uint8_t* ownerPsk, const size_t ownerPskSize);
+
+#ifdef MULTIPLE_OWNER
+/**
+ * Gets CA secure endpoint info corresponding for endpoint.
+ *
+ * @param[in]  peer    remote address
+ *
+ * @return  CASecureEndpoint or NULL
+ */
+const CASecureEndpoint_t *GetCASecureEndpointData(const CAEndpoint_t* peer);
+#endif
+
+/**
+ * Sets CA secure endpoint identity with uuid.
+ *
+ * @param[in]  peer    remote address
+ * @param[in]  uuid    UUID data to set
+ *
+ * @retval  ::CA_STATUS_OK for success, otherwise some error value
+ */
+CAResult_t SetCASecureEndpointUuid(const CAEndpoint_t *peer, const char *uuid);
+
+bool CAIsExistSslPeer(const CAEndpoint_t *peer);
+
 #ifdef __cplusplus
 }
 #endif //__cplusplus