pub struct Ipv4PacketBuilder { /* private fields */ }
Expand description
A builder for IPv4 packets.
Implementations§
Source§impl Ipv4PacketBuilder
impl Ipv4PacketBuilder
Sourcepub fn new<S: Into<Ipv4Addr>, D: Into<Ipv4Addr>>(
src_ip: S,
dst_ip: D,
ttl: u8,
proto: Ipv4Proto,
) -> Ipv4PacketBuilder
pub fn new<S: Into<Ipv4Addr>, D: Into<Ipv4Addr>>( src_ip: S, dst_ip: D, ttl: u8, proto: Ipv4Proto, ) -> Ipv4PacketBuilder
Construct a new Ipv4PacketBuilder
.
Sourcepub fn dscp_and_ecn(&mut self, dscp_and_ecn: DscpAndEcn)
pub fn dscp_and_ecn(&mut self, dscp_and_ecn: DscpAndEcn)
Sets DSCP and ECN fields.
Sourcepub fn fragment_offset(&mut self, fragment_offset: FragmentOffset)
pub fn fragment_offset(&mut self, fragment_offset: FragmentOffset)
Set the fragment offset.
Sourcepub fn read_df_flag(&self) -> bool
pub fn read_df_flag(&self) -> bool
Returns the configured Don’t Fragment (DF) flag.
Trait Implementations§
Source§impl Clone for Ipv4PacketBuilder
impl Clone for Ipv4PacketBuilder
Source§fn clone(&self) -> Ipv4PacketBuilder
fn clone(&self) -> Ipv4PacketBuilder
Returns a copy of the value. Read more
1.0.0 · 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 Ipv4PacketBuilder
impl Debug for Ipv4PacketBuilder
Source§impl IpPacketBuilder<Ipv4> for Ipv4PacketBuilder
impl IpPacketBuilder<Ipv4> for Ipv4PacketBuilder
Source§fn new(src_ip: Ipv4Addr, dst_ip: Ipv4Addr, ttl: u8, proto: Ipv4Proto) -> Self
fn new(src_ip: Ipv4Addr, dst_ip: Ipv4Addr, ttl: u8, proto: Ipv4Proto) -> Self
Returns a new packet builder for an associated IP version with the given
given source and destination IP addresses, TTL (IPv4)/Hop Limit (IPv4)
and Protocol Number.
Source§fn set_src_ip(&mut self, addr: Ipv4Addr)
fn set_src_ip(&mut self, addr: Ipv4Addr)
Sets the source IP address for the builder.
Source§fn set_dst_ip(&mut self, addr: Ipv4Addr)
fn set_dst_ip(&mut self, addr: Ipv4Addr)
Sets the destination IP address for the builder.
Source§fn set_dscp_and_ecn(&mut self, dscp_and_ecn: DscpAndEcn)
fn set_dscp_and_ecn(&mut self, dscp_and_ecn: DscpAndEcn)
Set DSCP & ECN fields.
Source§impl PacketBuilder for Ipv4PacketBuilder
impl PacketBuilder for Ipv4PacketBuilder
Source§impl PartialEq for Ipv4PacketBuilder
impl PartialEq for Ipv4PacketBuilder
impl Eq for Ipv4PacketBuilder
impl StructuralPartialEq for Ipv4PacketBuilder
Auto Trait Implementations§
impl Freeze for Ipv4PacketBuilder
impl RefUnwindSafe for Ipv4PacketBuilder
impl Send for Ipv4PacketBuilder
impl Sync for Ipv4PacketBuilder
impl Unpin for Ipv4PacketBuilder
impl UnwindSafe for Ipv4PacketBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)