pub trait MulticastMembershipHandler<I: Ip, BC>: DeviceIdContext<AnyDevice> {
// Required methods
fn join_multicast_group(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
addr: MulticastAddr<I::Addr>,
);
fn leave_multicast_group(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
addr: MulticastAddr<I::Addr>,
);
fn select_device_for_multicast_group(
&mut self,
addr: MulticastAddr<I::Addr>,
marks: &Marks,
) -> Result<Self::DeviceId, ResolveRouteError>;
}
Expand description
Abstraction over the ability to join and leave multicast groups.
Required Methods§
Sourcefn join_multicast_group(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
addr: MulticastAddr<I::Addr>,
)
fn join_multicast_group( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, addr: MulticastAddr<I::Addr>, )
Requests that the specified device join the given multicast group.
If this method is called multiple times with the same device and
address, the device will remain joined to the multicast group until
[MulticastTransportIpContext::leave_multicast_group
] has been called
the same number of times.
Sourcefn leave_multicast_group(
&mut self,
bindings_ctx: &mut BC,
device: &Self::DeviceId,
addr: MulticastAddr<I::Addr>,
)
fn leave_multicast_group( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, addr: MulticastAddr<I::Addr>, )
Requests that the specified device leave the given multicast group.
Each call to this method must correspond to an earlier call to
[MulticastTransportIpContext::join_multicast_group
]. The device
remains a member of the multicast group so long as some call to
join_multicast_group
has been made without a corresponding call to
leave_multicast_group
.
Sourcefn select_device_for_multicast_group(
&mut self,
addr: MulticastAddr<I::Addr>,
marks: &Marks,
) -> Result<Self::DeviceId, ResolveRouteError>
fn select_device_for_multicast_group( &mut self, addr: MulticastAddr<I::Addr>, marks: &Marks, ) -> Result<Self::DeviceId, ResolveRouteError>
Selects a default device with which to join the given multicast group.
The selection is made by consulting the routing table; If there is no route available to the given address, an error is returned.