""
This commit is contained in:
4
iftop.8
4
iftop.8
@@ -1,6 +1,6 @@
|
|||||||
.TH DRIFTNET 1
|
.TH IFTOP 8
|
||||||
.\"
|
.\"
|
||||||
.\" iftop.1:
|
.\" iftop.8:
|
||||||
.\" Manual page for iftop.
|
.\" Manual page for iftop.
|
||||||
.\"
|
.\"
|
||||||
.\" $Id$
|
.\" $Id$
|
||||||
|
|||||||
9
iftop.c
9
iftop.c
@@ -179,6 +179,7 @@ void usage(FILE *fp) {
|
|||||||
"iftop: display bandwidth usage on an interface by host\n"
|
"iftop: display bandwidth usage on an interface by host\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" -d don't do hostname lookups\n"
|
||||||
" -i interface listen on named interface (default: eth0)\n"
|
" -i interface listen on named interface (default: eth0)\n"
|
||||||
" -f filter code use filter code to select packets to count\n"
|
" -f filter code use filter code to select packets to count\n"
|
||||||
" (default: none, but only IP packets are counted)\n"
|
" (default: none, but only IP packets are counted)\n"
|
||||||
@@ -190,10 +191,11 @@ void usage(FILE *fp) {
|
|||||||
|
|
||||||
/* main:
|
/* main:
|
||||||
* Entry point. See usage(). */
|
* Entry point. See usage(). */
|
||||||
char optstr[] = "+i:f:h";
|
char optstr[] = "+i:f:dh";
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
struct sigaction sa = {0};
|
struct sigaction sa = {0};
|
||||||
|
extern int dnsresolution; /* in ui.c */
|
||||||
int opt;
|
int opt;
|
||||||
|
|
||||||
opterr = 0;
|
opterr = 0;
|
||||||
@@ -203,6 +205,10 @@ int main(int argc, char **argv) {
|
|||||||
usage(stdout);
|
usage(stdout);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
dnsresolution = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'i':
|
case 'i':
|
||||||
interface = optarg;
|
interface = optarg;
|
||||||
break;
|
break;
|
||||||
@@ -224,7 +230,6 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sa.sa_handler = finish;
|
sa.sa_handler = finish;
|
||||||
|
|
||||||
sigaction(SIGINT, &sa, NULL);
|
sigaction(SIGINT, &sa, NULL);
|
||||||
|
|
||||||
pthread_mutex_init(&tick_mutex, NULL);
|
pthread_mutex_init(&tick_mutex, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user