From 8fe5a36685c88220157164ac5a5bc002e8eec273 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Wed, 16 Dec 2015 22:12:07 +0200 Subject: flowtop: Show selected proto family Show family name in the filter status line. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- flowtop.c | 27 ++++++++++++++++++--------- 1 file 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 ...]"); -- cgit v1.2.3-54-g00ecf