#[repr(C, packed)]pub struct Ip4Header {
pub tos: u8,
pub ttl: u8,
/* private fields */
}
Expand description
IPv4 header: https://tools.ietf.org/html/rfc791#section-3.1
Fields§
§tos: u8
Type of service in old traffic. DSCP and ECN flags in modern traffic.
ttl: u8
Packet time to live
Implementations§
source§impl Ip4Header
impl Ip4Header
sourcepub fn header_len(&self) -> u8
pub fn header_len(&self) -> u8
Length of the IPv4 header (with options) in bytes.
sourcepub fn packet_len(&self) -> u16
pub fn packet_len(&self) -> u16
Length of the packet in bytes, starting from the 1st byte of the IPv4 header.
Auto Trait Implementations§
impl RefUnwindSafe for Ip4Header
impl Send for Ip4Header
impl Sync for Ip4Header
impl Unpin for Ip4Header
impl UnwindSafe for Ip4Header
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