Struct smoltcp::wire::IgmpPacket
source · [−]Expand description
A read/write wrapper around an Internet Group Management Protocol v1/v2 packet buffer.
Implementations
sourceimpl<T: AsRef<[u8]>> Packet<T>
impl<T: AsRef<[u8]>> Packet<T>
Internet Group Management Protocol v1/v2 defined in RFC 2236.
sourcepub fn new_unchecked(buffer: T) -> Packet<T>
pub fn new_unchecked(buffer: T) -> Packet<T>
Imbue a raw octet buffer with IGMPv2 packet structure.
sourcepub fn new_checked(buffer: T) -> Result<Packet<T>>
pub fn new_checked(buffer: T) -> Result<Packet<T>>
Shorthand for a combination of new_unchecked and check_len.
sourcepub fn check_len(&self) -> Result<()>
pub fn check_len(&self) -> Result<()>
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the packet, returning the underlying buffer.
sourcepub fn max_resp_code(&self) -> u8
pub fn max_resp_code(&self) -> u8
Return the maximum response time, using the encoding specified in RFC 3376: 4.1.1. Max Resp Code.
sourcepub fn group_addr(&self) -> Ipv4Address
pub fn group_addr(&self) -> Ipv4Address
Return the source address field.
sourcepub fn verify_checksum(&self) -> bool
pub fn verify_checksum(&self) -> bool
sourceimpl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T>
sourcepub fn set_msg_type(&mut self, value: Message)
pub fn set_msg_type(&mut self, value: Message)
Set the message type field.
sourcepub fn set_max_resp_code(&mut self, value: u8)
pub fn set_max_resp_code(&mut self, value: u8)
Set the maximum response time, using the encoding specified in [RFC 3376]: 4.1.1. Max Resp Code.
sourcepub fn set_checksum(&mut self, value: u16)
pub fn set_checksum(&mut self, value: u16)
Set the checksum field.
sourcepub fn set_group_address(&mut self, addr: Ipv4Address)
pub fn set_group_address(&mut self, addr: Ipv4Address)
Set the group address field
sourcepub fn fill_checksum(&mut self)
pub fn fill_checksum(&mut self)
Compute and fill in the header checksum.
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more