1139823Simp/*-
2118623Shsu * Copyright (c) 1998-2000
3118623Shsu * University of Southern California/Information Sciences Institute.
4118623Shsu * All rights reserved.
5118623Shsu *
6118623Shsu * Redistribution and use in source and binary forms, with or without
7118623Shsu * modification, are permitted provided that the following conditions
8118623Shsu * are met:
9118623Shsu * 1. Redistributions of source code must retain the above copyright
10118623Shsu *    notice, this list of conditions and the following disclaimer.
11118623Shsu * 2. Redistributions in binary form must reproduce the above copyright
12118623Shsu *    notice, this list of conditions and the following disclaimer in the
13118623Shsu *    documentation and/or other materials provided with the distribution.
14118623Shsu * 3. Neither the name of the project nor the names of its contributors
15118623Shsu *    may be used to endorse or promote products derived from this software
16118623Shsu *    without specific prior written permission.
17118623Shsu *
18118623Shsu * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19118623Shsu * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20118623Shsu * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21118623Shsu * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22118623Shsu * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23118623Shsu * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24118623Shsu * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25118623Shsu * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26118623Shsu * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27118623Shsu * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28118623Shsu * SUCH DAMAGE.
29118623Shsu *
30118623Shsu * $FreeBSD$
31118623Shsu */
32118623Shsu
33118623Shsu#ifndef _NETINET_PIM_VAR_H_
34118623Shsu#define _NETINET_PIM_VAR_H_
35118623Shsu
36118623Shsu/*
37118623Shsu * Protocol Independent Multicast (PIM),
38118623Shsu * kernel variables and implementation-specific definitions.
39118623Shsu *
40118623Shsu * Written by George Edmond Eddy (Rusty), ISI, February 1998.
41118623Shsu * Modified by Pavlin Radoslavov, USC/ISI, May 1998, Aug 1999, October 2000.
42118623Shsu * Modified by Hitoshi Asaeda, WIDE, August 1998.
43118623Shsu */
44118623Shsu
45118623Shsu/*
46118623Shsu * PIM statistics kept in the kernel
47118623Shsu */
48118623Shsustruct pimstat {
49253081Sae	uint64_t pims_rcv_total_msgs;	   /* total PIM messages received    */
50253081Sae	uint64_t pims_rcv_total_bytes;	   /* total PIM bytes received	     */
51253081Sae	uint64_t pims_rcv_tooshort;	   /* rcvd with too few bytes	     */
52253081Sae	uint64_t pims_rcv_badsum;	   /* rcvd with bad checksum	     */
53253081Sae	uint64_t pims_rcv_badversion;	   /* rcvd bad PIM version	     */
54253081Sae	uint64_t pims_rcv_registers_msgs;  /* rcvd regs. msgs (data only)    */
55253081Sae	uint64_t pims_rcv_registers_bytes; /* rcvd regs. bytes (data only)   */
56253081Sae	uint64_t pims_rcv_registers_wrongiif; /* rcvd regs. on wrong iif     */
57253081Sae	uint64_t pims_rcv_badregisters;	   /* rcvd invalid registers	     */
58253081Sae	uint64_t pims_snd_registers_msgs;  /* sent regs. msgs (data only)    */
59253081Sae	uint64_t pims_snd_registers_bytes; /* sent regs. bytes (data only)   */
60118623Shsu};
61118623Shsu
62190967Srwatson#ifdef _KERNEL
63253084Sae#define	PIMSTAT_ADD(name, val)	\
64253084Sae    VNET_PCPUSTAT_ADD(struct pimstat, pimstat, name, (val))
65190967Srwatson#define	PIMSTAT_INC(name)	PIMSTAT_ADD(name, 1)
66190967Srwatson#endif
67190967Srwatson
68118623Shsu/*
69262489Sjhb * Identifiers for PIM sysctl nodes
70118623Shsu */
71118623Shsu#define PIMCTL_STATS		1	/* statistics (read-only) */
72118623Shsu
73118623Shsu#ifdef _KERNEL
74118623Shsu
75269699Skevloint pim_input(struct mbuf **, int *, int);
76118623ShsuSYSCTL_DECL(_net_inet_pim);
77118623Shsu#endif
78118623Shsu
79118623Shsu#endif /* _NETINET_PIM_VAR_H_ */
80