pub struct MulticastForwardingApi<I: Ip, C> { /* private fields */ }
Expand description
The multicast forwarding API.
Implementations§
Source§impl<I: Ip, C> MulticastForwardingApi<I, C>
impl<I: Ip, C> MulticastForwardingApi<I, C>
Source§impl<I: IpLayerIpExt, C> MulticastForwardingApi<I, C>where
C: ContextPair,
C::CoreContext: MulticastForwardingStateContext<I, C::BindingsContext> + MulticastForwardingDeviceContext<I> + IpLayerForwardingContext<I, C::BindingsContext> + CounterContext<MulticastForwardingCounters<I>> + CoreTimerContext<MulticastForwardingTimerId<I>, C::BindingsContext>,
C::BindingsContext: IpLayerBindingsContext<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
impl<I: IpLayerIpExt, C> MulticastForwardingApi<I, C>where
C: ContextPair,
C::CoreContext: MulticastForwardingStateContext<I, C::BindingsContext> + MulticastForwardingDeviceContext<I> + IpLayerForwardingContext<I, C::BindingsContext> + CounterContext<MulticastForwardingCounters<I>> + CoreTimerContext<MulticastForwardingTimerId<I>, C::BindingsContext>,
C::BindingsContext: IpLayerBindingsContext<I, <C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
Sourcepub fn enable(&mut self) -> bool
pub fn enable(&mut self) -> bool
Enables multicast forwarding.
Returns whether multicast forwarding was newly enabled.
Sourcepub fn disable(&mut self) -> bool
pub fn disable(&mut self) -> bool
Disables multicast forwarding.
Returns whether multicast forwarding was newly disabled.
Upon being disabled, the multicast route table will be cleared, and all pending packets will be dropped.
Sourcepub fn add_multicast_route(
&mut self,
key: MulticastRouteKey<I>,
route: MulticastRoute<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
) -> Result<Option<MulticastRoute<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, MulticastForwardingDisabledError>
pub fn add_multicast_route( &mut self, key: MulticastRouteKey<I>, route: MulticastRoute<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, ) -> Result<Option<MulticastRoute<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, MulticastForwardingDisabledError>
Add the route to the multicast route table.
If a route already exists with the same key, it will be replaced, and the original route will be returned.
Sourcepub fn remove_multicast_route(
&mut self,
key: &MulticastRouteKey<I>,
) -> Result<Option<MulticastRoute<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, MulticastForwardingDisabledError>
pub fn remove_multicast_route( &mut self, key: &MulticastRouteKey<I>, ) -> Result<Option<MulticastRoute<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, MulticastForwardingDisabledError>
Remove the route from the multicast route table.
Returns None
if the route did not exist.
Sourcepub fn remove_references_to_device(
&mut self,
dev: &<C::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId,
)
pub fn remove_references_to_device( &mut self, dev: &<C::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId, )
Remove all references to the device from the multicast forwarding state.
Typically, this is called as part of device removal to purge all strong device references.
Any routes that reference the device as an input_interface
will be
removed. Any routes that reference the device as a
MulticastRouteTarget
will have that target removed (and will
themselves be removed if it’s the only target).
Sourcepub fn get_route_stats(
&mut self,
key: &MulticastRouteKey<I>,
) -> Result<Option<MulticastRouteStats<<C::BindingsContext as InstantBindingsTypes>::Instant>>, MulticastForwardingDisabledError>
pub fn get_route_stats( &mut self, key: &MulticastRouteKey<I>, ) -> Result<Option<MulticastRouteStats<<C::BindingsContext as InstantBindingsTypes>::Instant>>, MulticastForwardingDisabledError>
Returns the MulticastRouteStats
, if any, for the given key.
Sourcepub fn inspect<N: Inspector + InspectorDeviceExt<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>(
&mut self,
inspector: &mut N,
)
pub fn inspect<N: Inspector + InspectorDeviceExt<<C::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>( &mut self, inspector: &mut N, )
Writes multicast routing table information to the provided inspector
.