pub struct RouterAdvertisementPayloadSlice<'a> { /* private fields */ }Expand description
Borrowed payload of a Router Advertisement message (RFC 4861, Section 4.2).
The full packet layout is:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cur Hop Limit |M|O| Reserved | Router Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reachable Time |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Retrans Timer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options ...
+-+-+-+-+-+-+-+-+-+-+-+-In this crate, Cur Hop Limit, M, O, and Router Lifetime are represented by
crate::icmpv6::RouterAdvertisementHeader in crate::Icmpv6Type::RouterAdvertisement.
This slice starts after that fixed part and contains:
Reachable TimeRetrans Timer- options
Implementations§
Source§impl<'a> RouterAdvertisementPayloadSlice<'a>
impl<'a> RouterAdvertisementPayloadSlice<'a>
Sourcepub const FIXED_PART_LEN: usize = RouterAdvertisementPayload::LEN
pub const FIXED_PART_LEN: usize = RouterAdvertisementPayload::LEN
Length of the fixed payload part (Reachable Time and Retrans Timer) in bytes.
Sourcepub fn from_slice(slice: &'a [u8]) -> Result<Self, LenError>
pub fn from_slice(slice: &'a [u8]) -> Result<Self, LenError>
Creates a payload slice from the bytes after the ICMPv6 header.
Sourcepub fn reachable_time(&self) -> u32
pub fn reachable_time(&self) -> u32
Reachable time in milliseconds.
Sourcepub fn retrans_timer(&self) -> u32
pub fn retrans_timer(&self) -> u32
Retransmit timer in milliseconds.
Sourcepub fn options_iterator(&self) -> NdpOptionsIterator<'a> ⓘ
pub fn options_iterator(&self) -> NdpOptionsIterator<'a> ⓘ
Returns an iterator over Neighbor Discovery options.
Sourcepub fn to_payload(&self) -> (RouterAdvertisementPayload, &'a [u8])
pub fn to_payload(&self) -> (RouterAdvertisementPayload, &'a [u8])
Convert to an owned structured payload and return trailing options.
Trait Implementations§
Source§impl<'a> Clone for RouterAdvertisementPayloadSlice<'a>
impl<'a> Clone for RouterAdvertisementPayloadSlice<'a>
Source§fn clone(&self) -> RouterAdvertisementPayloadSlice<'a>
fn clone(&self) -> RouterAdvertisementPayloadSlice<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for RouterAdvertisementPayloadSlice<'a>
impl<'a> Debug for RouterAdvertisementPayloadSlice<'a>
impl<'a> Eq for RouterAdvertisementPayloadSlice<'a>
Source§impl<'a> PartialEq for RouterAdvertisementPayloadSlice<'a>
impl<'a> PartialEq for RouterAdvertisementPayloadSlice<'a>
impl<'a> StructuralPartialEq for RouterAdvertisementPayloadSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for RouterAdvertisementPayloadSlice<'a>
impl<'a> RefUnwindSafe for RouterAdvertisementPayloadSlice<'a>
impl<'a> Send for RouterAdvertisementPayloadSlice<'a>
impl<'a> Sync for RouterAdvertisementPayloadSlice<'a>
impl<'a> Unpin for RouterAdvertisementPayloadSlice<'a>
impl<'a> UnsafeUnpin for RouterAdvertisementPayloadSlice<'a>
impl<'a> UnwindSafe for RouterAdvertisementPayloadSlice<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more