]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include/FreeRTOS_Sockets.h
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-TCP / include / FreeRTOS_Sockets.h
index 88d3bba651225c932624199d3d4b09215386d82d..926ccebbdb4265c8fe4fe7da024d70ff26bcbc58 100644 (file)
-/*\r
- * FreeRTOS+TCP V2.2.0\r
- * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
- * this software and associated documentation files (the "Software"), to deal in\r
- * the Software without restriction, including without limitation the rights to\r
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
- * the Software, and to permit persons to whom the Software is furnished to do so,\r
- * subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in all\r
- * copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- *\r
- * http://aws.amazon.com/freertos\r
- * http://www.FreeRTOS.org\r
- */\r
-\r
-#ifndef FREERTOS_SOCKETS_H\r
-#define FREERTOS_SOCKETS_H\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/* Standard includes. */\r
-#include <string.h>\r
-\r
-/* Application level configuration options. */\r
-#include "FreeRTOSIPConfig.h"\r
-\r
-#ifndef FREERTOS_IP_CONFIG_H\r
-       #error FreeRTOSIPConfig.h has not been included yet\r
-#endif\r
-\r
-/* Event bit definitions are required by the select functions. */\r
-#include "event_groups.h"\r
-\r
-#ifndef INC_FREERTOS_H\r
-       #error FreeRTOS.h must be included before FreeRTOS_Sockets.h.\r
-#endif\r
-\r
-#ifndef INC_TASK_H\r
-       #ifndef TASK_H /* For compatibility with older FreeRTOS versions. */\r
-               #error The FreeRTOS header file task.h must be included before FreeRTOS_Sockets.h.\r
-       #endif\r
-#endif\r
-\r
-/* Assigned to an Socket_t variable when the socket is not valid, probably\r
-because it could not be created. */\r
-#define FREERTOS_INVALID_SOCKET        ( ( Socket_t ) ~0U )\r
-\r
-/* API function error values.  As errno is supported, the FreeRTOS sockets\r
-functions return error codes rather than just a pass or fail indication. */\r
-/* HT: Extended the number of error codes, gave them positive values and if possible\r
-the corresponding found in errno.h\r
-In case of an error, API's will still return negative numbers, e.g.\r
-  return -pdFREERTOS_ERRNO_EWOULDBLOCK;\r
-in case an operation would block */\r
-\r
-/* The following defines are obsolete, please use -pdFREERTOS_ERRNO_Exxx */\r
-\r
-#define FREERTOS_SOCKET_ERROR  ( -1 )\r
-#define FREERTOS_EWOULDBLOCK   ( - pdFREERTOS_ERRNO_EWOULDBLOCK )\r
-#define FREERTOS_EINVAL                        ( - pdFREERTOS_ERRNO_EINVAL )\r
-#define FREERTOS_EADDRNOTAVAIL ( - pdFREERTOS_ERRNO_EADDRNOTAVAIL )\r
-#define FREERTOS_EADDRINUSE            ( - pdFREERTOS_ERRNO_EADDRINUSE )\r
-#define FREERTOS_ENOBUFS               ( - pdFREERTOS_ERRNO_ENOBUFS )\r
-#define FREERTOS_ENOPROTOOPT   ( - pdFREERTOS_ERRNO_ENOPROTOOPT )\r
-#define FREERTOS_ECLOSED               ( - pdFREERTOS_ERRNO_ENOTCONN )\r
-\r
-/* Values for the parameters to FreeRTOS_socket(), inline with the Berkeley\r
-standard.  See the documentation of FreeRTOS_socket() for more information. */\r
-#define FREERTOS_AF_INET               ( 2 )\r
-#define FREERTOS_AF_INET6              ( 10 )\r
-#define FREERTOS_SOCK_DGRAM            ( 2 )\r
-#define FREERTOS_IPPROTO_UDP   ( 17 )\r
-\r
-#define FREERTOS_SOCK_STREAM   ( 1 )\r
-#define FREERTOS_IPPROTO_TCP   ( 6 )\r
-/* IP packet of type "Any local network"\r
- * can be used in stead of TCP for testing with sockets in raw mode\r
- */\r
-#define FREERTOS_IPPROTO_USR_LAN  ( 63 )\r
-\r
-/* A bit value that can be passed into the FreeRTOS_sendto() function as part of\r
-the flags parameter.  Setting the FREERTOS_ZERO_COPY in the flags parameter\r
-indicates that the zero copy interface is being used.  See the documentation for\r
-FreeRTOS_sockets() for more information. */\r
-#define FREERTOS_ZERO_COPY             ( 1 )\r
-\r
-/* Values that can be passed in the option name parameter of calls to\r
-FreeRTOS_setsockopt(). */\r
-#define FREERTOS_SO_RCVTIMEO                   ( 0 )           /* Used to set the receive time out. */\r
-#define FREERTOS_SO_SNDTIMEO                   ( 1 )           /* Used to set the send time out. */\r
-#define FREERTOS_SO_UDPCKSUM_OUT               ( 2 )           /* Used to turn the use of the UDP checksum by a socket on or off.  This also doubles as part of an 8-bit bitwise socket option. */\r
-#if( ipconfigSOCKET_HAS_USER_SEMAPHORE == 1 )\r
-       #define FREERTOS_SO_SET_SEMAPHORE       ( 3 )           /* Used to set a user's semaphore */\r
-#endif\r
-#define FREERTOS_SO_SNDBUF                             ( 4 )           /* Set the size of the send buffer (TCP only) */\r
-#define FREERTOS_SO_RCVBUF                             ( 5 )           /* Set the size of the receive buffer (TCP only) */\r
-\r
-#if ipconfigUSE_CALLBACKS == 1\r
-       #define FREERTOS_SO_TCP_CONN_HANDLER    ( 6 )           /* Install a callback for (dis) connection events. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-       #define FREERTOS_SO_TCP_RECV_HANDLER    ( 7 )           /* Install a callback for receiving TCP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-       #define FREERTOS_SO_TCP_SENT_HANDLER    ( 8 )           /* Install a callback for sending TCP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-       #define FREERTOS_SO_UDP_RECV_HANDLER    ( 9 )           /* Install a callback for receiving UDP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-       #define FREERTOS_SO_UDP_SENT_HANDLER    ( 10 )          /* Install a callback for sending UDP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-#endif /* ipconfigUSE_CALLBACKS */\r
-\r
-#define FREERTOS_SO_REUSE_LISTEN_SOCKET        ( 11 )          /* When a listening socket gets connected, do not create a new one but re-use it */\r
-#define FREERTOS_SO_CLOSE_AFTER_SEND   ( 12 )          /* As soon as the last byte has been transmitted, finalise the connection */\r
-#define FREERTOS_SO_WIN_PROPERTIES             ( 13 )          /* Set all buffer and window properties in one call, parameter is pointer to WinProperties_t */\r
-#define FREERTOS_SO_SET_FULL_SIZE              ( 14 )          /* Refuse to send packets smaller than MSS  */\r
-\r
-#define FREERTOS_SO_STOP_RX                            ( 15 )          /* Temporarily hold up reception, used by streaming client */\r
-\r
-#if( ipconfigUDP_MAX_RX_PACKETS > 0 )\r
-       #define FREERTOS_SO_UDP_MAX_RX_PACKETS  ( 16 )          /* This option helps to limit the maximum number of packets a UDP socket will buffer */\r
-#endif\r
-\r
-#if( ipconfigSOCKET_HAS_USER_WAKE_CALLBACK == 1 )\r
-       #define FREERTOS_SO_WAKEUP_CALLBACK     ( 17 )\r
-#endif\r
-\r
-#define FREERTOS_SO_SET_LOW_HIGH_WATER ( 18 )\r
-\r
-#define FREERTOS_NOT_LAST_IN_FRAGMENTED_PACKET         ( 0x80 )  /* For internal use only, but also part of an 8-bit bitwise value. */\r
-#define FREERTOS_FRAGMENTED_PACKET                             ( 0x40 )  /* For internal use only, but also part of an 8-bit bitwise value. */\r
-\r
-/* Values for flag for FreeRTOS_shutdown(). */\r
-#define FREERTOS_SHUT_RD                               ( 0 )           /* Not really at this moment, just for compatibility of the interface */\r
-#define FREERTOS_SHUT_WR                               ( 1 )\r
-#define FREERTOS_SHUT_RDWR                             ( 2 )\r
-\r
-/* Values for flag for FreeRTOS_recv(). */\r
-#define FREERTOS_MSG_OOB                               ( 2 )           /* process out-of-band data */\r
-#define FREERTOS_MSG_PEEK                              ( 4 )           /* peek at incoming message */\r
-#define FREERTOS_MSG_DONTROUTE                 ( 8 )           /* send without using routing tables */\r
-#define FREERTOS_MSG_DONTWAIT                  ( 16 )          /* Can be used with recvfrom(), sendto(), recv(), and send(). */\r
-\r
-typedef struct xWIN_PROPS {\r
-       /* Properties of the Tx buffer and Tx window */\r
-       int32_t lTxBufSize;     /* Unit: bytes */\r
-       int32_t lTxWinSize;     /* Unit: MSS */\r
-\r
-       /* Properties of the Rx buffer and Rx window */\r
-       int32_t lRxBufSize;     /* Unit: bytes */\r
-       int32_t lRxWinSize;     /* Unit: MSS */\r
-} WinProperties_t;\r
-\r
-typedef struct xLOW_HIGH_WATER {\r
-       /* Structure to pass for the 'FREERTOS_SO_SET_LOW_HIGH_WATER' option */\r
-       size_t uxLittleSpace;   /* Send a STOP when buffer space drops below X bytes */\r
-       size_t uxEnoughSpace;   /* Send a GO when buffer space grows above X bytes */\r
-} LowHighWater_t;\r
-\r
-/* For compatibility with the expected Berkeley sockets naming. */\r
-#define socklen_t uint32_t\r
-\r
-/* For this limited implementation, only two members are required in the\r
-Berkeley style sockaddr structure. */\r
-struct freertos_sockaddr\r
-{\r
-       /* _HT_ On 32- and 64-bit architectures, the addition of the two uint8_t\r
-       fields doesn't make the structure bigger, due to alignment.\r
-       The fields are inserted as a preparation for IPv6. */\r
-\r
-       /* sin_len and sin_family not used in the IPv4-only release. */\r
-       uint8_t sin_len;                /* length of this structure. */\r
-       uint8_t sin_family;             /* FREERTOS_AF_INET. */\r
-       uint16_t sin_port;\r
-       uint32_t sin_addr;\r
-};\r
-\r
-#if ipconfigBYTE_ORDER == pdFREERTOS_LITTLE_ENDIAN\r
-\r
-       #define FreeRTOS_inet_addr_quick( ucOctet0, ucOctet1, ucOctet2, ucOctet3 )                              \\r
-                                                                               ( ( ( ( uint32_t ) ( ucOctet3 ) ) << 24UL ) |           \\r
-                                                                               ( ( ( uint32_t ) ( ucOctet2 ) ) << 16UL ) |                     \\r
-                                                                               ( ( ( uint32_t ) ( ucOctet1 ) ) <<  8UL ) |                     \\r
-                                                                               ( ( uint32_t ) ( ucOctet0 ) ) )\r
-\r
-       #define FreeRTOS_inet_ntoa( ulIPAddress, pucBuffer )                                                                    \\r
-                                                               sprintf( ( char * ) ( pucBuffer ), "%u.%u.%u.%u",                       \\r
-                                                                       ( ( unsigned ) ( ( ulIPAddress ) & 0xffUL ) ),                  \\r
-                                                                       ( ( unsigned ) ( ( ( ulIPAddress ) >> 8 ) & 0xffUL ) ), \\r
-                                                                       ( ( unsigned ) ( ( ( ulIPAddress ) >> 16 ) & 0xffUL ) ),\\r
-                                                                       ( ( unsigned ) ( ( ulIPAddress ) >> 24 ) ) )\r
-\r
-#else /* ipconfigBYTE_ORDER */\r
-\r
-       #define FreeRTOS_inet_addr_quick( ucOctet0, ucOctet1, ucOctet2, ucOctet3 )                              \\r
-                                                                               ( ( ( ( uint32_t ) ( ucOctet0 ) ) << 24UL ) |           \\r
-                                                                               ( ( ( uint32_t ) ( ucOctet1 ) ) << 16UL ) |                     \\r
-                                                                               ( ( ( uint32_t ) ( ucOctet2 ) ) <<  8UL ) |                     \\r
-                                                                               ( ( uint32_t ) ( ucOctet3 ) ) )\r
-\r
-       #define FreeRTOS_inet_ntoa( ulIPAddress, pucBuffer )                                                                    \\r
-                                                               sprintf( ( char * ) ( pucBuffer ), "%u.%u.%u.%u",                       \\r
-                                                                       ( ( unsigned ) ( ( ulIPAddress ) >> 24 ) ),                             \\r
-                                                                       ( ( unsigned ) ( ( ( ulIPAddress ) >> 16 ) & 0xffUL ) ),\\r
-                                                                       ( ( unsigned ) ( ( ( ulIPAddress ) >> 8 ) & 0xffUL ) ), \\r
-                                                                       ( ( unsigned ) ( ( ulIPAddress ) & 0xffUL ) ) )\r
-\r
-#endif /* ipconfigBYTE_ORDER */\r
-\r
-/* The socket type itself. */\r
-struct xSOCKET;\r
-typedef struct xSOCKET *Socket_t;\r
-\r
-/* The SocketSet_t type is the equivalent to the fd_set type used by the\r
-Berkeley API. */\r
-struct xSOCKET_SET;\r
-typedef struct xSOCKET_SET *SocketSet_t;\r
-\r
-/**\r
- * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE\r
- * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:\r
- * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html\r
- */\r
-Socket_t FreeRTOS_socket( BaseType_t xDomain, BaseType_t xType, BaseType_t xProtocol );\r
-int32_t FreeRTOS_recvfrom( Socket_t xSocket, void *pvBuffer, size_t xBufferLength, BaseType_t xFlags, struct freertos_sockaddr *pxSourceAddress, socklen_t *pxSourceAddressLength );\r
-int32_t FreeRTOS_sendto( Socket_t xSocket, const void *pvBuffer, size_t xTotalDataLength, BaseType_t xFlags, const struct freertos_sockaddr *pxDestinationAddress, socklen_t xDestinationAddressLength );\r
-BaseType_t FreeRTOS_bind( Socket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );\r
-\r
-/* function to get the local address and IP port */\r
-size_t FreeRTOS_GetLocalAddress( Socket_t xSocket, struct freertos_sockaddr *pxAddress );\r
-\r
-/* Made available when ipconfigETHERNET_DRIVER_FILTERS_PACKETS is set to 1. */\r
-BaseType_t xPortHasUDPSocket( uint16_t usPortNr );\r
-\r
-#if ipconfigUSE_TCP == 1\r
-\r
-BaseType_t FreeRTOS_connect( Socket_t xClientSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );\r
-BaseType_t FreeRTOS_listen( Socket_t xSocket, BaseType_t xBacklog );\r
-BaseType_t FreeRTOS_recv( Socket_t xSocket, void *pvBuffer, size_t xBufferLength, BaseType_t xFlags );\r
-BaseType_t FreeRTOS_send( Socket_t xSocket, const void *pvBuffer, size_t uxDataLength, BaseType_t xFlags );\r
-Socket_t FreeRTOS_accept( Socket_t xServerSocket, struct freertos_sockaddr *pxAddress, socklen_t *pxAddressLength );\r
-BaseType_t FreeRTOS_shutdown (Socket_t xSocket, BaseType_t xHow);\r
-\r
-#if( ipconfigSUPPORT_SIGNALS != 0 )\r
-       /* Send a signal to the task which is waiting for a given socket. */\r
-       BaseType_t FreeRTOS_SignalSocket( Socket_t xSocket );\r
-\r
-       /* Send a signal to the task which reads from this socket (FromISR\r
-       version). */\r
-       BaseType_t FreeRTOS_SignalSocketFromISR( Socket_t xSocket, BaseType_t *pxHigherPriorityTaskWoken );\r
-#endif /* ipconfigSUPPORT_SIGNALS */\r
-\r
-/* Return the remote address and IP port. */\r
-BaseType_t FreeRTOS_GetRemoteAddress( Socket_t xSocket, struct freertos_sockaddr *pxAddress );\r
-\r
-/* returns pdTRUE if TCP socket is connected */\r
-BaseType_t FreeRTOS_issocketconnected( Socket_t xSocket );\r
-\r
-/* returns the actual size of MSS being used */\r
-BaseType_t FreeRTOS_mss( Socket_t xSocket );\r
-\r
-/* for internal use only: return the connection status */\r
-BaseType_t FreeRTOS_connstatus( Socket_t xSocket );\r
-\r
-/* Returns the number of bytes that may be added to txStream */\r
-BaseType_t FreeRTOS_maywrite( Socket_t xSocket );\r
-\r
-/*\r
- * Two helper functions, mostly for testing\r
- * rx_size returns the number of bytes available in the Rx buffer\r
- * tx_space returns the free space in the Tx buffer\r
- */\r
-BaseType_t FreeRTOS_rx_size( Socket_t xSocket );\r
-BaseType_t FreeRTOS_tx_space( Socket_t xSocket );\r
-BaseType_t FreeRTOS_tx_size( Socket_t xSocket );\r
-\r
-/* Returns the number of outstanding bytes in txStream. */\r
-/* The function FreeRTOS_outstanding() was already implemented\r
-FreeRTOS_tx_size(). */\r
-#define FreeRTOS_outstanding( xSocket )        FreeRTOS_tx_size( xSocket )\r
-\r
-/* Returns the number of bytes in the socket's rxStream. */\r
-/* The function FreeRTOS_recvcount() was already implemented\r
-FreeRTOS_rx_size(). */\r
-#define FreeRTOS_recvcount( xSocket )  FreeRTOS_rx_size( xSocket )\r
-\r
-/*\r
- * For advanced applications only:\r
- * Get a direct pointer to the circular transmit buffer.\r
- * '*pxLength' will contain the number of bytes that may be written.\r
- */\r
-uint8_t *FreeRTOS_get_tx_head( Socket_t xSocket, BaseType_t *pxLength );\r
-\r
-#endif /* ipconfigUSE_TCP */\r
-\r
-/*\r
- * Connect / disconnect handler for a TCP socket\r
- * For example:\r
- *             static void vMyConnectHandler (Socket_t xSocket, BaseType_t ulConnected)\r
- *             {\r
- *             }\r
- *             F_TCP_UDP_Handler_t xHnd = { vMyConnectHandler };\r
- *             FreeRTOS_setsockopt( sock, 0, FREERTOS_SO_TCP_CONN_HANDLER, ( void * ) &xHnd, sizeof( xHnd ) );\r
- */\r
-\r
-typedef void (* FOnConnected_t )( Socket_t /* xSocket */, BaseType_t /* ulConnected */ );\r
-\r
-/*\r
- * Reception handler for a TCP socket\r
- * A user-proved function will be called on reception of a message\r
- * If the handler returns a positive number, the messages will not be stored\r
- * For example:\r
- *             static BaseType_t xOnTCPReceive( Socket_t xSocket, void * pData, size_t xLength )\r
- *             {\r
- *                     // handle the message\r
- *                     return 1;\r
- *             }\r
- *             F_TCP_UDP_Handler_t xHand = { xOnTCPReceive };\r
- *             FreeRTOS_setsockopt( sock, 0, FREERTOS_SO_TCP_RECV_HANDLER, ( void * ) &xHand, sizeof( xHand ) );\r
- */\r
-typedef BaseType_t (* FOnTCPReceive_t )( Socket_t /* xSocket */, void * /* pData */, size_t /* xLength */ );\r
-typedef void (* FOnTCPSent_t )( Socket_t /* xSocket */, size_t /* xLength */ );\r
-\r
-/*\r
- * Reception handler for a UDP socket\r
- * A user-proved function will be called on reception of a message\r
- * If the handler returns a positive number, the messages will not be stored\r
- */\r
-typedef BaseType_t (* FOnUDPReceive_t ) (Socket_t /* xSocket */, void * /* pData */, size_t /* xLength */,\r
-       const struct freertos_sockaddr * /* pxFrom */, const struct freertos_sockaddr * /* pxDest */ );\r
-typedef void (* FOnUDPSent_t )( Socket_t /* xSocket */, size_t /* xLength */ );\r
-\r
-\r
-typedef union xTCP_UDP_HANDLER\r
-{\r
-       FOnConnected_t  pxOnTCPConnected;       /* FREERTOS_SO_TCP_CONN_HANDLER */\r
-       FOnTCPReceive_t pxOnTCPReceive;         /* FREERTOS_SO_TCP_RECV_HANDLER */\r
-       FOnTCPSent_t    pxOnTCPSent;            /* FREERTOS_SO_TCP_SENT_HANDLER */\r
-       FOnUDPReceive_t pxOnUDPReceive;         /* FREERTOS_SO_UDP_RECV_HANDLER */\r
-       FOnUDPSent_t    pxOnUDPSent;            /* FREERTOS_SO_UDP_SENT_HANDLER */\r
-} F_TCP_UDP_Handler_t;\r
-\r
-BaseType_t FreeRTOS_setsockopt( Socket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength );\r
-BaseType_t FreeRTOS_closesocket( Socket_t xSocket );\r
-uint32_t FreeRTOS_gethostbyname( const char *pcHostName );\r
-uint32_t FreeRTOS_inet_addr( const char * pcIPAddress );\r
-\r
-/*\r
- * For the web server: borrow the circular Rx buffer for inspection\r
- * HTML driver wants to see if a sequence of 13/10/13/10 is available\r
- */\r
-const struct xSTREAM_BUFFER *FreeRTOS_get_rx_buf( Socket_t xSocket );\r
-\r
-void FreeRTOS_netstat( void );\r
-\r
-#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
-\r
-       /* For FD_SET and FD_CLR, a combination of the following bits can be used: */\r
-\r
-       typedef enum eSELECT_EVENT {\r
-               eSELECT_READ    = 0x0001,\r
-               eSELECT_WRITE   = 0x0002,\r
-               eSELECT_EXCEPT  = 0x0004,\r
-               eSELECT_INTR    = 0x0008,\r
-               eSELECT_ALL             = 0x000F,\r
-               /* Reserved for internal use: */\r
-               eSELECT_CALL_IP = 0x0010,\r
-               /* end */\r
-       } eSelectEvent_t;\r
-\r
-       SocketSet_t FreeRTOS_CreateSocketSet( void );\r
-       void FreeRTOS_DeleteSocketSet( SocketSet_t xSocketSet );\r
-       void FreeRTOS_FD_SET( Socket_t xSocket, SocketSet_t xSocketSet, EventBits_t xBitsToSet );\r
-       void FreeRTOS_FD_CLR( Socket_t xSocket, SocketSet_t xSocketSet, EventBits_t xBitsToClear );\r
-       EventBits_t FreeRTOS_FD_ISSET( Socket_t xSocket, SocketSet_t xSocketSet );\r
-       BaseType_t FreeRTOS_select( SocketSet_t xSocketSet, TickType_t xBlockTimeTicks );\r
-\r
-#endif /* ipconfigSUPPORT_SELECT_FUNCTION */\r
-\r
-#ifdef __cplusplus\r
-} // extern "C"\r
-#endif\r
-\r
-#endif /* FREERTOS_SOCKETS_H */\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
+/*
+ * FreeRTOS+TCP V2.2.0
+ * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * http://aws.amazon.com/freertos
+ * http://www.FreeRTOS.org
+ */
+
+#ifndef FREERTOS_SOCKETS_H
+#define FREERTOS_SOCKETS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Standard includes. */
+#include <string.h>
+
+/* Application level configuration options. */
+#include "FreeRTOSIPConfig.h"
+
+#ifndef FREERTOS_IP_CONFIG_H
+       #error FreeRTOSIPConfig.h has not been included yet
+#endif
+
+/* Event bit definitions are required by the select functions. */
+#include "event_groups.h"
+
+#ifndef INC_FREERTOS_H
+       #error FreeRTOS.h must be included before FreeRTOS_Sockets.h.
+#endif
+
+#ifndef INC_TASK_H
+       #ifndef TASK_H /* For compatibility with older FreeRTOS versions. */
+               #error The FreeRTOS header file task.h must be included before FreeRTOS_Sockets.h.
+       #endif
+#endif
+
+/* Assigned to an Socket_t variable when the socket is not valid, probably
+because it could not be created. */
+#define FREERTOS_INVALID_SOCKET        ( ( Socket_t ) ~0U )
+
+/* API function error values.  As errno is supported, the FreeRTOS sockets
+functions return error codes rather than just a pass or fail indication. */
+/* HT: Extended the number of error codes, gave them positive values and if possible
+the corresponding found in errno.h
+In case of an error, API's will still return negative numbers, e.g.
+  return -pdFREERTOS_ERRNO_EWOULDBLOCK;
+in case an operation would block */
+
+/* The following defines are obsolete, please use -pdFREERTOS_ERRNO_Exxx */
+
+#define FREERTOS_SOCKET_ERROR  ( -1 )
+#define FREERTOS_EWOULDBLOCK   ( - pdFREERTOS_ERRNO_EWOULDBLOCK )
+#define FREERTOS_EINVAL                        ( - pdFREERTOS_ERRNO_EINVAL )
+#define FREERTOS_EADDRNOTAVAIL ( - pdFREERTOS_ERRNO_EADDRNOTAVAIL )
+#define FREERTOS_EADDRINUSE            ( - pdFREERTOS_ERRNO_EADDRINUSE )
+#define FREERTOS_ENOBUFS               ( - pdFREERTOS_ERRNO_ENOBUFS )
+#define FREERTOS_ENOPROTOOPT   ( - pdFREERTOS_ERRNO_ENOPROTOOPT )
+#define FREERTOS_ECLOSED               ( - pdFREERTOS_ERRNO_ENOTCONN )
+
+/* Values for the parameters to FreeRTOS_socket(), inline with the Berkeley
+standard.  See the documentation of FreeRTOS_socket() for more information. */
+#define FREERTOS_AF_INET               ( 2 )
+#define FREERTOS_AF_INET6              ( 10 )
+#define FREERTOS_SOCK_DGRAM            ( 2 )
+#define FREERTOS_IPPROTO_UDP   ( 17 )
+
+#define FREERTOS_SOCK_STREAM   ( 1 )
+#define FREERTOS_IPPROTO_TCP   ( 6 )
+/* IP packet of type "Any local network"
+ * can be used in stead of TCP for testing with sockets in raw mode
+ */
+#define FREERTOS_IPPROTO_USR_LAN  ( 63 )
+
+/* A bit value that can be passed into the FreeRTOS_sendto() function as part of
+the flags parameter.  Setting the FREERTOS_ZERO_COPY in the flags parameter
+indicates that the zero copy interface is being used.  See the documentation for
+FreeRTOS_sockets() for more information. */
+#define FREERTOS_ZERO_COPY             ( 1 )
+
+/* Values that can be passed in the option name parameter of calls to
+FreeRTOS_setsockopt(). */
+#define FREERTOS_SO_RCVTIMEO                   ( 0 )           /* Used to set the receive time out. */
+#define FREERTOS_SO_SNDTIMEO                   ( 1 )           /* Used to set the send time out. */
+#define FREERTOS_SO_UDPCKSUM_OUT               ( 2 )           /* Used to turn the use of the UDP checksum by a socket on or off.  This also doubles as part of an 8-bit bitwise socket option. */
+#if( ipconfigSOCKET_HAS_USER_SEMAPHORE == 1 )
+       #define FREERTOS_SO_SET_SEMAPHORE       ( 3 )           /* Used to set a user's semaphore */
+#endif
+#define FREERTOS_SO_SNDBUF                             ( 4 )           /* Set the size of the send buffer (TCP only) */
+#define FREERTOS_SO_RCVBUF                             ( 5 )           /* Set the size of the receive buffer (TCP only) */
+
+#if ipconfigUSE_CALLBACKS == 1
+       #define FREERTOS_SO_TCP_CONN_HANDLER    ( 6 )           /* Install a callback for (dis) connection events. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */
+       #define FREERTOS_SO_TCP_RECV_HANDLER    ( 7 )           /* Install a callback for receiving TCP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */
+       #define FREERTOS_SO_TCP_SENT_HANDLER    ( 8 )           /* Install a callback for sending TCP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */
+       #define FREERTOS_SO_UDP_RECV_HANDLER    ( 9 )           /* Install a callback for receiving UDP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */
+       #define FREERTOS_SO_UDP_SENT_HANDLER    ( 10 )          /* Install a callback for sending UDP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */
+#endif /* ipconfigUSE_CALLBACKS */
+
+#define FREERTOS_SO_REUSE_LISTEN_SOCKET        ( 11 )          /* When a listening socket gets connected, do not create a new one but re-use it */
+#define FREERTOS_SO_CLOSE_AFTER_SEND   ( 12 )          /* As soon as the last byte has been transmitted, finalise the connection */
+#define FREERTOS_SO_WIN_PROPERTIES             ( 13 )          /* Set all buffer and window properties in one call, parameter is pointer to WinProperties_t */
+#define FREERTOS_SO_SET_FULL_SIZE              ( 14 )          /* Refuse to send packets smaller than MSS  */
+
+#define FREERTOS_SO_STOP_RX                            ( 15 )          /* Temporarily hold up reception, used by streaming client */
+
+#if( ipconfigUDP_MAX_RX_PACKETS > 0 )
+       #define FREERTOS_SO_UDP_MAX_RX_PACKETS  ( 16 )          /* This option helps to limit the maximum number of packets a UDP socket will buffer */
+#endif
+
+#if( ipconfigSOCKET_HAS_USER_WAKE_CALLBACK == 1 )
+       #define FREERTOS_SO_WAKEUP_CALLBACK     ( 17 )
+#endif
+
+#define FREERTOS_SO_SET_LOW_HIGH_WATER ( 18 )
+
+#define FREERTOS_NOT_LAST_IN_FRAGMENTED_PACKET         ( 0x80 )  /* For internal use only, but also part of an 8-bit bitwise value. */
+#define FREERTOS_FRAGMENTED_PACKET                             ( 0x40 )  /* For internal use only, but also part of an 8-bit bitwise value. */
+
+/* Values for flag for FreeRTOS_shutdown(). */
+#define FREERTOS_SHUT_RD                               ( 0 )           /* Not really at this moment, just for compatibility of the interface */
+#define FREERTOS_SHUT_WR                               ( 1 )
+#define FREERTOS_SHUT_RDWR                             ( 2 )
+
+/* Values for flag for FreeRTOS_recv(). */
+#define FREERTOS_MSG_OOB                               ( 2 )           /* process out-of-band data */
+#define FREERTOS_MSG_PEEK                              ( 4 )           /* peek at incoming message */
+#define FREERTOS_MSG_DONTROUTE                 ( 8 )           /* send without using routing tables */
+#define FREERTOS_MSG_DONTWAIT                  ( 16 )          /* Can be used with recvfrom(), sendto(), recv(), and send(). */
+
+typedef struct xWIN_PROPS {
+       /* Properties of the Tx buffer and Tx window */
+       int32_t lTxBufSize;     /* Unit: bytes */
+       int32_t lTxWinSize;     /* Unit: MSS */
+
+       /* Properties of the Rx buffer and Rx window */
+       int32_t lRxBufSize;     /* Unit: bytes */
+       int32_t lRxWinSize;     /* Unit: MSS */
+} WinProperties_t;
+
+typedef struct xLOW_HIGH_WATER {
+       /* Structure to pass for the 'FREERTOS_SO_SET_LOW_HIGH_WATER' option */
+       size_t uxLittleSpace;   /* Send a STOP when buffer space drops below X bytes */
+       size_t uxEnoughSpace;   /* Send a GO when buffer space grows above X bytes */
+} LowHighWater_t;
+
+/* For compatibility with the expected Berkeley sockets naming. */
+#define socklen_t uint32_t
+
+/* For this limited implementation, only two members are required in the
+Berkeley style sockaddr structure. */
+struct freertos_sockaddr
+{
+       /* _HT_ On 32- and 64-bit architectures, the addition of the two uint8_t
+       fields doesn't make the structure bigger, due to alignment.
+       The fields are inserted as a preparation for IPv6. */
+
+       /* sin_len and sin_family not used in the IPv4-only release. */
+       uint8_t sin_len;                /* length of this structure. */
+       uint8_t sin_family;             /* FREERTOS_AF_INET. */
+       uint16_t sin_port;
+       uint32_t sin_addr;
+};
+
+#if ipconfigBYTE_ORDER == pdFREERTOS_LITTLE_ENDIAN
+
+       #define FreeRTOS_inet_addr_quick( ucOctet0, ucOctet1, ucOctet2, ucOctet3 )                              \
+                                                                               ( ( ( ( uint32_t ) ( ucOctet3 ) ) << 24UL ) |           \
+                                                                               ( ( ( uint32_t ) ( ucOctet2 ) ) << 16UL ) |                     \
+                                                                               ( ( ( uint32_t ) ( ucOctet1 ) ) <<  8UL ) |                     \
+                                                                               ( ( uint32_t ) ( ucOctet0 ) ) )
+
+       #define FreeRTOS_inet_ntoa( ulIPAddress, pucBuffer )                                                                    \
+                                                               sprintf( ( char * ) ( pucBuffer ), "%u.%u.%u.%u",                       \
+                                                                       ( ( unsigned ) ( ( ulIPAddress ) & 0xffUL ) ),                  \
+                                                                       ( ( unsigned ) ( ( ( ulIPAddress ) >> 8 ) & 0xffUL ) ), \
+                                                                       ( ( unsigned ) ( ( ( ulIPAddress ) >> 16 ) & 0xffUL ) ),\
+                                                                       ( ( unsigned ) ( ( ulIPAddress ) >> 24 ) ) )
+
+#else /* ipconfigBYTE_ORDER */
+
+       #define FreeRTOS_inet_addr_quick( ucOctet0, ucOctet1, ucOctet2, ucOctet3 )                              \
+                                                                               ( ( ( ( uint32_t ) ( ucOctet0 ) ) << 24UL ) |           \
+                                                                               ( ( ( uint32_t ) ( ucOctet1 ) ) << 16UL ) |                     \
+                                                                               ( ( ( uint32_t ) ( ucOctet2 ) ) <<  8UL ) |                     \
+                                                                               ( ( uint32_t ) ( ucOctet3 ) ) )
+
+       #define FreeRTOS_inet_ntoa( ulIPAddress, pucBuffer )                                                                    \
+                                                               sprintf( ( char * ) ( pucBuffer ), "%u.%u.%u.%u",                       \
+                                                                       ( ( unsigned ) ( ( ulIPAddress ) >> 24 ) ),                             \
+                                                                       ( ( unsigned ) ( ( ( ulIPAddress ) >> 16 ) & 0xffUL ) ),\
+                                                                       ( ( unsigned ) ( ( ( ulIPAddress ) >> 8 ) & 0xffUL ) ), \
+                                                                       ( ( unsigned ) ( ( ulIPAddress ) & 0xffUL ) ) )
+
+#endif /* ipconfigBYTE_ORDER */
+
+/* The socket type itself. */
+struct xSOCKET;
+typedef struct xSOCKET *Socket_t;
+
+/* The SocketSet_t type is the equivalent to the fd_set type used by the
+Berkeley API. */
+struct xSOCKET_SET;
+typedef struct xSOCKET_SET *SocketSet_t;
+
+/**
+ * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE
+ * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html
+ */
+Socket_t FreeRTOS_socket( BaseType_t xDomain, BaseType_t xType, BaseType_t xProtocol );
+int32_t FreeRTOS_recvfrom( Socket_t xSocket, void *pvBuffer, size_t xBufferLength, BaseType_t xFlags, struct freertos_sockaddr *pxSourceAddress, socklen_t *pxSourceAddressLength );
+int32_t FreeRTOS_sendto( Socket_t xSocket, const void *pvBuffer, size_t xTotalDataLength, BaseType_t xFlags, const struct freertos_sockaddr *pxDestinationAddress, socklen_t xDestinationAddressLength );
+BaseType_t FreeRTOS_bind( Socket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );
+
+/* function to get the local address and IP port */
+size_t FreeRTOS_GetLocalAddress( Socket_t xSocket, struct freertos_sockaddr *pxAddress );
+
+/* Made available when ipconfigETHERNET_DRIVER_FILTERS_PACKETS is set to 1. */
+BaseType_t xPortHasUDPSocket( uint16_t usPortNr );
+
+#if ipconfigUSE_TCP == 1
+
+BaseType_t FreeRTOS_connect( Socket_t xClientSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );
+BaseType_t FreeRTOS_listen( Socket_t xSocket, BaseType_t xBacklog );
+BaseType_t FreeRTOS_recv( Socket_t xSocket, void *pvBuffer, size_t xBufferLength, BaseType_t xFlags );
+BaseType_t FreeRTOS_send( Socket_t xSocket, const void *pvBuffer, size_t uxDataLength, BaseType_t xFlags );
+Socket_t FreeRTOS_accept( Socket_t xServerSocket, struct freertos_sockaddr *pxAddress, socklen_t *pxAddressLength );
+BaseType_t FreeRTOS_shutdown (Socket_t xSocket, BaseType_t xHow);
+
+#if( ipconfigSUPPORT_SIGNALS != 0 )
+       /* Send a signal to the task which is waiting for a given socket. */
+       BaseType_t FreeRTOS_SignalSocket( Socket_t xSocket );
+
+       /* Send a signal to the task which reads from this socket (FromISR
+       version). */
+       BaseType_t FreeRTOS_SignalSocketFromISR( Socket_t xSocket, BaseType_t *pxHigherPriorityTaskWoken );
+#endif /* ipconfigSUPPORT_SIGNALS */
+
+/* Return the remote address and IP port. */
+BaseType_t FreeRTOS_GetRemoteAddress( Socket_t xSocket, struct freertos_sockaddr *pxAddress );
+
+/* returns pdTRUE if TCP socket is connected */
+BaseType_t FreeRTOS_issocketconnected( Socket_t xSocket );
+
+/* returns the actual size of MSS being used */
+BaseType_t FreeRTOS_mss( Socket_t xSocket );
+
+/* for internal use only: return the connection status */
+BaseType_t FreeRTOS_connstatus( Socket_t xSocket );
+
+/* Returns the number of bytes that may be added to txStream */
+BaseType_t FreeRTOS_maywrite( Socket_t xSocket );
+
+/*
+ * Two helper functions, mostly for testing
+ * rx_size returns the number of bytes available in the Rx buffer
+ * tx_space returns the free space in the Tx buffer
+ */
+BaseType_t FreeRTOS_rx_size( Socket_t xSocket );
+BaseType_t FreeRTOS_tx_space( Socket_t xSocket );
+BaseType_t FreeRTOS_tx_size( Socket_t xSocket );
+
+/* Returns the number of outstanding bytes in txStream. */
+/* The function FreeRTOS_outstanding() was already implemented
+FreeRTOS_tx_size(). */
+#define FreeRTOS_outstanding( xSocket )        FreeRTOS_tx_size( xSocket )
+
+/* Returns the number of bytes in the socket's rxStream. */
+/* The function FreeRTOS_recvcount() was already implemented
+FreeRTOS_rx_size(). */
+#define FreeRTOS_recvcount( xSocket )  FreeRTOS_rx_size( xSocket )
+
+/*
+ * For advanced applications only:
+ * Get a direct pointer to the circular transmit buffer.
+ * '*pxLength' will contain the number of bytes that may be written.
+ */
+uint8_t *FreeRTOS_get_tx_head( Socket_t xSocket, BaseType_t *pxLength );
+
+#endif /* ipconfigUSE_TCP */
+
+/*
+ * Connect / disconnect handler for a TCP socket
+ * For example:
+ *             static void vMyConnectHandler (Socket_t xSocket, BaseType_t ulConnected)
+ *             {
+ *             }
+ *             F_TCP_UDP_Handler_t xHnd = { vMyConnectHandler };
+ *             FreeRTOS_setsockopt( sock, 0, FREERTOS_SO_TCP_CONN_HANDLER, ( void * ) &xHnd, sizeof( xHnd ) );
+ */
+
+typedef void (* FOnConnected_t )( Socket_t /* xSocket */, BaseType_t /* ulConnected */ );
+
+/*
+ * Reception handler for a TCP socket
+ * A user-proved function will be called on reception of a message
+ * If the handler returns a positive number, the messages will not be stored
+ * For example:
+ *             static BaseType_t xOnTCPReceive( Socket_t xSocket, void * pData, size_t xLength )
+ *             {
+ *                     // handle the message
+ *                     return 1;
+ *             }
+ *             F_TCP_UDP_Handler_t xHand = { xOnTCPReceive };
+ *             FreeRTOS_setsockopt( sock, 0, FREERTOS_SO_TCP_RECV_HANDLER, ( void * ) &xHand, sizeof( xHand ) );
+ */
+typedef BaseType_t (* FOnTCPReceive_t )( Socket_t /* xSocket */, void * /* pData */, size_t /* xLength */ );
+typedef void (* FOnTCPSent_t )( Socket_t /* xSocket */, size_t /* xLength */ );
+
+/*
+ * Reception handler for a UDP socket
+ * A user-proved function will be called on reception of a message
+ * If the handler returns a positive number, the messages will not be stored
+ */
+typedef BaseType_t (* FOnUDPReceive_t ) (Socket_t /* xSocket */, void * /* pData */, size_t /* xLength */,
+       const struct freertos_sockaddr * /* pxFrom */, const struct freertos_sockaddr * /* pxDest */ );
+typedef void (* FOnUDPSent_t )( Socket_t /* xSocket */, size_t /* xLength */ );
+
+
+typedef union xTCP_UDP_HANDLER
+{
+       FOnConnected_t  pxOnTCPConnected;       /* FREERTOS_SO_TCP_CONN_HANDLER */
+       FOnTCPReceive_t pxOnTCPReceive;         /* FREERTOS_SO_TCP_RECV_HANDLER */
+       FOnTCPSent_t    pxOnTCPSent;            /* FREERTOS_SO_TCP_SENT_HANDLER */
+       FOnUDPReceive_t pxOnUDPReceive;         /* FREERTOS_SO_UDP_RECV_HANDLER */
+       FOnUDPSent_t    pxOnUDPSent;            /* FREERTOS_SO_UDP_SENT_HANDLER */
+} F_TCP_UDP_Handler_t;
+
+BaseType_t FreeRTOS_setsockopt( Socket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength );
+BaseType_t FreeRTOS_closesocket( Socket_t xSocket );
+uint32_t FreeRTOS_gethostbyname( const char *pcHostName );
+uint32_t FreeRTOS_inet_addr( const char * pcIPAddress );
+
+/*
+ * For the web server: borrow the circular Rx buffer for inspection
+ * HTML driver wants to see if a sequence of 13/10/13/10 is available
+ */
+const struct xSTREAM_BUFFER *FreeRTOS_get_rx_buf( Socket_t xSocket );
+
+void FreeRTOS_netstat( void );
+
+#if ipconfigSUPPORT_SELECT_FUNCTION == 1
+
+       /* For FD_SET and FD_CLR, a combination of the following bits can be used: */
+
+       typedef enum eSELECT_EVENT {
+               eSELECT_READ    = 0x0001,
+               eSELECT_WRITE   = 0x0002,
+               eSELECT_EXCEPT  = 0x0004,
+               eSELECT_INTR    = 0x0008,
+               eSELECT_ALL             = 0x000F,
+               /* Reserved for internal use: */
+               eSELECT_CALL_IP = 0x0010,
+               /* end */
+       } eSelectEvent_t;
+
+       SocketSet_t FreeRTOS_CreateSocketSet( void );
+       void FreeRTOS_DeleteSocketSet( SocketSet_t xSocketSet );
+       void FreeRTOS_FD_SET( Socket_t xSocket, SocketSet_t xSocketSet, EventBits_t xBitsToSet );
+       void FreeRTOS_FD_CLR( Socket_t xSocket, SocketSet_t xSocketSet, EventBits_t xBitsToClear );
+       EventBits_t FreeRTOS_FD_ISSET( Socket_t xSocket, SocketSet_t xSocketSet );
+       BaseType_t FreeRTOS_select( SocketSet_t xSocketSet, TickType_t xBlockTimeTicks );
+
+#endif /* ipconfigSUPPORT_SELECT_FUNCTION */
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /* FREERTOS_SOCKETS_H */
+
+
+
+
+
+
+
+
+
+
+
+
+