Struct smoltcp::socket::Dhcpv4Socket
source · [−]pub struct Dhcpv4Socket { /* private fields */ }
Implementations
sourceimpl Dhcpv4Socket
impl Dhcpv4Socket
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
.
sourcepub fn max_lease_duration(&self) -> Option<Duration>
pub fn max_lease_duration(&self) -> Option<Duration>
Get the configured max lease duration.
See also Self::set_max_lease_duration()
sourcepub fn set_max_lease_duration(&mut self, max_lease_duration: Option<Duration>)
pub fn set_max_lease_duration(&mut self, max_lease_duration: Option<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.)
sourcepub fn ignore_naks(&self) -> bool
pub fn ignore_naks(&self) -> bool
Get whether to ignore NAKs.
See also Self::set_ignore_naks()
sourcepub fn set_ignore_naks(&mut self, ignore_naks: bool)
pub fn set_ignore_naks(&mut self, ignore_naks: bool)
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.
Trait Implementations
sourceimpl<'a> AnySocket<'a> for Dhcpv4Socket
impl<'a> AnySocket<'a> for Dhcpv4Socket
Auto Trait Implementations
impl RefUnwindSafe for Dhcpv4Socket
impl Send for Dhcpv4Socket
impl Sync for Dhcpv4Socket
impl Unpin for Dhcpv4Socket
impl UnwindSafe for Dhcpv4Socket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more