pim6.h revision 62587
155714Skris/*	$FreeBSD: head/sys/netinet6/pim6.h 62587 2000-07-04 16:35:15Z itojun $	*/
255714Skris/*	$KAME: pim6.h,v 1.3 2000/03/25 07:23:58 sumikawa Exp $	*/
355714Skris
455714Skris/*
555714Skris * Copyright (C) 1998 WIDE Project.
655714Skris * All rights reserved.
755714Skris *
8280304Sjkim * Redistribution and use in source and binary forms, with or without
955714Skris * modification, are permitted provided that the following conditions
1055714Skris * are met:
1155714Skris * 1. Redistributions of source code must retain the above copyright
1255714Skris *    notice, this list of conditions and the following disclaimer.
1355714Skris * 2. Redistributions in binary form must reproduce the above copyright
1455714Skris *    notice, this list of conditions and the following disclaimer in the
15280304Sjkim *    documentation and/or other materials provided with the distribution.
1655714Skris * 3. Neither the name of the project nor the names of its contributors
1755714Skris *    may be used to endorse or promote products derived from this software
1855714Skris *    without specific prior written permission.
1955714Skris *
2055714Skris * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
2155714Skris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22280304Sjkim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2355714Skris * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2455714Skris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2555714Skris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2655714Skris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2755714Skris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2855714Skris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2955714Skris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3055714Skris * SUCH DAMAGE.
3155714Skris */
3255714Skris/*
3355714Skris * Protocol Independent Multicast (PIM) definitions
3455714Skris *
3555714Skris * Written by Ahmed Helmy, SGI, July 1996
3655714Skris *
37280304Sjkim * MULTICAST
3855714Skris */
3955714Skris
40280304Sjkim/*
4155714Skris * PIM packet header
4255714Skris */
4355714Skris#define PIM_VERSION	2
4455714Skrisstruct pim {
4555714Skris#if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
4655714Skris	u_char	pim_type:4, /* the PIM message type, currently they are:
4755714Skris			     * Hello, Register, Register-Stop, Join/Prune,
4855714Skris			     * Bootstrap, Assert, Graft (PIM-DM only),
4955714Skris			     * Graft-Ack (PIM-DM only), C-RP-Adv
5055714Skris			     */
5155714Skris		pim_ver:4;  /* PIM version number; 2 for PIMv2 */
52280304Sjkim#else
5355714Skris	u_char	pim_ver:4,	/* PIM version */
5455714Skris		pim_type:4;	/* PIM type    */
5555714Skris#endif
5655714Skris	u_char  pim_rsv;	/* Reserved */
5755714Skris	u_short	pim_cksum;	/* IP style check sum */
5855714Skris};
5955714Skris
6055714Skris#define PIM_MINLEN	8		/* The header min. length is 8    */
6155714Skris#define PIM6_REG_MINLEN	(PIM_MINLEN+40)	/* Register message + inner IP6 header */
6255714Skris
6355714Skris/*
6455714Skris * Message types
65280304Sjkim */
66280304Sjkim#define PIM_REGISTER	1	/* PIM Register type is 1 */
6755714Skris
68280304Sjkim/* second bit in reg_head is the null bit */
69280304Sjkim#define PIM_NULL_REGISTER 0x40000000
70291721Sjkim