Blame inet/netinet/igmp.h

Packit 6c4009
/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _NETINET_IGMP_H
Packit 6c4009
#define	_NETINET_IGMP_H 1
Packit 6c4009
Packit 6c4009
#include <sys/cdefs.h>
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
Packit 6c4009
#include <netinet/in.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Copyright (c) 1988 Stephen Deering.
Packit 6c4009
 * Copyright (c) 1992, 1993
Packit 6c4009
 *	The Regents of the University of California.  All rights reserved.
Packit 6c4009
 *
Packit 6c4009
 * This code is derived from software contributed to Berkeley by
Packit 6c4009
 * Stephen Deering of Stanford University.
Packit 6c4009
 *
Packit 6c4009
 * Redistribution and use in source and binary forms, with or without
Packit 6c4009
 * modification, are permitted provided that the following conditions
Packit 6c4009
 * are met:
Packit 6c4009
 * 1. Redistributions of source code must retain the above copyright
Packit 6c4009
 *    notice, this list of conditions and the following disclaimer.
Packit 6c4009
 * 2. Redistributions in binary form must reproduce the above copyright
Packit 6c4009
 *    notice, this list of conditions and the following disclaimer in the
Packit 6c4009
 *    documentation and/or other materials provided with the distribution.
Packit 6c4009
 * 4. Neither the name of the University nor the names of its contributors
Packit 6c4009
 *    may be used to endorse or promote products derived from this software
Packit 6c4009
 *    without specific prior written permission.
Packit 6c4009
 *
Packit 6c4009
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
Packit 6c4009
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 6c4009
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit 6c4009
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
Packit 6c4009
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit 6c4009
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit 6c4009
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit 6c4009
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit 6c4009
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit 6c4009
 * SUCH DAMAGE.
Packit 6c4009
 *
Packit 6c4009
 *	@(#)igmp.h	8.1 (Berkeley) 6/10/93
Packit 6c4009
 *	$FreeBSD$
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
struct igmp {
Packit 6c4009
  uint8_t igmp_type;             /* IGMP type */
Packit 6c4009
  uint8_t igmp_code;             /* routing code */
Packit 6c4009
  uint16_t igmp_cksum;           /* checksum */
Packit 6c4009
  struct in_addr igmp_group;     /* group address */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
#define IGMP_MINLEN			8
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Message types, including version number.
Packit 6c4009
 */
Packit 6c4009
#define IGMP_MEMBERSHIP_QUERY   	0x11	/* membership query         */
Packit 6c4009
#define IGMP_V1_MEMBERSHIP_REPORT	0x12	/* Ver. 1 membership report */
Packit 6c4009
#define IGMP_V2_MEMBERSHIP_REPORT	0x16	/* Ver. 2 membership report */
Packit 6c4009
#define IGMP_V2_LEAVE_GROUP		0x17	/* Leave-group message	    */
Packit 6c4009
Packit 6c4009
#define IGMP_DVMRP			0x13	/* DVMRP routing message    */
Packit 6c4009
#define IGMP_PIM			0x14	/* PIM routing message      */
Packit 6c4009
#define IGMP_TRACE			0x15
Packit 6c4009
Packit 6c4009
#define IGMP_MTRACE_RESP		0x1e	/* traceroute resp.(to sender)*/
Packit 6c4009
#define IGMP_MTRACE			0x1f	/* mcast traceroute messages  */
Packit 6c4009
Packit 6c4009
#define IGMP_MAX_HOST_REPORT_DELAY	10	/* max delay for response to     */
Packit 6c4009
						/*  query (in seconds) according */
Packit 6c4009
						/*  to RFC1112                   */
Packit 6c4009
#define IGMP_TIMER_SCALE		10	/* denotes that the igmp code field */
Packit 6c4009
						/* specifies time in 10th of seconds*/
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * States for the IGMP v2 state table.
Packit 6c4009
 */
Packit 6c4009
#define IGMP_DELAYING_MEMBER	1
Packit 6c4009
#define IGMP_IDLE_MEMBER	2
Packit 6c4009
#define IGMP_LAZY_MEMBER	3
Packit 6c4009
#define IGMP_SLEEPING_MEMBER	4
Packit 6c4009
#define IGMP_AWAKENING_MEMBER	5
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * States for IGMP router version cache.
Packit 6c4009
 */
Packit 6c4009
#define IGMP_v1_ROUTER		1
Packit 6c4009
#define IGMP_v2_ROUTER		2
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * The following four defininitions are for backwards compatibility.
Packit 6c4009
 * They should be removed as soon as all applications are updated to
Packit 6c4009
 * use the new constant names.
Packit 6c4009
 */
Packit 6c4009
#define IGMP_HOST_MEMBERSHIP_QUERY	IGMP_MEMBERSHIP_QUERY
Packit 6c4009
#define IGMP_HOST_MEMBERSHIP_REPORT	IGMP_V1_MEMBERSHIP_REPORT
Packit 6c4009
#define IGMP_HOST_NEW_MEMBERSHIP_REPORT	IGMP_V2_MEMBERSHIP_REPORT
Packit 6c4009
#define IGMP_HOST_LEAVE_MESSAGE		IGMP_V2_LEAVE_GROUP
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#endif	/* netinet/igmp.h */