Commit 6ba321dd authored by pdw's avatar pdw

Added pause functionality.

parent 164fd7ef
......@@ -8,6 +8,7 @@ Minor fix to rate display
Minor fix to netmask handling (specifying /32 was broken)
Updated RPM spec file
Iain Lea <iain@bricbrac.de>
Added pause functionality (P)
0.7 02/10/02
......
......@@ -27,7 +27,7 @@ MANDIR = man
#MANDIR = share/man # FHS-ish
# You shouldn't need to change anything below this point.
VERSION = 0.8pre1
VERSION = 0.8pre2
CFLAGS += -g -Wall "-DIFTOP_VERSION=\"$(VERSION)\""
LDFLAGS += -g
LDLIBS += -lpcap -lpthread -lcurses -lm
......
......@@ -69,6 +69,7 @@ static void set_defaults() {
options.showports = OPTION_PORTS_OFF;
options.aggregate_src = 0;
options.aggregate_dest = 0;
options.paused = 0;
}
static void die(char *msg) {
......@@ -137,7 +138,8 @@ static void usage(FILE *fp) {
" -n net/mask show traffic flows in/out of network\n"
" -P show ports as well as hosts\n"
"\n"
"iftop, version " IFTOP_VERSION " copyright (c) 2002 Paul Warren <pdw@ex-parrot.com>\n"
"iftop, version " IFTOP_VERSION "\n"
"copyright (c) 2002 Paul Warren <pdw@ex-parrot.com> and contributors\n"
);
}
......
......@@ -40,6 +40,7 @@ typedef struct {
option_port_t showports;
int aggregate_src;
int aggregate_dest;
int paused;
} options_t;
......
......@@ -194,6 +194,10 @@ void analyse_data() {
hash_node_type* n = NULL;
int i;
if(options.paused == 0) {
return;
}
memset(&totals, 0, sizeof totals);
screen_data_clear();
......@@ -491,7 +495,7 @@ void ui_loop() {
tick(1);
break;
case 'b':
case 'b':
options.showbars = !options.showbars;
tick(1);
break;
......@@ -540,6 +544,9 @@ void ui_loop() {
: OPTION_PORTS_OFF;
// Don't tick here, otherwise we get a bogus display
break;
case 'P':
options.paused = !options.paused;
break;
}
tick(0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment