1caf43b02SWarner Losh /*- 2*51369649SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 3*51369649SPedro F. Giffuni * 482cd038dSYoshinobu Inoue * Copyright (C) 1998 WIDE Project. 582cd038dSYoshinobu Inoue * All rights reserved. 682cd038dSYoshinobu Inoue * 782cd038dSYoshinobu Inoue * Redistribution and use in source and binary forms, with or without 882cd038dSYoshinobu Inoue * modification, are permitted provided that the following conditions 982cd038dSYoshinobu Inoue * are met: 1082cd038dSYoshinobu Inoue * 1. Redistributions of source code must retain the above copyright 1182cd038dSYoshinobu Inoue * notice, this list of conditions and the following disclaimer. 1282cd038dSYoshinobu Inoue * 2. Redistributions in binary form must reproduce the above copyright 1382cd038dSYoshinobu Inoue * notice, this list of conditions and the following disclaimer in the 1482cd038dSYoshinobu Inoue * documentation and/or other materials provided with the distribution. 1582cd038dSYoshinobu Inoue * 3. Neither the name of the project nor the names of its contributors 1682cd038dSYoshinobu Inoue * may be used to endorse or promote products derived from this software 1782cd038dSYoshinobu Inoue * without specific prior written permission. 1882cd038dSYoshinobu Inoue * 1982cd038dSYoshinobu Inoue * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 2082cd038dSYoshinobu Inoue * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2182cd038dSYoshinobu Inoue * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2282cd038dSYoshinobu Inoue * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 2382cd038dSYoshinobu Inoue * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2482cd038dSYoshinobu Inoue * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2582cd038dSYoshinobu Inoue * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2682cd038dSYoshinobu Inoue * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2782cd038dSYoshinobu Inoue * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2882cd038dSYoshinobu Inoue * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2982cd038dSYoshinobu Inoue * SUCH DAMAGE. 30b48287a3SDavid E. O'Brien * 31b48287a3SDavid E. O'Brien * $KAME: pim6.h,v 1.3 2000/03/25 07:23:58 sumikawa Exp $ 3282cd038dSYoshinobu Inoue */ 3382cd038dSYoshinobu Inoue /* 3482cd038dSYoshinobu Inoue * Protocol Independent Multicast (PIM) definitions 3582cd038dSYoshinobu Inoue * 3682cd038dSYoshinobu Inoue * Written by Ahmed Helmy, SGI, July 1996 3782cd038dSYoshinobu Inoue * 3882cd038dSYoshinobu Inoue * MULTICAST 3982cd038dSYoshinobu Inoue */ 4082cd038dSYoshinobu Inoue 4182cd038dSYoshinobu Inoue /* 4282cd038dSYoshinobu Inoue * PIM packet header 4382cd038dSYoshinobu Inoue */ 4482cd038dSYoshinobu Inoue #define PIM_VERSION 2 4582cd038dSYoshinobu Inoue struct pim { 4682cd038dSYoshinobu Inoue #if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN) 4782cd038dSYoshinobu Inoue u_char pim_type:4, /* the PIM message type, currently they are: 4882cd038dSYoshinobu Inoue * Hello, Register, Register-Stop, Join/Prune, 4982cd038dSYoshinobu Inoue * Bootstrap, Assert, Graft (PIM-DM only), 5082cd038dSYoshinobu Inoue * Graft-Ack (PIM-DM only), C-RP-Adv 5182cd038dSYoshinobu Inoue */ 5282cd038dSYoshinobu Inoue pim_ver:4; /* PIM version number; 2 for PIMv2 */ 5382cd038dSYoshinobu Inoue #else 5482cd038dSYoshinobu Inoue u_char pim_ver:4, /* PIM version */ 5582cd038dSYoshinobu Inoue pim_type:4; /* PIM type */ 5682cd038dSYoshinobu Inoue #endif 5782cd038dSYoshinobu Inoue u_char pim_rsv; /* Reserved */ 5882cd038dSYoshinobu Inoue u_short pim_cksum; /* IP style check sum */ 5982cd038dSYoshinobu Inoue }; 6082cd038dSYoshinobu Inoue 6182cd038dSYoshinobu Inoue #define PIM_MINLEN 8 /* The header min. length is 8 */ 6282cd038dSYoshinobu Inoue #define PIM6_REG_MINLEN (PIM_MINLEN+40) /* Register message + inner IP6 header */ 6382cd038dSYoshinobu Inoue 6482cd038dSYoshinobu Inoue /* 6582cd038dSYoshinobu Inoue * Message types 6682cd038dSYoshinobu Inoue */ 6782cd038dSYoshinobu Inoue #define PIM_REGISTER 1 /* PIM Register type is 1 */ 6882cd038dSYoshinobu Inoue 6982cd038dSYoshinobu Inoue /* second bit in reg_head is the null bit */ 7082cd038dSYoshinobu Inoue #define PIM_NULL_REGISTER 0x40000000 71