mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 09:48:00 -04:00
61 lines
1.7 KiB
Plaintext
61 lines
1.7 KiB
Plaintext
$NetBSD: patch-bh,v 1.1 2009/05/09 16:33:04 adrianp Exp $
|
|
|
|
diff -ur dsniff-2.3.orig/msgsnarf.c dsniff-2.3/msgsnarf.c
|
|
--- msgsnarf.c.orig 2000-12-15 20:12:19.000000000 +0000
|
|
+++ msgsnarf.c 2009-05-06 23:23:49.000000000 +0100
|
|
@@ -41,7 +41,7 @@
|
|
usage(void)
|
|
{
|
|
fprintf(stderr, "Version: " VERSION "\n"
|
|
- "Usage: msgsnarf [-i interface] [[-v] pattern [expression]]\n");
|
|
+ "Usage: msgsnarf [-i interface | -p pcapfile] [[-v] pattern [expression]]\n");
|
|
exit(1);
|
|
}
|
|
|
|
@@ -627,11 +627,14 @@
|
|
{
|
|
int c;
|
|
|
|
- while ((c = getopt(argc, argv, "i:hv?V")) != -1) {
|
|
+ while ((c = getopt(argc, argv, "i:p:hv?V")) != -1) {
|
|
switch (c) {
|
|
case 'i':
|
|
nids_params.device = optarg;
|
|
break;
|
|
+ case 'p':
|
|
+ nids_params.filename = optarg;
|
|
+ break;
|
|
case 'v':
|
|
Opt_invert = 1;
|
|
break;
|
|
@@ -660,11 +663,24 @@
|
|
|
|
nids_register_tcp(sniff_msgs);
|
|
|
|
- if (nids_params.pcap_filter != NULL) {
|
|
- warnx("listening on %s [%s]", nids_params.device,
|
|
- nids_params.pcap_filter);
|
|
- }
|
|
- else warnx("listening on %s", nids_params.device);
|
|
+ if (nids_params.pcap_filter != NULL) {
|
|
+ if (nids_params.filename == NULL) {
|
|
+ warnx("listening on %s [%s]", nids_params.device,
|
|
+ nids_params.pcap_filter);
|
|
+ }
|
|
+ else {
|
|
+ warnx("using %s [%s]", nids_params.filename,
|
|
+ nids_params.pcap_filter);
|
|
+ }
|
|
+ }
|
|
+ else {
|
|
+ if (nids_params.filename == NULL) {
|
|
+ warnx("listening on %s", nids_params.device);
|
|
+ }
|
|
+ else {
|
|
+ warnx("using %s", nids_params.filename);
|
|
+ }
|
|
+ }
|
|
|
|
nids_run();
|
|
|