Struct icmp_socket::packet::Icmpv6Packet [−][src]
Fields
typ: u8
code: u8
checksum: u16
message: 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]
mtu: u32,
packet: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
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.
fn try_from(b: &[u8]) -> Result<Self, Self::Error>
[src]
impl WithEchoReply for Icmpv6Packet
[src]
type Packet = Icmpv6Packet
fn with_echo_reply(
identifier: u16,
sequence: u16,
payload: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
[src]
identifier: u16,
sequence: u16,
payload: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
impl WithEchoRequest for Icmpv6Packet
[src]
type Packet = Icmpv6Packet
fn with_echo_request(
identifier: u16,
sequence: u16,
payload: Vec<u8>
) -> Result<Self::Packet, IcmpPacketBuildError>
[src]
identifier: u16,
sequence: u16,
payload: Vec<u8>
) -> Result<Self::Packet, IcmpPacketBuildError>
impl WithParameterProblem for Icmpv6Packet
[src]
type Packet = Icmpv6Packet
type Pointer = u32
fn with_parameter_problem(
code: u8,
pointer: Self::Pointer,
packet: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
[src]
code: u8,
pointer: Self::Pointer,
packet: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
impl WithTimeExceeded for Icmpv6Packet
[src]
type Packet = Icmpv6Packet
fn with_time_exceeded(
code: u8,
packet: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
[src]
code: u8,
packet: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
impl WithUnreachable for Icmpv6Packet
[src]
type Packet = Icmpv6Packet
fn with_unreachable(
code: u8,
packet: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
[src]
code: u8,
packet: Vec<u8>
) -> Result<Self, IcmpPacketBuildError>
Auto Trait Implementations
impl RefUnwindSafe for Icmpv6Packet
[src]
impl Send for Icmpv6Packet
[src]
impl Sync for Icmpv6Packet
[src]
impl Unpin for Icmpv6Packet
[src]
impl UnwindSafe for Icmpv6Packet
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,