ipcomp_var.h revision 195699
11573Srgrimes/*	$FreeBSD: head/sys/netipsec/ipcomp_var.h 195699 2009-07-14 22:48:30Z rwatson $	*/
21573Srgrimes/*	$KAME: ipcomp.h,v 1.8 2000/09/26 07:55:14 itojun Exp $	*/
31573Srgrimes
41573Srgrimes/*-
51573Srgrimes * Copyright (C) 1999 WIDE Project.
61573Srgrimes * All rights reserved.
71573Srgrimes *
81573Srgrimes * Redistribution and use in source and binary forms, with or without
91573Srgrimes * modification, are permitted provided that the following conditions
101573Srgrimes * are met:
111573Srgrimes * 1. Redistributions of source code must retain the above copyright
121573Srgrimes *    notice, this list of conditions and the following disclaimer.
131573Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
141573Srgrimes *    notice, this list of conditions and the following disclaimer in the
151573Srgrimes *    documentation and/or other materials provided with the distribution.
161573Srgrimes * 3. Neither the name of the project nor the names of its contributors
171573Srgrimes *    may be used to endorse or promote products derived from this software
181573Srgrimes *    without specific prior written permission.
191573Srgrimes *
201573Srgrimes * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
211573Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
221573Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
231573Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
241573Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
251573Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
261573Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
271573Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
281573Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
291573Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
301573Srgrimes * SUCH DAMAGE.
311573Srgrimes */
3282995Sache
3382995Sache#ifndef _NETIPSEC_IPCOMP_VAR_H_
341573Srgrimes#define _NETIPSEC_IPCOMP_VAR_H_
351573Srgrimes
361573Srgrimes/*
371573Srgrimes * These define the algorithm indices into the histogram.  They're
381573Srgrimes * presently based on the PF_KEY v2 protocol values which is bogus;
391573Srgrimes * they should be decoupled from the protocol at which time we can
401573Srgrimes * pack them and reduce the size of the array to a minimum.
411573Srgrimes */
421573Srgrimes#define	IPCOMP_ALG_MAX	8
431573Srgrimes
441573Srgrimesstruct ipcompstat {
451573Srgrimes	u_int32_t	ipcomps_hdrops;	/* Packet shorter than header shows */
461573Srgrimes	u_int32_t	ipcomps_nopf;	/* Protocol family not supported */
471573Srgrimes	u_int32_t	ipcomps_notdb;
481573Srgrimes	u_int32_t	ipcomps_badkcr;
4982975Sache	u_int32_t	ipcomps_qfull;
501573Srgrimes	u_int32_t	ipcomps_noxform;
511573Srgrimes	u_int32_t	ipcomps_wrap;
521573Srgrimes	u_int32_t	ipcomps_input;	/* Input IPcomp packets */
531573Srgrimes	u_int32_t	ipcomps_output;	/* Output IPcomp packets */
541573Srgrimes	u_int32_t	ipcomps_invalid;/* Trying to use an invalid TDB */
551573Srgrimes	u_int64_t	ipcomps_ibytes;	/* Input bytes */
5687016Sache	u_int64_t	ipcomps_obytes;	/* Output bytes */
571573Srgrimes	u_int32_t	ipcomps_toobig;	/* Packet got > IP_MAXPACKET */
5887016Sache	u_int32_t	ipcomps_pdrops;	/* Packet blocked due to policy */
5987016Sache	u_int32_t	ipcomps_crypto;	/* "Crypto" processing failure */
6087494Sache	u_int32_t	ipcomps_hist[IPCOMP_ALG_MAX];/* Per-algorithm op count */
6187016Sache};
6287494Sache
631573Srgrimes#ifdef _KERNEL
641573SrgrimesVNET_DECLARE(int, ipcomp_enable);
651573Srgrimes#define	V_ipcomp_enable		VNET_GET(ipcomp_enable)
661573SrgrimesVNET_DECLARE(struct ipcompstat, ipcompstat);
671573Srgrimes#define	V_ipcompstat		VNET_GET(ipcompstat)
681573Srgrimes#endif /* _KERNEL */
6982975Sache#endif /*_NETIPSEC_IPCOMP_VAR_H_*/
701573Srgrimes