xref: /dflybsd-src/sys/netinet/pim_var.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn Marino /*
2*86d7f5d3SJohn Marino  * Copyright (c) 1998-2000
3*86d7f5d3SJohn Marino  * University of Southern California/Information Sciences Institute.
4*86d7f5d3SJohn Marino  * All rights reserved.
5*86d7f5d3SJohn Marino  *
6*86d7f5d3SJohn Marino  * Redistribution and use in source and binary forms, with or without
7*86d7f5d3SJohn Marino  * modification, are permitted provided that the following conditions
8*86d7f5d3SJohn Marino  * are met:
9*86d7f5d3SJohn Marino  * 1. Redistributions of source code must retain the above copyright
10*86d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer.
11*86d7f5d3SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
12*86d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
13*86d7f5d3SJohn Marino  *    documentation and/or other materials provided with the distribution.
14*86d7f5d3SJohn Marino  * 3. Neither the name of the project nor the names of its contributors
15*86d7f5d3SJohn Marino  *    may be used to endorse or promote products derived from this software
16*86d7f5d3SJohn Marino  *    without specific prior written permission.
17*86d7f5d3SJohn Marino  *
18*86d7f5d3SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19*86d7f5d3SJohn Marino  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*86d7f5d3SJohn Marino  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*86d7f5d3SJohn Marino  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22*86d7f5d3SJohn Marino  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*86d7f5d3SJohn Marino  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*86d7f5d3SJohn Marino  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*86d7f5d3SJohn Marino  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*86d7f5d3SJohn Marino  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*86d7f5d3SJohn Marino  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*86d7f5d3SJohn Marino  * SUCH DAMAGE.
29*86d7f5d3SJohn Marino  *
30*86d7f5d3SJohn Marino  * $FreeBSD: src/sys/netinet/pim_var.h,v 1.1.2.1 2003/08/24 17:04:44 hsu Exp $
31*86d7f5d3SJohn Marino  * $DragonFly: src/sys/netinet/pim_var.h,v 1.4 2006/09/30 20:03:44 swildner Exp $
32*86d7f5d3SJohn Marino  */
33*86d7f5d3SJohn Marino 
34*86d7f5d3SJohn Marino #ifndef _NETINET_PIM_VAR_H_
35*86d7f5d3SJohn Marino #define _NETINET_PIM_VAR_H_
36*86d7f5d3SJohn Marino 
37*86d7f5d3SJohn Marino #ifndef _SYS_TYPES_H_
38*86d7f5d3SJohn Marino #include <sys/types.h>
39*86d7f5d3SJohn Marino #endif
40*86d7f5d3SJohn Marino 
41*86d7f5d3SJohn Marino #ifdef _KERNEL
42*86d7f5d3SJohn Marino 
43*86d7f5d3SJohn Marino #ifndef _SYS_SYSCTL_H_
44*86d7f5d3SJohn Marino #include <sys/sysctl.h>
45*86d7f5d3SJohn Marino #endif
46*86d7f5d3SJohn Marino 
47*86d7f5d3SJohn Marino #endif
48*86d7f5d3SJohn Marino 
49*86d7f5d3SJohn Marino /*
50*86d7f5d3SJohn Marino  * Protocol Independent Multicast (PIM),
51*86d7f5d3SJohn Marino  * kernel variables and implementation-specific definitions.
52*86d7f5d3SJohn Marino  *
53*86d7f5d3SJohn Marino  * Written by George Edmond Eddy (Rusty), ISI, February 1998.
54*86d7f5d3SJohn Marino  * Modified by Pavlin Radoslavov, USC/ISI, May 1998, Aug 1999, October 2000.
55*86d7f5d3SJohn Marino  * Modified by Hitoshi Asaeda, WIDE, August 1998.
56*86d7f5d3SJohn Marino  */
57*86d7f5d3SJohn Marino 
58*86d7f5d3SJohn Marino /*
59*86d7f5d3SJohn Marino  * PIM statistics kept in the kernel
60*86d7f5d3SJohn Marino  */
61*86d7f5d3SJohn Marino struct pimstat {
62*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_total_msgs;	   /* total PIM messages received    */
63*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_total_bytes;	   /* total PIM bytes received	     */
64*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_tooshort;	   /* rcvd with too few bytes	     */
65*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_badsum;	   /* rcvd with bad checksum	     */
66*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_badversion;	   /* rcvd bad PIM version	     */
67*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_registers_msgs;  /* rcvd regs. msgs (data only)    */
68*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_registers_bytes; /* rcvd regs. bytes (data only)   */
69*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_registers_wrongiif; /* rcvd regs. on wrong iif     */
70*86d7f5d3SJohn Marino 	u_quad_t pims_rcv_badregisters;	   /* rcvd invalid registers	     */
71*86d7f5d3SJohn Marino 	u_quad_t pims_snd_registers_msgs;  /* sent regs. msgs (data only)    */
72*86d7f5d3SJohn Marino 	u_quad_t pims_snd_registers_bytes; /* sent regs. bytes (data only)   */
73*86d7f5d3SJohn Marino };
74*86d7f5d3SJohn Marino 
75*86d7f5d3SJohn Marino /*
76*86d7f5d3SJohn Marino  * Names for PIM sysctl objects
77*86d7f5d3SJohn Marino  */
78*86d7f5d3SJohn Marino #define PIMCTL_STATS		1	/* statistics (read-only) */
79*86d7f5d3SJohn Marino #define PIMCTL_MAXID		2
80*86d7f5d3SJohn Marino 
81*86d7f5d3SJohn Marino #define PIMCTL_NAMES {			\
82*86d7f5d3SJohn Marino 	{ 0, 0 },			\
83*86d7f5d3SJohn Marino 	{ "stats", CTLTYPE_STRUCT },	\
84*86d7f5d3SJohn Marino }
85*86d7f5d3SJohn Marino 
86*86d7f5d3SJohn Marino #ifdef _KERNEL
87*86d7f5d3SJohn Marino 
88*86d7f5d3SJohn Marino struct mbuf;
89*86d7f5d3SJohn Marino 
90*86d7f5d3SJohn Marino int pim_input(struct mbuf **, int *, int);
91*86d7f5d3SJohn Marino SYSCTL_DECL(_net_inet_pim);
92*86d7f5d3SJohn Marino #endif
93*86d7f5d3SJohn Marino 
94*86d7f5d3SJohn Marino #endif /* _NETINET_PIM_VAR_H_ */
95