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]

Creates a slice containing an ipv4 header (including header options).

Returns the slice containing the ipv4 header

Read the "version" field of the IPv4 header (should be 4).

Read the "ip header length" (length of the ipv4 header + options in multiples of 4 bytes).

Read the "differentiated_services_code_point" from the slice.

Read the "explicit_congestion_notification" from the slice.

Read the "total length" from the slice (total length of ip header + payload).

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 "time_to_live" field from the slice.

Read the "protocol" field from the slice.

Read the "header checksum" field from the slice.

Returns a slice containing the ipv4 source address.

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).

Decode all the fields and copy the results to a Ipv4Header struct

Trait Implementations

impl<'a> Clone for Ipv4HeaderSlice<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> Debug for Ipv4HeaderSlice<'a>
[src]

Formats the value using the given formatter. Read more

impl<'a> Eq for Ipv4HeaderSlice<'a>
[src]

impl<'a> PartialEq for Ipv4HeaderSlice<'a>
[src]

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> Send for Ipv4HeaderSlice<'a>

impl<'a> Sync for Ipv4HeaderSlice<'a>