2
* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3
* dump.c - Enable/Disable verbosity flags.
5
* Luca Deri <deri@ntop.org>
6
* Rocco Carbone <rocco@ntop.org>
7
* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35
* Get/Set Packets dump.
37
int intop_dump (int argc, char * argv [])
40
* Notice the command name.
42
char * commandname = argv [0];
46
printf ("Usage: %s [-h] [-i interface] [-f filename] [-A] [-R] [-H] [-E] [-I] [-T]\n", xxx)
47
char * optstring = "hi:f:ARHEIT";
50
* Reserve here space for the local variables.
52
char * interface = NULL;
60
static FILE * fd = NULL;
66
* Parse command line options to the application via standard system calls.
68
while ((c = getopt (argc, argv, optstring)) != -1)
85
if (! strcmp (optarg, "-"))
89
fd = fopen (optarg, "w");
91
fprintf (stdout, "Cannot open %s.\n", optarg);
140
printf ("\nWrong option(s): \" ");
141
while (optind < argc)
142
printf ("%s ", argv [optind ++]);
151
* Safe to play with the 'active' interface (if any)
152
* in case no specific one was chosen by the user.
154
if (! interface && ! (interface = intop_interface (active)))
156
printf ("No interface is currently enabled for packet sniffing.\n");
161
* Lookup for the given name in the table of enabled interfaces.
163
current = intop_lookup_interface (interface);
166
printf ("%s: unknown interface %s.\n", commandname, interface);
171
* Toogle the verbosity flags.
173
n = nethandler (current);
177
n -> hashing = hflag;