summaryrefslogtreecommitdiff
path: root/src/tools/oping/oping.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2023-03-14 12:50:28 +0100
committerSander Vrijders <[email protected]>2023-03-18 17:12:27 +0100
commit9ce5f6b0b1ae281bfa82df31a92026d946366286 (patch)
tree18d44da9eb6b499a6dbfa89d890fe4d501196776 /src/tools/oping/oping.c
parent99b4f4d6d6f18321489bae50f1762b29165f7de1 (diff)
downloadouroboros-9ce5f6b0b1ae281bfa82df31a92026d946366286.tar.gz
ouroboros-9ce5f6b0b1ae281bfa82df31a92026d946366286.zip
tools: Add raw_crypt spec to oping help message
The oping tool supports an encrypted raw flow (qos_raw_crypt), but this was not mentioned in the help. Some minor refactoring. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/tools/oping/oping.c')
-rw-r--r--src/tools/oping/oping.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/tools/oping/oping.c b/src/tools/oping/oping.c
index cfb2fb55..15cba04b 100644
--- a/src/tools/oping/oping.c
+++ b/src/tools/oping/oping.c
@@ -60,14 +60,31 @@
#include <errno.h>
#include <float.h>
-#define OPING_BUF_SIZE 1500
-
-#define ECHO_REQUEST 0
-#define ECHO_REPLY 1
-
+#define OPING_BUF_SIZE 1500
+#define ECHO_REQUEST 0
+#define ECHO_REPLY 1
#define OPING_MAX_FLOWS 256
-struct c {
+#define USAGE_STRING \
+"Usage: oping [OPTION]...\n" \
+"\n" \
+"Checks liveness between a client and a server\n" \
+"and reports the Round Trip Time (RTT)\n" \
+"\n" \
+" -l, --listen Run in server mode\n" \
+"\n" \
+" -c, --count Number of packets\n" \
+" -d, --duration Duration of the test (default 1s)\n" \
+" -i, --interval Interval (default 1000ms)\n" \
+" -n, --server-name Name of the oping server\n" \
+" -q, --qos QoS (raw, raw_crypt, best, video, voice, data)\n" \
+" -s, --size Payload size (B, default 64)\n" \
+" -Q, --quiet Only print final statistics\n" \
+" -D, --timeofday Print time of day before each line\n" \
+"\n" \
+" --help Display this help text and exit\n" \
+
+struct {
char * s_apn;
int interval;
uint32_t count;
@@ -90,7 +107,7 @@ struct c {
pthread_t writer_pt;
} client;
-struct s {
+struct {
struct timespec times[OPING_MAX_FLOWS];
fset_t * flows;
fqueue_t * fq;
@@ -116,22 +133,7 @@ struct oping_msg {
static void usage(void)
{
- printf("Usage: oping [OPTION]...\n"
- "Checks liveness between a client and a server\n"
- "and reports the Round Trip Time (RTT)\n\n"
- " -l, --listen Run in server mode\n"
- "\n"
- " -c, --count Number of packets\n"
- " -d, --duration Duration of the test (default 1s)\n"
- " -i, --interval Interval (default 1000ms)\n"
- " -n, --server-name Name of the oping server\n"
- " -q, --qos QoS (raw, best, video, voice, data)"
- "\n"
- " -s, --size Payload size (B, default 64)\n"
- " -Q, --quiet Only print final statistics\n"
- " -D, --timeofday Print time of day before each line"
- "\n"
- " --help Display this help text and exit\n");
+ printf(USAGE_STRING);
}
/* Times are in ms. */