Struct smoltcp::wire::IgmpPacket[][src]

pub struct IgmpPacket<T: AsRef<[u8]>> { /* fields omitted */ }

A read/write wrapper around an Internet Group Management Protocol v1/v2 packet buffer.

Implementations

impl<T: AsRef<[u8]>> Packet<T>[src]

Internet Group Management Protocol v1/v2 defined in RFC 2236.

pub fn new_unchecked(buffer: T) -> Packet<T>[src]

Imbue a raw octet buffer with IGMPv2 packet structure.

pub fn new_checked(buffer: T) -> Result<Packet<T>>[src]

Shorthand for a combination of new_unchecked and check_len.

pub fn check_len(&self) -> Result<()>[src]

Ensure that no accessor method will panic if called. Returns Err(Error::Truncated) if the buffer is too short.

pub fn into_inner(self) -> T[src]

Consume the packet, returning the underlying buffer.

pub fn msg_type(&self) -> Message[src]

Return the message type field.

pub fn max_resp_code(&self) -> u8[src]

Return the maximum response time, using the encoding specified in RFC 3376: 4.1.1. Max Resp Code.

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

Return the checksum field.

pub fn group_addr(&self) -> Ipv4Address[src]

Return the source address field.

pub fn verify_checksum(&self) -> bool[src]

Validate the header checksum.

Fuzzing

This function always returns true when fuzzing.

impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T>[src]

pub fn set_msg_type(&mut self, value: Message)[src]

Set the message type field.

pub fn set_max_resp_code(&mut self, value: u8)[src]

Set the maximum response time, using the encoding specified in [RFC 3376]: 4.1.1. Max Resp Code.

pub fn set_checksum(&mut self, value: u16)[src]

Set the checksum field.

pub fn set_group_address(&mut self, addr: Ipv4Address)[src]

Set the group address field

pub fn fill_checksum(&mut self)[src]

Compute and fill in the header checksum.

Trait Implementations

impl<T: Debug + AsRef<[u8]>> Debug for Packet<T>[src]

impl<'a, T: AsRef<[u8]> + ?Sized> Display for Packet<&'a T>[src]

impl<T: AsRef<[u8]>> PrettyPrint for Packet<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Packet<T> where
    T: RefUnwindSafe

impl<T> Send for Packet<T> where
    T: Send

impl<T> Sync for Packet<T> where
    T: Sync

impl<T> Unpin for Packet<T> where
    T: Unpin

impl<T> UnwindSafe for Packet<T> where
    T: UnwindSafe

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> ToString for T where
    T: Display + ?Sized
[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.