summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-04-17 20:31:26 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-04-18 16:36:24 +0200
commite9bd3cd92b7f48d6550b328421d74f6554598e04 (patch)
tree6c87d7911db601e9076a3a06aac9a7bfc369f036
parent28de5698cece520251b966e7e41d256517f97d44 (diff)
flowtop: Add display option to show src info
Add 's' key option to toggle source peer info at runtime, behaviour is the same like for '-s' command line option. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--flowtop.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/flowtop.c b/flowtop.c
index 119e2f9..aac8b80 100644
--- a/flowtop.c
+++ b/flowtop.c
@@ -784,10 +784,8 @@ static void flow_entry_get_extended(struct flow_entry *n)
if (n->flow_id == 0)
return;
- if (show_src) {
- flow_entry_get_extended_revdns(n, FLOW_DIR_SRC);
- flow_entry_get_extended_geo(n, FLOW_DIR_SRC);
- }
+ flow_entry_get_extended_revdns(n, FLOW_DIR_SRC);
+ flow_entry_get_extended_geo(n, FLOW_DIR_SRC);
flow_entry_get_extended_revdns(n, FLOW_DIR_DST);
flow_entry_get_extended_geo(n, FLOW_DIR_DST);
@@ -1189,12 +1187,13 @@ static void draw_help(WINDOW *screen)
mvaddnstr(row + 11, col + 3, "b Toggle rate units (bits/bytes)", -1);
mvaddnstr(row + 12, col + 3, "a Toggle display of active flows (rate > 0) only", -1);
+ mvaddnstr(row + 13, col + 3, "s Toggle show source peer info", -1);
- mvaddnstr(row + 14, col + 3, "T Toggle display TCP flows", -1);
- mvaddnstr(row + 15, col + 3, "U Toggle display UDP flows", -1);
- mvaddnstr(row + 16, col + 3, "D Toggle display DCCP flows", -1);
- mvaddnstr(row + 17, col + 3, "I Toggle display ICMP flows", -1);
- mvaddnstr(row + 18, col + 3, "S Toggle display SCTP flows", -1);
+ mvaddnstr(row + 15, col + 3, "T Toggle display TCP flows", -1);
+ mvaddnstr(row + 16, col + 3, "U Toggle display UDP flows", -1);
+ mvaddnstr(row + 17, col + 3, "D Toggle display DCCP flows", -1);
+ mvaddnstr(row + 18, col + 3, "I Toggle display ICMP flows", -1);
+ mvaddnstr(row + 19, col + 3, "S Toggle display SCTP flows", -1);
}
static void draw_header(WINDOW *screen)
@@ -1300,6 +1299,9 @@ static void presenter(void)
case 'a':
show_active_only = !show_active_only;
break;
+ case 's':
+ show_src = !show_src;
+ break;
case '?':
show_help = !show_help;
wclear(screen);