pub struct NeighborApi<I: Ip, D, C>(/* private fields */);Expand description
The neighbor API.
Implementations§
Source§impl<I: Ip, D, C> NeighborApi<I, D, C>
impl<I: Ip, D, C> NeighborApi<I, D, C>
Source§impl<I, D, C> NeighborApi<I, D, C>where
I: Ip,
D: LinkDevice,
C: ContextPair,
C::CoreContext: NudContext<I, D, C::BindingsContext>,
C::BindingsContext: NudBindingsContext<I, D, <C::CoreContext as DeviceIdContext<D>>::DeviceId>,
impl<I, D, C> NeighborApi<I, D, C>where
I: Ip,
D: LinkDevice,
C: ContextPair,
C::CoreContext: NudContext<I, D, C::BindingsContext>,
C::BindingsContext: NudBindingsContext<I, D, <C::CoreContext as DeviceIdContext<D>>::DeviceId>,
Sourcepub fn resolve_link_addr(
&mut self,
device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
dst: &SpecifiedAddr<I::Addr>,
) -> LinkResolutionResult<D::Address, <<C::BindingsContext as LinkResolutionContext<D>>::Notifier as LinkResolutionNotifier<D>>::Observer>
pub fn resolve_link_addr( &mut self, device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, dst: &SpecifiedAddr<I::Addr>, ) -> LinkResolutionResult<D::Address, <<C::BindingsContext as LinkResolutionContext<D>>::Notifier as LinkResolutionNotifier<D>>::Observer>
Resolve the link-address for a given device’s neighbor.
Lookup the given destination IP address in the neighbor table for given device, returning either the associated link-address if it is available, or an observer that can be used to wait for link address resolution to complete.
Sourcepub fn flush_table(
&mut self,
device: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
)
pub fn flush_table( &mut self, device: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, )
Flush neighbor table entries.
Sourcepub fn insert_static_entry(
&mut self,
device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
neighbor: I::Addr,
link_address: D::Address,
) -> Result<(), StaticNeighborInsertionError>
pub fn insert_static_entry( &mut self, device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, neighbor: I::Addr, link_address: D::Address, ) -> Result<(), StaticNeighborInsertionError>
Sets a static neighbor entry for the neighbor.
If no entry exists, a new one may be created. If an entry already exists, it will be updated with the provided link address and set to be a static entry.
Dynamic updates for the neighbor will be ignored for static entries.
Sourcepub fn probe_entry(
&mut self,
device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
neighbor: I::Addr,
) -> Result<(), TriggerNeighborProbeError>
pub fn probe_entry( &mut self, device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, neighbor: I::Addr, ) -> Result<(), TriggerNeighborProbeError>
Immediately triggers a unicast probe to be sent to neighbor.
For IPv6, this probe is an NDP Neighbor Solicitation, while for IPv4 it’s an ARP Request.
Returns an error if the probe was not sent, unless the neighbor was already in the Probe state, in which case it succeeds without sending another probe.
Sourcepub fn remove_entry(
&mut self,
device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
neighbor: I::Addr,
) -> Result<(), NeighborRemovalError>
pub fn remove_entry( &mut self, device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, neighbor: I::Addr, ) -> Result<(), NeighborRemovalError>
Remove a static or dynamic neighbor table entry.
Sourcepub fn inspect_neighbors<N: Inspector>(
&mut self,
device: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
inspector: &mut N,
)
pub fn inspect_neighbors<N: Inspector>( &mut self, device: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, inspector: &mut N, )
Writes device’s neighbor state information into inspector.
Auto Trait Implementations§
impl<I, D, C> Freeze for NeighborApi<I, D, C>where
C: Freeze,
impl<I, D, C> RefUnwindSafe for NeighborApi<I, D, C>
impl<I, D, C> Send for NeighborApi<I, D, C>
impl<I, D, C> Sync for NeighborApi<I, D, C>
impl<I, D, C> Unpin for NeighborApi<I, D, C>
impl<I, D, C> UnsafeUnpin for NeighborApi<I, D, C>where
C: UnsafeUnpin,
impl<I, D, C> UnwindSafe for NeighborApi<I, D, C>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more