xref: /freebsd/sys/netinet/pim_var.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1c398230bSWarner Losh /*-
2*51369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
3*51369649SPedro F. Giffuni  *
459ca77f4SJeffrey Hsu  * Copyright (c) 1998-2000
559ca77f4SJeffrey Hsu  * University of Southern California/Information Sciences Institute.
659ca77f4SJeffrey Hsu  * All rights reserved.
759ca77f4SJeffrey Hsu  *
859ca77f4SJeffrey Hsu  * Redistribution and use in source and binary forms, with or without
959ca77f4SJeffrey Hsu  * modification, are permitted provided that the following conditions
1059ca77f4SJeffrey Hsu  * are met:
1159ca77f4SJeffrey Hsu  * 1. Redistributions of source code must retain the above copyright
1259ca77f4SJeffrey Hsu  *    notice, this list of conditions and the following disclaimer.
1359ca77f4SJeffrey Hsu  * 2. Redistributions in binary form must reproduce the above copyright
1459ca77f4SJeffrey Hsu  *    notice, this list of conditions and the following disclaimer in the
1559ca77f4SJeffrey Hsu  *    documentation and/or other materials provided with the distribution.
1659ca77f4SJeffrey Hsu  * 3. Neither the name of the project nor the names of its contributors
1759ca77f4SJeffrey Hsu  *    may be used to endorse or promote products derived from this software
1859ca77f4SJeffrey Hsu  *    without specific prior written permission.
1959ca77f4SJeffrey Hsu  *
2059ca77f4SJeffrey Hsu  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
2159ca77f4SJeffrey Hsu  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2259ca77f4SJeffrey Hsu  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2359ca77f4SJeffrey Hsu  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2459ca77f4SJeffrey Hsu  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2559ca77f4SJeffrey Hsu  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2659ca77f4SJeffrey Hsu  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2759ca77f4SJeffrey Hsu  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2859ca77f4SJeffrey Hsu  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2959ca77f4SJeffrey Hsu  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3059ca77f4SJeffrey Hsu  * SUCH DAMAGE.
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 {
49c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_total_msgs;	   /* total PIM messages received    */
50c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_total_bytes;	   /* total PIM bytes received	     */
51c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_tooshort;	   /* rcvd with too few bytes	     */
52c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_badsum;	   /* rcvd with bad checksum	     */
53c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_badversion;	   /* rcvd bad PIM version	     */
54c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_registers_msgs;  /* rcvd regs. msgs (data only)    */
55c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_registers_bytes; /* rcvd regs. bytes (data only)   */
56c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_registers_wrongiif; /* rcvd regs. on wrong iif     */
57c80211e3SAndrey V. Elsukov 	uint64_t pims_rcv_badregisters;	   /* rcvd invalid registers	     */
58c80211e3SAndrey V. Elsukov 	uint64_t pims_snd_registers_msgs;  /* sent regs. msgs (data only)    */
59c80211e3SAndrey V. Elsukov 	uint64_t pims_snd_registers_bytes; /* sent regs. bytes (data only)   */
6059ca77f4SJeffrey Hsu };
6159ca77f4SJeffrey Hsu 
6207cf7ab2SRobert Watson #ifdef _KERNEL
635b7cb97cSAndrey V. Elsukov #define	PIMSTAT_ADD(name, val)	\
645b7cb97cSAndrey V. Elsukov     VNET_PCPUSTAT_ADD(struct pimstat, pimstat, name, (val))
6507cf7ab2SRobert Watson #define	PIMSTAT_INC(name)	PIMSTAT_ADD(name, 1)
6607cf7ab2SRobert Watson #endif
6707cf7ab2SRobert Watson 
6859ca77f4SJeffrey Hsu /*
695b26ea5dSJohn Baldwin  * Identifiers for PIM sysctl nodes
7059ca77f4SJeffrey Hsu  */
7159ca77f4SJeffrey Hsu #define PIMCTL_STATS		1	/* statistics (read-only) */
7259ca77f4SJeffrey Hsu 
7359ca77f4SJeffrey Hsu #ifdef _KERNEL
7459ca77f4SJeffrey Hsu SYSCTL_DECL(_net_inet_pim);
7559ca77f4SJeffrey Hsu #endif
7659ca77f4SJeffrey Hsu 
7759ca77f4SJeffrey Hsu #endif /* _NETINET_PIM_VAR_H_ */
78