pub struct IgmpPacket<T: AsRef<[u8]>> { /* private fields */ }
Expand description
A read/write wrapper around an Internet Group Management Protocol v1/v2 packet buffer.
Implementations§
Source§impl<T: AsRef<[u8]>> Packet<T>
Internet Group Management Protocol v1/v2 defined in RFC 2236.
impl<T: AsRef<[u8]>> Packet<T>
Internet Group Management Protocol v1/v2 defined in RFC 2236.
Sourcepub const fn new_unchecked(buffer: T) -> Packet<T>
pub const 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)
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
Source§impl<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.