[][src]Enum capsule::packets::checksum::PseudoHeader

pub enum PseudoHeader {
    V4 {
        src: Ipv4Addr,
        dst: Ipv4Addr,
        packet_len: u16,
        protocol: ProtocolNumber,
    },
    V6 {
        src: Ipv6Addr,
        dst: Ipv6Addr,
        packet_len: u16,
        protocol: ProtocolNumber,
    },
}

Generic pseudo header used to calculate checksum.

Variants

V4

IPv4 pseudo header.

Fields of V4

src: Ipv4Addr

Source address.

dst: Ipv4Addr

Destination address.

packet_len: u16

Packet length.

protocol: ProtocolNumber

Next layer's protocol.

V6

IPv6 pseudo header.

Fields of V6

src: Ipv6Addr

Source address.

dst: Ipv6Addr

Destination address.

packet_len: u16

Packet length.

protocol: ProtocolNumber

Next layer's protocol.

Implementations

impl PseudoHeader[src]

pub fn sum(&self) -> u16[src]

Calculates the upper-layer checksum based on the psuedo header.

Trait Implementations

impl Debug for PseudoHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,