]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include/FreeRTOS_DHCP.h
a49909eb2e42184a3202a1a542c8022895ff0704
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-TCP / include / FreeRTOS_DHCP.h
1 /*
2  * FreeRTOS+TCP V2.2.0
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://aws.amazon.com/freertos
23  * http://www.FreeRTOS.org
24  */
25
26 #ifndef FREERTOS_DHCP_H
27 #define FREERTOS_DHCP_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /* Application level configuration options. */
34 #include "FreeRTOSIPConfig.h"
35 #include "IPTraceMacroDefaults.h"
36
37 /* Used in the DHCP callback if ipconfigUSE_DHCP_HOOK is set to 1. */
38 typedef enum eDHCP_PHASE
39 {
40         eDHCPPhasePreDiscover,  /* Driver is about to send a DHCP discovery. */
41         eDHCPPhasePreRequest,   /* Driver is about to request DHCP an IP address. */
42 #if( ipconfigDHCP_SEND_DISCOVER_AFTER_AUTO_IP != 0 )
43         eDHCPPhasePreLLA,               /* Driver is about to try get an LLA address */
44 #endif /* ipconfigDHCP_SEND_DISCOVER_AFTER_AUTO_IP */
45 } eDHCPCallbackPhase_t;
46
47 /* Used in the DHCP callback if ipconfigUSE_DHCP_HOOK is set to 1. */
48 typedef enum eDHCP_ANSWERS
49 {
50         eDHCPContinue,                  /* Continue the DHCP process */
51         eDHCPUseDefaults,               /* Stop DHCP and use the static defaults. */
52         eDHCPStopNoChanges,             /* Stop DHCP and continue with current settings. */
53 } eDHCPCallbackAnswer_t;
54
55 /*
56  * NOT A PUBLIC API FUNCTION.
57  */
58 void vDHCPProcess( BaseType_t xReset );
59
60 /* Internal call: returns true if socket is the current DHCP socket */
61 BaseType_t xIsDHCPSocket( Socket_t xSocket );
62
63 /* Prototype of the hook (or callback) function that must be provided by the
64 application if ipconfigUSE_DHCP_HOOK is set to 1.  See the following URL for
65 usage information:
66 http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html#ipconfigUSE_DHCP_HOOK
67 */
68 eDHCPCallbackAnswer_t xApplicationDHCPHook( eDHCPCallbackPhase_t eDHCPPhase, uint32_t ulIPAddress );
69
70 #ifdef __cplusplus
71 }       /* extern "C" */
72 #endif
73
74 #endif /* FREERTOS_DHCP_H */
75
76
77
78
79
80
81
82
83
84
85
86
87