3 * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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:
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
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.
22 * http://aws.amazon.com/freertos
23 * http://www.FreeRTOS.org
26 #ifndef FREERTOS_DHCP_H
27 #define FREERTOS_DHCP_H
33 /* Application level configuration options. */
34 #include "FreeRTOSIPConfig.h"
35 #include "IPTraceMacroDefaults.h"
37 /* Used in the DHCP callback if ipconfigUSE_DHCP_HOOK is set to 1. */
38 typedef enum eDHCP_PHASE
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;
47 /* Used in the DHCP callback if ipconfigUSE_DHCP_HOOK is set to 1. */
48 typedef enum eDHCP_ANSWERS
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;
56 * NOT A PUBLIC API FUNCTION.
58 void vDHCPProcess( BaseType_t xReset );
60 /* Internal call: returns true if socket is the current DHCP socket */
61 BaseType_t xIsDHCPSocket( Socket_t xSocket );
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
66 http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html#ipconfigUSE_DHCP_HOOK
68 eDHCPCallbackAnswer_t xApplicationDHCPHook( eDHCPCallbackPhase_t eDHCPPhase, uint32_t ulIPAddress );
74 #endif /* FREERTOS_DHCP_H */