]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include/FreeRTOS_DHCP.h
Added +TCP code to main repo.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-TCP / include / FreeRTOS_DHCP.h
1 /*\r
2  * FreeRTOS+TCP Labs Build 160919 (C) 2016 Real Time Engineers ltd.\r
3  * Authors include Hein Tibosch and Richard Barry\r
4  *\r
5  *******************************************************************************\r
6  ***** NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ***\r
7  ***                                                                         ***\r
8  ***                                                                         ***\r
9  ***   FREERTOS+TCP IS STILL IN THE LAB (mainly because the FTP and HTTP     ***\r
10  ***   demos have a dependency on FreeRTOS+FAT, which is only in the Labs    ***\r
11  ***   download):                                                            ***\r
12  ***                                                                         ***\r
13  ***   FreeRTOS+TCP is functional and has been used in commercial products   ***\r
14  ***   for some time.  Be aware however that we are still refining its       ***\r
15  ***   design, the source code does not yet quite conform to the strict      ***\r
16  ***   coding and style standards mandated by Real Time Engineers ltd., and  ***\r
17  ***   the documentation and testing is not necessarily complete.            ***\r
18  ***                                                                         ***\r
19  ***   PLEASE REPORT EXPERIENCES USING THE SUPPORT RESOURCES FOUND ON THE    ***\r
20  ***   URL: http://www.FreeRTOS.org/contact  Active early adopters may, at   ***\r
21  ***   the sole discretion of Real Time Engineers Ltd., be offered versions  ***\r
22  ***   under a license other than that described below.                      ***\r
23  ***                                                                         ***\r
24  ***                                                                         ***\r
25  ***** NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ***\r
26  *******************************************************************************\r
27  *\r
28  * FreeRTOS+TCP can be used under two different free open source licenses.  The\r
29  * license that applies is dependent on the processor on which FreeRTOS+TCP is\r
30  * executed, as follows:\r
31  *\r
32  * If FreeRTOS+TCP is executed on one of the processors listed under the Special\r
33  * License Arrangements heading of the FreeRTOS+TCP license information web\r
34  * page, then it can be used under the terms of the FreeRTOS Open Source\r
35  * License.  If FreeRTOS+TCP is used on any other processor, then it can be used\r
36  * under the terms of the GNU General Public License V2.  Links to the relevant\r
37  * licenses follow:\r
38  *\r
39  * The FreeRTOS+TCP License Information Page: http://www.FreeRTOS.org/tcp_license\r
40  * The FreeRTOS Open Source License: http://www.FreeRTOS.org/license\r
41  * The GNU General Public License Version 2: http://www.FreeRTOS.org/gpl-2.0.txt\r
42  *\r
43  * FreeRTOS+TCP is distributed in the hope that it will be useful.  You cannot\r
44  * use FreeRTOS+TCP unless you agree that you use the software 'as is'.\r
45  * FreeRTOS+TCP is provided WITHOUT ANY WARRANTY; without even the implied\r
46  * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
47  * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
48  * implied, expressed, or statutory.\r
49  *\r
50  * 1 tab == 4 spaces!\r
51  *\r
52  * http://www.FreeRTOS.org\r
53  * http://www.FreeRTOS.org/plus\r
54  * http://www.FreeRTOS.org/labs\r
55  *\r
56  */\r
57 \r
58 #ifndef FREERTOS_DHCP_H\r
59 #define FREERTOS_DHCP_H\r
60 \r
61 #ifdef __cplusplus\r
62 extern "C" {\r
63 #endif\r
64 \r
65 /* Application level configuration options. */\r
66 #include "FreeRTOSIPConfig.h"\r
67 #include "IPTraceMacroDefaults.h"\r
68 \r
69 /* Used in the DHCP callback if ipconfigUSE_DHCP_HOOK is set to 1. */\r
70 typedef enum eDHCP_PHASE\r
71 {\r
72         eDHCPPhasePreDiscover,  /* Driver is about to send a DHCP discovery. */\r
73         eDHCPPhasePreRequest,   /* Driver is about to request DHCP an IP address. */\r
74 #if( ipconfigDHCP_SEND_DISCOVER_AFTER_AUTO_IP != 0 )\r
75         eDHCPPhasePreLLA,               /* Driver is about to try get an LLA address */\r
76 #endif /* ipconfigDHCP_SEND_DISCOVER_AFTER_AUTO_IP */\r
77 } eDHCPCallbackPhase_t;\r
78 \r
79 /* Used in the DHCP callback if ipconfigUSE_DHCP_HOOK is set to 1. */\r
80 typedef enum eDHCP_ANSWERS\r
81 {\r
82         eDHCPContinue,                  /* Continue the DHCP process */\r
83         eDHCPUseDefaults,               /* Stop DHCP and use the static defaults. */\r
84         eDHCPStopNoChanges,             /* Stop DHCP and continue with current settings. */\r
85 } eDHCPCallbackAnswer_t;\r
86 \r
87 /*\r
88  * NOT A PUBLIC API FUNCTION.\r
89  */\r
90 void vDHCPProcess( BaseType_t xReset );\r
91 \r
92 /* Internal call: returns true if socket is the current DHCP socket */\r
93 BaseType_t xIsDHCPSocket( Socket_t xSocket );\r
94 \r
95 /* Prototype of the hook (or callback) function that must be provided by the\r
96 application if ipconfigUSE_DHCP_HOOK is set to 1.  See the following URL for\r
97 usage information:\r
98 http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html#ipconfigUSE_DHCP_HOOK\r
99 */\r
100 eDHCPCallbackAnswer_t xApplicationDHCPHook( eDHCPCallbackPhase_t eDHCPPhase, uint32_t ulIPAddress );\r
101 \r
102 #ifdef __cplusplus\r
103 }       /* extern "C" */\r
104 #endif\r
105 \r
106 #endif /* FREERTOS_DHCP_H */\r
107 \r
108 \r
109 \r
110 \r
111 \r
112 \r
113 \r
114 \r
115 \r
116 \r
117 \r
118 \r
119 \r