SatCat5
satcat5::igmp::Server Class Reference

Detailed Description

Router/Server for the Internet Group Management Protocol (IGMP).

This class implements the router/server side of IGMP, including IGMP snooping for layer-2 Ethernet switches. Election of the "querier" server is automatic; the querier is responsible for sending IGMP queries at regular intervals, and all others listen passively to keep port-by-port membership lists up-to-date.

TODO: This class operates with the software router or switch only. It does NOT provide for multicast management of an HDL router, HDL switch, or mixed-mode configurations. Those hooks will need to be created if and when those features are added to the HDL.

See also
ip_igmp_server.h, ip::IgmpClient.

Definition at line 72 of file igmp_server.h.

#include <igmp_server.h>

Inheritance diagram for satcat5::igmp::Server:
[legend]
Collaboration diagram for satcat5::igmp::Server:
[legend]

Public Member Functions

 Server (satcat5::eth::SwitchCore *sw, satcat5::ip::Dispatch *iface, satcat5::igmp::Group *groups, unsigned gcount)
 Link this plugin to the network switch or router. More...
 
void flush ()
 Flush all existing routes and reset status.
 
void force_version (u8 version)
 Force a specific IGMP version for compatibility or testing. More...
 
SATCAT5_PMASK_TYPE get_mask (const satcat5::ip::Addr &addr) const
 Get the port-mask for a given multicast IP address.
 
bool is_querier () const
 Are we the current querier?
 
void query (satcat5::eth::PluginPacket &pkt) override
 Packet-processing callback from PluginCore.
 
void set_mdly (u8 fast, u8 slow)
 Set the max-delay parameter for outgoing queries. More...
 
u8 version () const
 Current IGMP version for this network.
 

Protected Member Functions

void timer_event () override
 Child class MUST override this method.
 
satcat5::igmp::Groupfind_or_create (const satcat5::ip::Addr &group)
 
satcat5::igmp::Groupfind_match (const satcat5::ip::Addr &group) const
 
void rcvd_igmp (satcat5::eth::PluginPacket &pkt)
 
void rcvd_mcast (satcat5::eth::PluginPacket &pkt)
 
void send_query (satcat5::igmp::Group *group, bool first)
 
void timer_once (unsigned msec)
 Configure a one-time notification after X milliseconds.
 
void timer_every (unsigned msec)
 Configure a repeating notification every X milliseconds.
 
void timer_stop ()
 Stop all future notifications.
 
unsigned timer_interval () const
 Accessor for recurring timer interval, if one is set.
 
unsigned timer_remaining () const
 Accessor for time to next event, if one is set.
 

Static Protected Member Functions

static unsigned count_timer ()
 Count all objects of this type, including idle timers.
 

Protected Attributes

satcat5::ip::Dispatch *const m_iface
 
satcat5::igmp::Group *const m_groups
 
const u16 m_gcount
 
u8 m_status
 
u8 m_mdly_fast
 
u8 m_mdly_slow
 
u8 m_vmin
 
u8 m_vmax
 
u32 m_query_timer
 
u32 m_window_timer
 
satcat5::eth::SwitchCore *const m_switch
 Pointer to the associated SwitchCore object.
 

Private Attributes

satcat5::eth::PluginCorem_next
 
unsigned m_trem
 
unsigned m_tnext
 

Constructor & Destructor Documentation

◆ Server()

Server::Server ( satcat5::eth::SwitchCore sw,
satcat5::ip::Dispatch iface,
satcat5::igmp::Group groups,
unsigned  gcount 
)

Link this plugin to the network switch or router.

The caller must provide a pointer to a working buffer with an array of igmp::Group objects. The elements must be zero initialized or use the default constructor. The size of this buffer sets the maximum number of concurrent IGMP groups, i.e., one slot per active multicast address.

  • sw Software-defined switch or router.
  • iface Optional transmit interface (routers only). Routers MUST specify a transmit interface. Switches MUST NOT specify a transmit interface.
  • groups Pointer to the working buffer.
  • gcount Size of the working buffer.

Definition at line 50 of file igmp_server.cc.

Member Function Documentation

◆ force_version()

void satcat5::igmp::Server::force_version ( u8  version)
inline

Force a specific IGMP version for compatibility or testing.

Per RFC2236 Section 4, this must be configured manually.

Definition at line 102 of file igmp_server.h.

◆ set_mdly()

void satcat5::igmp::Server::set_mdly ( u8  fast,
u8  slow 
)
inline

Set the max-delay parameter for outgoing queries.

"Fast" parameter is for single-group queries (default 20 = 2.0 seconds). "Slow" is for general queries (default 100 = 10.0 seconds). These use the quasi-floating-point format of IGMPv3.

Definition at line 118 of file igmp_server.h.


The documentation for this class was generated from the following files: