This commit is contained in:
chris
2002-04-02 21:40:28 +00:00
parent de65eda001
commit 2ece61a41f
4 changed files with 13 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ $Id$
0.2 02/04/02 0.2 02/04/02
Added -n option to analyse traffic flows across a network boundary. Added -n option to analyse traffic flows across a network boundary.
Added cummulative traffic totals. Added cumulative traffic totals.
Graphs now optional. Graphs now optional.
UI more responsive to key presses. UI more responsive to key presses.
Auto-sizing bar graph scale. Auto-sizing bar graph scale.

View File

@@ -11,7 +11,7 @@ iftop - display bandwidth usage on an interface by host
.SH SYNOPSIS .SH SYNOPSIS
\fBiftop\fP \fB-h\fP | \fBiftop\fP \fB-h\fP |
[\fB-d\fP] [\fB-p\fP] [\fB-i\fP \fIinterface\fP] [\fB-f\fP \fIfilter code\fP] [\fB-n\fP \fInet\fP/\fImask\fP] [\fB-dpb\fP] [\fB-i\fP \fIinterface\fP] [\fB-f\fP \fIfilter code\fP] [\fB-n\fP \fInet\fP/\fImask\fP]
.SH DESCRIPTION .SH DESCRIPTION
\fBiftop\fP listens to network traffic on a named \fIinterface\fP, or \fBeth0\fP \fBiftop\fP listens to network traffic on a named \fIinterface\fP, or \fBeth0\fP
@@ -58,6 +58,9 @@ Don't do hostname lookups. This setting may be altered at run time.
Run in promiscuous mode, so that traffic which does not pass directly through Run in promiscuous mode, so that traffic which does not pass directly through
the specified interface is also counted. the specified interface is also counted.
.TP .TP
\fB-b\fP
Don't display bar graphs of traffic. This setting may be altered at run time.
.TP
\fB-i\fP \fIinterface\fP \fB-i\fP \fIinterface\fP
Listen to packets on \fIinterface\fP. Listen to packets on \fIinterface\fP.
.TP .TP

View File

@@ -13,7 +13,7 @@
options_t options; options_t options;
char optstr[] = "+i:f:n:dhp"; char optstr[] = "+i:f:n:dhpb";
/* Global options. */ /* Global options. */
@@ -68,12 +68,13 @@ static void usage(FILE *fp) {
fprintf(fp, fprintf(fp,
"iftop: display bandwidth usage on an interface by host\n" "iftop: display bandwidth usage on an interface by host\n"
"\n" "\n"
"Synopsis: iftop -h | [-d] [-p] [-i interface] [-f filter code] [-n net/mask]\n" "Synopsis: iftop -h | [-dpb] [-i interface] [-f filter code] [-n net/mask]\n"
"\n" "\n"
" -h display this message\n" " -h display this message\n"
" -d don't do hostname lookups\n" " -d don't do hostname lookups\n"
" -p run in promiscuous mode (show traffic between other\n" " -p run in promiscuous mode (show traffic between other\n"
" hosts on the same network segment)\n" " hosts on the same network segment)\n"
" -b don't display a bar graph of traffic\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"
@@ -115,6 +116,10 @@ void options_read(int argc, char **argv) {
set_net_filter(optarg); set_net_filter(optarg);
break; break;
case 'b':
options.showbars = 0;
break;
case '?': case '?':
fprintf(stderr, "iftop: unknown option -%c\n", optopt); fprintf(stderr, "iftop: unknown option -%c\n", optopt);
usage(stderr); usage(stderr);

View File

@@ -34,6 +34,7 @@ void resolver_worker(void* ptr) {
delay.tv_sec = 0; delay.tv_sec = 0;
delay.tv_nsec = 500; delay.tv_nsec = 500;
pthread_mutex_lock(&resolver_queue_mutex); pthread_mutex_lock(&resolver_queue_mutex);
sethostent(1);
while(1) { while(1) {
/* Wait until we are told that an address has been added to the /* Wait until we are told that an address has been added to the
* queue. */ * queue. */