xref: /titanic_52/usr/src/uts/common/netinet/igmp_var.h (revision f4b3ec61df05330d25f55a36b975b4d7519fdeb1)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*f4b3ec61Sdh155122  * Common Development and Distribution License (the "License").
6*f4b3ec61Sdh155122  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*f4b3ec61Sdh155122  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_NETINET_IGMP_VAR_H
277c478bd9Sstevel@tonic-gate #define	_NETINET_IGMP_VAR_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * Internet Group Management Protocol (IGMP),
377c478bd9Sstevel@tonic-gate  * implementation-specific definitions.
387c478bd9Sstevel@tonic-gate  *
397c478bd9Sstevel@tonic-gate  * Written by Steve Deering, Stanford, May 1988.
407c478bd9Sstevel@tonic-gate  * Modified by Ajit Thyagarajan, PARC, August 1994.
417c478bd9Sstevel@tonic-gate  *
427c478bd9Sstevel@tonic-gate  * MULTICAST 3.5.1.1
437c478bd9Sstevel@tonic-gate  */
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate struct igmpstat {
467c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_total;		/* total IGMP messages received    */
477c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_tooshort;	/* received with too few bytes	   */
487c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_badsum;	/* received with bad checksum	   */
497c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_queries;	/* received membership queries	   */
507c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_badqueries;	/* received invalid queries	   */
517c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_reports;	/* received membership reports	   */
527c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_badreports;	/* received invalid reports	   */
537c478bd9Sstevel@tonic-gate 	uint_t	igps_rcv_ourreports;	/* received reports for our groups */
547c478bd9Sstevel@tonic-gate 	uint_t	igps_snd_reports;	/* sent membership reports	   */
557c478bd9Sstevel@tonic-gate };
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate #ifdef _KERNEL
587c478bd9Sstevel@tonic-gate /*
597c478bd9Sstevel@tonic-gate  * slowtimo interval used for both IGMP and MLD
607c478bd9Sstevel@tonic-gate  */
617c478bd9Sstevel@tonic-gate #define	MCAST_SLOWTIMO_INTERVAL	10000	/* milliseconds */
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate /*
657c478bd9Sstevel@tonic-gate  * Macro to compute a random timer value between 1 and maxticks.
667c478bd9Sstevel@tonic-gate  * Include <sys/random.h> for random_get_pseudo_bytes() declaration.
677c478bd9Sstevel@tonic-gate  */
687c478bd9Sstevel@tonic-gate #include <sys/random.h>
697c478bd9Sstevel@tonic-gate #define	MCAST_RANDOM_DELAY(timer, maxticks)				      \
707c478bd9Sstevel@tonic-gate 	/* uint_t timer; int maxticks */				      \
717c478bd9Sstevel@tonic-gate 	(void) random_get_pseudo_bytes((uint8_t *)&(timer), sizeof (uint_t)); \
727c478bd9Sstevel@tonic-gate 	(timer) = ((uint_t)(timer) % (maxticks)) + 1
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate /*
757c478bd9Sstevel@tonic-gate  * States for IGMPv2's leave processing
767c478bd9Sstevel@tonic-gate  */
777c478bd9Sstevel@tonic-gate #define	IGMP_OTHERMEMBER			0
787c478bd9Sstevel@tonic-gate #define	IGMP_IREPORTEDLAST			1
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate /*
817c478bd9Sstevel@tonic-gate  * We must remember what version the subnet's querier is.
827c478bd9Sstevel@tonic-gate  */
837c478bd9Sstevel@tonic-gate #define	IGMP_V1_ROUTER				0
847c478bd9Sstevel@tonic-gate #define	IGMP_V2_ROUTER				1
857c478bd9Sstevel@tonic-gate #define	IGMP_V3_ROUTER				2
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate /*
887c478bd9Sstevel@tonic-gate  * Map MLD versions to corresponding IGMP versions
897c478bd9Sstevel@tonic-gate  */
907c478bd9Sstevel@tonic-gate #define	MLD_V1_ROUTER				IGMP_V2_ROUTER
917c478bd9Sstevel@tonic-gate #define	MLD_V2_ROUTER				IGMP_V3_ROUTER
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate /*
947c478bd9Sstevel@tonic-gate  * Default values for various IGMPv3/MLDv2 values
957c478bd9Sstevel@tonic-gate  */
967c478bd9Sstevel@tonic-gate #define	MCAST_DEF_ROBUSTNESS			2
977c478bd9Sstevel@tonic-gate #define	MCAST_QUERY_RESP_INTERVAL		10	/* in seconds */
987c478bd9Sstevel@tonic-gate #define	MCAST_DEF_QUERY_INTERVAL		125	/* in seconds */
997c478bd9Sstevel@tonic-gate #define	MCAST_DEF_QUERY_RESP_INTERVAL		100	/* in tenths of secs */
1007c478bd9Sstevel@tonic-gate #define	MCAST_DEF_UNSOL_RPT_INTERVAL		1	/* in seconds */
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate /*
1037c478bd9Sstevel@tonic-gate  * IGMP and MLD mandate a TTL/Hop Limit of 1 for protocol messages
1047c478bd9Sstevel@tonic-gate  */
1057c478bd9Sstevel@tonic-gate #define	IGMP_TTL	1
1067c478bd9Sstevel@tonic-gate #define	MLD_HOP_LIMIT	1
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1117c478bd9Sstevel@tonic-gate }
1127c478bd9Sstevel@tonic-gate #endif
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate #endif	/* _NETINET_IGMP_VAR_H */
115