67 struct DHCPOptionHeader
71 DHCPOptionHeader(uint8_t optionCode, uint8_t optionLength) : code(optionCode), length(optionLength){}
76 template<u
int8_t CODE, u
int8_t LENGTH>
77 struct DHCPOption :
public DHCPOptionHeader
79 DHCPOption() : DHCPOptionHeader(CODE, LENGTH){}
83 struct DHCPIPOption : DHCPOptionHeader
88 struct DHCPRequestedIPOption :
public DHCPOption < DHCP_OPTIONS_REQUESTED_IP, sizeof(IPAddress) >
93 struct DHCPTimerOption :DHCPOptionHeader
98 struct DHCPClientIdentifierOptionHeader : DHCPOption<DHCP_OPTIONS_CLIENT_IDENTIFIER, sizeof(uint8_t) + sizeof(MACAddress)>
100 uint8_t hardwareType;
107 template <u
int8_t MESSAGETYPE>
108 struct DHCPMessageTypeOption :
public DHCPOption <DHCP_OPTIONS_MESSAGETYPE, 1>
111 DHCPMessageTypeOption() : messageType(MESSAGETYPE){}
115 typedef DHCPMessageTypeOption<DHCP_DISCOVER> DHCPDiscoverMessageTypeOption;
116 typedef DHCPMessageTypeOption<DHCP_REQUEST> DHCPRequestMessageTypeOption;
127 uint16_t renewalTimer;
129 void onReceive(uint16_t len);
130 void setMagicCookie();
131 void sendDHCPDiscover();
133 void writeAdditionalFields();
134 NOINLINE DHCPOptionHeader* findOption(uint8_t searchCode);
135 void prepareDHCPRequest();
136 uint8_t getMessageType();
137 __FlashStringHelper* getStateString();
static const uint8_t DHCP_OPTIONS_SUBNET
static const uint8_t DHCP_OPTIONS_REQUESTED_IP
static const uint8_t DHCP_OPTIONS_CLIENT_IDENTIFIER
static const uint8_t DHCP_REQUEST
static const uint8_t DHCP_OPTIONS_HOSTNAME
static const uint8_t DHCP_OPTIONS_PAD
Implements the UDP protocol.
static const uint8_t DHCP_INFORM
static const uint8_t DHCP_OPTIONS_RENEWAL_TIME
static const uint8_t DHCP_RELEASE
static const uint8_t DHCP_OPTIONS_END
represents an IP address in memory
Represents a network byte order 32 bit integer.
static const uint8_t DHCP_OPTIONS_SERVER_IDENTIFIER
bool dhcpSetup()
Attempts to configure the IP settings: local IP, subnet mask, gateway and DNS via DHCP...
static const uint8_t DHCP_DISCOVER
Maintains a state variable and allows to pull out a state string representation for debugging...
static const uint8_t DHCP_OFFER
static const uint8_t DHCP_DECLINE
static const uint8_t DHCP_ACK
static const uint8_t DHCP_OPTIONS_ROUTER
static const uint8_t DHCP_NACK
static const uint8_t DHCP_HARDWARE_TYPE_ETHERNET
static const uint8_t DHCP_OPTIONS_DNS
static const uint8_t DHCP_OPTIONS_MESSAGETYPE