pub struct DhcpBuilder { /* private fields */ }Expand description
Builder for constructing DHCP packets.
Implementations§
Source§impl DhcpBuilder
impl DhcpBuilder
pub fn new() -> Self
Sourcepub fn discover(client_mac: MacAddress, xid: u32) -> Self
pub fn discover(client_mac: MacAddress, xid: u32) -> Self
Create a DHCP Discover message.
Sourcepub fn offer(
xid: u32,
client_mac: MacAddress,
offered_ip: Ipv4Addr,
server_ip: Ipv4Addr,
) -> Self
pub fn offer( xid: u32, client_mac: MacAddress, offered_ip: Ipv4Addr, server_ip: Ipv4Addr, ) -> Self
Create a DHCP Offer message.
Sourcepub fn request(
client_mac: MacAddress,
xid: u32,
requested_ip: Ipv4Addr,
server_ip: Ipv4Addr,
) -> Self
pub fn request( client_mac: MacAddress, xid: u32, requested_ip: Ipv4Addr, server_ip: Ipv4Addr, ) -> Self
Create a DHCP Request message.
Sourcepub fn ack(
xid: u32,
client_mac: MacAddress,
assigned_ip: Ipv4Addr,
server_ip: Ipv4Addr,
) -> Self
pub fn ack( xid: u32, client_mac: MacAddress, assigned_ip: Ipv4Addr, server_ip: Ipv4Addr, ) -> Self
Create a DHCP ACK message.
Sourcepub fn nak(xid: u32, client_mac: MacAddress, server_ip: Ipv4Addr) -> Self
pub fn nak(xid: u32, client_mac: MacAddress, server_ip: Ipv4Addr) -> Self
Create a DHCP NAK message.
pub fn op(self, op: u8) -> Self
pub fn xid(self, xid: u32) -> Self
pub fn flags(self, flags: u16) -> Self
pub fn ciaddr(self, ip: Ipv4Addr) -> Self
pub fn yiaddr(self, ip: Ipv4Addr) -> Self
pub fn siaddr(self, ip: Ipv4Addr) -> Self
pub fn giaddr(self, ip: Ipv4Addr) -> Self
pub fn chaddr_mac(self, mac: MacAddress) -> Self
Sourcepub fn option(self, opt: DhcpOption) -> Self
pub fn option(self, opt: DhcpOption) -> Self
Add a DHCP option.
Sourcepub fn lease_time(self, seconds: u32) -> Self
pub fn lease_time(self, seconds: u32) -> Self
Add a lease time option.
Sourcepub fn subnet_mask(self, mask: Ipv4Addr) -> Self
pub fn subnet_mask(self, mask: Ipv4Addr) -> Self
Add a subnet mask option.
Sourcepub fn domain_name(self, name: &str) -> Self
pub fn domain_name(self, name: &str) -> Self
Add a domain name option.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DhcpBuilder
impl RefUnwindSafe for DhcpBuilder
impl Send for DhcpBuilder
impl Sync for DhcpBuilder
impl Unpin for DhcpBuilder
impl UnsafeUnpin for DhcpBuilder
impl UnwindSafe for DhcpBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more