Vitezslav Samel (3): kill unfinished work on graphing logging fix: show program interface only if not given any command line arg fix: clear screen before exit when given arg on cmdline
src/iptraf.c | 53 ++++++++++++----------------------------------------- src/log.c | 1 - src/logvars.h | 1 - 3 files changed, 12 insertions(+), 43 deletions(-)
Signed-off-by: Vitezslav Samel vitezslav@samel.cz --- src/iptraf.c | 42 +++++++----------------------------------- src/log.c | 1 - src/logvars.h | 1 - 3 files changed, 7 insertions(+), 37 deletions(-)
diff --git a/src/iptraf.c b/src/iptraf.c index e840ba7..b43c485 100644 --- a/src/iptraf.c +++ b/src/iptraf.c @@ -53,7 +53,6 @@ int exitloop = 0; int daemonized = 0; int facility_running = 0; int is_first_instance; -char graphing_filter[80];
static void press_enter_to_continue(void) { @@ -138,23 +137,15 @@ static void program_interface(void) int break_aborted;
struct filterstate ofilter; - struct ffnode *fltfiles;
char ifname[IFNAMSIZ]; char *ifptr = NULL;
/* - * Load saved filter or graphing filter if specified + * Load saved filter */ - if (graphing_logfile[0] != '\0') { - loadfilterlist(&fltfiles); - memset(&ofilter, 0, sizeof(struct filterstate)); - loadfilter(pickfilterbyname(fltfiles, graphing_filter), - &(ofilter.fl), FLT_RESOLVE); - } else { - loadfilters(&ofilter); - indicate(""); - } + loadfilters(&ofilter); + indicate("");
tx_initmenu(&menu, 15, 35, (LINES - 16) / 2, (COLS - 35) / 2, BOXATTR, STDATTR, HIGHATTR, BARSTDATTR, BARHIGHATTR, DESCATTR); @@ -399,8 +390,6 @@ int main(int argc, char **argv) die("only one of -i|-d|-s|-z|-l|-g options must be used");
strcpy(current_logfile, ""); - strcpy(graphing_logfile, ""); - strcpy(graphing_filter, "");
if (f_opt) { removetags(); @@ -444,12 +433,6 @@ int main(int argc, char **argv) die("Your TERM variable is not set.\n" "Please set it to an appropriate value");
-#if 0 /* undocumented feature, will take care of it later */ - if (graphing_logfile[0] != '\0' && graphing_filter[0] == '\0') { - fprintf(stderr, "Specify an IP filter name with -F\n"); - exit(1); - } -#endif loadoptions();
/* @@ -466,10 +449,7 @@ int main(int argc, char **argv) freopen("/dev/null", "w", stderr); /* redirect std error */ signal(SIGUSR2, term_usr2_handler);
- if (graphing_logfile[0] != '\0') - options.logging = 0; /* if raw logging is specified */ - else /* then standard logging is disabled */ - options.logging = 1; + options.logging = 1; break; case -1: /* error */ die("Fork error, %s cannot run in background", IPTRAF_NAME); @@ -522,20 +502,12 @@ int main(int argc, char **argv) }
struct filterstate ofilter; - struct ffnode *fltfiles;
/* - * Load saved filter or graphing filter if specified + * Load saved filter */ - if (graphing_logfile[0] != '\0') { - loadfilterlist(&fltfiles); - memset(&ofilter, 0, sizeof(struct filterstate)); - loadfilter(pickfilterbyname(fltfiles, graphing_filter), - &(ofilter.fl), FLT_RESOLVE); - } else { - loadfilters(&ofilter); - indicate(""); - } + loadfilters(&ofilter); + indicate("");
/* bad, bad, bad name draw_desktop() * hide all into tui_top_panel(char *msg) diff --git a/src/log.c b/src/log.c index dfa2cd9..e956853 100644 --- a/src/log.c +++ b/src/log.c @@ -23,7 +23,6 @@ log.c - the iptraf logging facility int rotate_flag; char target_logname[TARGET_LOGNAME_MAX]; char current_logfile[TARGET_LOGNAME_MAX]; -char graphing_logfile[TARGET_LOGNAME_MAX];
/* * Generates a log file based on a template for a particular instance of diff --git a/src/logvars.h b/src/logvars.h index 41b2e5c..83e86df 100644 --- a/src/logvars.h +++ b/src/logvars.h @@ -4,6 +4,5 @@ extern int rotate_flag; extern char target_logname[160]; extern char current_logfile[160]; -extern char graphing_logfile[160];
#endif /* IPTRAF_NG_LOGVARS_H */
This patch reverts back to behaviour changed by "capture: introduce packet capturing" commit: when starting with -g, -i, -l, -d, -s or -z command line argument don't show the main program interface after exit from the given function.
Signed-off-by: Vitezslav Samel vitezslav@samel.cz --- src/iptraf.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/iptraf.c b/src/iptraf.c index b43c485..316efdd 100644 --- a/src/iptraf.c +++ b/src/iptraf.c @@ -535,8 +535,8 @@ int main(int argc, char **argv) servmon(s_opt, facilitytime, &ofilter); else if (z_opt) packet_size_breakdown(z_opt, facilitytime, &ofilter); - - program_interface(); + else + program_interface();
endwin();
When given any command line argument we must clear screen and properly update the screen too.
Signed-off-by: Vitezslav Samel vitezslav@samel.cz --- src/iptraf.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/iptraf.c b/src/iptraf.c index 316efdd..253d58c 100644 --- a/src/iptraf.c +++ b/src/iptraf.c @@ -248,10 +248,6 @@ static void program_interface(void) } while (!endloop);
tx_destroymenu(&menu); - - erase(); - update_panels(); - doupdate(); }
static int first_instance(void) @@ -538,6 +534,9 @@ int main(int argc, char **argv) else program_interface();
+ erase(); + update_panels(); + doupdate(); endwin();
if (is_first_instance)
Vitezslav Samel vitezslav@samel.cz writes:
Vitezslav Samel (3): kill unfinished work on graphing logging fix: show program interface only if not given any command line arg fix: clear screen before exit when given arg on cmdline
src/iptraf.c | 53 ++++++++++++----------------------------------------- src/log.c | 1 - src/logvars.h | 1 - 3 files changed, 12 insertions(+), 43 deletions(-)
all in.
iptraf-ng@lists.fedorahosted.org