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