pub struct Dhcpv4Socket { /* private fields */ }

Implementations

DHCP client socket.

The socket acquires an IP address configuration through DHCP autonomously. You must query the configuration with .poll() after every call to Interface::poll(), and apply the configuration to the Interface.

Create a DHCPv4 socket

Get the configured max lease duration.

See also Self::set_max_lease_duration()

Set the max lease duration.

When set, the lease duration will be capped at the configured duration if the DHCP server gives us a longer lease. This is generally not recommended, but can be useful for debugging or reacting faster to network configuration changes.

If None, no max is applied (the lease duration from the DHCP server is used.)

Get whether to ignore NAKs.

See also Self::set_ignore_naks()

Set whether to ignore NAKs.

This is not compliant with the DHCP RFCs, since theoretically we must stop using the assigned IP when receiving a NAK. This can increase reliability on broken networks with buggy routers or rogue DHCP servers, however.

Reset state and restart discovery phase.

Use this to speed up acquisition of an address in a new network if a link was down and it is now back up.

Query the socket for configuration changes.

The socket has an internal “configuration changed” flag. If set, this function returns the configuration and resets the flag.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.