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 { 49118623Shsu u_quad_t pims_rcv_total_msgs; /* total PIM messages received */ 50118623Shsu u_quad_t pims_rcv_total_bytes; /* total PIM bytes received */ 51118623Shsu u_quad_t pims_rcv_tooshort; /* rcvd with too few bytes */ 52118623Shsu u_quad_t pims_rcv_badsum; /* rcvd with bad checksum */ 53118623Shsu u_quad_t pims_rcv_badversion; /* rcvd bad PIM version */ 54118623Shsu u_quad_t pims_rcv_registers_msgs; /* rcvd regs. msgs (data only) */ 55118623Shsu u_quad_t pims_rcv_registers_bytes; /* rcvd regs. bytes (data only) */ 56118623Shsu u_quad_t pims_rcv_registers_wrongiif; /* rcvd regs. on wrong iif */ 57118623Shsu u_quad_t pims_rcv_badregisters; /* rcvd invalid registers */ 58118623Shsu u_quad_t pims_snd_registers_msgs; /* sent regs. msgs (data only) */ 59118623Shsu u_quad_t pims_snd_registers_bytes; /* sent regs. bytes (data only) */ 60118623Shsu}; 61118623Shsu 62190967Srwatson#ifdef _KERNEL 63208744Szec#define PIMSTAT_ADD(name, val) V_pimstat.name += (val) 64190967Srwatson#define PIMSTAT_INC(name) PIMSTAT_ADD(name, 1) 65190967Srwatson#endif 66190967Srwatson 67118623Shsu/* 68118623Shsu * Names for PIM sysctl objects 69118623Shsu */ 70118623Shsu#define PIMCTL_STATS 1 /* statistics (read-only) */ 71118623Shsu#define PIMCTL_MAXID 2 72118623Shsu 73118623Shsu#define PIMCTL_NAMES { \ 74118623Shsu { 0, 0 }, \ 75118623Shsu { "stats", CTLTYPE_STRUCT }, \ 76118623Shsu} 77118623Shsu 78118623Shsu#ifdef _KERNEL 79118623Shsu 80118623Shsuvoid pim_input(struct mbuf *, int); 81118623ShsuSYSCTL_DECL(_net_inet_pim); 82118623Shsu#endif 83118623Shsu 84118623Shsu#endif /* _NETINET_PIM_VAR_H_ */ 85