pub struct DhcpSession {
pub interface: String,
pub mac: [u8; 6],
pub lease: Lease,
pub owns_default_route: bool,
}Expand description
A DHCP lease in hand, and what is needed to keep it alive: the caller
spawns [dhcp_renewal] with this once the runtime is up.
Fields§
§interface: StringThe interface the lease is applied to.
mac: [u8; 6]Its MAC — chaddr for every renewal REQUEST.
lease: LeaseThe lease as granted at boot.
owns_default_route: boolWhether this is the FIRST entry of the net spec, and so the one that
owns the box-wide singletons: the default route, the hostname — and now
/etc/resolv.conf.
Carried on the session because the renewal loop needs the same answer
the boot path had, and there is exactly one resolver file for however
many interfaces the declaration names. eth0:dhcp,eth1:dhcp is a public
NIC and a utility one; letting the utility network’s lease overwrite the
resolver on its own T1 would be the same coin flip over egress that
NetConfig::parse_list refuses for the default route, except it would
happen hours after boot with nobody watching.
Trait Implementations§
Source§impl Clone for DhcpSession
impl Clone for DhcpSession
Source§fn clone(&self) -> DhcpSession
fn clone(&self) -> DhcpSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DhcpSession
impl RefUnwindSafe for DhcpSession
impl Send for DhcpSession
impl Sync for DhcpSession
impl Unpin for DhcpSession
impl UnsafeUnpin for DhcpSession
impl UnwindSafe for DhcpSession
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request