Go to the documentation of this file.
18 #ifndef __BIN_DHCPC_DHCPCLIENT_H
19 #define __BIN_DHCPC_DHCPCLIENT_H
247 const Size size)
const;
static const u32 MagicValue
Magic number value for the packet header.
DhcpClient(int argc, char **argv)
Class constructor.
virtual Result exec()
Execute the application event loop.
u32 m_transactionId
Transaction ID of the current request.
Result sendBootRequest(const DhcpClient::MessageType messageType, const IPV4::Address &ipAddr, const IPV4::Address &ipServer, const IPV4::Address &ipGateway) const
Send DHCP boot request.
POSIX-compatible application.
static const u16 ClientPort
Client UDP port.
static const Size ReceiveTimeoutMs
Timeout in milliseconds to wait for packet receive.
Result offer(IPV4::Address &ipAddr, IPV4::Address &ipServer, IPV4::Address &ipGateway) const
Receive DHCP Offer message.
virtual Result initialize()
Initialize the application.
Ethernet network address.
unsigned short u16
Unsigned 16-bit number.
Dynamic Host Configuration Protocol (DHCP) client application.
unsigned int u32
Unsigned 32-bit number.
unsigned int Size
Any sane size indicator cannot go negative.
NetworkClient * m_client
Network client.
Ethernet::Address m_etherAddress
Host ethernet address.
Result receiveBootResponse(const DhcpClient::MessageType messageType, IPV4::Address &ipAddr, IPV4::Address &ipServer, IPV4::Address &ipGateway) const
Receive DHCP boot response.
Operation
DHCP operations.
Networking Client implementation.
Result setIpAddress(const char *device, const IPV4::Address ipAddr) const
Set IP address on a device.
Result udpReceive(void *packet, Size &size) const
Receive UDP packet.
Result request(const IPV4::Address &ipAddr, const IPV4::Address &ipServer, const IPV4::Address &ipGateway) const
Send DHCP Request message.
unsigned char u8
Unsigned 8-bit number.
MessageType
DHCP message types.
static const Size MaximumRetries
Maximum number of retries to receive an IP address.
Result acknowledge(IPV4::Address &ipAddr, IPV4::Address &ipServer, IPV4::Address &ipGateway) const
Receive DHCP Acknowledge message.
static const u16 ServerPort
Server UDP port.
virtual ~DhcpClient()
Class destructor.
Result udpSend(const void *packet, const Size size) const
Send UDP broadcast packet.
Result discover(const IPV4::Address &ipAddr, const IPV4::Address &ipServer, const IPV4::Address &ipGateway) const
Send DHCP Discover message.