netstack3_ip::gmp

Trait GmpHandler

Source
pub trait GmpHandler<I: IpExt, BC>: DeviceIdContext<AnyDevice> {
    // Required methods
    fn gmp_handle_maybe_enabled(
        &mut self,
        bindings_ctx: &mut BC,
        device: &Self::DeviceId,
    );
    fn gmp_handle_disabled(
        &mut self,
        bindings_ctx: &mut BC,
        device: &Self::DeviceId,
    );
    fn gmp_join_group(
        &mut self,
        bindings_ctx: &mut BC,
        device: &Self::DeviceId,
        group_addr: MulticastAddr<I::Addr>,
    ) -> GroupJoinResult;
    fn gmp_leave_group(
        &mut self,
        bindings_ctx: &mut BC,
        device: &Self::DeviceId,
        group_addr: MulticastAddr<I::Addr>,
    ) -> GroupLeaveResult;
    fn gmp_get_mode(&mut self, device: &Self::DeviceId) -> I::GmpProtoConfigMode;
    fn gmp_set_mode(
        &mut self,
        bindings_ctx: &mut BC,
        device: &Self::DeviceId,
        new_mode: I::GmpProtoConfigMode,
    ) -> I::GmpProtoConfigMode;
}
Expand description

An implementation of a Group Management Protocol (GMP) such as the Internet Group Management Protocol, Version 2 (IGMPv2) for IPv4 or the Multicast Listener Discovery (MLD) protocol for IPv6.

Required Methods§

Source

fn gmp_handle_maybe_enabled( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, )

Handles GMP potentially being enabled.

Attempts to transition memberships in the non-member state to a member state. Should be called anytime a configuration change occurs which results in GMP potentially being enabled. E.g. when IP or GMP transitions to being enabled.

This method is idempotent, once into the enabled state future calls are no-ops.

Source

fn gmp_handle_disabled( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, )

Handles GMP being disabled.

All joined groups will transition to the non-member state but still remain locally joined.

This method is idempotent, once into the disabled state future calls are no-ops.

Source

fn gmp_join_group( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, group_addr: MulticastAddr<I::Addr>, ) -> GroupJoinResult

Joins the given multicast group.

Source

fn gmp_leave_group( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, group_addr: MulticastAddr<I::Addr>, ) -> GroupLeaveResult

Leaves the given multicast group.

Source

fn gmp_get_mode(&mut self, device: &Self::DeviceId) -> I::GmpProtoConfigMode

Returns the current protocol mode.

Source

fn gmp_set_mode( &mut self, bindings_ctx: &mut BC, device: &Self::DeviceId, new_mode: I::GmpProtoConfigMode, ) -> I::GmpProtoConfigMode

Sets the new user-configured protocol mode.

Returns the previous mode. No packets are sent in response to switching modes.

Implementors§

Source§

impl<I: IpExt, BC: GmpBindingsContext, CC: GmpContext<I, BC>> GmpHandler<I, BC> for CC