]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_UDP_IP.h
Change version numbers in preparation for V7.6.0 release.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-UDP / include / FreeRTOS_UDP_IP.h
1 /*\r
2  * FreeRTOS+UDP V1.0.2 (C) 2013 Real Time Engineers ltd.\r
3  * All rights reserved\r
4  *\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
7  *\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
14  *\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
21  *\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
28  *\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
35  *\r
36  * 1 tab == 4 spaces!\r
37  *\r
38  * http://www.FreeRTOS.org\r
39  * http://www.FreeRTOS.org/udp\r
40  *\r
41  */\r
42 \r
43 #ifndef FREERTOS_IP_H\r
44 #define FREERTOS_IP_H\r
45 \r
46 /* Use in FreeRTOSIPConfig.h. */\r
47 #define FREERTOS_LITTLE_ENDIAN  0\r
48 #define FREERTOS_BIG_ENDIAN             1\r
49 \r
50 /* Application level configuration options. */\r
51 #include "FreeRTOSIPConfig.h"\r
52 #include "FreeRTOSIPConfigDefaults.h"\r
53 #include "IPTraceMacroDefaults.h"\r
54 \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
58 \r
59 #include "pack_struct_start.h"\r
60 struct xMAC_ADDRESS\r
61 {\r
62         uint8_t ucBytes[ ipMAC_ADDRESS_LENGTH_BYTES ];\r
63 }\r
64 #include "pack_struct_end.h"\r
65 typedef struct xMAC_ADDRESS xMACAddress_t;\r
66 \r
67 typedef enum eNETWORK_EVENTS\r
68 {\r
69         eNetworkUp,             /* The network is configured. */\r
70         eNetworkDown    /* The network connection has been lost. */\r
71 } eIPCallbackEvent_t;\r
72 \r
73 typedef enum ePING_REPLY_STATUS\r
74 {\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
79 \r
80 /* Endian related definitions. */\r
81 #if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )\r
82 \r
83         uint16_t FreeRTOS_htons( uint16_t usIn );\r
84         uint32_t FreeRTOS_htonl( uint32_t ulIn );\r
85 \r
86 #else\r
87 \r
88         #define FreeRTOS_htons( x ) ( x )\r
89         #define FreeRTOS_htonl( x ) ( x )\r
90 \r
91 #endif /* ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN */\r
92 \r
93 #define FreeRTOS_ntohs( x ) FreeRTOS_htons( x )\r
94 #define FreeRTOS_ntohl( x ) FreeRTOS_htonl( x )\r
95 \r
96 /**\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
100  */\r
101 portBASE_TYPE 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, portTickType xBlockTimeTicks );\r
103 void FreeRTOS_GetAddressConfiguration( uint32_t *pulIPAddress, uint32_t *pulNetMask, uint32_t *pulGatewayAddress, uint32_t *pulDNSServerAddress );\r
104 portBASE_TYPE FreeRTOS_SendPingRequest( uint32_t ulIPAddress, size_t xNumberOfBytesToSend, portTickType 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
109 \r
110 #if ( ipconfigFREERTOS_PLUS_NABTO == 1 )\r
111         portBASE_TYPE xStartNabtoTask( void );\r
112 #endif\r
113 \r
114 #endif /* FREERTOS_IP_H */\r
115 \r
116 \r
117 \r
118 \r
119 \r
120 \r
121 \r
122 \r
123 \r
124 \r
125 \r
126 \r
127 \r