Mercurial > dropbear
comparison svr-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 |
---|---|
78 "-P PidFile Create pid file PidFile\n" | 78 "-P PidFile Create pid file PidFile\n" |
79 " (default %s)\n" | 79 " (default %s)\n" |
80 #ifdef INETD_MODE | 80 #ifdef INETD_MODE |
81 "-i Start for inetd\n" | 81 "-i Start for inetd\n" |
82 #endif | 82 #endif |
83 "-W <receive_window_buffer> (default %d, larger may be faster)\n" | |
83 #ifdef DEBUG_TRACE | 84 #ifdef DEBUG_TRACE |
84 "-v verbose\n" | 85 "-v verbose\n" |
85 #endif | 86 #endif |
86 ,DROPBEAR_VERSION, progname, | 87 ,DROPBEAR_VERSION, progname, |
87 #ifdef DROPBEAR_DSS | 88 #ifdef DROPBEAR_DSS |
88 DSS_PRIV_FILENAME, | 89 DSS_PRIV_FILENAME, |
89 #endif | 90 #endif |
90 #ifdef DROPBEAR_RSA | 91 #ifdef DROPBEAR_RSA |
91 RSA_PRIV_FILENAME, | 92 RSA_PRIV_FILENAME, |
92 #endif | 93 #endif |
93 DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT, DROPBEAR_PIDFILE); | 94 DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT, DROPBEAR_PIDFILE, DEFAULT_RECV_WINDOW); |
94 } | 95 } |
95 | 96 |
96 void svr_getopts(int argc, char ** argv) { | 97 void svr_getopts(int argc, char ** argv) { |
97 | 98 |
98 unsigned int i; | 99 unsigned int i; |
126 svr_opts.domotd = 1; | 127 svr_opts.domotd = 1; |
127 #endif | 128 #endif |
128 #ifndef DISABLE_SYSLOG | 129 #ifndef DISABLE_SYSLOG |
129 svr_opts.usingsyslog = 1; | 130 svr_opts.usingsyslog = 1; |
130 #endif | 131 #endif |
132 opts.recv_window = DEFAULT_RECV_WINDOW; | |
133 char* recv_window_arg = NULL; | |
131 #ifdef ENABLE_SVR_REMOTETCPFWD | 134 #ifdef ENABLE_SVR_REMOTETCPFWD |
132 opts.listen_fwd_all = 0; | 135 opts.listen_fwd_all = 0; |
133 #endif | 136 #endif |
134 | 137 |
135 for (i = 1; i < (unsigned int)argc; i++) { | 138 for (i = 1; i < (unsigned int)argc; i++) { |
202 break; | 205 break; |
203 #endif | 206 #endif |
204 case 'w': | 207 case 'w': |
205 svr_opts.norootlogin = 1; | 208 svr_opts.norootlogin = 1; |
206 break; | 209 break; |
210 case 'W': | |
211 next = &recv_window_arg; | |
212 break; | |
207 #if defined(ENABLE_SVR_PASSWORD_AUTH) || defined(ENABLE_SVR_PAM_AUTH) | 213 #if defined(ENABLE_SVR_PASSWORD_AUTH) || defined(ENABLE_SVR_PAM_AUTH) |
208 case 's': | 214 case 's': |
209 svr_opts.noauthpass = 1; | 215 svr_opts.noauthpass = 1; |
210 break; | 216 break; |
211 case 'g': | 217 case 'g': |
263 if (buf_readfile(svr_opts.banner, svr_opts.bannerfile)!=DROPBEAR_SUCCESS) { | 269 if (buf_readfile(svr_opts.banner, svr_opts.bannerfile)!=DROPBEAR_SUCCESS) { |
264 dropbear_exit("Error reading banner file '%s'", | 270 dropbear_exit("Error reading banner file '%s'", |
265 svr_opts.bannerfile); | 271 svr_opts.bannerfile); |
266 } | 272 } |
267 buf_setpos(svr_opts.banner, 0); | 273 buf_setpos(svr_opts.banner, 0); |
268 } | 274 |
269 | 275 } |
276 | |
277 if (recv_window_arg) | |
278 { | |
279 opts.recv_window = atol(recv_window_arg); | |
280 if (opts.recv_window == 0) | |
281 { | |
282 dropbear_exit("Bad recv window '%s'", recv_window_arg); | |
283 } | |
284 } | |
270 } | 285 } |
271 | 286 |
272 static void addportandaddress(char* spec) { | 287 static void addportandaddress(char* spec) { |
273 | 288 |
274 char *myspec = NULL; | 289 char *myspec = NULL; |