Home | History | Annotate | Line # | Download | only in netinet
igmp_var.h revision 1.16.2.4
      1  1.16.2.4  christos /*	$NetBSD: igmp_var.h,v 1.16.2.4 2005/12/11 10:29:24 christos 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.1   hpeyerl  *
      7       1.1   hpeyerl  * This code is derived from software contributed to Berkeley by
      8       1.1   hpeyerl  * Stephen Deering of Stanford University.
      9       1.1   hpeyerl  *
     10       1.1   hpeyerl  * Redistribution and use in source and binary forms, with or without
     11       1.1   hpeyerl  * modification, are permitted provided that the following conditions
     12       1.1   hpeyerl  * are met:
     13       1.1   hpeyerl  * 1. Redistributions of source code must retain the above copyright
     14       1.1   hpeyerl  *    notice, this list of conditions and the following disclaimer.
     15       1.1   hpeyerl  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1   hpeyerl  *    notice, this list of conditions and the following disclaimer in the
     17       1.1   hpeyerl  *    documentation and/or other materials provided with the distribution.
     18  1.16.2.1     skrll  * 3. Neither the name of the University nor the names of its contributors
     19  1.16.2.1     skrll  *    may be used to endorse or promote products derived from this software
     20  1.16.2.1     skrll  *    without specific prior written permission.
     21  1.16.2.1     skrll  *
     22  1.16.2.1     skrll  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     23  1.16.2.1     skrll  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  1.16.2.1     skrll  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  1.16.2.1     skrll  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     26  1.16.2.1     skrll  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     27  1.16.2.1     skrll  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     28  1.16.2.1     skrll  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     29  1.16.2.1     skrll  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     30  1.16.2.1     skrll  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     31  1.16.2.1     skrll  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32  1.16.2.1     skrll  * SUCH DAMAGE.
     33  1.16.2.1     skrll  *
     34  1.16.2.1     skrll  *	@(#)igmp_var.h	8.1 (Berkeley) 7/19/93
     35  1.16.2.1     skrll  */
     36  1.16.2.1     skrll 
     37  1.16.2.1     skrll /*
     38  1.16.2.1     skrll  * Copyright (c) 1988 Stephen Deering.
     39  1.16.2.1     skrll  *
     40  1.16.2.1     skrll  * This code is derived from software contributed to Berkeley by
     41  1.16.2.1     skrll  * Stephen Deering of Stanford University.
     42  1.16.2.1     skrll  *
     43  1.16.2.1     skrll  * Redistribution and use in source and binary forms, with or without
     44  1.16.2.1     skrll  * modification, are permitted provided that the following conditions
     45  1.16.2.1     skrll  * are met:
     46  1.16.2.1     skrll  * 1. Redistributions of source code must retain the above copyright
     47  1.16.2.1     skrll  *    notice, this list of conditions and the following disclaimer.
     48  1.16.2.1     skrll  * 2. Redistributions in binary form must reproduce the above copyright
     49  1.16.2.1     skrll  *    notice, this list of conditions and the following disclaimer in the
     50  1.16.2.1     skrll  *    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.16.2.1     skrll #define	IGMP_RANDOM_DELAY(X)	(random() % (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.16.2.1     skrll void	igmp_input(struct mbuf *, ...);
    117  1.16.2.1     skrll int	igmp_joingroup(struct in_multi *);
    118  1.16.2.1     skrll void	igmp_leavegroup(struct in_multi *);
    119  1.16.2.1     skrll void	igmp_fasttimo(void);
    120  1.16.2.1     skrll void	igmp_slowtimo(void);
    121  1.16.2.1     skrll void	igmp_purgeif(struct ifnet *);
    122       1.1   hpeyerl #endif
    123      1.10     perry 
    124  1.16.2.4  christos #endif /* !_NETINET_IGMP_VAR_H_ */
    125