xref: /freebsd/sys/netinet/pim_var.h (revision c80211e3cf59276683fe85db8142f09fbc97e2cc)
1c398230bSWarner Losh /*-
259ca77f4SJeffrey Hsu  * Copyright (c) 1998-2000
359ca77f4SJeffrey Hsu  * University of Southern California/Information Sciences Institute.
459ca77f4SJeffrey Hsu  * All rights reserved.
559ca77f4SJeffrey Hsu  *
659ca77f4SJeffrey Hsu  * Redistribution and use in source and binary forms, with or without
759ca77f4SJeffrey Hsu  * modification, are permitted provided that the following conditions
859ca77f4SJeffrey Hsu  * are met:
959ca77f4SJeffrey Hsu  * 1. Redistributions of source code must retain the above copyright
1059ca77f4SJeffrey Hsu  *    notice, this list of conditions and the following disclaimer.
1159ca77f4SJeffrey Hsu  * 2. Redistributions in binary form must reproduce the above copyright
1259ca77f4SJeffrey Hsu  *    notice, this list of conditions and the following disclaimer in the
1359ca77f4SJeffrey Hsu  *    documentation and/or other materials provided with the distribution.
1459ca77f4SJeffrey Hsu  * 3. Neither the name of the project nor the names of its contributors
1559ca77f4SJeffrey Hsu  *    may be used to endorse or promote products derived from this software
1659ca77f4SJeffrey Hsu  *    without specific prior written permission.
1759ca77f4SJeffrey Hsu  *
1859ca77f4SJeffrey Hsu  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
1959ca77f4SJeffrey Hsu  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2059ca77f4SJeffrey Hsu  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2159ca77f4SJeffrey Hsu  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2259ca77f4SJeffrey Hsu  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2359ca77f4SJeffrey Hsu  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2459ca77f4SJeffrey Hsu  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2559ca77f4SJeffrey Hsu  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2659ca77f4SJeffrey Hsu  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2759ca77f4SJeffrey Hsu  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2859ca77f4SJeffrey Hsu  * SUCH DAMAGE.
2959ca77f4SJeffrey Hsu  *
3059ca77f4SJeffrey Hsu  * $FreeBSD$
3159ca77f4SJeffrey Hsu  */
3259ca77f4SJeffrey Hsu 
3359ca77f4SJeffrey Hsu #ifndef _NETINET_PIM_VAR_H_
3459ca77f4SJeffrey Hsu #define _NETINET_PIM_VAR_H_
3559ca77f4SJeffrey Hsu 
3659ca77f4SJeffrey Hsu /*
3759ca77f4SJeffrey Hsu  * Protocol Independent Multicast (PIM),
3859ca77f4SJeffrey Hsu  * kernel variables and implementation-specific definitions.
3959ca77f4SJeffrey Hsu  *
4059ca77f4SJeffrey Hsu  * Written by George Edmond Eddy (Rusty), ISI, February 1998.
4159ca77f4SJeffrey Hsu  * Modified by Pavlin Radoslavov, USC/ISI, May 1998, Aug 1999, October 2000.
4259ca77f4SJeffrey Hsu  * Modified by Hitoshi Asaeda, WIDE, August 1998.
4359ca77f4SJeffrey Hsu  */
4459ca77f4SJeffrey Hsu 
4559ca77f4SJeffrey Hsu /*
4659ca77f4SJeffrey Hsu  * PIM statistics kept in the kernel
4759ca77f4SJeffrey Hsu  */
4859ca77f4SJeffrey Hsu struct pimstat {
49*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_total_msgs;	   /* total PIM messages received    */
50*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_total_bytes;	   /* total PIM bytes received	     */
51*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_tooshort;	   /* rcvd with too few bytes	     */
52*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_badsum;	   /* rcvd with bad checksum	     */
53*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_badversion;	   /* rcvd bad PIM version	     */
54*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_registers_msgs;  /* rcvd regs. msgs (data only)    */
55*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_registers_bytes; /* rcvd regs. bytes (data only)   */
56*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_registers_wrongiif; /* rcvd regs. on wrong iif     */
57*c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_badregisters;	   /* rcvd invalid registers	     */
58*c80211e3SAndrey V. Elsukov 	uint64_t pims_snd_registers_msgs;  /* sent regs. msgs (data only)    */
59*c80211e3SAndrey V. Elsukov 	uint64_t pims_snd_registers_bytes; /* sent regs. bytes (data only)   */
6059ca77f4SJeffrey Hsu };
6159ca77f4SJeffrey Hsu 
6207cf7ab2SRobert Watson #ifdef _KERNEL
637c4b8137SMarko Zec #define	PIMSTAT_ADD(name, val)	V_pimstat.name += (val)
6407cf7ab2SRobert Watson #define	PIMSTAT_INC(name)	PIMSTAT_ADD(name, 1)
6507cf7ab2SRobert Watson #endif
6607cf7ab2SRobert Watson 
6759ca77f4SJeffrey Hsu /*
6859ca77f4SJeffrey Hsu  * Names for PIM sysctl objects
6959ca77f4SJeffrey Hsu  */
7059ca77f4SJeffrey Hsu #define PIMCTL_STATS		1	/* statistics (read-only) */
7159ca77f4SJeffrey Hsu #define PIMCTL_MAXID		2
7259ca77f4SJeffrey Hsu 
7359ca77f4SJeffrey Hsu #define PIMCTL_NAMES {			\
7459ca77f4SJeffrey Hsu 	{ 0, 0 },			\
7559ca77f4SJeffrey Hsu 	{ "stats", CTLTYPE_STRUCT },	\
7659ca77f4SJeffrey Hsu }
7759ca77f4SJeffrey Hsu 
7859ca77f4SJeffrey Hsu #ifdef _KERNEL
7959ca77f4SJeffrey Hsu 
8059ca77f4SJeffrey Hsu void pim_input(struct mbuf *, int);
8159ca77f4SJeffrey Hsu SYSCTL_DECL(_net_inet_pim);
8259ca77f4SJeffrey Hsu #endif
8359ca77f4SJeffrey Hsu 
8459ca77f4SJeffrey Hsu #endif /* _NETINET_PIM_VAR_H_ */
85