/*\r
- * FreeRTOS+UDP V1.0.2 (C) 2013 Real Time Engineers ltd.\r
- * All rights reserved\r
+ * FreeRTOS+UDP V1.0.4\r
+ * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\r
*\r
- * This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license\r
- * terms are different to the FreeRTOS license terms.\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
- * FreeRTOS+UDP uses a dual license model that allows the software to be used \r
- * under a standard GPL open source license, or a commercial license. The \r
- * standard GPL license (unlike the modified GPL license under which FreeRTOS \r
- * itself is distributed) requires that all software statically linked with \r
- * FreeRTOS+UDP is also distributed under the same GPL V2 license terms. \r
- * Details of both license options follow:\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software. If you wish to use our Amazon\r
+ * FreeRTOS name, please do so in a fair use way that does not cause confusion.\r
*\r
- * - Open source licensing -\r
- * FreeRTOS+UDP is a free download and may be used, modified, evaluated and\r
- * distributed without charge provided the user adheres to version two of the\r
- * GNU General Public License (GPL) and does not remove the copyright notice or\r
- * this text. The GPL V2 text is available on the gnu.org web site, and on the\r
- * following URL: http://www.FreeRTOS.org/gpl-2.0.txt.\r
- *\r
- * - Commercial licensing -\r
- * Businesses and individuals that for commercial or other reasons cannot comply\r
- * with the terms of the GPL V2 license must obtain a commercial license before \r
- * incorporating FreeRTOS+UDP into proprietary software for distribution in any \r
- * form. Commercial licenses can be purchased from http://shop.freertos.org/udp \r
- * and do not require any source files to be changed.\r
- *\r
- * FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot\r
- * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
- * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
- * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
- * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
- * implied, expressed, or statutory.\r
- *\r
- * 1 tab == 4 spaces!\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://www.FreeRTOS.org\r
- * http://www.FreeRTOS.org/udp\r
+ * http://aws.amazon.com/freertos\r
*\r
+ * 1 tab == 4 spaces!\r
*/\r
\r
#ifndef FREERTOS_UDP_H\r
#if ipconfigBYTE_ORDER == FREERTOS_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
+ ( ( ( ( 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 ), "%d.%d.%d.%d", \\r
- ( ( ulIPAddress ) & 0xffUL ), \\r
- ( ( ( ulIPAddress ) >> 8UL ) & 0xffUL ), \\r
- ( ( ( ulIPAddress ) >> 16UL ) & 0xffUL ), \\r
- ( ( ( ulIPAddress ) >> 24UL ) & 0xffUL ) )\r
+ ( int ) ( ( ulIPAddress ) & 0xffUL ), \\r
+ ( int ) ( ( ( ulIPAddress ) >> 8UL ) & 0xffUL ),\\r
+ ( int ) ( ( ( ulIPAddress ) >> 16UL ) & 0xffUL ),\\r
+ ( int ) ( ( ( ulIPAddress ) >> 24UL ) & 0xffUL ) )\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
+ ( ( ( ( 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 ), "%d.%d.%d.%d", \\r
- ( ( ( ulIPAddress ) >> 24UL ) & 0xffUL ) ), \\r
+ ( ( ( ulIPAddress ) >> 24UL ) & 0xffUL ), \\r
( ( ( ulIPAddress ) >> 16UL ) & 0xffUL ), \\r
( ( ( ulIPAddress ) >> 8UL ) & 0xffUL ), \\r
- ( ( ulIPAddress ) & 0xffUL )\r
+ ( ( ulIPAddress ) & 0xffUL ) )\r
\r
#endif /* ipconfigBYTE_ORDER */\r
\r
/* The socket type itself. */\r
typedef void *xSocket_t;\r
\r
-/* The xSocketSet_t type is the equivalent to the fd_set type used by the \r
+/* The xSocketSet_t type is the equivalent to the fd_set type used by the\r
Berkeley API. */\r
typedef void *xSocketSet_t;\r
\r
* FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:\r
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml\r
*/\r
-xSocket_t FreeRTOS_socket( portBASE_TYPE xDomain, portBASE_TYPE xType, portBASE_TYPE xProtocol );\r
+xSocket_t FreeRTOS_socket( BaseType_t xDomain, BaseType_t xType, BaseType_t xProtocol );\r
int32_t FreeRTOS_recvfrom( xSocket_t xSocket, void *pvBuffer, size_t xBufferLength, uint32_t ulFlags, struct freertos_sockaddr *pxSourceAddress, socklen_t *pxSourceAddressLength );\r
int32_t FreeRTOS_sendto( xSocket_t xSocket, const void *pvBuffer, size_t xTotalDataLength, uint32_t ulFlags, const struct freertos_sockaddr *pxDestinationAddress, socklen_t xDestinationAddressLength );\r
-portBASE_TYPE FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );\r
-portBASE_TYPE FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength );\r
-portBASE_TYPE FreeRTOS_closesocket( xSocket_t xSocket );\r
-uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName );\r
-uint32_t FreeRTOS_inet_addr( const uint8_t * pucIPAddress );\r
+BaseType_t FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );\r
+BaseType_t FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength );\r
+BaseType_t FreeRTOS_closesocket( xSocket_t xSocket );\r
+uint32_t FreeRTOS_gethostbyname( const char *pcHostName );\r
+uint32_t FreeRTOS_inet_addr( const char *pcIPAddress );\r
\r
#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
- xSocketSet_t FreeRTOS_CreateSocketSet( unsigned portBASE_TYPE uxEventQueueLength );\r
- portBASE_TYPE FreeRTOS_FD_SET( xSocket_t xSocket, xSocketSet_t xSocketSet );\r
- portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet );\r
- xSocket_t FreeRTOS_select( xSocketSet_t xSocketSet, portTickType xBlockTimeTicks );\r
+ xSocketSet_t FreeRTOS_CreateSocketSet( UBaseType_t uxEventQueueLength );\r
+ BaseType_t FreeRTOS_FD_SET( xSocket_t xSocket, xSocketSet_t xSocketSet );\r
+ BaseType_t FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet );\r
+ xSocket_t FreeRTOS_select( xSocketSet_t xSocketSet, TickType_t xBlockTimeTicks );\r
#endif /* ipconfigSUPPORT_SELECT_FUNCTION */\r
\r
#endif /* FREERTOS_UDP_H */\r