diff options
author | Dimitri Staessens <dimitri.staessens@ugent.be> | 2017-11-18 04:12:52 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-11-19 10:32:22 +0100 |
commit | cab0e5a0fed570407a3e35a246c784b82953f5bb (patch) | |
tree | ebd6223a2a1b886035483dcca13434c88bb8699d /src/tools/oping/oping.c | |
parent | 5a7101e54002188770441fb2fd9f64a00bb661c6 (diff) | |
download | ouroboros-cab0e5a0fed570407a3e35a246c784b82953f5bb.tar.gz ouroboros-cab0e5a0fed570407a3e35a246c784b82953f5bb.zip |
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 <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/tools/oping/oping.c')
-rw-r--r-- | src/tools/oping/oping.c | 14 |
1 files changed, 4 insertions, 10 deletions
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 <ouroboros/endian.h> #include <ouroboros/fqueue.h> #include <ouroboros/dev.h> @@ -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(); } |