/* $OpenBSD: ip_ah.h,v 1.29 2002/06/09 16:26:10 itojun Exp $ */1/*-2* The authors of this code are John Ioannidis ([email protected]),3* Angelos D. Keromytis ([email protected]) and4* Niels Provos ([email protected]).5*6* The original version of this code was written by John Ioannidis7* for BSD/OS in Athens, Greece, in November 1995.8*9* Ported to OpenBSD and NetBSD, with additional transforms, in December 1996,10* by Angelos D. Keromytis.11*12* Additional transforms and features in 1997 and 1998 by Angelos D. Keromytis13* and Niels Provos.14*15* Additional features in 1999 by Angelos D. Keromytis.16*17* Copyright (C) 1995, 1996, 1997, 1998, 1999 John Ioannidis,18* Angelos D. Keromytis and Niels Provos.19* Copyright (c) 2001 Angelos D. Keromytis.20*21* Permission to use, copy, and modify this software with or without fee22* is hereby granted, provided that this entire notice is included in23* all copies of any software which is or includes a copy or24* modification of this software.25* You may use this code under the GNU public license if you so wish. Please26* contribute changes back to the authors under this freer than GPL license27* so that we may further the use of strong encryption without limitations to28* all.29*30* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR31* IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY32* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE33* MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR34* PURPOSE.35*/3637#ifndef _NETIPSEC_AH_VAR_H_38#define _NETIPSEC_AH_VAR_H_3940/*41* These define the algorithm indices into the histogram. They're42* presently based on the PF_KEY v2 protocol values which is bogus;43* they should be decoupled from the protocol at which time we can44* pack them and reduce the size of the array to a minimum.45*/46#define AH_ALG_MAX 164748struct ahstat {49uint64_t ahs_hdrops; /* Packet shorter than header shows */50uint64_t ahs_nopf; /* Protocol family not supported */51uint64_t ahs_notdb;52uint64_t ahs_badkcr;53uint64_t ahs_badauth;54uint64_t ahs_noxform;55uint64_t ahs_qfull;56uint64_t ahs_wrap;57uint64_t ahs_replay;58uint64_t ahs_badauthl; /* Bad authenticator length */59uint64_t ahs_input; /* Input AH packets */60uint64_t ahs_output; /* Output AH packets */61uint64_t ahs_invalid; /* Trying to use an invalid TDB */62uint64_t ahs_ibytes; /* Input bytes */63uint64_t ahs_obytes; /* Output bytes */64uint64_t ahs_toobig; /* Packet got larger than IP_MAXPACKET */65uint64_t ahs_pdrops; /* Packet blocked due to policy */66uint64_t ahs_crypto; /* Crypto processing failure */67uint64_t ahs_tunnel; /* Tunnel sanity check failure */68uint64_t ahs_hist[AH_ALG_MAX]; /* Per-algorithm op count */69};7071#ifdef _KERNEL72#include <sys/counter.h>73#include <netinet/in_kdtrace.h>7475VNET_DECLARE(int, ah_enable);76VNET_DECLARE(int, ah_cleartos);77VNET_PCPUSTAT_DECLARE(struct ahstat, ahstat);7879#define AHSTAT_ADD(name, val) \80do { \81MIB_SDT_PROBE1(ah, count, name, (val)); \82VNET_PCPUSTAT_ADD(struct ahstat, ahstat, name, (val)); \83} while (0)84#define AHSTAT_INC2(name, type) \85do { \86MIB_SDT_PROBE2(ah, count, name, 1, (type)); \87VNET_PCPUSTAT_ADD(struct ahstat, ahstat, name[type], 1); \88} while (0)89#define AHSTAT_INC(name) AHSTAT_ADD(name, 1)90#define V_ah_enable VNET(ah_enable)91#define V_ah_cleartos VNET(ah_cleartos)92#endif /* _KERNEL */93#endif /*_NETIPSEC_AH_VAR_H_*/949596