fe4a78da01
file in addition to sniffing the wire directly.
60 lines
1.8 KiB
Text
60 lines
1.8 KiB
Text
$NetBSD: patch-bd,v 1.1 2009/05/09 16:33:04 adrianp Exp $
|
|
|
|
diff -ur dsniff-2.3.orig/filesnarf.c dsniff-2.3/filesnarf.c
|
|
--- filesnarf.c.orig 2000-12-15 20:16:58.000000000 +0000
|
|
+++ filesnarf.c 2009-05-06 23:23:49.000000000 +0100
|
|
@@ -51,7 +51,7 @@
|
|
usage(void)
|
|
{
|
|
fprintf(stderr, "Version: " VERSION "\n"
|
|
- "Usage: filesnarf [-i interface] [[-v] pattern [expression]]\n");
|
|
+ "Usage: filesnarf [-i interface | -p pcapfile] [[-v] pattern [expression]]\n");
|
|
exit(1);
|
|
}
|
|
|
|
@@ -462,11 +462,14 @@
|
|
{
|
|
int c;
|
|
|
|
- while ((c = getopt(argc, argv, "i:vh?V")) != -1) {
|
|
+ while ((c = getopt(argc, argv, "i:p:vh?V")) != -1) {
|
|
switch (c) {
|
|
case 'i':
|
|
nids_params.device = optarg;
|
|
break;
|
|
+ case 'p':
|
|
+ nids_params.filename = optarg;
|
|
+ break;
|
|
case 'v':
|
|
Opt_invert = 1;
|
|
break;
|
|
@@ -496,11 +499,24 @@
|
|
nids_register_ip(decode_udp_nfs);
|
|
nids_register_tcp(decode_tcp_nfs);
|
|
|
|
- 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();
|
|
|