// Options to configure the behavior of the DHCP client. enumclass ClientOption : uint32_t {
NoGateway = (1 << 0), // Do not configure the system's default gateway
};
class DhcpClient { public: // Create a DHCP client with the given |options|. These options are values // from the ClientOption enum. explicit DhcpClient(uint32_t options);
// Initialize the DHCP client to listen on |interfaceName|.
Result init(constchar* interfaceName);
Result run();
// Wait for any pending timeouts void waitAndReceive(const sigset_t& pollSignalMask); // Create a varying timeout (+- 1 second) based on the next timeout.
uint32_t calculateTimeoutMillis(); // Increase the next timeout in a manner that's compliant with the DHCP RFC. void increaseTimeout(); // Move to |state|, the next poll timeout will be zero and the new // state will be immediately evaluated. void setNextState(State state); // Configure network interface based on the DHCP configuration in |msg|. bool configureDhcp(const Message& msg); // Halt network operations on the network interface for when configuration // is not possible and the protocol demands it. void haltNetwork(); // Receive a message on the socket and populate |msg| with the received // data. If the message is a valid DHCP message the method returns true. If // it's not valid false is returned. bool receiveDhcpMessage(Message* msg);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.