aboutsummaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorMasaq- <tilt@techie.com>2019-02-21 05:11:07 +0000
committerMasaq- <tilt@techie.com>2019-02-21 05:11:07 +0000
commit3245b7777503e1edb8e0a98d2375b3802ca29ee1 (patch)
treedaca05079757f4506bc7b51c27e8c3c57b7af163 /src/options.c
parentbbacf7a27f42147ed587c5e59b0f60c76e5248dd (diff)
-E --empty-pings compensate for ICMP sequence number inspection
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/options.c b/src/options.c
index 85b8a9c..66c44a6 100644
--- a/src/options.c
+++ b/src/options.c
@@ -144,7 +144,7 @@ static const struct option_usage usage[] = {
/** --ack-interval */
{"milliseconds", 0, OPT_DEC32, {.unum = 1000},
"Tune the explicit acknowledgement interval (in milliseconds)\n"
- "Decreasing the acknowlegement interval can improve NAT stability.\n"
+ "Decreasing the acknowledgement interval can improve NAT stability.\n"
},
/** --resend-interval */
{"milliseconds", 0, OPT_DEC32, {.unum = 1500},
@@ -157,6 +157,11 @@ static const struct option_usage usage[] = {
"Decreasing the payload size can avoid corruption of large packets.\n"
"Increasing the payload size can compensate for out-of-order delivery.\n"
},
+ /** --empty-pings */
+ {"count", 0, OPT_DEC32, {.unum = 0},
+ "Tune the number of empty pings to send with each explicit acknowledgement.\n"
+ "Empty pings can compensate for ICMP sequence number inspection.\n"
+ },
/** --daemon */
{"pidfile", 0, OPT_STR, {.str = "/run/ptunnel.pid"},
#ifdef WIN32
@@ -223,6 +228,7 @@ static struct option long_options[] = {
{"ack-interval", required_argument, 0, 'a'},
{"resend-interval", required_argument, 0, 't'},
{"payload-size", required_argument, 0, 'y'},
+ {"empty-pings", required_argument, 0, 'E'},
{"daemon", optional_argument, 0, 'd'},
{"syslog", no_argument, 0, 'S'},
{"user", optional_argument, 0, 'u'},
@@ -409,7 +415,7 @@ int parse_options(int argc, char **argv) {
* since you have to pass long options as '--option=value'. Commonly used
* '--option value' is *NOT* allowed for some libc implementations.
*/
- c = getopt_long(argc, argv, "m:p:l:r::R::c:v:L::o::sP:d::Su::g::C::e::w:a:t:y:h", &long_options[0], &oidx);
+ c = getopt_long(argc, argv, "m:p:l:r::R::c:v:L::o::sP:d::Su::g::C::e::w:a:t:y:E:h", &long_options[0], &oidx);
if (c == -1) break;
switch (c) {
@@ -578,6 +584,11 @@ int parse_options(int argc, char **argv) {
break;
opts.payload_size = atoi(optarg);
break;
+ case 'E':
+ if (!optarg)
+ break;
+ opts.empty_pings = atoi(optarg);
+ break;
case 'h':
print_usage(argv[0]);
exit(EXIT_SUCCESS);