summaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorchris <>2002-10-25 09:26:56 +0000
committerchris <>2002-10-25 09:26:56 +0000
commit5624d5f6866ea35ceac1a4d6447c9571cd40bcc2 (patch)
treed0a65ed463610aff59547293d6e2a6fd4bda984b /ui.c
parentf46898753e916988a68b4786dcd180b1e2e685df (diff)
downloadiftop-5624d5f6866ea35ceac1a4d6447c9571cd40bcc2.zip
""
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/ui.c b/ui.c
index d53797e..8209abf 100644
--- a/ui.c
+++ b/ui.c
@@ -11,6 +11,7 @@
#include <pthread.h>
#include <signal.h>
#include <stdlib.h>
+#include <unistd.h>
#include <netdb.h>
#include <sys/wait.h>
@@ -30,28 +31,23 @@
#define HELP_TIME 2
#define HELP_MESSAGE \
-"Host display:\n"\
-" r - toggle DNS host resolution \n"\
-" s - toggle show source host\n"\
-" d - toggle show destination host\n"\
-"\nPort display:\n"\
-" R - toggle service resolution \n"\
-" S - toggle show source port \n"\
+"Host display: General:\n"\
+" r - toggle DNS host resolution P - pause display\n"\
+" s - toggle show source host h - toggle this help display\n"\
+" d - toggle show destination host b - toggle bar graph display\n"\
+" f - edit filter code\n"\
+"Port display: ! - shell command\n"\
+" R - toggle service resolution q - quit\n"\
+" S - toggle show source port\n"\
" D - toggle show destination port\n"\
" p - toggle port display\n"\
-"\nSorting:\n"\
+"\n"\
+"Sorting:\n"\
" 1/2/3 - sort by 1st/2nd/3rd column\n"\
" < - sort by source name\n"\
" > - sort by dest name\n"\
-"\nGeneral:\n"\
-" P - pause display\n"\
-" 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
-
+"\n"\
+"iftop, version " IFTOP_VERSION
/* 1, 15 and 60 seconds */
@@ -627,7 +623,7 @@ void ui_loop() {
/* in edline.c */
char *edline(int linenum, const char *prompt, const char *initial);
/* in iftop.c */
- int set_filter_code(const char *filter);
+ char *set_filter_code(const char *filter);
extern sig_atomic_t foad;
@@ -772,6 +768,14 @@ void ui_loop() {
if (!(m = set_filter_code(s))) {
xfree(options.filtercode);
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 {
showhelp(m);
xfree(s);