Trait etherparse::WriteEtherExt
[−]
[src]
pub trait WriteEtherExt: Write + Sized { fn write_ethernet2_header(
&mut self,
value: &Ethernet2Header
) -> Result<(), Error> { ... } fn write_vlan_tagging_header(
&mut self,
value: &VlanTaggingHeader
) -> Result<(), WriteError> { ... } fn write_ipv4_header(
&mut self,
value: &Ipv4Header,
options: &[u8]
) -> Result<(), WriteError> { ... } fn write_ipv4_header_raw(
&mut self,
value: &Ipv4Header,
options: &[u8]
) -> Result<(), WriteError> { ... } fn write_ipv6_header(
&mut self,
value: &Ipv6Header
) -> Result<(), WriteError> { ... } }
Helper for writing headers. Import this for adding write functions to every struct that implements the trait Read.
Provided Methods
fn write_ethernet2_header(
&mut self,
value: &Ethernet2Header
) -> Result<(), Error>
&mut self,
value: &Ethernet2Header
) -> Result<(), Error>
Writes a given Ethernet-II header to the current position.
fn write_vlan_tagging_header(
&mut self,
value: &VlanTaggingHeader
) -> Result<(), WriteError>
&mut self,
value: &VlanTaggingHeader
) -> Result<(), WriteError>
Write a IEEE 802.1Q VLAN tagging header
fn write_ipv4_header(
&mut self,
value: &Ipv4Header,
options: &[u8]
) -> Result<(), WriteError>
&mut self,
value: &Ipv4Header,
options: &[u8]
) -> Result<(), WriteError>
Writes a given IPv4 header to the current position (this method automatically calculates the header length and checksum).
fn write_ipv4_header_raw(
&mut self,
value: &Ipv4Header,
options: &[u8]
) -> Result<(), WriteError>
&mut self,
value: &Ipv4Header,
options: &[u8]
) -> Result<(), WriteError>
Writes a given IPv4 header to the current position (this method just writes the specified checksum and header_length and does note compute it).
fn write_ipv6_header(&mut self, value: &Ipv6Header) -> Result<(), WriteError>
Writes a given IPv6 header to the current position.