ongrep

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

commit 226da0615f1cde94cf4d96fd22788addfd6f3292
parent a6705dbc35214af8a4c911efb5ac34bd80b1d9a4
Author: Stephen Gregoratto <dev@sgregoratto.me>
Date:   Wed, 24 Jun 2020 15:30:33 +1000

Tweak manpage, re-enable higlighting mode option

Add documentation for option -C introduced in #07ae21e and re-enable it
in the optstring. Also note that regular expression options are
incompatible with option -X.

Diffstat:
Mngrep.8 | 10+++++++++-
Mngrep.c | 7++++---
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ngrep.8 b/ngrep.8 @@ -9,7 +9,7 @@ .Nd network packet search .Sh SYNOPSIS .Nm -.Op Fl DeilMNpqtTvwxX +.Op Fl CDeilMNpqtTvwxX .Op Fl A Ar num .Op Fl c Ar cols .Op Fl d Ar dev @@ -39,6 +39,8 @@ The options are as follows: Dump .Ar num packets of trailing context after matching a packet. +.It Fl C +Enable highlighting of matched data. .It Fl c Ar cols Explicitly set the console width to .Ar cols . @@ -75,6 +77,8 @@ argument. .It Fl i Ignore case in .Ar expression . +Incompatible with +.Fl X . .It Fl I Ar pcap_dump Input file .Ar pcap_dump @@ -87,6 +91,8 @@ Force output to be line buffered. Make .Ar expression match single lines. +Incompatible with +.Fl X . .It Fl N Show sub-protocol number along with single-character identifier (useful when observing raw or unknown protocols). @@ -140,6 +146,8 @@ match Match .Ar expression as a word. +Incompatible with +.Fl X . .It Fl W Cm normal | byline | single | none Specify an alternate manner for displaying packets. The diff --git a/ngrep.c b/ngrep.c @@ -95,7 +95,7 @@ void (*print_time)() = NULL, (*dump_delay)() = dump_delay_proc_init; */ uint32_t ws_row, ws_col = 80, ws_col_forced = 0; -const char *optstring = "A:c:d:DeF:hiI:lMn:NO:pP:qs:S:tTvwW:xX"; +const char *optstring = "A:Cc:d:DeF:hiI:lMn:NO:pP:qs:S:tTvwW:xX"; int main(int argc, char **argv) @@ -1253,9 +1253,10 @@ void usage(void) { fprintf(stderr, - "usage: ngrep [-DeilMNpqtTvwxX] [-A num] [-c cols] [-d dev] [-F file] [-I pcap_dump]\n" + "usage: %s [-CDeilMNpqtTvwxX] [-A num] [-c cols] [-d dev] [-F file] [-I pcap_dump]\n" " [-n num] [-O pcap_dump] [-P char] [-S limitlen] [-s snaplen]\n" - " [-W normal | byline | single | none] [expression] [filter]\n"); + " [-W normal | byline | single | none] [expression] [filter]\n", + getprogname()); exit(2); }