Added pause functionality.
This commit is contained in:
1
CHANGES
1
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 <iain@bricbrac.de>
|
||||
Added pause functionality (P)
|
||||
|
||||
0.7 02/10/02
|
||||
|
||||
|
||||
2
Makefile
2
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
7
ui.c
7
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();
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user