This commit is contained in:
chris
2002-10-25 09:26:56 +00:00
parent f46898753e
commit 5624d5f686

40
ui.c
View File

@@ -11,6 +11,7 @@
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <netdb.h> #include <netdb.h>
#include <sys/wait.h> #include <sys/wait.h>
@@ -30,28 +31,23 @@
#define HELP_TIME 2 #define HELP_TIME 2
#define HELP_MESSAGE \ #define HELP_MESSAGE \
"Host display:\n"\ "Host display: General:\n"\
" r - toggle DNS host resolution \n"\ " r - toggle DNS host resolution P - pause display\n"\
" s - toggle show source host\n"\ " s - toggle show source host h - toggle this help display\n"\
" d - toggle show destination host\n"\ " d - toggle show destination host b - toggle bar graph display\n"\
"\nPort display:\n"\ " f - edit filter code\n"\
" R - toggle service resolution \n"\ "Port display: ! - shell command\n"\
" S - toggle show source port \n"\ " R - toggle service resolution q - quit\n"\
" S - toggle show source port\n"\
" D - toggle show destination port\n"\ " D - toggle show destination port\n"\
" p - toggle port display\n"\ " p - toggle port display\n"\
"\nSorting:\n"\ "\n"\
"Sorting:\n"\
" 1/2/3 - sort by 1st/2nd/3rd column\n"\ " 1/2/3 - sort by 1st/2nd/3rd column\n"\
" < - sort by source name\n"\ " < - sort by source name\n"\
" > - sort by dest name\n"\ " > - sort by dest name\n"\
"\nGeneral:\n"\ "\n"\
" P - pause display\n"\ "iftop, version " IFTOP_VERSION
" h - toggle this help display\n"\
" b - toggle bar graph display\n"\
" f - edit filter code\n"\
" ! - shell command\n"\
" q - quit\n"\
"\niftop, version " IFTOP_VERSION
/* 1, 15 and 60 seconds */ /* 1, 15 and 60 seconds */
@@ -627,7 +623,7 @@ void ui_loop() {
/* in edline.c */ /* in edline.c */
char *edline(int linenum, const char *prompt, const char *initial); char *edline(int linenum, const char *prompt, const char *initial);
/* in iftop.c */ /* in iftop.c */
int set_filter_code(const char *filter); char *set_filter_code(const char *filter);
extern sig_atomic_t foad; extern sig_atomic_t foad;
@@ -772,6 +768,14 @@ void ui_loop() {
if (!(m = set_filter_code(s))) { if (!(m = set_filter_code(s))) {
xfree(options.filtercode); xfree(options.filtercode);
options.filtercode = s; options.filtercode = s;
/* -lpcap will write junk to stderr; we do our best to
* erase it.... */
touchline(stdscr, 0, 2);
move(0, 0);
clrtoeol();
move(1, 0);
clrtoeol();
refresh();
} else { } else {
showhelp(m); showhelp(m);
xfree(s); xfree(s);