/**
* Connect to TCP Server.
- * @param[in] TCPServerInfo TCP Server information.
- * @return TCP Server Information structure.
+ *
+ * @param[in] endpoint remote endpoint information.
+ * @return TCP Session Information structure.
*/
-CATCPServerInfo_t *CAConnectToTCPServer(const CAEndpoint_t *TCPServerInfo);
+CATCPSessionInfo_t *CAConnectTCPSession(const CAEndpoint_t *endpoint);
/**
* Disconnect from TCP Server.
- * @param[in] TCPServerInfo TCP Server information.
+ *
+ * @param[in] svritem TCP session information.
+ * @param[in] index current session index in list.
* @return ::CA_STATUS_OK or Appropriate error code.
*/
-CAResult_t CADisconnectFromTCPServer(const CAEndpoint_t *TCPServerInfo);
+CAResult_t CADisconnectTCPSession(CATCPSessionInfo_t *svritem, size_t index);
+
+/**
+ * Disconnect all connection from TCP Server.
+ */
+void CATCPDisconnectAll();
/**
- * Get TCP Connection Information from list.
- * @param[in] addr TCP Server address.
- * @param[in] port TCP Server port.
+ * Get TCP connection information from list.
+ *
+ * @param[in] endpoint remote endpoint information.
* @param[out] index index of array list.
+ * @return TCP Session Information structure.
+ */
+CATCPSessionInfo_t *CAGetTCPSessionInfoFromEndpoint(const CAEndpoint_t *endpoint,
+ size_t *index);
+
+/**
+ * Get total length from CoAP over TCP header.
+ *
+ * @param[in] recvBuffer received header data.
+ * @return total data length
+ */
+size_t CAGetTotalLengthFromHeader(const unsigned char *recvBuffer);
+
+/**
+ * Get session information from file descriptor index.
+ *
+ * @param[in] fd file descriptor.
+ * @param[out] index index of array list
* @return TCP Server Information structure.
*/
-CATCPServerInfo_t *CAGetTCPServerInfoFromList(const char *addr, const uint16_t port,
- uint32_t *index);
+CATCPSessionInfo_t *CAGetSessionInfoFromFD(int fd, size_t *index);
#ifdef __cplusplus
}