1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_NETINET_IGMP_VAR_H
28*7c478bd9Sstevel@tonic-gate #define	_NETINET_IGMP_VAR_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
33*7c478bd9Sstevel@tonic-gate extern "C" {
34*7c478bd9Sstevel@tonic-gate #endif
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate /*
37*7c478bd9Sstevel@tonic-gate  * Internet Group Management Protocol (IGMP),
38*7c478bd9Sstevel@tonic-gate  * implementation-specific definitions.
39*7c478bd9Sstevel@tonic-gate  *
40*7c478bd9Sstevel@tonic-gate  * Written by Steve Deering, Stanford, May 1988.
41*7c478bd9Sstevel@tonic-gate  * Modified by Ajit Thyagarajan, PARC, August 1994.
42*7c478bd9Sstevel@tonic-gate  *
43*7c478bd9Sstevel@tonic-gate  * MULTICAST 3.5.1.1
44*7c478bd9Sstevel@tonic-gate  */
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate struct igmpstat {
47*7c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_total;		/* total IGMP messages received    */
48*7c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_tooshort;	/* received with too few bytes	   */
49*7c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_badsum;	/* received with bad checksum	   */
50*7c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_queries;	/* received membership queries	   */
51*7c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_badqueries;	/* received invalid queries	   */
52*7c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_reports;	/* received membership reports	   */
53*7c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_badreports;	/* received invalid reports	   */
54*7c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_ourreports;	/* received reports for our groups */
55*7c478bd9Sstevel@tonic-gate 	uint_t	igps_snd_reports;	/* sent membership reports	   */
56*7c478bd9Sstevel@tonic-gate };
57*7c478bd9Sstevel@tonic-gate 
58*7c478bd9Sstevel@tonic-gate #ifdef _KERNEL
59*7c478bd9Sstevel@tonic-gate struct igmpstat igmpstat;
60*7c478bd9Sstevel@tonic-gate 
61*7c478bd9Sstevel@tonic-gate /*
62*7c478bd9Sstevel@tonic-gate  * slowtimo interval used for both IGMP and MLD
63*7c478bd9Sstevel@tonic-gate  */
64*7c478bd9Sstevel@tonic-gate #define	MCAST_SLOWTIMO_INTERVAL	10000	/* milliseconds */
65*7c478bd9Sstevel@tonic-gate 
66*7c478bd9Sstevel@tonic-gate 
67*7c478bd9Sstevel@tonic-gate /*
68*7c478bd9Sstevel@tonic-gate  * Macro to compute a random timer value between 1 and maxticks.
69*7c478bd9Sstevel@tonic-gate  * Include <sys/random.h> for random_get_pseudo_bytes() declaration.
70*7c478bd9Sstevel@tonic-gate  */
71*7c478bd9Sstevel@tonic-gate #include <sys/random.h>
72*7c478bd9Sstevel@tonic-gate #define	MCAST_RANDOM_DELAY(timer, maxticks)				      \
73*7c478bd9Sstevel@tonic-gate 	/* uint_t timer; int maxticks */				      \
74*7c478bd9Sstevel@tonic-gate 	(void) random_get_pseudo_bytes((uint8_t *)&(timer), sizeof (uint_t)); \
75*7c478bd9Sstevel@tonic-gate 	(timer) = ((uint_t)(timer) % (maxticks)) + 1
76*7c478bd9Sstevel@tonic-gate 
77*7c478bd9Sstevel@tonic-gate /*
78*7c478bd9Sstevel@tonic-gate  * States for IGMPv2's leave processing
79*7c478bd9Sstevel@tonic-gate  */
80*7c478bd9Sstevel@tonic-gate #define	IGMP_OTHERMEMBER			0
81*7c478bd9Sstevel@tonic-gate #define	IGMP_IREPORTEDLAST			1
82*7c478bd9Sstevel@tonic-gate 
83*7c478bd9Sstevel@tonic-gate /*
84*7c478bd9Sstevel@tonic-gate  * We must remember what version the subnet's querier is.
85*7c478bd9Sstevel@tonic-gate  */
86*7c478bd9Sstevel@tonic-gate #define	IGMP_V1_ROUTER				0
87*7c478bd9Sstevel@tonic-gate #define	IGMP_V2_ROUTER				1
88*7c478bd9Sstevel@tonic-gate #define	IGMP_V3_ROUTER				2
89*7c478bd9Sstevel@tonic-gate 
90*7c478bd9Sstevel@tonic-gate /*
91*7c478bd9Sstevel@tonic-gate  * Map MLD versions to corresponding IGMP versions
92*7c478bd9Sstevel@tonic-gate  */
93*7c478bd9Sstevel@tonic-gate #define	MLD_V1_ROUTER				IGMP_V2_ROUTER
94*7c478bd9Sstevel@tonic-gate #define	MLD_V2_ROUTER				IGMP_V3_ROUTER
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate /*
97*7c478bd9Sstevel@tonic-gate  * Default values for various IGMPv3/MLDv2 values
98*7c478bd9Sstevel@tonic-gate  */
99*7c478bd9Sstevel@tonic-gate #define	MCAST_DEF_ROBUSTNESS			2
100*7c478bd9Sstevel@tonic-gate #define	MCAST_QUERY_RESP_INTERVAL		10	/* in seconds */
101*7c478bd9Sstevel@tonic-gate #define	MCAST_DEF_QUERY_INTERVAL		125	/* in seconds */
102*7c478bd9Sstevel@tonic-gate #define	MCAST_DEF_QUERY_RESP_INTERVAL		100	/* in tenths of secs */
103*7c478bd9Sstevel@tonic-gate #define	MCAST_DEF_UNSOL_RPT_INTERVAL		1	/* in seconds */
104*7c478bd9Sstevel@tonic-gate 
105*7c478bd9Sstevel@tonic-gate /*
106*7c478bd9Sstevel@tonic-gate  * IGMP and MLD mandate a TTL/Hop Limit of 1 for protocol messages
107*7c478bd9Sstevel@tonic-gate  */
108*7c478bd9Sstevel@tonic-gate #define	IGMP_TTL	1
109*7c478bd9Sstevel@tonic-gate #define	MLD_HOP_LIMIT	1
110*7c478bd9Sstevel@tonic-gate 
111*7c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
112*7c478bd9Sstevel@tonic-gate 
113*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
114*7c478bd9Sstevel@tonic-gate }
115*7c478bd9Sstevel@tonic-gate #endif
116*7c478bd9Sstevel@tonic-gate 
117*7c478bd9Sstevel@tonic-gate #endif	/* _NETINET_IGMP_VAR_H */
118