Back to index

glibc  2.9
igmp.h
Go to the documentation of this file.
00001 /* Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _NETINET_IGMP_H
00020 #define       _NETINET_IGMP_H 1
00021 
00022 #include <sys/cdefs.h>
00023 #include <sys/types.h>
00024 
00025 #ifdef __USE_BSD
00026 
00027 #include <netinet/in.h>
00028 
00029 __BEGIN_DECLS
00030 
00031 /*
00032  * Copyright (c) 1988 Stephen Deering.
00033  * Copyright (c) 1992, 1993
00034  *     The Regents of the University of California.  All rights reserved.
00035  *
00036  * This code is derived from software contributed to Berkeley by
00037  * Stephen Deering of Stanford University.
00038  *
00039  * Redistribution and use in source and binary forms, with or without
00040  * modification, are permitted provided that the following conditions
00041  * are met:
00042  * 1. Redistributions of source code must retain the above copyright
00043  *    notice, this list of conditions and the following disclaimer.
00044  * 2. Redistributions in binary form must reproduce the above copyright
00045  *    notice, this list of conditions and the following disclaimer in the
00046  *    documentation and/or other materials provided with the distribution.
00047  * 4. Neither the name of the University nor the names of its contributors
00048  *    may be used to endorse or promote products derived from this software
00049  *    without specific prior written permission.
00050  *
00051  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00052  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00053  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00054  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00055  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00056  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00057  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00058  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00059  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00060  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00061  * SUCH DAMAGE.
00062  *
00063  *     @(#)igmp.h    8.1 (Berkeley) 6/10/93
00064  *     $FreeBSD$
00065  */
00066 
00067 struct igmp {
00068   u_int8_t igmp_type;             /* IGMP type */
00069   u_int8_t igmp_code;             /* routing code */
00070   u_int16_t igmp_cksum;           /* checksum */
00071   struct in_addr igmp_group;      /* group address */
00072 };
00073 
00074 #define IGMP_MINLEN                8
00075 
00076 /*
00077  * Message types, including version number.
00078  */
00079 #define IGMP_MEMBERSHIP_QUERY      0x11   /* membership query         */
00080 #define IGMP_V1_MEMBERSHIP_REPORT  0x12   /* Ver. 1 membership report */
00081 #define IGMP_V2_MEMBERSHIP_REPORT  0x16   /* Ver. 2 membership report */
00082 #define IGMP_V2_LEAVE_GROUP        0x17   /* Leave-group message          */
00083 
00084 #define IGMP_DVMRP                 0x13   /* DVMRP routing message    */
00085 #define IGMP_PIM                   0x14   /* PIM routing message      */
00086 #define IGMP_TRACE                 0x15
00087 
00088 #define IGMP_MTRACE_RESP           0x1e   /* traceroute resp.(to sender)*/
00089 #define IGMP_MTRACE                0x1f   /* mcast traceroute messages  */
00090 
00091 #define IGMP_MAX_HOST_REPORT_DELAY 10     /* max delay for response to     */
00092                                           /*  query (in seconds) according */
00093                                           /*  to RFC1112                   */
00094 #define IGMP_TIMER_SCALE           10     /* denotes that the igmp code field */
00095                                           /* specifies time in 10th of seconds*/
00096 
00097 /*
00098  * States for the IGMP v2 state table.
00099  */
00100 #define IGMP_DELAYING_MEMBER       1
00101 #define IGMP_IDLE_MEMBER    2
00102 #define IGMP_LAZY_MEMBER    3
00103 #define IGMP_SLEEPING_MEMBER       4
00104 #define IGMP_AWAKENING_MEMBER      5
00105 
00106 /*
00107  * States for IGMP router version cache.
00108  */
00109 #define IGMP_v1_ROUTER             1
00110 #define IGMP_v2_ROUTER             2
00111 
00112 /*
00113  * The following four defininitions are for backwards compatibility.
00114  * They should be removed as soon as all applications are updated to
00115  * use the new constant names.
00116  */
00117 #define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
00118 #define IGMP_HOST_MEMBERSHIP_REPORT       IGMP_V1_MEMBERSHIP_REPORT
00119 #define IGMP_HOST_NEW_MEMBERSHIP_REPORT   IGMP_V2_MEMBERSHIP_REPORT
00120 #define IGMP_HOST_LEAVE_MESSAGE           IGMP_V2_LEAVE_GROUP
00121 
00122 __END_DECLS
00123 
00124 #endif
00125 
00126 #endif /* netinet/igmp.h */