summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>1999-02-25 22:37:29 +0000
committerangelos <angelos@openbsd.org>1999-02-25 22:37:29 +0000
commitbda2c52cd42db347af14c73be6bf3cbc45c89944 (patch)
tree86c90387cdc1388f6842a9babd4b6d599f413c95
parentListen to kernel replies and report errors (much room for improvement (diff)
downloadwireguard-openbsd-bda2c52cd42db347af14c73be6bf3cbc45c89944.tar.xz
wireguard-openbsd-bda2c52cd42db347af14c73be6bf3cbc45c89944.zip
Prettier reporting, report number of flows in use per SA.
-rw-r--r--sys/netinet/ip_ipsp.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index 506cc7a2a7a..47ca06ba871 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.34 1999/02/25 20:21:07 angelos Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.35 1999/02/25 22:37:29 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -760,6 +760,7 @@ int
ipsp_kern(int off, char **bufp, int len)
{
static char buffer[IPSEC_KERNFS_BUFSIZE];
+ struct flow *flow;
struct tdb *tdb;
int l, i;
@@ -890,16 +891,17 @@ ipsp_kern(int off, char **bufp, int len)
ipsp_address(tdb->tdb_inext->tdb_dst),
tdb->tdb_inext->tdb_sproto);
- if (tdb->tdb_flow)
- l+= sprintf(buffer + l,
- "\tCurrently used by at least one flow\n");
+ for (i = 0, flow = tdb->tdb_flow; flow; flow = flow->flow_next)
+ i++;
- l += sprintf(buffer + l, "\t\tCurrently %qu bytes processed\n",
- tdb->tdb_cur_bytes);
-
- l += sprintf(buffer + l, "\t\t%u flows processed so far\n",
+ l+= sprintf(buffer + l, "\tCurrently used by %d flows\n", i);
+
+ l += sprintf(buffer + l, "\t%u flows have used this SA\n",
tdb->tdb_cur_allocations);
+ l += sprintf(buffer + l, "\t%qu bytes processed by this SA\n",
+ tdb->tdb_cur_bytes);
+
l += sprintf(buffer + l, "\tExpirations:\n");
if (tdb->tdb_flags & TDBF_TIMER)