From cab0e5a0fed570407a3e35a246c784b82953f5bb Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 18 Nov 2017 04:12:52 +0100 Subject: tools: Send time in oping packets The oping tool now stores the time it sent the packet inside the SDU, simplifying the implementation. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/tools/oping/oping.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/tools/oping/oping.c') diff --git a/src/tools/oping/oping.c b/src/tools/oping/oping.c index 6addbc58..18cc86ee 100644 --- a/src/tools/oping/oping.c +++ b/src/tools/oping/oping.c @@ -39,6 +39,7 @@ #define _POSIX_C_SOURCE 199506L #define __XSI_VISIBLE 500 +#include #include #include @@ -70,10 +71,6 @@ struct c { double rtt_avg; double rtt_m2; - /* needs locking */ - struct timespec * times; - pthread_mutex_t lock; - pthread_t reader_pt; pthread_t writer_pt; } client; @@ -92,7 +89,9 @@ struct s { struct oping_msg { uint32_t type; uint32_t id; -}; + uint64_t tv_sec; + uint64_t tv_nsec; +} __attribute__((packed)); #include "oping_client.c" @@ -177,11 +176,6 @@ int main(int argc, char ** argv) client.size = 64; } - if (client.count > 1000000) { - printf("Count truncated to 1 million SDUs.\n"); - client.count = 1000000; - } - ret = client_main(); } -- cgit v1.2.3