projects
/
liboping.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix printing the ToS value.
[liboping.git]
/
src
/
oping.c
diff --git
a/src/oping.c
b/src/oping.c
index
313b83d
..
0f8e413
100644
(file)
--- a/
src/oping.c
+++ b/
src/oping.c
@@
-25,6
+25,8
@@
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
+# include <stdint.h>
+# include <inttypes.h>
# include <errno.h>
# include <assert.h>
#else
# include <errno.h>
# include <assert.h>
#else
@@
-631,7
+633,7
@@
static void update_host_hook (pingobj_iter_t *iter, /* {{{ */
double latency;
unsigned int sequence;
int recv_ttl;
double latency;
unsigned int sequence;
int recv_ttl;
- u
nsigned
recv_tos;
+ u
int8_t
recv_tos;
size_t buffer_len;
size_t data_len;
ping_context_t *context;
size_t buffer_len;
size_t data_len;
ping_context_t *context;
@@
-694,8
+696,8
@@
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 tos=
%u "
- "time=",
+ HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i tos=
0x%02"PRIx8
+ "
time=",
data_len, context->host, context->addr,
sequence, recv_ttl, recv_tos);
wattron (main_win, COLOR_PAIR(color));
data_len, context->host, context->addr,
sequence, recv_ttl, recv_tos);
wattron (main_win, COLOR_PAIR(color));
@@
-706,8
+708,8
@@
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 tos=
%u "
- "time=%.2f ms\n",
+ HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i tos=
0x%02"PRIx8
+ "
time=%.2f ms\n",
data_len,
context->host, context->addr,
sequence, recv_ttl, recv_tos, latency);
data_len,
context->host, context->addr,
sequence, recv_ttl, recv_tos, latency);