Struct IgmpPacket
pub struct IgmpPacket<'a> { /* private fields */ }Expand description
A read/write wrapper around an Internet Group Management Protocol v1/v2 packet buffer.
Implementations§
§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.
pub 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.
pub fn new_checked(buffer: &'a mut [u8]) -> Result<Packet<'a>, Error>
pub fn new_checked(buffer: &'a mut [u8]) -> Result<Packet<'a>, Error>
Shorthand for a combination of new_unchecked and check_len.
pub fn check_len(&self) -> Result<(), Error>
pub fn check_len(&self) -> Result<(), Error>
Ensure that no accessor method will panic if called.
Returns Err(Error) if the buffer is too short.
pub 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.
pub 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.
pub fn group_addr(&self) -> Ipv4Addr
pub fn group_addr(&self) -> Ipv4Addr
Return the group address field.
pub fn verify_checksum(&self) -> bool
pub fn verify_checksum(&self) -> bool
pub fn set_msg_type(&mut self, value: Message)
pub fn set_msg_type(&mut self, value: Message)
Set the message type field.
pub 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.
pub 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.
pub fn set_checksum(&mut self, value: u16)
pub fn set_checksum(&mut self, value: u16)
Set the checksum field.
pub fn set_group_address(&mut self, addr: Ipv4Addr)
pub fn set_group_address(&mut self, addr: Ipv4Addr)
Set the group address field
pub fn fill_checksum(&mut self)
pub fn fill_checksum(&mut self)
Compute and fill in the header checksum.