FreeBSD kernel IPv4 code
igmp_var.h File Reference
#include <sys/counter.h>
Include dependency graph for igmp_var.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  igmpstat
 
struct  igmp_ifinfo
 
struct  igmp_ifsoftc
 

Macros

#define IGPS_VERSION_3   3 /* as of FreeBSD 8.x */
 
#define IGPS_VERSION3_LEN   168
 
#define IGMPCTL_STATS   1 /* statistics (read-only) */
 
#define IGMP_RANDOM_DELAY(X)   (random() % (X) + 1)
 
#define IGMP_MAX_STATE_CHANGES   24 /* Max pending changes per group */
 
#define IGMP_NOT_MEMBER   0 /* Can garbage collect in_multi */
 
#define IGMP_SILENT_MEMBER   1 /* Do not perform IGMP for group */
 
#define IGMP_REPORTING_MEMBER   2 /* IGMPv1/2/3 we are reporter */
 
#define IGMP_IDLE_MEMBER   3 /* IGMPv1/2 we reported last */
 
#define IGMP_LAZY_MEMBER   4 /* IGMPv1/2 other member reporting */
 
#define IGMP_SLEEPING_MEMBER   5 /* IGMPv1/2 start query response */
 
#define IGMP_AWAKENING_MEMBER   6 /* IGMPv1/2 group timer will start */
 
#define IGMP_G_QUERY_PENDING_MEMBER   7 /* IGMPv3 group query pending */
 
#define IGMP_SG_QUERY_PENDING_MEMBER   8 /* IGMPv3 source query pending */
 
#define IGMP_LEAVING_MEMBER   9 /* IGMPv3 dying gasp (pending last */
 
#define IGMP_VERSION_NONE   0 /* Invalid */
 
#define IGMP_VERSION_1   1
 
#define IGMP_VERSION_2   2
 
#define IGMP_VERSION_3   3 /* Default */
 
#define IGMP_RV_INIT   2 /* Robustness Variable */
 
#define IGMP_RV_MIN   1
 
#define IGMP_RV_MAX   7
 
#define IGMP_QI_INIT   125 /* Query Interval (s) */
 
#define IGMP_QI_MIN   1
 
#define IGMP_QI_MAX   255
 
#define IGMP_QRI_INIT   10 /* Query Response Interval (s) */
 
#define IGMP_QRI_MIN   1
 
#define IGMP_QRI_MAX   255
 
#define IGMP_URI_INIT   3 /* Unsolicited Report Interval (s) */
 
#define IGMP_URI_MIN   0
 
#define IGMP_URI_MAX   10
 
#define IGMP_MAX_G_GS_PACKETS   8 /* # of packets to answer G/GS */
 
#define IGMP_MAX_STATE_CHANGE_PACKETS   8 /* # of packets per state change */
 
#define IGMP_MAX_RESPONSE_PACKETS   16 /* # of packets for general query */
 
#define IGMP_MAX_RESPONSE_BURST   4 /* # of responses to send at once */
 
#define IGMP_RESPONSE_BURST_INTERVAL   (PR_FASTHZ / 2) /* 500ms */
 
#define M_IGMPV2   M_PROTO1 /* Packet is IGMPv2 */
 
#define M_IGMPV3_HDR   M_PROTO2 /* Packet has IGMPv3 headers */
 
#define M_GROUPREC   M_PROTO3 /* mbuf chain is a group record */
 
#define M_IGMP_LOOP   M_PROTO4 /* transmit on loif, not real ifp */
 
#define RAOPT_LEN   4 /* Length of IP Router Alert option */
 
#define IGMP_LEADINGSPACE    (sizeof(struct ip) + RAOPT_LEN + sizeof(struct igmp_report))
 
#define IGIF_SILENT   0x00000001 /* Do not use IGMP on this ifp */
 
#define IGIF_LOOPBACK   0x00000002 /* Send IGMP reports to loopback */
 
#define IGMPSTAT_ADD(name, val)    VNET_PCPUSTAT_ADD(struct igmpstat, igmpstat, name, (val))
 
#define IGMPSTAT_INC(name)   IGMPSTAT_ADD(name, 1)
 
#define IGMP_LOCK_INIT()   mtx_init(&igmp_mtx, "igmp_mtx", NULL, MTX_DEF)
 
#define IGMP_LOCK_DESTROY()   mtx_destroy(&igmp_mtx)
 
#define IGMP_LOCK()   mtx_lock(&igmp_mtx)
 
#define IGMP_LOCK_ASSERT()   mtx_assert(&igmp_mtx, MA_OWNED)
 
#define IGMP_UNLOCK()   mtx_unlock(&igmp_mtx)
 
#define IGMP_UNLOCK_ASSERT()   mtx_assert(&igmp_mtx, MA_NOTOWNED)
 

Functions

 VNET_PCPUSTAT_DECLARE (struct igmpstat, igmpstat)
 
int igmp_change_state (struct in_multi *)
 
void igmp_fasttimo (void)
 
struct igmp_ifsoftcigmp_domifattach (struct ifnet *)
 
void igmp_domifdetach (struct ifnet *)
 
void igmp_ifdetach (struct ifnet *)
 
int igmp_input (struct mbuf **, int *, int)
 
void igmp_slowtimo (void)
 
 SYSCTL_DECL (_net_inet_igmp)
 

Macro Definition Documentation

◆ IGIF_LOOPBACK

#define IGIF_LOOPBACK   0x00000002 /* Send IGMP reports to loopback */

Definition at line 180 of file igmp_var.h.

◆ IGIF_SILENT

#define IGIF_SILENT   0x00000001 /* Do not use IGMP on this ifp */

Definition at line 179 of file igmp_var.h.

◆ IGMP_AWAKENING_MEMBER

#define IGMP_AWAKENING_MEMBER   6 /* IGMPv1/2 group timer will start */

Definition at line 114 of file igmp_var.h.

◆ IGMP_G_QUERY_PENDING_MEMBER

#define IGMP_G_QUERY_PENDING_MEMBER   7 /* IGMPv3 group query pending */

Definition at line 115 of file igmp_var.h.

◆ IGMP_IDLE_MEMBER

#define IGMP_IDLE_MEMBER   3 /* IGMPv1/2 we reported last */

Definition at line 111 of file igmp_var.h.

◆ IGMP_LAZY_MEMBER

#define IGMP_LAZY_MEMBER   4 /* IGMPv1/2 other member reporting */

Definition at line 112 of file igmp_var.h.

◆ IGMP_LEADINGSPACE

#define IGMP_LEADINGSPACE    (sizeof(struct ip) + RAOPT_LEN + sizeof(struct igmp_report))

Definition at line 167 of file igmp_var.h.

◆ IGMP_LEAVING_MEMBER

#define IGMP_LEAVING_MEMBER   9 /* IGMPv3 dying gasp (pending last */

Definition at line 117 of file igmp_var.h.

◆ IGMP_LOCK

#define IGMP_LOCK ( )    mtx_lock(&igmp_mtx)

Definition at line 202 of file igmp_var.h.

◆ IGMP_LOCK_ASSERT

#define IGMP_LOCK_ASSERT ( )    mtx_assert(&igmp_mtx, MA_OWNED)

Definition at line 203 of file igmp_var.h.

◆ IGMP_LOCK_DESTROY

#define IGMP_LOCK_DESTROY ( )    mtx_destroy(&igmp_mtx)

Definition at line 201 of file igmp_var.h.

◆ IGMP_LOCK_INIT

#define IGMP_LOCK_INIT ( )    mtx_init(&igmp_mtx, "igmp_mtx", NULL, MTX_DEF)

Definition at line 200 of file igmp_var.h.

◆ IGMP_MAX_G_GS_PACKETS

#define IGMP_MAX_G_GS_PACKETS   8 /* # of packets to answer G/GS */

Definition at line 147 of file igmp_var.h.

◆ IGMP_MAX_RESPONSE_BURST

#define IGMP_MAX_RESPONSE_BURST   4 /* # of responses to send at once */

Definition at line 150 of file igmp_var.h.

◆ IGMP_MAX_RESPONSE_PACKETS

#define IGMP_MAX_RESPONSE_PACKETS   16 /* # of packets for general query */

Definition at line 149 of file igmp_var.h.

◆ IGMP_MAX_STATE_CHANGE_PACKETS

#define IGMP_MAX_STATE_CHANGE_PACKETS   8 /* # of packets per state change */

Definition at line 148 of file igmp_var.h.

◆ IGMP_MAX_STATE_CHANGES

#define IGMP_MAX_STATE_CHANGES   24 /* Max pending changes per group */

Definition at line 103 of file igmp_var.h.

◆ IGMP_NOT_MEMBER

#define IGMP_NOT_MEMBER   0 /* Can garbage collect in_multi */

Definition at line 108 of file igmp_var.h.

◆ IGMP_QI_INIT

#define IGMP_QI_INIT   125 /* Query Interval (s) */

Definition at line 135 of file igmp_var.h.

◆ IGMP_QI_MAX

#define IGMP_QI_MAX   255

Definition at line 137 of file igmp_var.h.

◆ IGMP_QI_MIN

#define IGMP_QI_MIN   1

Definition at line 136 of file igmp_var.h.

◆ IGMP_QRI_INIT

#define IGMP_QRI_INIT   10 /* Query Response Interval (s) */

Definition at line 139 of file igmp_var.h.

◆ IGMP_QRI_MAX

#define IGMP_QRI_MAX   255

Definition at line 141 of file igmp_var.h.

◆ IGMP_QRI_MIN

#define IGMP_QRI_MIN   1

Definition at line 140 of file igmp_var.h.

◆ IGMP_RANDOM_DELAY

#define IGMP_RANDOM_DELAY (   X)    (random() % (X) + 1)

Definition at line 102 of file igmp_var.h.

◆ IGMP_REPORTING_MEMBER

#define IGMP_REPORTING_MEMBER   2 /* IGMPv1/2/3 we are reporter */

Definition at line 110 of file igmp_var.h.

◆ IGMP_RESPONSE_BURST_INTERVAL

#define IGMP_RESPONSE_BURST_INTERVAL   (PR_FASTHZ / 2) /* 500ms */

Definition at line 151 of file igmp_var.h.

◆ IGMP_RV_INIT

#define IGMP_RV_INIT   2 /* Robustness Variable */

Definition at line 131 of file igmp_var.h.

◆ IGMP_RV_MAX

#define IGMP_RV_MAX   7

Definition at line 133 of file igmp_var.h.

◆ IGMP_RV_MIN

#define IGMP_RV_MIN   1

Definition at line 132 of file igmp_var.h.

◆ IGMP_SG_QUERY_PENDING_MEMBER

#define IGMP_SG_QUERY_PENDING_MEMBER   8 /* IGMPv3 source query pending */

Definition at line 116 of file igmp_var.h.

◆ IGMP_SILENT_MEMBER

#define IGMP_SILENT_MEMBER   1 /* Do not perform IGMP for group */

Definition at line 109 of file igmp_var.h.

◆ IGMP_SLEEPING_MEMBER

#define IGMP_SLEEPING_MEMBER   5 /* IGMPv1/2 start query response */

Definition at line 113 of file igmp_var.h.

◆ IGMP_UNLOCK

#define IGMP_UNLOCK ( )    mtx_unlock(&igmp_mtx)

Definition at line 204 of file igmp_var.h.

◆ IGMP_UNLOCK_ASSERT

#define IGMP_UNLOCK_ASSERT ( )    mtx_assert(&igmp_mtx, MA_NOTOWNED)

Definition at line 205 of file igmp_var.h.

◆ IGMP_URI_INIT

#define IGMP_URI_INIT   3 /* Unsolicited Report Interval (s) */

Definition at line 143 of file igmp_var.h.

◆ IGMP_URI_MAX

#define IGMP_URI_MAX   10

Definition at line 145 of file igmp_var.h.

◆ IGMP_URI_MIN

#define IGMP_URI_MIN   0

Definition at line 144 of file igmp_var.h.

◆ IGMP_VERSION_1

#define IGMP_VERSION_1   1

Definition at line 124 of file igmp_var.h.

◆ IGMP_VERSION_2

#define IGMP_VERSION_2   2

Definition at line 125 of file igmp_var.h.

◆ IGMP_VERSION_3

#define IGMP_VERSION_3   3 /* Default */

Definition at line 126 of file igmp_var.h.

◆ IGMP_VERSION_NONE

#define IGMP_VERSION_NONE   0 /* Invalid */

Definition at line 123 of file igmp_var.h.

◆ IGMPCTL_STATS

#define IGMPCTL_STATS   1 /* statistics (read-only) */

Definition at line 100 of file igmp_var.h.

◆ IGMPSTAT_ADD

#define IGMPSTAT_ADD (   name,
  val 
)     VNET_PCPUSTAT_ADD(struct igmpstat, igmpstat, name, (val))

Definition at line 191 of file igmp_var.h.

◆ IGMPSTAT_INC

#define IGMPSTAT_INC (   name)    IGMPSTAT_ADD(name, 1)

Definition at line 193 of file igmp_var.h.

◆ IGPS_VERSION3_LEN

#define IGPS_VERSION3_LEN   168

Definition at line 92 of file igmp_var.h.

◆ IGPS_VERSION_3

#define IGPS_VERSION_3   3 /* as of FreeBSD 8.x */

Definition at line 91 of file igmp_var.h.

◆ M_GROUPREC

#define M_GROUPREC   M_PROTO3 /* mbuf chain is a group record */

Definition at line 158 of file igmp_var.h.

◆ M_IGMP_LOOP

#define M_IGMP_LOOP   M_PROTO4 /* transmit on loif, not real ifp */

Definition at line 159 of file igmp_var.h.

◆ M_IGMPV2

#define M_IGMPV2   M_PROTO1 /* Packet is IGMPv2 */

Definition at line 156 of file igmp_var.h.

◆ M_IGMPV3_HDR

#define M_IGMPV3_HDR   M_PROTO2 /* Packet has IGMPv3 headers */

Definition at line 157 of file igmp_var.h.

◆ RAOPT_LEN

#define RAOPT_LEN   4 /* Length of IP Router Alert option */

Definition at line 166 of file igmp_var.h.

Function Documentation

◆ igmp_change_state()

int igmp_change_state ( struct in_multi inm)

◆ igmp_domifattach()

struct igmp_ifsoftc * igmp_domifattach ( struct ifnet *  ifp)

Definition at line 611 of file igmp.c.

References igi_alloc_locked(), igmp_ifsoftc::igi_flags, IGIF_SILENT, IGMP_LOCK, IGMP_UNLOCK, and KTR_IGMPV3.

Referenced by in_domifattach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ igmp_domifdetach()

void igmp_domifdetach ( struct ifnet *  ifp)

Definition at line 711 of file igmp.c.

References igi_delete_locked(), IGMP_LOCK, IGMP_UNLOCK, and KTR_IGMPV3.

Referenced by in_domifdetach(), and in_ifscrub_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ igmp_fasttimo()

void igmp_fasttimo ( void  )

Definition at line 1659 of file igmp.c.

References igmp_fasttimo_vnet().

Here is the call graph for this function:

◆ igmp_ifdetach()

void igmp_ifdetach ( struct ifnet *  ifp)

Definition at line 671 of file igmp.c.

References ifma_restart, igmp_ifsoftc::igi_version, IGMP_LEAVING_MEMBER, IGMP_LOCK, IGMP_UNLOCK, IGMP_VERSION_3, inm_clear_recorded(), inm_rele_locked(), inm_release_list_deferred(), in_multi::inm_state, KTR_IGMPV3, and next.

Referenced by in_purgemaddrs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ igmp_input()

◆ igmp_slowtimo()

void igmp_slowtimo ( void  )

Definition at line 2197 of file igmp.c.

References igmp_slowtimo_vnet().

Here is the call graph for this function:

◆ SYSCTL_DECL()

SYSCTL_DECL ( _net_inet_igmp  )

◆ VNET_PCPUSTAT_DECLARE()

VNET_PCPUSTAT_DECLARE ( struct igmpstat  ,
igmpstat   
)