32 #include <satcat5/ip_core.h>
41 #ifndef SATCAT5_IGMP_ENABLE
42 #define SATCAT5_IGMP_ENABLE 1
49 DST_ALL_SYSTEMS(224, 0, 0, 1),
84 const unsigned wcount, u16* data);
104 #if SATCAT5_IGMP_ENABLE
126 #if SATCAT5_IGMP_ENABLE
132 void set_timer(u32& timer, u32 max_msec);
151 #if SATCAT5_IGMP_ENABLE
152 : m_igmp_group(0), m_igmp_timer(0), m_next(
nullptr)
163 { igmp->
join(*
this, addr); }
169 { igmp->
leave(*
this); }
172 #if SATCAT5_IGMP_ENABLE
Host/Client for the Internet Group Management Protocol (IGMP).
Client(satcat5::ip::Dispatch *iface)
Link this handler to an IPv4 network interface.
void join(satcat5::igmp::Address &obj, const satcat5::ip::Addr &addr)
Join a multicast group.
void timer_event() override
Child class MUST override this method.
void frame_rcvd(satcat5::io::LimitedRead &src) override
Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.
void leave(satcat5::igmp::Address &obj)
Leave a multicast group.
Limited read of next N bytes.
Protocol handler and dispatch unit for Internet Protocol v4 (IPv4).
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
Timer objects are polled after a fixed delay or at a regular interval.
Helper functions for manipulating singly-linked lists.
constexpr unsigned MIN_LEN_SHORTS
Set upper and lower bounds for the length of an IGMP message.
constexpr unsigned MAX_LEN_SHORTS
Set upper and lower bounds for the length of an IGMP message.
constexpr u16 TYPE_REPORT_V3
Reply to IGMPv3 query.
constexpr u16 RECORD_ALLOW_NEW
Record type: Append to allow list.
constexpr unsigned MIN_LEN_BYTES
Set upper and lower bounds for the length of an IGMP message.
constexpr u16 RECORD_BLOCK_OLD
Record type: Append to block list.
constexpr satcat5::ip::Addr DST_ALL_ROUTERS(224, 0, 0, 2)
< All endpoints on subnet.
constexpr unsigned MAX_V3_RECORDS
Set upper and lower bounds for the length of an IGMP message.
constexpr u16 RECORD_CHANGE_INCL
Record type: Change to INCL mode.
constexpr unsigned MAX_LEN_BYTES
Set upper and lower bounds for the length of an IGMP message.
constexpr u16 TYPE_REPORT_V1
Reply to IGMPv1 query.
constexpr u16 RECORD_MODE_INCL
Record type: Include mode.
constexpr u16 MASK_MAXLEN
Bit-mask "length" from first header word.
constexpr satcat5::ip::Addr DST_IGMPV3_REPORT(224, 0, 0, 22)
< All routers on subnet.
constexpr u16 RECORD_MODE_EXCL
Record type: Exclude mode.
u32 decode_maxdly(u16 hdr, bool v3)
Given the first word of the IGMP query header, decode max delay.
constexpr u16 TYPE_REPORT_V2
Reply to IGMPv2 query.
constexpr u16 RECORD_CHANGE_EXCL
Record type: Change to EXCL mode.
constexpr u16 TYPE_LEAVE_V2
Leaving group (v2 / v3)
bool igmp_send(satcat5::ip::Dispatch *iface, const satcat5::ip::Addr &dst, const unsigned wcount, u16 *data)
Given IGMP message contents, write Eth/IP headers and send packet.
constexpr u16 TYPE_QUERY
IGMP query (all versions)
constexpr u16 MASK_TYPE
Bit-mask "type" from first header word.
Templated functions for manipulating singly-linked lists.
Generic network Protocol API.
Core event-processing loop for SatCat5 software.
Client state for an IGMP multicast subscription.
void join(satcat5::igmp::Client *igmp, const satcat5::ip::Addr &addr)
Join a multicast group.
void leave(satcat5::igmp::Client *igmp)
Leave a multicast group.
constexpr Address()
Constructor for an address placeholder.
IPv4 address is a 32-bit unsigned integer.