Add interactive command 'b' to change rate units to show.

Signed-off-by: Vadim Kochan <vadi...@gmail.com>
---
 flowtop.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/flowtop.c b/flowtop.c
index 463d12e..a70899a 100644
--- a/flowtop.c
+++ b/flowtop.c
@@ -1180,6 +1180,12 @@ static void draw_help(WINDOW *screen)
        mvaddnstr(row + 6, col + 3, "ESC           Close window", -1);
        mvaddnstr(row + 7, col + 3, "?             Show 'Help'", -1);
        mvaddnstr(row + 8, col + 3, "q, Ctrl+C     Quit", -1);
+
+       attron(A_BOLD | A_UNDERLINE);
+       mvaddnstr(row + 10, col + 2, "Display Settings", -1);
+       attroff(A_BOLD | A_UNDERLINE);
+
+       mvaddnstr(row + 12, col + 3, "b             Change rate units 
(bits/bytes)", -1);
 }
 
 static void draw_footer(WINDOW *screen)
@@ -1239,6 +1245,12 @@ static void presenter(void)
                        if (skip_lines > SCROLL_MAX)
                                skip_lines = SCROLL_MAX;
                        break;
+               case 'b':
+                       if (rate_type == RATE_BYTES)
+                               rate_type = RATE_BITS;
+                       else
+                               rate_type = RATE_BYTES;
+                       break;
                case '?':
                        if (show_help)
                                show_help = false;
-- 
2.6.1

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to