2 * FreeRTOS+UDP V1.0.3 (C) 2014 Real Time Engineers ltd.
\r
3 * All rights reserved
\r
5 * This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license
\r
6 * terms are different to the FreeRTOS license terms.
\r
8 * FreeRTOS+UDP uses a dual license model that allows the software to be used
\r
9 * under a standard GPL open source license, or a commercial license. The
\r
10 * standard GPL license (unlike the modified GPL license under which FreeRTOS
\r
11 * itself is distributed) requires that all software statically linked with
\r
12 * FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
\r
13 * Details of both license options follow:
\r
15 * - Open source licensing -
\r
16 * FreeRTOS+UDP is a free download and may be used, modified, evaluated and
\r
17 * distributed without charge provided the user adheres to version two of the
\r
18 * GNU General Public License (GPL) and does not remove the copyright notice or
\r
19 * this text. The GPL V2 text is available on the gnu.org web site, and on the
\r
20 * following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
\r
22 * - Commercial licensing -
\r
23 * Businesses and individuals that for commercial or other reasons cannot comply
\r
24 * with the terms of the GPL V2 license must obtain a commercial license before
\r
25 * incorporating FreeRTOS+UDP into proprietary software for distribution in any
\r
26 * form. Commercial licenses can be purchased from http://shop.freertos.org/udp
\r
27 * and do not require any source files to be changed.
\r
29 * FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot
\r
30 * use FreeRTOS+UDP unless you agree that you use the software 'as is'.
\r
31 * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied
\r
32 * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
33 * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they
\r
34 * implied, expressed, or statutory.
\r
36 * 1 tab == 4 spaces!
\r
38 * http://www.FreeRTOS.org
\r
39 * http://www.FreeRTOS.org/udp
\r
43 #ifndef FREERTOS_IP_H
\r
44 #define FREERTOS_IP_H
\r
46 /* Use in FreeRTOSIPConfig.h. */
\r
47 #define FREERTOS_LITTLE_ENDIAN 0
\r
48 #define FREERTOS_BIG_ENDIAN 1
\r
50 /* Application level configuration options. */
\r
51 #include "FreeRTOSIPConfig.h"
\r
52 #include "FreeRTOSIPConfigDefaults.h"
\r
53 #include "IPTraceMacroDefaults.h"
\r
55 /* The number of octets in the MAC and IP addresses respectively. */
\r
56 #define ipMAC_ADDRESS_LENGTH_BYTES ( 6 )
\r
57 #define ipIP_ADDRESS_LENGTH_BYTES ( 4 )
\r
59 #include "pack_struct_start.h"
\r
62 uint8_t ucBytes[ ipMAC_ADDRESS_LENGTH_BYTES ];
\r
64 #include "pack_struct_end.h"
\r
65 typedef struct xMAC_ADDRESS xMACAddress_t;
\r
67 typedef enum eNETWORK_EVENTS
\r
69 eNetworkUp, /* The network is configured. */
\r
70 eNetworkDown /* The network connection has been lost. */
\r
71 } eIPCallbackEvent_t;
\r
73 typedef enum ePING_REPLY_STATUS
\r
75 eSuccess = 0, /* A correct reply has been received for an outgoing ping. */
\r
76 eInvalidChecksum, /* A reply was received for an outgoing ping but the checksum of the reply was incorrect. */
\r
77 eInvalidData /* A reply was received to an outgoing ping but the payload of the reply was not correct. */
\r
78 } ePingReplyStatus_t;
\r
80 /* Endian related definitions. */
\r
81 #if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )
\r
83 uint16_t FreeRTOS_htons( uint16_t usIn );
\r
84 uint32_t FreeRTOS_htonl( uint32_t ulIn );
\r
88 #define FreeRTOS_htons( x ) ( x )
\r
89 #define FreeRTOS_htonl( x ) ( x )
\r
91 #endif /* ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN */
\r
93 #define FreeRTOS_ntohs( x ) FreeRTOS_htons( x )
\r
94 #define FreeRTOS_ntohl( x ) FreeRTOS_htonl( x )
\r
97 * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE
\r
98 * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:
\r
99 * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml
\r
101 BaseType_t FreeRTOS_IPInit( const uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucNetMask[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucGatewayAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucDNSServerAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ] );
\r
102 void * FreeRTOS_GetUDPPayloadBuffer( size_t xRequestedSizeBytes, TickType_t xBlockTimeTicks );
\r
103 void FreeRTOS_GetAddressConfiguration( uint32_t *pulIPAddress, uint32_t *pulNetMask, uint32_t *pulGatewayAddress, uint32_t *pulDNSServerAddress );
\r
104 BaseType_t FreeRTOS_SendPingRequest( uint32_t ulIPAddress, size_t xNumberOfBytesToSend, TickType_t xBlockTimeTicks );
\r
105 void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent );
\r
106 void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier );
\r
107 void FreeRTOS_ReleaseUDPPayloadBuffer( void *pvBuffer );
\r
108 uint8_t * FreeRTOS_GetMACAddress( void );
\r
110 #if ( ipconfigFREERTOS_PLUS_NABTO == 1 )
\r
111 BaseType_t xStartNabtoTask( void );
\r
114 #endif /* FREERTOS_IP_H */
\r