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*f4b3ec61Sdh * Common Development and Distribution License (the "License"). 6*f4b3ec61Sdh * 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*f4b3ec61Sdh * 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 #ifdef __cplusplus 307c478bd9Sstevel@tonic-gate extern "C" { 317c478bd9Sstevel@tonic-gate #endif 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate /* 347c478bd9Sstevel@tonic-gate * Internet Group Management Protocol (IGMP), 357c478bd9Sstevel@tonic-gate * implementation-specific definitions. 367c478bd9Sstevel@tonic-gate * 377c478bd9Sstevel@tonic-gate * Written by Steve Deering, Stanford, May 1988. 387c478bd9Sstevel@tonic-gate * Modified by Ajit Thyagarajan, PARC, August 1994. 397c478bd9Sstevel@tonic-gate * 407c478bd9Sstevel@tonic-gate * MULTICAST 3.5.1.1 417c478bd9Sstevel@tonic-gate */ 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate struct igmpstat { 447c478bd9Sstevel@tonic-gate uint_t igps_rcv_total; /* total IGMP messages received */ 457c478bd9Sstevel@tonic-gate uint_t igps_rcv_tooshort; /* received with too few bytes */ 467c478bd9Sstevel@tonic-gate uint_t igps_rcv_badsum; /* received with bad checksum */ 477c478bd9Sstevel@tonic-gate uint_t igps_rcv_queries; /* received membership queries */ 487c478bd9Sstevel@tonic-gate uint_t igps_rcv_badqueries; /* received invalid queries */ 497c478bd9Sstevel@tonic-gate uint_t igps_rcv_reports; /* received membership reports */ 507c478bd9Sstevel@tonic-gate uint_t igps_rcv_badreports; /* received invalid reports */ 517c478bd9Sstevel@tonic-gate uint_t igps_rcv_ourreports; /* received reports for our groups */ 527c478bd9Sstevel@tonic-gate uint_t igps_snd_reports; /* sent membership reports */ 537c478bd9Sstevel@tonic-gate }; 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate #ifdef _KERNEL 567c478bd9Sstevel@tonic-gate /* 577c478bd9Sstevel@tonic-gate * slowtimo interval used for both IGMP and MLD 587c478bd9Sstevel@tonic-gate */ 597c478bd9Sstevel@tonic-gate #define MCAST_SLOWTIMO_INTERVAL 10000 /* milliseconds */ 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate /* 637c478bd9Sstevel@tonic-gate * Macro to compute a random timer value between 1 and maxticks. 647c478bd9Sstevel@tonic-gate * Include <sys/random.h> for random_get_pseudo_bytes() declaration. 657c478bd9Sstevel@tonic-gate */ 667c478bd9Sstevel@tonic-gate #include <sys/random.h> 677c478bd9Sstevel@tonic-gate #define MCAST_RANDOM_DELAY(timer, maxticks) \ 687c478bd9Sstevel@tonic-gate /* uint_t timer; int maxticks */ \ 697c478bd9Sstevel@tonic-gate (void) random_get_pseudo_bytes((uint8_t *)&(timer), sizeof (uint_t)); \ 707c478bd9Sstevel@tonic-gate (timer) = ((uint_t)(timer) % (maxticks)) + 1 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate /* 737c478bd9Sstevel@tonic-gate * States for IGMPv2's leave processing 747c478bd9Sstevel@tonic-gate */ 757c478bd9Sstevel@tonic-gate #define IGMP_OTHERMEMBER 0 767c478bd9Sstevel@tonic-gate #define IGMP_IREPORTEDLAST 1 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate /* 797c478bd9Sstevel@tonic-gate * We must remember what version the subnet's querier is. 807c478bd9Sstevel@tonic-gate */ 817c478bd9Sstevel@tonic-gate #define IGMP_V1_ROUTER 0 827c478bd9Sstevel@tonic-gate #define IGMP_V2_ROUTER 1 837c478bd9Sstevel@tonic-gate #define IGMP_V3_ROUTER 2 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate /* 867c478bd9Sstevel@tonic-gate * Map MLD versions to corresponding IGMP versions 877c478bd9Sstevel@tonic-gate */ 887c478bd9Sstevel@tonic-gate #define MLD_V1_ROUTER IGMP_V2_ROUTER 897c478bd9Sstevel@tonic-gate #define MLD_V2_ROUTER IGMP_V3_ROUTER 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate /* 927c478bd9Sstevel@tonic-gate * Default values for various IGMPv3/MLDv2 values 937c478bd9Sstevel@tonic-gate */ 947c478bd9Sstevel@tonic-gate #define MCAST_DEF_ROBUSTNESS 2 957c478bd9Sstevel@tonic-gate #define MCAST_QUERY_RESP_INTERVAL 10 /* in seconds */ 967c478bd9Sstevel@tonic-gate #define MCAST_DEF_QUERY_INTERVAL 125 /* in seconds */ 977c478bd9Sstevel@tonic-gate #define MCAST_DEF_QUERY_RESP_INTERVAL 100 /* in tenths of secs */ 987c478bd9Sstevel@tonic-gate #define MCAST_DEF_UNSOL_RPT_INTERVAL 1 /* in seconds */ 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate /* 1017c478bd9Sstevel@tonic-gate * IGMP and MLD mandate a TTL/Hop Limit of 1 for protocol messages 1027c478bd9Sstevel@tonic-gate */ 1037c478bd9Sstevel@tonic-gate #define IGMP_TTL 1 1047c478bd9Sstevel@tonic-gate #define MLD_HOP_LIMIT 1 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1097c478bd9Sstevel@tonic-gate } 1107c478bd9Sstevel@tonic-gate #endif 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate #endif /* _NETINET_IGMP_VAR_H */ 113