Nut/OS  4.10.3
API Reference
IGMP

RFC 2236 Internet Group Management Protocol. More...

Collaboration diagram for IGMP:

Data Structures

struct  igmp
 IGMP packet structure. More...
struct  igmpv3
 IGMPv3 query format. More...
struct  igmp_grouprec
 IGMPv3 group record. More...
struct  igmp_report
 IGMPv3 report. More...

Defines

#define IGMP_MINLEN   8
 Minimum IGMP packet length.
#define IGMP_MEMBERSHIP_QUERY   0x11
 Membership query.
#define IGMP_V1_MEMBERSHIP_REPORT   0x12
 Ver. 1 membership report.
#define IGMP_V2_MEMBERSHIP_REPORT   0x16
 Ver. 2 membership report.
#define IGMP_V3_MEMBERSHIP_REPORT   0x22
 Ver. 3 membership report.
#define IGMP_V2_LEAVE_GROUP   0x17
 Leave-group message.
#define IGMP_MAX_HOST_REPORT_DELAY   10
 Maximum delay for response query.
#define IGMP_TIMER_SCALE   10
 Code field time scale.
#define IGMP_EXCLUDE_LIST   1
 List identifiers.
#define IGMP_INCLUDE_LIST   2
#define IGMP_RECORDED_LIST   3

Typedefs

typedef struct igmp IGMP
 IGMP packet type.
typedef struct igmp_report IGMP_REPORT

Functions

void NutIgmpInput (NUTDEVICE *dev, NETBUF *nb)
 Process incoming IGMP packets.
int NutIgmpOutput (uint8_t type, uint32_t dest, NETBUF *nb)
 Send an IGMP datagram.
void NutIgmpJoinGroup (NUTDEVICE *dev, uint32_t ip_addr)
void NutIgmpLeaveGroup (NUTDEVICE *dev, uint32_t ip_addr)

IGMPv3 Report Types

#define IGMP_REPORT_MODE_IN   1
 Mode-is-include.
#define IGMP_REPORT_MODE_EX   2
 Mode-is-exclude.
#define IGMP_REPORT_TO_IN   3
 Change-to-include.
#define IGMP_REPORT_TO_EX   4
 Change-to-exclude.
#define IGMP_REPORT_ALLOW_NEW   5
 Allow-new-sources.
#define IGMP_REPORT_BLOCK_OLD   6
 Block-old-sources.

IGMPv3 Report Type Flags

#define IGMP_MASK_CUR_STATE   0x01
 Report current-state.
#define IGMP_MASK_ALLOW_NEW   0x02
 Report source as allow-new.
#define IGMP_MASK_BLOCK_OLD   0x04
 Report source as block-old.
#define IGMP_MASK_TO_IN   0x08
 Report source as to_in.
#define IGMP_MASK_TO_EX   0x10
 Report source as to_ex.
#define IGMP_MASK_STATE_T1   0x20
 State at T1.
#define IGMP_MASK_STATE_T2   0x40
 State at T2.
#define IGMP_MASK_IF_STATE   0x80
 Report current-state per interface.
#define IGMP_MASK_STATE_TX   (IGMP_MASK_STATE_T1 | IGMP_MASK_STATE_T2)
#define IGMP_MASK_PENDING   (IGMP_MASK_CUR_STATE | IGMP_MASK_ALLOW_NEW | IGMP_MASK_BLOCK_OLD)

Detailed Description

RFC 2236 Internet Group Management Protocol.


Define Documentation

#define IGMP_MINLEN   8

Minimum IGMP packet length.

Definition at line 151 of file igmp.h.

Referenced by NutIgmpInput().

#define IGMP_MEMBERSHIP_QUERY   0x11

Membership query.

Definition at line 153 of file igmp.h.

Referenced by NutIgmpInput().

#define IGMP_V1_MEMBERSHIP_REPORT   0x12

Ver. 1 membership report.

Definition at line 154 of file igmp.h.

Referenced by NutIgmpInput().

#define IGMP_V2_MEMBERSHIP_REPORT   0x16

Ver. 2 membership report.

Definition at line 155 of file igmp.h.

Referenced by NutIgmpInput(), and NutIgmpJoinGroup().

#define IGMP_V3_MEMBERSHIP_REPORT   0x22

Ver. 3 membership report.

Definition at line 156 of file igmp.h.

#define IGMP_V2_LEAVE_GROUP   0x17

Leave-group message.

Definition at line 157 of file igmp.h.

Referenced by NutIgmpLeaveGroup().

#define IGMP_MAX_HOST_REPORT_DELAY   10

Maximum delay for response query.

Definition at line 162 of file igmp.h.

#define IGMP_TIMER_SCALE   10

Code field time scale.

Definition at line 167 of file igmp.h.

#define IGMP_REPORT_MODE_IN   1

Mode-is-include.

Definition at line 173 of file igmp.h.

#define IGMP_REPORT_MODE_EX   2

Mode-is-exclude.

Definition at line 174 of file igmp.h.

#define IGMP_REPORT_TO_IN   3

Change-to-include.

Definition at line 175 of file igmp.h.

#define IGMP_REPORT_TO_EX   4

Change-to-exclude.

Definition at line 176 of file igmp.h.

#define IGMP_REPORT_ALLOW_NEW   5

Allow-new-sources.

Definition at line 177 of file igmp.h.

#define IGMP_REPORT_BLOCK_OLD   6

Block-old-sources.

Definition at line 178 of file igmp.h.

#define IGMP_MASK_CUR_STATE   0x01

Report current-state.

Definition at line 185 of file igmp.h.

#define IGMP_MASK_ALLOW_NEW   0x02

Report source as allow-new.

Definition at line 186 of file igmp.h.

#define IGMP_MASK_BLOCK_OLD   0x04

Report source as block-old.

Definition at line 187 of file igmp.h.

#define IGMP_MASK_TO_IN   0x08

Report source as to_in.

Definition at line 188 of file igmp.h.

#define IGMP_MASK_TO_EX   0x10

Report source as to_ex.

Definition at line 189 of file igmp.h.

#define IGMP_MASK_STATE_T1   0x20

State at T1.

Definition at line 190 of file igmp.h.

#define IGMP_MASK_STATE_T2   0x40

State at T2.

Definition at line 191 of file igmp.h.

#define IGMP_MASK_IF_STATE   0x80

Report current-state per interface.

Definition at line 192 of file igmp.h.

#define IGMP_MASK_STATE_TX   (IGMP_MASK_STATE_T1 | IGMP_MASK_STATE_T2)

Definition at line 194 of file igmp.h.

#define IGMP_MASK_PENDING   (IGMP_MASK_CUR_STATE | IGMP_MASK_ALLOW_NEW | IGMP_MASK_BLOCK_OLD)

Definition at line 195 of file igmp.h.

#define IGMP_EXCLUDE_LIST   1

List identifiers.

Definition at line 201 of file igmp.h.

#define IGMP_INCLUDE_LIST   2

Definition at line 202 of file igmp.h.

#define IGMP_RECORDED_LIST   3

Definition at line 203 of file igmp.h.


Typedef Documentation

IGMP packet type.

Definition at line 96 of file igmp.h.

typedef struct igmp_report IGMP_REPORT

Definition at line 97 of file igmp.h.


Function Documentation

void NutIgmpInput ( NUTDEVICE dev,
NETBUF nb 
)

Process incoming IGMP packets.

Parameters:
devIdentifies the device that received the packet.
nbPointer to a network buffer structure containing the IGMP packet.

Definition at line 100 of file igmpin.c.

References _NUTDEVICE::dev_icb, IGMP_MEMBERSHIP_QUERY, IGMP_MINLEN, igmp::igmp_type, IGMP_V1_MEMBERSHIP_REPORT, IGMP_V2_MEMBERSHIP_REPORT, INADDR_ALLHOSTS_GROUP, _NETBUF::nb_tp, NutIgmpJoinGroup(), NutNetBufFree(), _NBDATA::sz, and _NBDATA::vp.

Referenced by NutIpInput().

Here is the call graph for this function:

int NutIgmpOutput ( uint8_t  type,
uint32_t  dest,
NETBUF nb 
)

Send an IGMP datagram.

Known IGMP types are:

Parameters:
typeIGMP packet type.
destDestination IP address.
nbNetwork buffer structure containing the datagram.
Returns:
0 on success, -1 otherwise.

Definition at line 102 of file igmpout.c.

References igmp::igmp_cksum, igmp::igmp_code, igmp::igmp_group, igmp::igmp_type, IPPROTO_IGMP, _NETBUF::nb_tp, NBAF_TRANSPORT, NutIpChkSum(), NutIpOutput(), NutNetBufAlloc(), _NBDATA::sz, and _NBDATA::vp.

Here is the call graph for this function:

void NutIgmpJoinGroup ( NUTDEVICE dev,
uint32_t  ip_addr 
)

Definition at line 110 of file igmp.c.

References IGMP_V2_MEMBERSHIP_REPORT.

Referenced by NutIgmpInput(), and NutNetIfAddMcastAddr().

void NutIgmpLeaveGroup ( NUTDEVICE dev,
uint32_t  ip_addr 
)

Definition at line 115 of file igmp.c.

References IGMP_V2_LEAVE_GROUP.

Referenced by NutNetIfDelMcastAddr().