pub struct RoutesApi<I: Ip, C>(/* private fields */);
Expand description
The routes API for a specific IP version I
.
Implementations§
Source§impl<I, C> RoutesApi<I, C>where
I: IpLayerIpExt + IpDeviceIpExt,
C: ContextPair,
C::CoreContext: RoutesApiCoreContext<I, C::BindingsContext>,
C::BindingsContext: RoutesApiBindingsContext<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId: Ord,
impl<I, C> RoutesApi<I, C>where
I: IpLayerIpExt + IpDeviceIpExt,
C: ContextPair,
C::CoreContext: RoutesApiCoreContext<I, C::BindingsContext>,
C::BindingsContext: RoutesApiBindingsContext<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId: Ord,
Sourcepub fn new_table(
&mut self,
) -> RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>
pub fn new_table( &mut self, ) -> RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>
Allocates a new table in Core.
Sourcepub fn remove_table(
&mut self,
id: RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
) -> RemoveResourceResultWithContext<(), C::BindingsContext>
pub fn remove_table( &mut self, id: RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, ) -> RemoveResourceResultWithContext<(), C::BindingsContext>
Sourcepub fn main_table_id(
&mut self,
) -> RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>
pub fn main_table_id( &mut self, ) -> RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>
Gets the core ID of the main table.
Sourcepub fn collect_routes_into<X: From<Entry<I::Addr, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, T: Extend<X>>(
&mut self,
table_id: &RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
target: &mut T,
)
pub fn collect_routes_into<X: From<Entry<I::Addr, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, T: Extend<X>>( &mut self, table_id: &RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, target: &mut T, )
Collects all the routes in the specified table into target
.
Sourcepub fn collect_main_table_routes_into<X: From<Entry<I::Addr, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, T: Extend<X>>(
&mut self,
target: &mut T,
)
pub fn collect_main_table_routes_into<X: From<Entry<I::Addr, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, T: Extend<X>>( &mut self, target: &mut T, )
Collects all the routes in the main table into target
.
Sourcepub fn fold_routes<B, F>(&mut self, init: B, cb: F) -> Bwhere
F: FnMut(B, &RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, &Entry<I::Addr, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>) -> B,
pub fn fold_routes<B, F>(&mut self, init: B, cb: F) -> Bwhere
F: FnMut(B, &RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, &Entry<I::Addr, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>) -> B,
Like the Iterator fold accumulator.
Applies the given cb
to each route across all routing tables.
Sourcepub fn resolve_route(
&mut self,
destination: Option<RoutableIpAddr<I::Addr>>,
) -> Result<ResolvedRoute<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, ResolveRouteError>
pub fn resolve_route( &mut self, destination: Option<RoutableIpAddr<I::Addr>>, ) -> Result<ResolvedRoute<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, ResolveRouteError>
Resolve the route to a given destination.
Returns Some
ResolvedRoute
with details for reaching the destination,
or None
if the destination is unreachable.
Sourcepub fn select_device_for_gateway(
&mut self,
gateway: SpecifiedAddr<I::Addr>,
) -> Option<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>
pub fn select_device_for_gateway( &mut self, gateway: SpecifiedAddr<I::Addr>, ) -> Option<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>
Selects the device to use for gateway routes when the device was unspecified by the client.
Sourcepub fn inspect<'a, N: Inspector + InspectorDeviceExt<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>(
&mut self,
inspector: &mut N,
)
pub fn inspect<'a, N: Inspector + InspectorDeviceExt<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>( &mut self, inspector: &mut N, )
Writes routing table information to the provided inspector
.
Sourcepub fn set_routes(
&mut self,
table_id: &RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
entries: Vec<EntryAndGeneration<I::Addr, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>,
)
pub fn set_routes( &mut self, table_id: &RoutingTableId<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, entries: Vec<EntryAndGeneration<I::Addr, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, )
Replaces the entire route table atomically.
Sourcepub fn set_rules(
&mut self,
rules: Vec<Rule<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>,
)
pub fn set_rules( &mut self, rules: Vec<Rule<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, )
Replaces the entire rule table atomically.
Auto Trait Implementations§
impl<I, C> Freeze for RoutesApi<I, C>where
C: Freeze,
impl<I, C> RefUnwindSafe for RoutesApi<I, C>where
C: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, C> Send for RoutesApi<I, C>where
C: Send,
impl<I, C> Sync for RoutesApi<I, C>where
C: Sync,
impl<I, C> Unpin for RoutesApi<I, C>
impl<I, C> UnwindSafe for RoutesApi<I, C>where
C: UnwindSafe,
I: UnwindSafe,
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
Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
Source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
Source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more