aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/akcom-udpecho.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/akcom-udpecho.c')
-rw-r--r--src/akcom-udpecho.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/akcom-udpecho.c b/src/akcom-udpecho.c
index 085f4ca..09ed20c 100644
--- a/src/akcom-udpecho.c
+++ b/src/akcom-udpecho.c
@@ -161,7 +161,7 @@ typedef struct udp_echo_plus
161static const char * prog_name = PROGRAM_NAME; 161static const char * prog_name = PROGRAM_NAME;
162static uint32_t cnf_count = 0; 162static uint32_t cnf_count = 0;
163static int cnf_debug = 0; 163static int cnf_debug = 0;
164static int cnf_echoplus = 0; 164static int cnf_echoplus = -1;
165static int cnf_verbose = 0; 165static int cnf_verbose = 0;
166static int cnf_silent = 0; 166static int cnf_silent = 0;
167static unsigned long cnf_timeout = 5; 167static unsigned long cnf_timeout = 5;
@@ -297,7 +297,7 @@ main(
297 cnf_echoplus = 1; 297 cnf_echoplus = 1;
298 break; 298 break;
299 299
300 case 'E': 300 case 'r':
301 cnf_echoplus = 0; 301 cnf_echoplus = 0;
302 break; 302 break;
303 303
@@ -551,6 +551,8 @@ my_loop(
551 stats_max_adj = ( (!(stats_max_adj)) || (pckt_time_adj > stats_max_adj) ) ? pckt_time_adj : stats_max_adj; 551 stats_max_adj = ( (!(stats_max_adj)) || (pckt_time_adj > stats_max_adj) ) ? pckt_time_adj : stats_max_adj;
552 552
553 // print packet 553 // print packet
554 if (cnf_echoplus == -1)
555 cnf_echoplus = (((rcvbuff->res_sn)) || ((rcvbuff->recv_time)) || ((rcvbuff->reply_time))) ? 1 : 0;
554 if (!(cnf_echoplus)) 556 if (!(cnf_echoplus))
555 { 557 {
556 printf("udpecho_seq=%u time=%" PRIu64 ".%" PRIu64 " ms\n", 558 printf("udpecho_seq=%u time=%" PRIu64 ".%" PRIu64 " ms\n",
@@ -723,10 +725,10 @@ my_usage(
723 printf(" -6 connect via IPv6 only\n"); 725 printf(" -6 connect via IPv6 only\n");
724 printf(" -c count stop after sending count packets\n"); 726 printf(" -c count stop after sending count packets\n");
725 printf(" -d, --debug print packet debugging information\n"); 727 printf(" -d, --debug print packet debugging information\n");
726 printf(" -e, --echoplus expect echo plus response%s\n", ((cnf_echoplus)) ? " (default)" : ""); 728 printf(" -e, --echoplus expect echo plus response%s\n", (cnf_echoplus == 1) ? " (default)" : "");
727 printf(" -h, --help print this help and exit\n"); 729 printf(" -h, --help print this help and exit\n");
728 printf(" -i interval interval between packet (default: %lu sec)\n", cnf_interval); 730 printf(" -i interval interval between packet (default: %lu sec)\n", cnf_interval);
729 printf(" -r, --rfc expect RFC compliant echo response%s\n", (!(cnf_echoplus)) ? " (default)" : ""); 731 printf(" -r, --rfc expect RFC compliant echo response%s\n", (cnf_echoplus == 0) ? " (default)" : "");
730 printf(" -q, --quiet, --silent do not print messages\n"); 732 printf(" -q, --quiet, --silent do not print messages\n");
731 printf(" -s packetsize size of data bytes to be sent. (default: %zu bytes)\n", cnf_packetsize); 733 printf(" -s packetsize size of data bytes to be sent. (default: %zu bytes)\n", cnf_packetsize);
732 printf(" -t sec response timeout (default: %lu sec)\n", cnf_timeout); 734 printf(" -t sec response timeout (default: %lu sec)\n", cnf_timeout);