summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ah.h
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2017-11-08 16:29:21 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2017-11-08 16:29:21 +0000
commit95d5c9837745945f60f71500bac2d42a6b94bef5 (patch)
tree8185f42316464cc4022835a594e1f72de27f647a /sys/netinet/ip_ah.h
parent918103455ceabf54af40927fdf81e9470a75ed3b (diff)
Make {ah,esp,ipcomp}stat use percpu counters.
OK bluhm@, mpi@
Diffstat (limited to 'sys/netinet/ip_ah.h')
-rw-r--r--sys/netinet/ip_ah.h46
1 files changed, 44 insertions, 2 deletions
diff --git a/sys/netinet/ip_ah.h b/sys/netinet/ip_ah.h
index c3dd6cfd795..9a9e1cbc600 100644
--- a/sys/netinet/ip_ah.h
+++ b/sys/netinet/ip_ah.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.h,v 1.35 2017/11/07 16:51:23 visa Exp $ */
+/* $OpenBSD: ip_ah.h,v 1.36 2017/11/08 16:29:20 visa Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -92,7 +92,49 @@ struct ah {
}
#ifdef _KERNEL
+
+#include <sys/percpu.h>
+
+enum ahstat_counters {
+ ahs_hdrops, /* Packet shorter than header shows */
+ ahs_nopf, /* Protocol family not supported */
+ ahs_notdb,
+ ahs_badkcr,
+ ahs_badauth,
+ ahs_noxform,
+ ahs_qfull,
+ ahs_wrap,
+ ahs_replay,
+ ahs_badauthl, /* Bad authenticator length */
+ ahs_input, /* Input AH packets */
+ ahs_output, /* Output AH packets */
+ ahs_invalid, /* Trying to use an invalid TDB */
+ ahs_ibytes, /* Input bytes */
+ ahs_obytes, /* Output bytes */
+ ahs_toobig, /* Packet got larger than
+ * IP_MAXPACKET */
+ ahs_pdrops, /* Packet blocked due to policy */
+ ahs_crypto, /* Crypto processing failure */
+ ahs_outfail, /* Packet output failure */
+
+ ahs_ncounters
+};
+
+extern struct cpumem *ahcounters;
+
+static inline void
+ahstat_inc(enum ahstat_counters c)
+{
+ counters_inc(ahcounters, c);
+}
+
+static inline void
+ahstat_add(enum ahstat_counters c, uint64_t v)
+{
+ counters_add(ahcounters, c, v);
+}
+
extern int ah_enable;
-extern struct ahstat ahstat;
+
#endif /* _KERNEL */
#endif /* _NETINET_IP_AH_H_ */