ongrep

A cleaned up fork of ngrep for OpenBSD
git clone git://git.sgregoratto.me/ongrep
Log | Files | Refs | README | LICENSE

commit 7d5105ac27dbf89fc1cde8f739f7cfafea136fb1
parent 0745c555bf87b66d41f665bce65811af0db26bc4
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Thu, 12 Apr 2007 05:28:38 +0000

add support for OpenBSD's PFLOG packet capture type (patch #1696074)

Diffstat:
Mconfig.h.in | 1+
Mngrep.c | 6++++++
Mngrep.h | 1+
3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/config.h.in b/config.h.in @@ -11,6 +11,7 @@ #define USE_IPv6 @USE_IPv6@ #define HAVE_DLT_RAW @HAVE_DLT_RAW@ +#define HAVE_DLT_PFLOG @HAVE_DLT_PFLOG@ #define HAVE_DLT_LOOP @HAVE_DLT_LOOP@ #define HAVE_DLT_LINUX_SLL @HAVE_DLT_LINUX_SLL@ #define HAVE_DLT_IEEE802_11 @HAVE_DLT_IEEE802_11@ diff --git a/ngrep.c b/ngrep.c @@ -597,6 +597,12 @@ int main(int argc, char **argv) { break; #endif +#if HAVE_DLT_PFLOG + case DLT_PFLOG: + link_offset = PFLOGHDR_SIZE; + break; +#endif + default: fprintf(stderr, "fatal: unsupported interface type %u\n", pcap_datalink(pd)); clean_exit(-1); diff --git a/ngrep.h b/ngrep.h @@ -23,6 +23,7 @@ #define FDDIHDR_SIZE 21 #define ISDNHDR_SIZE 16 #define IEEE80211HDR_SIZE 32 +#define PFLOGHDR_SIZE 48 /* * Default patterns for BPF and regular expression filters.