diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2015-07-25 19:56:59 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2015-07-26 20:31:24 +0200 |
commit | ad7cfbf4efca7a2716eba89994f5f8f8167cd51c (patch) | |
tree | bdbf98aa300cd7b282e95f5cc7fbbbf12faf2a6a /flowtop.c | |
parent | ba9ec2c4c5cfad8471eb1fffab4bdcc40404c2f9 (diff) |
flowtop: Change tcp param to 'bool is_tcp' in presenter_get_port(..)
Rename tcp -> is_tcp param and change it to bool.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'flowtop.c')
-rw-r--r-- | flowtop.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -681,7 +681,7 @@ static void flow_entry_get_extended(struct flow_entry *n) walk_processes(n); } -static uint16_t presenter_get_port(uint16_t src, uint16_t dst, int tcp) +static uint16_t presenter_get_port(uint16_t src, uint16_t dst, bool is_tcp) { if (src < dst && src < 1024) { return src; @@ -689,7 +689,7 @@ static uint16_t presenter_get_port(uint16_t src, uint16_t dst, int tcp) return dst; } else { const char *tmp1, *tmp2; - if (tcp) { + if (is_tcp) { tmp1 = lookup_port_tcp(src); tmp2 = lookup_port_tcp(dst); } else { @@ -770,12 +770,12 @@ static void presenter_screen_do_line(WINDOW *screen, struct flow_entry *n, /* Guess application port */ switch (n->l4_proto) { case IPPROTO_TCP: - port = presenter_get_port(n->port_src, n->port_dst, 1); + port = presenter_get_port(n->port_src, n->port_dst, true); pname = lookup_port_tcp(port); break; case IPPROTO_UDP: case IPPROTO_UDPLITE: - port = presenter_get_port(n->port_src, n->port_dst, 0); + port = presenter_get_port(n->port_src, n->port_dst, false); pname = lookup_port_udp(port); break; } @@ -932,7 +932,7 @@ static void presenter_screen_update(WINDOW *screen, struct flow_list *fl, for (; n; n = rcu_dereference(n->next)) { n->is_visible = false; - if (presenter_get_port(n->port_src, n->port_dst, 0) == 53) + if (presenter_get_port(n->port_src, n->port_dst, false) == 53) continue; if (presenter_flow_wrong_state(n)) |