projects
/
liboping.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b819ef6
)
src/oping.c: Only print QoS information if it's not 0/0.
author
Florian Forster
<octo@verplant.org>
Wed, 27 Oct 2010 10:11:51 +0000
(12:11 +0200)
committer
Florian Forster
<octo@verplant.org>
Wed, 27 Oct 2010 10:11:51 +0000
(12:11 +0200)
src/oping.c
patch
|
blob
|
history
diff --git
a/src/oping.c
b/src/oping.c
index
84d97af
..
d84219e
100644
(file)
--- a/
src/oping.c
+++ b/
src/oping.c
@@
-881,11
+881,16
@@
static void update_host_hook (pingobj_iter_t *iter, /* {{{ */
|| (latency > (average + stddev)))
color = OPING_YELLOW;
|| (latency > (average + stddev)))
color = OPING_YELLOW;
- HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i qos=%s"
- " time=",
+ HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
data_len, context->host, context->addr,
sequence, recv_ttl,
format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
data_len, context->host, context->addr,
sequence, recv_ttl,
format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
+ if ((recv_qos != 0) || (opt_send_qos != 0))
+ {
+ HOST_PRINTF ("qos=%s ",
+ format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
+ }
+ HOST_PRINTF ("time=");
wattron (main_win, COLOR_PAIR(color));
HOST_PRINTF ("%.2f", latency);
wattroff (main_win, COLOR_PAIR(color));
wattron (main_win, COLOR_PAIR(color));
HOST_PRINTF ("%.2f", latency);
wattroff (main_win, COLOR_PAIR(color));
@@
-894,13
+899,16
@@
static void update_host_hook (pingobj_iter_t *iter, /* {{{ */
else
{
#endif
else
{
#endif
- HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i qos=%s"
- " time=%.2f ms\n",
+ HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
data_len,
context->host, context->addr,
data_len,
context->host, context->addr,
- sequence, recv_ttl,
- format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)),
- latency);
+ sequence, recv_ttl);
+ if ((recv_qos != 0) || (opt_send_qos != 0))
+ {
+ HOST_PRINTF ("qos=%s ",
+ format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
+ }
+ HOST_PRINTF ("time=%.2f ms\n", latency);
#if USE_NCURSES
}
#endif
#if USE_NCURSES
}
#endif