36 static const uint16_t
PORT = 68;
44 DHCP(
const char* hostname,
const uint8_t* mac);
80 int request(uint8_t ip[4], uint8_t subnet[4], uint8_t gateway[4]);
105 return (m_lease_obtained);
111 return (m_lease_expires);
137 } __attribute__((packed));
144 FLAGS_BROADCAST = 0x8000
168 static const uint32_t MAGIC_COOKIE = 0x63825363;
175 ROUTERS_ON_SUBNET = 3,
179 REQUESTED_IP_ADDR = 50,
180 IP_ADDR_LEASE_TIME = 51,
182 SERVER_IDENTIFIER = 54,
186 CLIENT_IDENTIFIER = 61,
188 } __attribute__((packed));
200 } __attribute__((packed));
206 uint8_t m_gateway[4];
218 const char* m_hostname;
221 const uint8_t* m_mac;
227 uint32_t m_lease_obtained;
230 uint32_t m_lease_expires;
233 static const uint16_t SERVER_PORT = 67;
241 int send(uint8_t type);
251 int recv(uint8_t type, uint16_t ms = 2000);
uint32_t lease_expires() const
int request(uint8_t ip[4], uint8_t subnet[4], uint8_t gateway[4])
static const uint16_t PORT
const uint8_t * gateway_addr() const
const uint8_t * dhcp_addr() const
int release(Socket *sock)
const uint8_t * dns_addr() const
DHCP(const char *hostname, const uint8_t *mac)
uint32_t lease_obtained() const