ongrep

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

commit 0e64d39fd4c29a3ea472360d9b852dcf5ab5bd5f
parent 2ad63fc6fc84fd16dd7e318bdc3bfb272e99166d
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Wed,  6 Jun 2001 15:15:22 +0000

added -s (set caplen)

Diffstat:
Mngrep.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/ngrep.c b/ngrep.c @@ -117,7 +117,7 @@ int main(int argc, char **argv) { signal(SIGPIPE, clean_exit); signal(SIGWINCH, update_windowsize); - while ((c = getopt(argc, argv, "hXViwqpevxlDtTn:d:A:I:O:")) != EOF) { + while ((c = getopt(argc, argv, "hXViwqpevxlDtTs:n:d:A:I:O:")) != EOF) { switch (c) { case 'I': read_file = optarg; @@ -134,6 +134,9 @@ int main(int argc, char **argv) { case 'n': max_matches = atoi(optarg); break; + case 's': + snaplen = atoi(optarg); + break; case 'T': print_time = &print_time_diff_init; break; @@ -799,8 +802,8 @@ void update_windowsize(int e) { void usage(int e) { - printf("usage: ngrep <-hXViwqpevxlDtT> <-IO pcap_dump> <-n num> <-d dev> <-A num>\n" - " <match expression> <bpf filter>\n"); + printf("usage: ngrep <-hXViwqpevxlDtTs> <-IO pcap_dump> <-n num> <-d dev> <-A num>\n" + " <match expression> <bpf filter>\n"); exit(e); }