Struct etherparse::Ipv4HeaderSlice [−][src]
pub struct Ipv4HeaderSlice<'a> { /* fields omitted */ }
A slice containing an ipv4 header of a network package.
Methods
impl<'a> Ipv4HeaderSlice<'a>
[src]
impl<'a> Ipv4HeaderSlice<'a>
pub fn from_slice(slice: &'a [u8]) -> Result<Ipv4HeaderSlice<'a>, ReadError>
[src]
pub fn from_slice(slice: &'a [u8]) -> Result<Ipv4HeaderSlice<'a>, ReadError>
Creates a slice containing an ipv4 header (including header options).
pub fn slice(&self) -> &'a [u8]
[src]
pub fn slice(&self) -> &'a [u8]
Returns the slice containing the ipv4 header
pub fn version(&self) -> u8
[src]
pub fn version(&self) -> u8
Read the "version" field of the IPv4 header (should be 4).
pub fn ihl(&self) -> u8
[src]
pub fn ihl(&self) -> u8
Read the "ip header length" (length of the ipv4 header + options in multiples of 4 bytes).
pub fn dcp(&self) -> u8
[src]
pub fn dcp(&self) -> u8
Read the "differentiated_services_code_point" from the slice.
pub fn ecn(&self) -> u8
[src]
pub fn ecn(&self) -> u8
Read the "explicit_congestion_notification" from the slice.
pub fn total_length(&self) -> u16
[src]
pub fn total_length(&self) -> u16
Read the "total length" from the slice (total length of ip header + payload).
pub fn identification(&self) -> u16
[src]
pub fn identification(&self) -> u16
Read the "identification" field from the slice.
pub fn dont_fragment(&self) -> bool
[src]
pub fn dont_fragment(&self) -> bool
Read the "dont fragment" flag from the slice.
pub fn more_fragments(&self) -> bool
[src]
pub fn more_fragments(&self) -> bool
Read the "more fragments" flag from the slice.
pub fn fragments_offset(&self) -> u16
[src]
pub fn fragments_offset(&self) -> u16
Read the "fragment_offset" field from the slice.
pub fn ttl(&self) -> u8
[src]
pub fn ttl(&self) -> u8
Read the "time_to_live" field from the slice.
pub fn protocol(&self) -> u8
[src]
pub fn protocol(&self) -> u8
Read the "protocol" field from the slice.
pub fn header_checksum(&self) -> u16
[src]
pub fn header_checksum(&self) -> u16
Read the "header checksum" field from the slice.
pub fn source(&self) -> &'a [u8]
[src]
pub fn source(&self) -> &'a [u8]
Returns a slice containing the ipv4 source address.
pub fn source_addr(&self) -> Ipv4Addr
[src]
pub fn source_addr(&self) -> Ipv4Addr
Return the ipv4 source address as an std::net::Ipv4Addr
pub fn destination(&self) -> &'a [u8]
[src]
pub fn destination(&self) -> &'a [u8]
Returns a slice containing the ipv4 source address.
pub fn destination_addr(&self) -> Ipv4Addr
[src]
pub fn destination_addr(&self) -> Ipv4Addr
Return the ipv4 destination address as an std::net::Ipv4Addr
pub fn options(&self) -> &'a [u8]
[src]
pub fn options(&self) -> &'a [u8]
Returns a slice containing the ipv4 header options (empty when there are no options).
pub fn to_header(&self) -> Ipv4Header
[src]
pub fn to_header(&self) -> Ipv4Header
Decode all the fields and copy the results to a Ipv4Header struct
Trait Implementations
impl<'a> Clone for Ipv4HeaderSlice<'a>
[src]
impl<'a> Clone for Ipv4HeaderSlice<'a>
fn clone(&self) -> Ipv4HeaderSlice<'a>
[src]
fn clone(&self) -> Ipv4HeaderSlice<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a> Debug for Ipv4HeaderSlice<'a>
[src]
impl<'a> Debug for Ipv4HeaderSlice<'a>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Eq for Ipv4HeaderSlice<'a>
[src]
impl<'a> Eq for Ipv4HeaderSlice<'a>
impl<'a> PartialEq for Ipv4HeaderSlice<'a>
[src]
impl<'a> PartialEq for Ipv4HeaderSlice<'a>
fn eq(&self, other: &Ipv4HeaderSlice<'a>) -> bool
[src]
fn eq(&self, other: &Ipv4HeaderSlice<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Ipv4HeaderSlice<'a>) -> bool
[src]
fn ne(&self, other: &Ipv4HeaderSlice<'a>) -> bool
This method tests for !=
.
Auto Trait Implementations
impl<'a> Send for Ipv4HeaderSlice<'a>
impl<'a> Send for Ipv4HeaderSlice<'a>
impl<'a> Sync for Ipv4HeaderSlice<'a>
impl<'a> Sync for Ipv4HeaderSlice<'a>