summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-12-16 22:12:07 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-12-21 14:31:26 +0100
commit8fe5a36685c88220157164ac5a5bc002e8eec273 (patch)
treea98694049f47505e850fe7869449226b9d90955a
parenta8931ffedd1662d22efbe542b2464ceb55644cb3 (diff)
flowtop: Show selected proto family
Show family name in the filter status line. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--flowtop.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/flowtop.c b/flowtop.c
index d38dbd1..52e4bef 100644
--- a/flowtop.c
+++ b/flowtop.c
@@ -1145,15 +1145,24 @@ static void draw_flows(WINDOW *screen, struct flow_list *fl,
maxy -= (2 + (show_src ? 1 : 0));
}
- mvwprintw(screen, 1, 2,
- "Kernel netfilter flows(%u) for %s%s%s%s%s%s"
- "[+%d]", flows, what & INCLUDE_TCP ? "TCP, " : "",
- what & INCLUDE_UDP ? "UDP, " : "",
- what & INCLUDE_SCTP ? "SCTP, " : "",
- what & INCLUDE_DCCP ? "DCCP, " : "",
- what & INCLUDE_ICMP && what & INCLUDE_IPV4 ? "ICMP, " : "",
- what & INCLUDE_ICMP && what & INCLUDE_IPV6 ? "ICMP6, " : "",
- skip_lines);
+ mvwprintw(screen, 1, 2, "Kernel netfilter flows(%u) for ", flows);
+ if (what & INCLUDE_IPV4)
+ printw("IPv4,");
+ if (what & INCLUDE_IPV6)
+ printw("IPv6,");
+ if (what & INCLUDE_TCP)
+ printw("TCP,");
+ if (what & INCLUDE_UDP)
+ printw("UDP,");
+ if (what & INCLUDE_SCTP)
+ printw("SCTP,");
+ if (what & INCLUDE_DCCP)
+ printw("DCCP,");
+ if (what & INCLUDE_ICMP && what & INCLUDE_IPV4)
+ printw("ICMP,");
+ if (what & INCLUDE_ICMP && what & INCLUDE_IPV6)
+ printw("ICMP6,");
+ printw(" [+%d]", skip_lines);
if (is_flow_collecting)
printw(" [Collecting flows ...]");