xref: /illumos-gate/usr/src/uts/common/netinet/pim.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
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 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 /*
68  * Protocol Independent Multicast (PIM) definitions
69  *
70  * Written by Ahmed Helmy, USC/SGI, July 1996
71  * Modified by George Edmond Eddy (Rusty), ISI, February 1998
72  * Modified by Pavlin Ivanov Radoslavov, USC/ISI, May 1998
73  *
74  * $Id: pim.h,v 1.3 1999/08/31 03:03:08 pavlin Exp $
75  */
76 
77 /*
78  * PIM packet format.
79  */
80 typedef struct pim {
81 #ifdef _BIT_FIELDS_LTOH
82 	uint8_t		pim_type:4,	/* type of PIM message */
83 			pim_vers:4;	/* PIM version */
84 #else
85 	uint8_t		pim_vers:4,	/* PIM version */
86 			pim_type:4;	/* type of PIM message */
87 #endif
88 	uint8_t		pim_reserved;	/* Reserved */
89 	uint16_t	pim_cksum;	/* IP-style checksum */
90 } pim_t;
91 
92 #define	PIM_VERSION	2
93 #define	PIM_MINLEN	8		/* The header min. length is 8 */
94 
95 /* Register message + inner IPheader */
96 #define	PIM_REG_MINLEN 	(PIM_MINLEN + IP_SIMPLE_HDR_LENGTH)
97 
98 /*
99  * From the PIM protocol spec (RFC 2362), the following PIM message types
100  * are defined.  All of these, except PIM_REGISTER, are currently not defined
101  * in the USC/ISI distributed <netinet/pim.h> include file.  So they are listed
102  * here commented out.
103  *
104  * #define	PIM_HELLO		0x0
105  * #define	PIM_REGISTER		0x1
106  * #define	PIM_REGISTER_STOP	0x2
107  * #define	PIM_JOIN_PRUNE		0x3
108  * #define	PIM_BOOTSTRAP		0x4
109  * #define	PIM_ASSERT		0x5
110  * #define	PIM_GRAFT		0x6
111  * #define	PIM_GRAFT_ACK		0x7
112  * #define	PIM_CAND_RP_ADV		0x8
113  *
114  */
115 #define	PIM_REGISTER	0x1		/* PIM Register type is 1 */
116 
117 /*
118  * First bit in reg_head (right after PIM header) is the Border bit.
119  */
120 #define	PIM_BORDER_REGISTER	0x80000000
121 
122 /*
123  * Second bit in reg_head (right after PIM header) is the Null-Register bit
124  */
125 #define	PIM_NULL_REGISTER	0x40000000
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 #endif /* _NETINET_PIM_H */
132