comparison cli-runopts.c @ 449:3e6c536bc023

Add -W <windowsize> argument and document it.
author Matt Johnston <matt@ucc.asn.au>
date Wed, 25 Jul 2007 15:44:25 +0000
parents 2cd2edfa11ee
children 7e43f5e473b9
comparison
equal deleted inserted replaced
448:9c61e7af0156 449:3e6c536bc023
61 "-g Allow remote hosts to connect to forwarded ports\n" 61 "-g Allow remote hosts to connect to forwarded ports\n"
62 #endif 62 #endif
63 #ifdef ENABLE_CLI_REMOTETCPFWD 63 #ifdef ENABLE_CLI_REMOTETCPFWD
64 "-R <listenport:remotehost:remoteport> Remote port forwarding\n" 64 "-R <listenport:remotehost:remoteport> Remote port forwarding\n"
65 #endif 65 #endif
66 "-W <receive_window_buffer> (default %d, larger may be faster)\n"
66 #ifdef DEBUG_TRACE 67 #ifdef DEBUG_TRACE
67 "-v verbose\n" 68 "-v verbose\n"
68 #endif 69 #endif
69 ,DROPBEAR_VERSION, cli_opts.progname); 70 ,DROPBEAR_VERSION, cli_opts.progname, DEFAULT_RECV_WINDOW);
70 } 71 }
71 72
72 void cli_getopts(int argc, char ** argv) { 73 void cli_getopts(int argc, char ** argv) {
73 74
74 unsigned int i, j; 75 unsigned int i, j;
107 #endif 108 #endif
108 /* not yet 109 /* not yet
109 opts.ipv4 = 1; 110 opts.ipv4 = 1;
110 opts.ipv6 = 1; 111 opts.ipv6 = 1;
111 */ 112 */
113 opts.recv_window = DEFAULT_RECV_WINDOW;
114 char* recv_window_arg = NULL;
112 115
113 /* Iterate all the arguments */ 116 /* Iterate all the arguments */
114 for (i = 1; i < (unsigned int)argc; i++) { 117 for (i = 1; i < (unsigned int)argc; i++) {
115 #ifdef ENABLE_CLI_PUBKEY_AUTH 118 #ifdef ENABLE_CLI_PUBKEY_AUTH
116 if (nextiskey) { 119 if (nextiskey) {
198 printhelp(); 201 printhelp();
199 exit(EXIT_SUCCESS); 202 exit(EXIT_SUCCESS);
200 break; 203 break;
201 case 'u': 204 case 'u':
202 /* backwards compatibility with old urandom option */ 205 /* backwards compatibility with old urandom option */
206 break;
207 case 'W':
208 next = &recv_window_arg;
203 break; 209 break;
204 #ifdef DEBUG_TRACE 210 #ifdef DEBUG_TRACE
205 case 'v': 211 case 'v':
206 debug_trace = 1; 212 debug_trace = 1;
207 break; 213 break;
290 296
291 if (cli_opts.backgrounded && cli_opts.cmd == NULL 297 if (cli_opts.backgrounded && cli_opts.cmd == NULL
292 && cli_opts.no_cmd == 0) { 298 && cli_opts.no_cmd == 0) {
293 dropbear_exit("command required for -f"); 299 dropbear_exit("command required for -f");
294 } 300 }
301
302 if (recv_window_arg)
303 {
304 opts.recv_window = atol(recv_window_arg);
305 if (opts.recv_window == 0)
306 {
307 dropbear_exit("Bad recv window '%s'", recv_window_arg);
308 }
309 }
295 } 310 }
296 311
297 #ifdef ENABLE_CLI_PUBKEY_AUTH 312 #ifdef ENABLE_CLI_PUBKEY_AUTH
298 static void loadidentityfile(const char* filename) { 313 static void loadidentityfile(const char* filename) {
299 314