Struct packet_formats::icmp::ndp::RouterAdvertisement
source · #[repr(C)]pub struct RouterAdvertisement { /* private fields */ }
Expand description
An NDP Router Advertisement.
Implementations§
source§impl RouterAdvertisement
impl RouterAdvertisement
sourcepub fn new(
current_hop_limit: u8,
managed_flag: bool,
other_config_flag: bool,
router_lifetime: u16,
reachable_time: u32,
retransmit_timer: u32
) -> Self
pub fn new( current_hop_limit: u8, managed_flag: bool, other_config_flag: bool, router_lifetime: u16, reachable_time: u32, retransmit_timer: u32 ) -> Self
Creates a new Router Advertisement with the specified field values.
Equivalent to calling with_prf
with a default preference value.
sourcepub fn with_prf(
current_hop_limit: u8,
managed_flag: bool,
other_config_flag: bool,
preference: RoutePreference,
router_lifetime: u16,
reachable_time: u32,
retransmit_timer: u32
) -> Self
pub fn with_prf( current_hop_limit: u8, managed_flag: bool, other_config_flag: bool, preference: RoutePreference, router_lifetime: u16, reachable_time: u32, retransmit_timer: u32 ) -> Self
Creates a new Router Advertisement with the specified field values.
sourcepub fn current_hop_limit(&self) -> Option<NonZeroU8>
pub fn current_hop_limit(&self) -> Option<NonZeroU8>
Returns the current hop limit field.
A value of None
means unspecified by the source of the Router Advertisement.
sourcepub fn router_lifetime(&self) -> Option<NonZeroDuration>
pub fn router_lifetime(&self) -> Option<NonZeroDuration>
Returns the router lifetime.
A value of None
indicates that the router is not a default router and SHOULD
NOT appear in the default router list.
sourcepub fn reachable_time(&self) -> Option<NonZeroDuration>
pub fn reachable_time(&self) -> Option<NonZeroDuration>
Returns the reachable time.
A value of None
means unspecified by the source of the Router Advertisement.
sourcepub fn retransmit_timer(&self) -> Option<NonZeroDuration>
pub fn retransmit_timer(&self) -> Option<NonZeroDuration>
Returns the retransmit timer.
A value of None
means unspecified by the source of the Router Advertisement.
Trait Implementations§
source§impl Clone for RouterAdvertisement
impl Clone for RouterAdvertisement
source§fn clone(&self) -> RouterAdvertisement
fn clone(&self) -> RouterAdvertisement
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RouterAdvertisement
impl Debug for RouterAdvertisement
source§impl FromBytes for RouterAdvertisementwhere
u8: FromBytes,
U16: FromBytes,
U32: FromBytes,
impl FromBytes for RouterAdvertisementwhere
u8: FromBytes,
U16: FromBytes,
U32: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized + NoCell,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized + NoCell,
Interprets the prefix of the given
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized + NoCell,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized + NoCell,
Interprets the suffix of the given
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + IntoBytes + NoCell,
fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + IntoBytes + NoCell,
Interprets the prefix of the given
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + IntoBytes + NoCell,
fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + IntoBytes + NoCell,
Interprets the suffix of the given
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
source§impl FromZeros for RouterAdvertisementwhere
u8: FromZeros,
U16: FromZeros,
U32: FromZeros,
impl FromZeros for RouterAdvertisementwhere
u8: FromZeros,
U16: FromZeros,
U32: FromZeros,
source§impl IcmpMessage<Ipv6> for RouterAdvertisement
impl IcmpMessage<Ipv6> for RouterAdvertisement
source§const EXPECTS_BODY: bool = true
const EXPECTS_BODY: bool = true
Whether or not a message body is expected in an ICMP packet.
§type Code = IcmpUnusedCode
type Code = IcmpUnusedCode
The type of codes used with this message. Read more
§type Body<B: ByteSlice> = Records<B, NdpOptionsImpl>
type Body<B: ByteSlice> = Records<B, NdpOptionsImpl>
The type of the body used with this message.
source§impl IntoBytes for RouterAdvertisementwhere
u8: IntoBytes,
U16: IntoBytes,
U32: IntoBytes,
HasPadding<RouterAdvertisement, { _ }>: ShouldBe<false>,
impl IntoBytes for RouterAdvertisementwhere
u8: IntoBytes,
U16: IntoBytes,
U32: IntoBytes,
HasPadding<RouterAdvertisement, { _ }>: ShouldBe<false>,
source§impl PartialEq for RouterAdvertisement
impl PartialEq for RouterAdvertisement
source§fn eq(&self, other: &RouterAdvertisement) -> bool
fn eq(&self, other: &RouterAdvertisement) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for RouterAdvertisement
impl Eq for RouterAdvertisement
impl StructuralPartialEq for RouterAdvertisement
impl Unaligned for RouterAdvertisementwhere
u8: Unaligned,
U16: Unaligned,
U32: Unaligned,
Auto Trait Implementations§
impl Freeze for RouterAdvertisement
impl RefUnwindSafe for RouterAdvertisement
impl Send for RouterAdvertisement
impl Sync for RouterAdvertisement
impl Unpin for RouterAdvertisement
impl UnwindSafe for RouterAdvertisement
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