Struct icmp_socket::packet::Icmpv6Packet[][src]

pub struct Icmpv6Packet {
    pub typ: u8,
    pub code: u8,
    pub checksum: u16,
    pub message: Icmpv6Message,
}

Fields

typ: u8code: u8checksum: u16message: Icmpv6Message

Implementations

impl Icmpv6Packet[src]

pub fn parse<B: AsRef<[u8]>>(bytes: B) -> Result<Self, PacketParseError>[src]

Construct a packet by parsing the provided bytes.

pub fn get_bytes(&self, with_checksum: bool) -> Vec<u8>[src]

Get this packet serialized to bytes suitable for sending on the wire.

pub fn calculate_checksum(&self, source: &Ipv6Addr, dest: &Ipv6Addr) -> u16[src]

Calculate the checksum for the packet given the provided source and destination addresses.

pub fn with_checksum(mut self: Self, source: &Ipv6Addr, dest: &Ipv6Addr) -> Self[src]

Fill the checksum for the packet using the given source and destination addresses.

pub fn with_packet_too_big(
    mtu: u32,
    packet: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
[src]

Construct a packet for Packet Too Big messages.

Trait Implementations

impl Debug for Icmpv6Packet[src]

impl TryFrom<&'_ [u8]> for Icmpv6Packet[src]

type Error = PacketParseError

The type returned in the event of a conversion error.

impl WithEchoReply for Icmpv6Packet[src]

type Packet = Icmpv6Packet

impl WithEchoRequest for Icmpv6Packet[src]

type Packet = Icmpv6Packet

impl WithParameterProblem for Icmpv6Packet[src]

type Packet = Icmpv6Packet

type Pointer = u32

impl WithTimeExceeded for Icmpv6Packet[src]

type Packet = Icmpv6Packet

impl WithUnreachable for Icmpv6Packet[src]

type Packet = Icmpv6Packet

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, 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.