diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-03-22 08:13:11 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-03-22 08:13:11 +0000 |
commit | cb31bc75619a7dc976bec5559db8b757d17161dd (patch) | |
tree | 10f5d617b846d345e0c5d45d28f4060b69de62b5 /usr.sbin/tcpdump/print-pfsync.c | |
parent | 0ea12386247e8a080fb60f07b4e818e98394cc1a (diff) |
Add support for PFSYNC_ACT_BUS. (Bulk Update Status)
ok deraadt@
Diffstat (limited to 'usr.sbin/tcpdump/print-pfsync.c')
-rw-r--r-- | usr.sbin/tcpdump/print-pfsync.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-pfsync.c b/usr.sbin/tcpdump/print-pfsync.c index 9c7a96c1a61..4313dd0df5b 100644 --- a/usr.sbin/tcpdump/print-pfsync.c +++ b/usr.sbin/tcpdump/print-pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-pfsync.c,v 1.25 2004/02/20 20:03:05 mcbride Exp $ */ +/* $OpenBSD: print-pfsync.c,v 1.26 2004/03/22 08:13:10 mcbride Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -28,7 +28,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-pfsync.c,v 1.25 2004/02/20 20:03:05 mcbride Exp $"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-pfsync.c,v 1.26 2004/03/22 08:13:10 mcbride Exp $"; #endif #include <sys/param.h> @@ -115,7 +115,8 @@ pfsync_print(struct pfsync_header *hdr, int len) struct pfsync_state_del *d; struct pfsync_state_clr *c; struct pfsync_state_upd_req *r; - int i, flags = 0; + struct pfsync_state_bus *b; + int i, flags = 0, min, sec; u_int64_t id; if (eflag) @@ -208,6 +209,28 @@ pfsync_print(struct pfsync_header *hdr, int len) betoh64(id), ntohl(r->creatorid)); } break; + case PFSYNC_ACT_BUS: + if (sizeof(*b) <= len) { + b = (void *)((char *)hdr + PFSYNC_HDRLEN); + printf("\n\tcreatorid: %08x", htonl(b->creatorid)); + sec = b->endtime % 60; + b->endtime /= 60; + min = b->endtime % 60; + b->endtime /= 60; + printf(" age %.2u:%.2u:%.2u", b->endtime, min, sec); + switch (b->status) { + case PFSYNC_BUS_START: + printf(" status: start"); + break; + case PFSYNC_BUS_END: + printf(" status: end"); + break; + default: + printf(" status: ?"); + break; + } + } + break; default: break; } |