Enum etherparse::TransportHeader
source · Expand description
The possible headers on the transport layer
Variants§
Implementations§
source§impl TransportHeader
impl TransportHeader
sourcepub fn udp(self) -> Option<UdpHeader>
pub fn udp(self) -> Option<UdpHeader>
Returns Result::Some containing the udp header if self has the value Udp. Otherwise None is returned.
sourcepub fn mut_udp<'a>(&'a mut self) -> Option<&'a mut UdpHeader>
pub fn mut_udp<'a>(&'a mut self) -> Option<&'a mut UdpHeader>
Returns Result::Some containing the udp header if self has the value Udp. Otherwise None is returned.
sourcepub fn tcp(self) -> Option<TcpHeader>
pub fn tcp(self) -> Option<TcpHeader>
Returns Result::Some containing the tcp header if self has the value Tcp. Otherwise None is returned.
sourcepub fn mut_tcp<'a>(&'a mut self) -> Option<&'a mut TcpHeader>
pub fn mut_tcp<'a>(&'a mut self) -> Option<&'a mut TcpHeader>
Returns Result::Some containing a mutable refernce to the tcp header if self has the value Tcp. Otherwise None is returned.
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the size of the transport header (in case of UDP fixed, in case of TCP cotanining the options).dd
sourcepub fn update_checksum_ipv4(
&mut self,
ip_header: &Ipv4Header,
payload: &[u8]
) -> Result<(), ValueError>
pub fn update_checksum_ipv4(
&mut self,
ip_header: &Ipv4Header,
payload: &[u8]
) -> Result<(), ValueError>
Calculates the checksum for the transport header & sets it in the header for an ipv4 header.
sourcepub fn update_checksum_ipv6(
&mut self,
ip_header: &Ipv6Header,
payload: &[u8]
) -> Result<(), ValueError>
pub fn update_checksum_ipv6(
&mut self,
ip_header: &Ipv6Header,
payload: &[u8]
) -> Result<(), ValueError>
Calculates the checksum for the transport header & sets it in the header for an ipv6 header.
Trait Implementations§
source§impl Clone for TransportHeader
impl Clone for TransportHeader
source§fn clone(&self) -> TransportHeader
fn clone(&self) -> TransportHeader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more