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