#[non_exhaustive]pub struct DhcpServerConfig {
pub pool_start: Ipv4Address,
pub pool_end: Ipv4Address,
pub lease_duration: Duration,
pub gateway: Option<Ipv4Address>,
pub dns_servers: Vec<Ipv4Address, DHCP_MAX_DNS_SERVER_COUNT>,
pub outgoing_options: &'static [DhcpOption<'static>],
}Expand description
Configuration of the DHCP server, passed to Iface::set_dhcpv4_server.
Start from DhcpServerConfig::new and change the fields you need.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pool_start: Ipv4AddressFirst address of the pool leases are taken from.
pool_end: Ipv4AddressLast address of the pool, inclusive.
lease_duration: DurationHow long a lease lasts. Clients asking for a shorter lease get it.
gateway: Option<Ipv4Address>The default gateway sent to clients, if any.
dns_servers: Vec<Ipv4Address, DHCP_MAX_DNS_SERVER_COUNT>The DNS servers sent to clients. Empty sends none.
outgoing_options: &'static [DhcpOption<'static>]Extra options added to every OFFER and ACK.
Implementations§
Source§impl DhcpServerConfig
impl DhcpServerConfig
Sourcepub fn new(pool_start: Ipv4Address, pool_end: Ipv4Address) -> Self
pub fn new(pool_start: Ipv4Address, pool_end: Ipv4Address) -> Self
A configuration leasing addresses from pool_start to pool_end
(inclusive) for one hour, with no gateway and no DNS servers.
Trait Implementations§
Source§impl Clone for DhcpServerConfig
impl Clone for DhcpServerConfig
Source§fn clone(&self) -> DhcpServerConfig
fn clone(&self) -> DhcpServerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DhcpServerConfig
impl Debug for DhcpServerConfig
Source§impl Format for DhcpServerConfigwhere
Ipv4Address: Format,
Duration: Format,
Option<Ipv4Address>: Format,
Vec<Ipv4Address, DHCP_MAX_DNS_SERVER_COUNT>: Format,
&'static [DhcpOption<'static>]: Format,
impl Format for DhcpServerConfigwhere
Ipv4Address: Format,
Duration: Format,
Option<Ipv4Address>: Format,
Vec<Ipv4Address, DHCP_MAX_DNS_SERVER_COUNT>: Format,
&'static [DhcpOption<'static>]: Format,
Auto Trait Implementations§
impl Freeze for DhcpServerConfig
impl RefUnwindSafe for DhcpServerConfig
impl Send for DhcpServerConfig
impl Sync for DhcpServerConfig
impl Unpin for DhcpServerConfig
impl UnsafeUnpin for DhcpServerConfig
impl UnwindSafe for DhcpServerConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more