ongrep

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

commit f5c13f579f771e59a58e62062d81bf6c03c19d60
parent 24600b6bb77850edfff81f7a76c0634ce8fcdc18
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Tue,  4 Dec 2007 02:20:10 +0000

potential fix for bug #1787433: VLAN support.  by moving our
"(ip...)" filter to the end instead of the beginning, we make
it possible for users to specify any vlan logic in their bpf
filter and have everything still work (bpf requires vlan be
ordered first in the filter)

Diffstat:
Mngrep.h | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ngrep.h b/ngrep.h @@ -24,6 +24,7 @@ #define ISDNHDR_SIZE 16 #define IEEE80211HDR_SIZE 32 #define PFLOGHDR_SIZE 48 +#define VLANHDR_SIZE 4 /* * Default patterns for BPF and regular expression filters. @@ -35,8 +36,8 @@ #define BPF_FILTER_IP "(ip)" #endif -#define BPF_FILTER_OTHER " and ( %s)" -#define BPF_MAIN_FILTER BPF_FILTER_IP BPF_FILTER_OTHER +#define BPF_FILTER_OTHER "( %s) and " +#define BPF_MAIN_FILTER BPF_FILTER_OTHER BPF_FILTER_IP #define WORD_REGEX "((^%s\\W)|(\\W%s$)|(\\W%s\\W))"