xref: /illumos-gate/usr/src/uts/common/netinet/pim.h (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1999 by Sun Microsystems, Inc.
24*7c478bd9Sstevel@tonic-gate  * All rights reserved.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*
28*7c478bd9Sstevel@tonic-gate  *  Copyright (c) 1996-1999 by the University of Southern California.
29*7c478bd9Sstevel@tonic-gate  *  All rights reserved.
30*7c478bd9Sstevel@tonic-gate  *
31*7c478bd9Sstevel@tonic-gate  *  Permission to use, copy, modify, and distribute this software and
32*7c478bd9Sstevel@tonic-gate  *  its documentation in source and binary forms for lawful
33*7c478bd9Sstevel@tonic-gate  *  purposes and without fee is hereby granted, provided
34*7c478bd9Sstevel@tonic-gate  *  that the above copyright notice appear in all copies and that both
35*7c478bd9Sstevel@tonic-gate  *  the copyright notice and this permission notice appear in supporting
36*7c478bd9Sstevel@tonic-gate  *  documentation, and that any documentation, advertising materials,
37*7c478bd9Sstevel@tonic-gate  *  and other materials related to such distribution and use acknowledge
38*7c478bd9Sstevel@tonic-gate  *  that the software was developed by the University of Southern
39*7c478bd9Sstevel@tonic-gate  *  California and/or Information Sciences Institute.
40*7c478bd9Sstevel@tonic-gate  *  The name of the University of Southern California may not
41*7c478bd9Sstevel@tonic-gate  *  be used to endorse or promote products derived from this software
42*7c478bd9Sstevel@tonic-gate  *  without specific prior written permission.
43*7c478bd9Sstevel@tonic-gate  *
44*7c478bd9Sstevel@tonic-gate  *  THE UNIVERSITY OF SOUTHERN CALIFORNIA DOES NOT MAKE ANY REPRESENTATIONS
45*7c478bd9Sstevel@tonic-gate  *  ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.  THIS SOFTWARE IS
46*7c478bd9Sstevel@tonic-gate  *  PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
47*7c478bd9Sstevel@tonic-gate  *  INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
48*7c478bd9Sstevel@tonic-gate  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND
49*7c478bd9Sstevel@tonic-gate  *  NON-INFRINGEMENT.
50*7c478bd9Sstevel@tonic-gate  *
51*7c478bd9Sstevel@tonic-gate  *  IN NO EVENT SHALL USC, OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY
52*7c478bd9Sstevel@tonic-gate  *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, WHETHER IN CONTRACT,
53*7c478bd9Sstevel@tonic-gate  *  TORT, OR OTHER FORM OF ACTION, ARISING OUT OF OR IN CONNECTION WITH,
54*7c478bd9Sstevel@tonic-gate  *  THE USE OR PERFORMANCE OF THIS SOFTWARE.
55*7c478bd9Sstevel@tonic-gate  *
56*7c478bd9Sstevel@tonic-gate  *  Other copyrights might apply to parts of this software and are so
57*7c478bd9Sstevel@tonic-gate  *  noted when applicable.
58*7c478bd9Sstevel@tonic-gate  */
59*7c478bd9Sstevel@tonic-gate 
60*7c478bd9Sstevel@tonic-gate #ifndef _NETINET_PIM_H
61*7c478bd9Sstevel@tonic-gate #define	_NETINET_PIM_H
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
64*7c478bd9Sstevel@tonic-gate 
65*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
66*7c478bd9Sstevel@tonic-gate extern "C" {
67*7c478bd9Sstevel@tonic-gate #endif
68*7c478bd9Sstevel@tonic-gate 
69*7c478bd9Sstevel@tonic-gate /*
70*7c478bd9Sstevel@tonic-gate  * Protocol Independent Multicast (PIM) definitions
71*7c478bd9Sstevel@tonic-gate  *
72*7c478bd9Sstevel@tonic-gate  * Written by Ahmed Helmy, USC/SGI, July 1996
73*7c478bd9Sstevel@tonic-gate  * Modified by George Edmond Eddy (Rusty), ISI, February 1998
74*7c478bd9Sstevel@tonic-gate  * Modified by Pavlin Ivanov Radoslavov, USC/ISI, May 1998
75*7c478bd9Sstevel@tonic-gate  *
76*7c478bd9Sstevel@tonic-gate  * $Id: pim.h,v 1.3 1999/08/31 03:03:08 pavlin Exp $
77*7c478bd9Sstevel@tonic-gate  */
78*7c478bd9Sstevel@tonic-gate 
79*7c478bd9Sstevel@tonic-gate /*
80*7c478bd9Sstevel@tonic-gate  * PIM packet format.
81*7c478bd9Sstevel@tonic-gate  */
82*7c478bd9Sstevel@tonic-gate typedef struct pim {
83*7c478bd9Sstevel@tonic-gate #ifdef _BIT_FIELDS_LTOH
84*7c478bd9Sstevel@tonic-gate 	uint8_t		pim_type:4,	/* type of PIM message */
85*7c478bd9Sstevel@tonic-gate 			pim_vers:4;	/* PIM version */
86*7c478bd9Sstevel@tonic-gate #else
87*7c478bd9Sstevel@tonic-gate 	uint8_t		pim_vers:4,	/* PIM version */
88*7c478bd9Sstevel@tonic-gate 			pim_type:4;	/* type of PIM message */
89*7c478bd9Sstevel@tonic-gate #endif
90*7c478bd9Sstevel@tonic-gate 	uint8_t		pim_reserved;	/* Reserved */
91*7c478bd9Sstevel@tonic-gate 	uint16_t	pim_cksum;	/* IP-style checksum */
92*7c478bd9Sstevel@tonic-gate } pim_t;
93*7c478bd9Sstevel@tonic-gate 
94*7c478bd9Sstevel@tonic-gate #define	PIM_VERSION	2
95*7c478bd9Sstevel@tonic-gate #define	PIM_MINLEN	8		/* The header min. length is 8 */
96*7c478bd9Sstevel@tonic-gate 
97*7c478bd9Sstevel@tonic-gate /* Register message + inner IPheader */
98*7c478bd9Sstevel@tonic-gate #define	PIM_REG_MINLEN 	(PIM_MINLEN + IP_SIMPLE_HDR_LENGTH)
99*7c478bd9Sstevel@tonic-gate 
100*7c478bd9Sstevel@tonic-gate /*
101*7c478bd9Sstevel@tonic-gate  * From the PIM protocol spec (RFC 2362), the following PIM message types
102*7c478bd9Sstevel@tonic-gate  * are defined.  All of these, except PIM_REGISTER, are currently not defined
103*7c478bd9Sstevel@tonic-gate  * in the USC/ISI distributed <netinet/pim.h> include file.  So they are listed
104*7c478bd9Sstevel@tonic-gate  * here commented out.
105*7c478bd9Sstevel@tonic-gate  *
106*7c478bd9Sstevel@tonic-gate  * #define	PIM_HELLO		0x0
107*7c478bd9Sstevel@tonic-gate  * #define	PIM_REGISTER		0x1
108*7c478bd9Sstevel@tonic-gate  * #define	PIM_REGISTER_STOP	0x2
109*7c478bd9Sstevel@tonic-gate  * #define	PIM_JOIN_PRUNE		0x3
110*7c478bd9Sstevel@tonic-gate  * #define	PIM_BOOTSTRAP		0x4
111*7c478bd9Sstevel@tonic-gate  * #define	PIM_ASSERT		0x5
112*7c478bd9Sstevel@tonic-gate  * #define	PIM_GRAFT		0x6
113*7c478bd9Sstevel@tonic-gate  * #define	PIM_GRAFT_ACK		0x7
114*7c478bd9Sstevel@tonic-gate  * #define	PIM_CAND_RP_ADV		0x8
115*7c478bd9Sstevel@tonic-gate  *
116*7c478bd9Sstevel@tonic-gate  */
117*7c478bd9Sstevel@tonic-gate #define	PIM_REGISTER	0x1		/* PIM Register type is 1 */
118*7c478bd9Sstevel@tonic-gate 
119*7c478bd9Sstevel@tonic-gate /*
120*7c478bd9Sstevel@tonic-gate  * First bit in reg_head (right after PIM header) is the Border bit.
121*7c478bd9Sstevel@tonic-gate  */
122*7c478bd9Sstevel@tonic-gate #define	PIM_BORDER_REGISTER	0x80000000
123*7c478bd9Sstevel@tonic-gate 
124*7c478bd9Sstevel@tonic-gate /*
125*7c478bd9Sstevel@tonic-gate  * Second bit in reg_head (right after PIM header) is the Null-Register bit
126*7c478bd9Sstevel@tonic-gate  */
127*7c478bd9Sstevel@tonic-gate #define	PIM_NULL_REGISTER	0x40000000
128*7c478bd9Sstevel@tonic-gate 
129*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
130*7c478bd9Sstevel@tonic-gate }
131*7c478bd9Sstevel@tonic-gate #endif
132*7c478bd9Sstevel@tonic-gate 
133*7c478bd9Sstevel@tonic-gate #endif /* _NETINET_PIM_H */
134