include/linux/igmp.h

Source file repositories/reference/linux-study-clean/include/linux/igmp.h

File Facts

System
Linux kernel
Corpus path
include/linux/igmp.h
Extension
.h
Size
8740 bytes
Lines
297
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ip_sf_socklist {
	unsigned int		sl_max;
	unsigned int		sl_count;
	struct rcu_head		rcu;
	__be32			sl_addr[] __counted_by(sl_max);
};

#define IP_SFBLOCK	10	/* allocate this many at once */

/* ip_mc_socklist is real list now. Speed is not argument;
   this list never used in fast path code
 */

struct ip_mc_socklist {
	struct ip_mc_socklist __rcu *next_rcu;
	struct ip_mreqn		multi;
	unsigned int		sfmode;		/* MCAST_{INCLUDE,EXCLUDE} */
	struct ip_sf_socklist __rcu	*sflist;
	struct rcu_head		rcu;
};

struct ip_sf_list {
	struct ip_sf_list	*sf_next;
	unsigned long		sf_count[2];	/* include/exclude counts */
	__be32			sf_inaddr;
	unsigned char		sf_gsresp;	/* include in g & s response? */
	unsigned char		sf_oldin;	/* change state */
	unsigned char		sf_crcount;	/* retrans. left to send */
};

struct ip_mc_list {
	struct in_device	*interface;
	__be32			multiaddr;
	unsigned int		sfmode;
	struct ip_sf_list	*sources;
	struct ip_sf_list	*tomb;
	unsigned long		sfcount[2];
	union {
		struct ip_mc_list *next;
		struct ip_mc_list __rcu *next_rcu;
	};
	struct ip_mc_list __rcu *next_hash;
	struct timer_list	timer;
	int			users;
	refcount_t		refcnt;
	spinlock_t		lock;
	char			tm_running;
	char			reporter;
	char			unsolicit_count;
	char			loaded;
	unsigned char		gsquery;	/* check source marks? */
	unsigned char		crcount;
	unsigned long		mca_cstamp;
	unsigned long		mca_tstamp;
	struct rcu_head		rcu;
};

/* RFC3376, relevant sections:
 *  - 4.1.1. Maximum Response Code
 *  - 4.1.7. QQIC (Querier's Query Interval Code)
 *
 * For both MRC and QQIC, values >= 128 use the same floating-point
 * encoding as follows:
 *
 *  0 1 2 3 4 5 6 7
 * +-+-+-+-+-+-+-+-+
 * |1| exp | mant  |
 * +-+-+-+-+-+-+-+-+
 */
#define IGMPV3_FP_EXP(value)		(((value) >> 4) & 0x07)
#define IGMPV3_FP_MAN(value)		((value) & 0x0f)

/* IGMPv3 floating-point exponential field min threshold */
#define IGMPV3_EXP_MIN_THRESHOLD	128
/* IGMPv3 FP max threshold (mant = 0xF, exp = 7) -> 31744 */
#define IGMPV3_EXP_MAX_THRESHOLD	31744

/* V3 exponential field encoding */

/* IGMPv3 MRC/QQIC 8-bit exponential field encode
 *
 * RFC3376, 4.1.1 & 4.1.7. defines only the decoding formula:
 *     MRT/QQI = (mant | 0x10) << (exp + 3)
 *
 * but does NOT define the encoding procedure. To derive exponent:
 *
 * For any value of mantissa and exponent, the decoding formula
 * indicates that the "hidden bit" (0x10) is shifted 4 bits left
 * to sit above the 4-bit mantissa. The RFC again shifts this
 * entire block left by (exp + 3) to reconstruct the value.

Annotation

Implementation Notes