diff --git a/CHANGES b/CHANGES index 00e5c42..980a5d8 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ Minor fix to rate display Minor fix to netmask handling (specifying /32 was broken) Updated RPM spec file Iain Lea +Added pause functionality (P) 0.7 02/10/02 diff --git a/Makefile b/Makefile index 88bc5c5..8e7c811 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/options.c b/options.c index 552c556..d9729bf 100644 --- a/options.c +++ b/options.c @@ -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 \n" +"iftop, version " IFTOP_VERSION "\n" +"copyright (c) 2002 Paul Warren and contributors\n" ); } diff --git a/options.h b/options.h index b7de6d5..b7dc81f 100644 --- a/options.h +++ b/options.h @@ -40,6 +40,7 @@ typedef struct { option_port_t showports; int aggregate_src; int aggregate_dest; + int paused; } options_t; diff --git a/ui.c b/ui.c index 0244884..a11cc0b 100644 --- a/ui.c +++ b/ui.c @@ -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); }