pub struct IgmpPacket<'a> { /* private fields */ }Expand description
A read/write wrapper around an Internet Group Management Protocol v1/v2 packet buffer.
Implementations§
Source§impl<'a> Packet<'a>
Internet Group Management Protocol v1/v2 defined in RFC 2236.
impl<'a> Packet<'a>
Internet Group Management Protocol v1/v2 defined in RFC 2236.
Sourcepub const fn new_unchecked(buffer: &'a mut [u8]) -> Packet<'a>
pub const fn new_unchecked(buffer: &'a mut [u8]) -> Packet<'a>
Imbue a raw octet buffer with IGMPv2 packet structure.
Sourcepub fn new_checked(buffer: &'a mut [u8]) -> Result<Packet<'a>>
pub fn new_checked(buffer: &'a mut [u8]) -> Result<Packet<'a>>
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 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 max_resp_time(&self) -> Duration
pub fn max_resp_time(&self) -> Duration
Return the maximum response time, decoded from the max resp code field.
Sourcepub fn group_addr(&self) -> Ipv4Address
pub fn group_addr(&self) -> Ipv4Address
Return the group address field.
Sourcepub fn verify_checksum(&self) -> bool
pub fn verify_checksum(&self) -> bool
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_max_resp_time(&mut self, value: Duration)
pub fn set_max_resp_time(&mut self, value: Duration)
Set the maximum response time, encoding it into the max resp code field.
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.