diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1999-02-25 22:37:30 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1999-02-25 22:37:30 +0000 |
commit | 877f993f08a121fc5b506cb282ceb9bdd0c0e674 (patch) | |
tree | 7ac478a41bdb08412f2ccb03b64d501a7d62775f | |
parent | 3365c743f3b0546660f460eb4aeb2668175ce0d5 (diff) |
Prettier reporting, report number of flows in use per SA.
-rw-r--r-- | sys/netinet/ip_ipsp.c | 18 |
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) |