6 #ifndef NET_CLIENT_DHCP_HPP_
7 #define NET_CLIENT_DHCP_HPP_
33 OPT_REQUESTED_IP_ADDRESS = 50,
34 OPT_IP_LEASE_TIME = 51,
35 OPT_DHCP_MESSAGE_TYPE = 53,
36 OPT_SERVER_IDENTIFIER = 54,
37 OPT_PARAM_REQUEST_LIST = 55,
38 OPT_CLIENT_IDENTIFIER = 61,
51 static uint32_t sTransactionId;
52 static NetDefs::IP_ADDR sOfferedYourIpAddr;
53 static NetDefs::IP_ADDR sOfferedMask;
54 static NetDefs::IP_ADDR sOfferedServerIpAddr;
55 static NetDefs::IP_ADDR sOfferedGatewayIpAddr;
56 static NetDefs::IP_ADDR sOfferedDnsIpAddr;
57 static uint32_t sLeaseTime;
58 static uint32_t sTimeout;
60 static void processFrame(NetDefs::FRAME& frame, NetDefs::DHCP_HEADER& header,
int len);
61 static bool sendMessage(MSG_TYPE type);
62 static bool parseMsg(NetDefs::FRAME& frame, NetDefs::DHCP_HEADER& header, MSG_TYPE& msgType,
int len);
63 static uint8_t* writeOption(uint8_t* dst, MSG_OPT option,
const uint8_t* parameters,
int len);
65 static void swapHeader(NetDefs::DHCP_HEADER& header);