summaryrefslogtreecommitdiff
path: root/cli-runopts.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli-runopts.c')
-rw-r--r--cli-runopts.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/cli-runopts.c b/cli-runopts.c
index ca58899..c8f2d7e 100644
--- a/cli-runopts.c
+++ b/cli-runopts.c
@@ -70,6 +70,7 @@ static void printhelp() {
#endif
"-W <receive_window_buffer> (default %d, larger may be faster, max 1MB)\n"
"-K <keepalive> (0 is never, default %d)\n"
+ "-I <idle_timeout> (0 is never, default %d)\n"
#ifdef ENABLE_CLI_NETCAT
"-B <endhost:endport> Netcat-alike bouncing\n"
#endif
@@ -80,7 +81,7 @@ static void printhelp() {
"-v verbose\n"
#endif
,DROPBEAR_VERSION, cli_opts.progname,
- DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE);
+ DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE, DEFAULT_IDLE_TIMEOUT);
}
@@ -105,6 +106,7 @@ void cli_getopts(int argc, char ** argv) {
char* recv_window_arg = NULL;
char* keepalive_arg = NULL;
+ char* idle_timeout_arg = NULL;
/* see printhelp() for options */
cli_opts.progname = argv[0];
@@ -252,6 +254,9 @@ void cli_getopts(int argc, char ** argv) {
case 'K':
next = &keepalive_arg;
break;
+ case 'I':
+ next = &idle_timeout_arg;
+ break;
#ifdef DEBUG_TRACE
case 'v':
debug_trace = 1;
@@ -359,6 +364,11 @@ void cli_getopts(int argc, char ** argv) {
dropbear_exit("Bad keepalive '%s'", keepalive_arg);
}
}
+ if (idle_timeout_arg) {
+ if (m_str_to_uint(idle_timeout_arg, &opts.idle_timeout_secs) == DROPBEAR_FAILURE) {
+ dropbear_exit("Bad idle_timeout '%s'", idle_timeout_arg);
+ }
+ }
#ifdef ENABLE_CLI_NETCAT
if (cli_opts.cmd && cli_opts.netcat_host) {