projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added ENABLE_TELNET_SERVER compile time option to the Webserver project to disable...
[pub/USBasp.git]
/
Projects
/
Webserver
/
Lib
/
DHCPClientApp.c
diff --git
a/Projects/Webserver/Lib/DHCPClientApp.c
b/Projects/Webserver/Lib/DHCPClientApp.c
index
cf51273
..
1af90ad
100644
(file)
--- a/
Projects/Webserver/Lib/DHCPClientApp.c
+++ b/
Projects/Webserver/Lib/DHCPClientApp.c
@@
-28,16
+28,17
@@
this software.
\r
*/
\r
\r
this software.
\r
*/
\r
\r
+#if defined(ENABLE_DHCP_CLIENT) || defined(__DOXYGEN__)
\r
+
\r
/** \file
\r
*
\r
* DHCP Client Application. When connected to the uIP stack, this will retrieve IP configuration settings from the
\r
* DHCP server on the network.
\r
*/
\r
\r
/** \file
\r
*
\r
* DHCP Client Application. When connected to the uIP stack, this will retrieve IP configuration settings from the
\r
* DHCP server on the network.
\r
*/
\r
\r
+#define INCLUDE_FROM_DHCPCLIENTAPP_C
\r
#include "DHCPClientApp.h"
\r
\r
#include "DHCPClientApp.h"
\r
\r
-#if defined(ENABLE_DHCP_CLIENT) || defined(__DOXYGEN__)
\r
-
\r
/** Initialization function for the DHCP client. */
\r
void DHCPClientApp_Init(void)
\r
{
\r
/** Initialization function for the DHCP client. */
\r
void DHCPClientApp_Init(void)
\r
{
\r
@@
-156,7
+157,10
@@
void DHCPClientApp_Callback(void)
uip_setnetmask((uip_ipaddr_t*)&AppState->DHCPClient.DHCPOffer_Data.Netmask);
\r
uip_setdraddr((uip_ipaddr_t*)&AppState->DHCPClient.DHCPOffer_Data.GatewayIP);
\r
\r
uip_setnetmask((uip_ipaddr_t*)&AppState->DHCPClient.DHCPOffer_Data.Netmask);
\r
uip_setdraddr((uip_ipaddr_t*)&AppState->DHCPClient.DHCPOffer_Data.GatewayIP);
\r
\r
- AppState->DHCPClient.CurrentState = DHCP_STATE_AddressLeased;
\r
+ /* Indicate to the user that we now have a valid IP configuration */
\r
+ HaveIPConfiguration = true;
\r
+
\r
+ AppState->DHCPClient.CurrentState = DHCP_STATE_AddressLeased;
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-172,7
+176,7
@@
void DHCPClientApp_Callback(void)
*
\r
* \return Size in bytes of the created DHCP packet
\r
*/
\r
*
\r
* \return Size in bytes of the created DHCP packet
\r
*/
\r
-uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* DHCPHeader, uint8_t DHCPMessageType, uip_udp_appstate_t* AppState)
\r
+
static
uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* DHCPHeader, uint8_t DHCPMessageType, uip_udp_appstate_t* AppState)
\r
{
\r
/* Erase existing packet data so that we start will all 0x00 DHCP header data */
\r
memset(DHCPHeader, 0, sizeof(DHCP_Header_t));
\r
{
\r
/* Erase existing packet data so that we start will all 0x00 DHCP header data */
\r
memset(DHCPHeader, 0, sizeof(DHCP_Header_t));
\r
@@
-211,7
+215,7
@@
uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* DHCPHeader, uint8_t DHCPMes
*
\r
* \return Number of bytes added to the DHCP packet
\r
*/
\r
*
\r
* \return Number of bytes added to the DHCP packet
\r
*/
\r
-uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option, uint8_t DataLen, void* OptionData)
\r
+
static
uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option, uint8_t DataLen, void* OptionData)
\r
{
\r
/* Skip through the DHCP options list until the terminator option is found */
\r
while (*DHCPOptionList != DHCP_OPTION_END)
\r
{
\r
/* Skip through the DHCP options list until the terminator option is found */
\r
while (*DHCPOptionList != DHCP_OPTION_END)
\r
@@
-235,7
+239,7
@@
uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option, uint8_t
*
\r
* \return Boolean true if the option was found in the DHCP packet's options list, false otherwise
\r
*/
\r
*
\r
* \return Boolean true if the option was found in the DHCP packet's options list, false otherwise
\r
*/
\r
-bool DHCPClientApp_GetOption(uint8_t* DHCPOptionList, uint8_t Option, void* Destination)
\r
+
static
bool DHCPClientApp_GetOption(uint8_t* DHCPOptionList, uint8_t Option, void* Destination)
\r
{
\r
/* Look through the incoming DHCP packet's options list for the requested option */
\r
while (*DHCPOptionList != DHCP_OPTION_END)
\r
{
\r
/* Look through the incoming DHCP packet's options list for the requested option */
\r
while (*DHCPOptionList != DHCP_OPTION_END)
\r