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
header_length: u8
differentiated_services_code_point: u8
explicit_congestion_notification: u8
total_length: u16
identification: u16
dont_fragment: bool
more_fragments: bool
fragments_offset: u16
time_to_live: u8
protocol: u8
header_checksum: u16
source: [u8; 4]
destination: [u8; 4]
Methods
impl Ipv4Header
[src]
fn new(
payload_and_options_length: u16,
time_to_live: u8,
protocol: IpTrafficClass,
source: [u8; 4],
destination: [u8; 4]
) -> Ipv4Header
[src]
payload_and_options_length: u16,
time_to_live: u8,
protocol: IpTrafficClass,
source: [u8; 4],
destination: [u8; 4]
) -> Ipv4Header
Constructs an Ipv4Header given an header and options length
fn calc_header_checksum(&self, options: &[u8]) -> Result<u16, WriteError>
[src]
Calculate header checksum of the current ipv4 header.
Trait Implementations
impl Debug for Ipv4Header
[src]
impl PartialEq for Ipv4Header
[src]
fn eq(&self, __arg_0: &Ipv4Header) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Ipv4Header) -> bool
[src]
This method tests for !=
.