igmp_var.h revision 1.17 1 1.17 agc /* $NetBSD: igmp_var.h,v 1.17 2003/08/07 16:33:09 agc Exp $ */
2 1.6 cgd
3 1.1 hpeyerl /*
4 1.5 mycroft * Copyright (c) 1992, 1993
5 1.5 mycroft * The Regents of the University of California. All rights reserved.
6 1.17 agc *
7 1.17 agc * This code is derived from software contributed to Berkeley by
8 1.17 agc * Stephen Deering of Stanford University.
9 1.17 agc *
10 1.17 agc * Redistribution and use in source and binary forms, with or without
11 1.17 agc * modification, are permitted provided that the following conditions
12 1.17 agc * are met:
13 1.17 agc * 1. Redistributions of source code must retain the above copyright
14 1.17 agc * notice, this list of conditions and the following disclaimer.
15 1.17 agc * 2. Redistributions in binary form must reproduce the above copyright
16 1.17 agc * notice, this list of conditions and the following disclaimer in the
17 1.17 agc * documentation and/or other materials provided with the distribution.
18 1.17 agc * 3. Neither the name of the University nor the names of its contributors
19 1.17 agc * may be used to endorse or promote products derived from this software
20 1.17 agc * without specific prior written permission.
21 1.17 agc *
22 1.17 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 1.17 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.17 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.17 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 1.17 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.17 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.17 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.17 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.17 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.17 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.17 agc * SUCH DAMAGE.
33 1.17 agc *
34 1.17 agc * @(#)igmp_var.h 8.1 (Berkeley) 7/19/93
35 1.17 agc */
36 1.17 agc
37 1.17 agc /*
38 1.17 agc * Copyright (c) 1988 Stephen Deering.
39 1.1 hpeyerl *
40 1.1 hpeyerl * This code is derived from software contributed to Berkeley by
41 1.1 hpeyerl * Stephen Deering of Stanford University.
42 1.1 hpeyerl *
43 1.1 hpeyerl * Redistribution and use in source and binary forms, with or without
44 1.1 hpeyerl * modification, are permitted provided that the following conditions
45 1.1 hpeyerl * are met:
46 1.1 hpeyerl * 1. Redistributions of source code must retain the above copyright
47 1.1 hpeyerl * notice, this list of conditions and the following disclaimer.
48 1.1 hpeyerl * 2. Redistributions in binary form must reproduce the above copyright
49 1.1 hpeyerl * notice, this list of conditions and the following disclaimer in the
50 1.1 hpeyerl * documentation and/or other materials provided with the distribution.
51 1.1 hpeyerl * 3. All advertising materials mentioning features or use of this software
52 1.1 hpeyerl * must display the following acknowledgement:
53 1.1 hpeyerl * This product includes software developed by the University of
54 1.1 hpeyerl * California, Berkeley and its contributors.
55 1.1 hpeyerl * 4. Neither the name of the University nor the names of its contributors
56 1.1 hpeyerl * may be used to endorse or promote products derived from this software
57 1.1 hpeyerl * without specific prior written permission.
58 1.1 hpeyerl *
59 1.1 hpeyerl * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60 1.1 hpeyerl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 1.1 hpeyerl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62 1.1 hpeyerl * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63 1.1 hpeyerl * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64 1.1 hpeyerl * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65 1.1 hpeyerl * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 1.1 hpeyerl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 1.1 hpeyerl * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 1.1 hpeyerl * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 1.1 hpeyerl * SUCH DAMAGE.
70 1.1 hpeyerl *
71 1.6 cgd * @(#)igmp_var.h 8.1 (Berkeley) 7/19/93
72 1.1 hpeyerl */
73 1.1 hpeyerl
74 1.10 perry #ifndef _NETINET_IGMP_VAR_H_
75 1.10 perry #define _NETINET_IGMP_VAR_H_
76 1.10 perry
77 1.1 hpeyerl /*
78 1.1 hpeyerl * Internet Group Management Protocol (IGMP),
79 1.1 hpeyerl * implementation-specific definitions.
80 1.1 hpeyerl *
81 1.1 hpeyerl * Written by Steve Deering, Stanford, May 1988.
82 1.8 mycroft * Modified by Rosen Sharma, Stanford, Aug 1994.
83 1.8 mycroft * Modified by Bill Fenner, Xerox PARC, Feb 1995.
84 1.1 hpeyerl *
85 1.8 mycroft * MULTICAST 1.3
86 1.1 hpeyerl */
87 1.1 hpeyerl
88 1.1 hpeyerl struct igmpstat {
89 1.11 bouyer u_quad_t igps_rcv_total; /* total IGMP messages received */
90 1.11 bouyer u_quad_t igps_rcv_tooshort; /* received with too few bytes */
91 1.11 bouyer u_quad_t igps_rcv_badsum; /* received with bad checksum */
92 1.11 bouyer u_quad_t igps_rcv_queries; /* received membership queries */
93 1.11 bouyer u_quad_t igps_rcv_badqueries; /* received invalid queries */
94 1.11 bouyer u_quad_t igps_rcv_reports; /* received membership reports */
95 1.11 bouyer u_quad_t igps_rcv_badreports; /* received invalid reports */
96 1.11 bouyer u_quad_t igps_rcv_ourreports; /* received reports for our groups */
97 1.11 bouyer u_quad_t igps_snd_reports; /* sent membership reports */
98 1.1 hpeyerl };
99 1.1 hpeyerl
100 1.7 jtc #ifdef _KERNEL
101 1.12 matt extern struct igmpstat igmpstat;
102 1.1 hpeyerl
103 1.1 hpeyerl /*
104 1.1 hpeyerl * Macro to compute a random timer value between 1 and (IGMP_MAX_REPORTING_
105 1.1 hpeyerl * DELAY * countdown frequency). We assume that the routine random()
106 1.1 hpeyerl * is defined somewhere (and that it returns a positive number).
107 1.1 hpeyerl */
108 1.13 itojun #define IGMP_RANDOM_DELAY(X) (arc4random() % (X) + 1)
109 1.14 thorpej
110 1.14 thorpej #ifdef __NO_STRICT_ALIGNMENT
111 1.14 thorpej #define IGMP_HDR_ALIGNED_P(ig) 1
112 1.14 thorpej #else
113 1.14 thorpej #define IGMP_HDR_ALIGNED_P(ig) ((((vaddr_t) (ig)) & 3) == 0)
114 1.14 thorpej #endif
115 1.1 hpeyerl
116 1.3 mycroft void igmp_init __P((void));
117 1.9 christos void igmp_input __P((struct mbuf *, ...));
118 1.15 matt int igmp_joingroup __P((struct in_multi *));
119 1.1 hpeyerl void igmp_leavegroup __P((struct in_multi *));
120 1.3 mycroft void igmp_fasttimo __P((void));
121 1.8 mycroft void igmp_slowtimo __P((void));
122 1.16 itojun extern void igmp_purgeif(struct ifnet *);
123 1.1 hpeyerl #endif
124 1.10 perry
125 1.10 perry #endif /* _NETINET_IGMP_VAR_H_ */
126