Struct etherparse::Ipv4Header [] [src]

pub struct Ipv4Header {
    pub header_length: u8,
    pub differentiated_services_code_point: u8,
    pub explicit_congestion_notification: u8,
    pub total_length: u16,
    pub identification: u16,
    pub dont_fragment: bool,
    pub more_fragments: bool,
    pub fragments_offset: u16,
    pub time_to_live: u8,
    pub protocol: u8,
    pub header_checksum: u16,
    pub source: [u8; 4],
    pub destination: [u8; 4],
}

IPv4 header without options.

Fields

Methods

impl Ipv4Header
[src]

[src]

Constructs an Ipv4Header with standard values for non specified values. Note: This header calculates the checksum assuming that there are no ipv4 options. In case there are calculate the checksum using the "calc_header_checksum" method.

[src]

Reads an IPv4 header from the current position.

[src]

Reads an IPv4 header assuming the version & ihl field have already been read.

[src]

Writes a given IPv4 header to the current position (this method automatically calculates the header length and checksum).

[src]

Writes a given IPv4 header to the current position (this method just writes the specified checksum and header_length and does note compute it).

[src]

Calculate header checksum of the current ipv4 header.

[src]

Sets the field total_length based on the size of the payload and the options. Returns an error if the payload is too big to fit.

Trait Implementations

impl Clone for Ipv4Header
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Ipv4Header
[src]

[src]

Formats the value using the given formatter. Read more

impl Eq for Ipv4Header
[src]

impl PartialEq for Ipv4Header
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl SerializedSize for Ipv4Header
[src]

SERIALIZED_SIZE: usize = 20

Size of the header itself (without options) in bytes.

Auto Trait Implementations

impl Send for Ipv4Header

impl Sync for Ipv4Header