The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/netinet/pim.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * SPDX-License-Identifier: BSD-3-Clause
    3  *
    4  * Copyright (c) 1996-2000
    5  * University of Southern California/Information Sciences Institute.
    6  * All rights reserved.
    7  *
    8  * Redistribution and use in source and binary forms, with or without
    9  * modification, are permitted provided that the following conditions
   10  * are met:
   11  * 1. Redistributions of source code must retain the above copyright
   12  *    notice, this list of conditions and the following disclaimer.
   13  * 2. Redistributions in binary form must reproduce the above copyright
   14  *    notice, this list of conditions and the following disclaimer in the
   15  *    documentation and/or other materials provided with the distribution.
   16  * 3. Neither the name of the project nor the names of its contributors
   17  *    may be used to endorse or promote products derived from this software
   18  *    without specific prior written permission.
   19  *
   20  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
   21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
   24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   30  * SUCH DAMAGE.
   31  *
   32  * $FreeBSD: releng/12.0/sys/netinet/pim.h 326023 2017-11-20 19:43:44Z pfg $
   33  */
   34 
   35 #ifndef _NETINET_PIM_H_
   36 #define _NETINET_PIM_H_
   37 
   38 /*
   39  * Protocol Independent Multicast (PIM) definitions.
   40  * RFC 2362, June 1998.
   41  *
   42  * Written by Ahmed Helmy, USC/SGI, July 1996.
   43  * Modified by George Edmond Eddy (Rusty), ISI, February 1998.
   44  * Modified by Pavlin Radoslavov, USC/ISI, May 1998, October 2000.
   45  */
   46 
   47 #include <sys/types.h>
   48 
   49 #ifndef _PIM_VT
   50 #ifndef BYTE_ORDER
   51 # error BYTE_ORDER is not defined!
   52 #endif
   53 #if (BYTE_ORDER != BIG_ENDIAN) && (BYTE_ORDER != LITTLE_ENDIAN)
   54 # error BYTE_ORDER must be defined to either BIG_ENDIAN or LITTLE_ENDIAN
   55 #endif
   56 #endif /* ! _PIM_VT */
   57 
   58 /*
   59  * PIM packet header
   60  */
   61 struct pim {
   62 #ifdef _PIM_VT
   63         uint8_t         pim_vt;         /* PIM version and message type */
   64 #else /* ! _PIM_VT   */
   65 #if BYTE_ORDER == BIG_ENDIAN
   66         u_int           pim_vers:4,     /* PIM protocol version         */
   67                         pim_type:4;     /* PIM message type             */
   68 #endif
   69 #if BYTE_ORDER == LITTLE_ENDIAN
   70         u_int           pim_type:4,     /* PIM message type             */
   71                         pim_vers:4;     /* PIM protocol version         */
   72 #endif
   73 #endif /* ! _PIM_VT  */
   74         uint8_t         pim_reserved;   /* Reserved                     */
   75         uint16_t        pim_cksum;      /* IP-style checksum            */
   76 };
   77 /* KAME-related name backward compatibility */
   78 #define pim_ver pim_vers
   79 #define pim_rsv pim_reserved
   80 
   81 #ifdef _PIM_VT
   82 #define PIM_MAKE_VT(v, t)       (0xff & (((v) << 4) | (0x0f & (t))))
   83 #define PIM_VT_V(x)             (((x) >> 4) & 0x0f)
   84 #define PIM_VT_T(x)             ((x) & 0x0f)
   85 #endif /* _PIM_VT */
   86 
   87 #define PIM_VERSION             2
   88 #define PIM_MINLEN              8       /* PIM message min. length      */
   89 #define PIM_REG_MINLEN  (PIM_MINLEN+20) /* PIM Register hdr + inner IPv4 hdr */
   90 #define PIM6_REG_MINLEN (PIM_MINLEN+40) /* PIM Register hdr + inner IPv6 hdr */
   91 
   92 /*
   93  * PIM message types
   94  */
   95 #define PIM_HELLO               0x0     /* PIM-SM and PIM-DM            */
   96 #define PIM_REGISTER            0x1     /* PIM-SM only                  */
   97 #define PIM_REGISTER_STOP       0x2     /* PIM-SM only                  */
   98 #define PIM_JOIN_PRUNE          0x3     /* PIM-SM and PIM-DM            */
   99 #define PIM_BOOTSTRAP           0x4     /* PIM-SM only                  */
  100 #define PIM_ASSERT              0x5     /* PIM-SM and PIM-DM            */
  101 #define PIM_GRAFT               0x6     /* PIM-DM only                  */
  102 #define PIM_GRAFT_ACK           0x7     /* PIM-DM only                  */
  103 #define PIM_CAND_RP_ADV         0x8     /* PIM-SM only                  */
  104 #define PIM_ALL_DF_ELECTION     0xa     /* Bidir-PIM-SM only            */
  105 
  106 /*
  107  * PIM-Register message flags
  108  */
  109 #define PIM_BORDER_REGISTER 0x80000000U /* The Border bit (host-order)  */
  110 #define PIM_NULL_REGISTER   0x40000000U /* The Null-Register bit (host-order)*/
  111 
  112 /*
  113  * All-PIM-Routers IPv4 and IPv6 multicast addresses
  114  */
  115 #define INADDR_ALLPIM_ROUTERS_GROUP     (uint32_t)0xe000000dU  /* 224.0.0.13 */
  116 #define IN6ADDR_LINKLOCAL_ALLPIM_ROUTERS        "ff02::d"
  117 #define IN6ADDR_LINKLOCAL_ALLPIM_ROUTERS_INIT                           \
  118         {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,             \
  119             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d }}}
  120 
  121 #endif /* _NETINET_PIM_H_ */

Cache object: 851d66221844186d80114dc98aa85dc5


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.