Struct etherparse::Ipv4HeaderSlice [−][src]
pub struct Ipv4HeaderSlice<'a> { /* fields omitted */ }
Expand description
A slice containing an ipv4 header of a network package.
Implementations
Creates a slice containing an ipv4 header (including header options).
Returns the slice containing the ipv4 header
Read the “ip header length” (length of the ipv4 header + options in multiples of 4 bytes).
Read the “total length” from the slice (total length of ip header + payload).
Determine the payload length based on the ihl & total_length field of the header.
Read the “identification” field from the slice.
Read the “dont fragment” flag from the slice.
Read the “more fragments” flag from the slice.
Read the “fragment_offset” field from the slice.
Read the “header checksum” field from the slice.
Return the ipv4 source address as an std::net::Ipv4Addr
Returns a slice containing the ipv4 source address.
Return the ipv4 destination address as an std::net::Ipv4Addr
Returns a slice containing the ipv4 header options (empty when there are no options).
Returns true if the payload is fragmented.
Either data is missing (more_fragments set) or there is an fragment offset.
Decode all the fields and copy the results to a Ipv4Header struct
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Ipv4HeaderSlice<'a>
impl<'a> Send for Ipv4HeaderSlice<'a>
impl<'a> Sync for Ipv4HeaderSlice<'a>
impl<'a> Unpin for Ipv4HeaderSlice<'a>
impl<'a> UnwindSafe for Ipv4HeaderSlice<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more