diff options
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r-- | ssh-keyscan.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index da34f7c63..9f7aa94aa 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "includes.h" | 9 | #include "includes.h" |
10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.23 2001/06/05 05:05:39 pvalchev Exp $"); | 10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.24 2001/06/23 15:12:20 itojun Exp $"); |
11 | 11 | ||
12 | #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) | 12 | #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) |
13 | #include <sys/queue.h> | 13 | #include <sys/queue.h> |
@@ -90,7 +90,7 @@ typedef struct { | |||
90 | void (*errfun) (const char *,...); | 90 | void (*errfun) (const char *,...); |
91 | } Linebuf; | 91 | } Linebuf; |
92 | 92 | ||
93 | Linebuf * | 93 | static Linebuf * |
94 | Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) | 94 | Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) |
95 | { | 95 | { |
96 | Linebuf *lb; | 96 | Linebuf *lb; |
@@ -124,7 +124,7 @@ Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) | |||
124 | return (lb); | 124 | return (lb); |
125 | } | 125 | } |
126 | 126 | ||
127 | void | 127 | static void |
128 | Linebuf_free(Linebuf * lb) | 128 | Linebuf_free(Linebuf * lb) |
129 | { | 129 | { |
130 | fclose(lb->stream); | 130 | fclose(lb->stream); |
@@ -132,7 +132,8 @@ Linebuf_free(Linebuf * lb) | |||
132 | xfree(lb); | 132 | xfree(lb); |
133 | } | 133 | } |
134 | 134 | ||
135 | void | 135 | #if 0 |
136 | static void | ||
136 | Linebuf_restart(Linebuf * lb) | 137 | Linebuf_restart(Linebuf * lb) |
137 | { | 138 | { |
138 | clearerr(lb->stream); | 139 | clearerr(lb->stream); |
@@ -140,13 +141,14 @@ Linebuf_restart(Linebuf * lb) | |||
140 | lb->lineno = 0; | 141 | lb->lineno = 0; |
141 | } | 142 | } |
142 | 143 | ||
143 | int | 144 | static int |
144 | Linebuf_lineno(Linebuf * lb) | 145 | Linebuf_lineno(Linebuf * lb) |
145 | { | 146 | { |
146 | return (lb->lineno); | 147 | return (lb->lineno); |
147 | } | 148 | } |
149 | #endif | ||
148 | 150 | ||
149 | char * | 151 | static char * |
150 | Linebuf_getline(Linebuf * lb) | 152 | Linebuf_getline(Linebuf * lb) |
151 | { | 153 | { |
152 | int n = 0; | 154 | int n = 0; |
@@ -183,7 +185,7 @@ Linebuf_getline(Linebuf * lb) | |||
183 | } | 185 | } |
184 | } | 186 | } |
185 | 187 | ||
186 | int | 188 | static int |
187 | fdlim_get(int hard) | 189 | fdlim_get(int hard) |
188 | { | 190 | { |
189 | #if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) | 191 | #if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) |
@@ -202,7 +204,7 @@ fdlim_get(int hard) | |||
202 | #endif | 204 | #endif |
203 | } | 205 | } |
204 | 206 | ||
205 | int | 207 | static int |
206 | fdlim_set(int lim) | 208 | fdlim_set(int lim) |
207 | { | 209 | { |
208 | #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE) | 210 | #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE) |
@@ -227,7 +229,7 @@ fdlim_set(int lim) | |||
227 | * separators. This is the same as the 4.4BSD strsep, but different from the | 229 | * separators. This is the same as the 4.4BSD strsep, but different from the |
228 | * one in the GNU libc. | 230 | * one in the GNU libc. |
229 | */ | 231 | */ |
230 | char * | 232 | static char * |
231 | xstrsep(char **str, const char *delim) | 233 | xstrsep(char **str, const char *delim) |
232 | { | 234 | { |
233 | char *s, *e; | 235 | char *s, *e; |
@@ -249,7 +251,7 @@ xstrsep(char **str, const char *delim) | |||
249 | * Get the next non-null token (like GNU strsep). Strsep() will return a | 251 | * Get the next non-null token (like GNU strsep). Strsep() will return a |
250 | * null token for two adjacent separators, so we may have to loop. | 252 | * null token for two adjacent separators, so we may have to loop. |
251 | */ | 253 | */ |
252 | char * | 254 | static char * |
253 | strnnsep(char **stringp, char *delim) | 255 | strnnsep(char **stringp, char *delim) |
254 | { | 256 | { |
255 | char *tok; | 257 | char *tok; |
@@ -260,7 +262,7 @@ strnnsep(char **stringp, char *delim) | |||
260 | return (tok); | 262 | return (tok); |
261 | } | 263 | } |
262 | 264 | ||
263 | void | 265 | static void |
264 | keyprint(char *host, char *output_name, char *kd, int len) | 266 | keyprint(char *host, char *output_name, char *kd, int len) |
265 | { | 267 | { |
266 | static Key *rsa; | 268 | static Key *rsa; |
@@ -295,7 +297,7 @@ keyprint(char *host, char *output_name, char *kd, int len) | |||
295 | fputs("\n", stdout); | 297 | fputs("\n", stdout); |
296 | } | 298 | } |
297 | 299 | ||
298 | int | 300 | static int |
299 | tcpconnect(char *host) | 301 | tcpconnect(char *host) |
300 | { | 302 | { |
301 | struct addrinfo hints, *ai, *aitop; | 303 | struct addrinfo hints, *ai, *aitop; |
@@ -328,7 +330,7 @@ tcpconnect(char *host) | |||
328 | return s; | 330 | return s; |
329 | } | 331 | } |
330 | 332 | ||
331 | int | 333 | static int |
332 | conalloc(char *iname, char *oname) | 334 | conalloc(char *iname, char *oname) |
333 | { | 335 | { |
334 | int s; | 336 | int s; |
@@ -366,7 +368,7 @@ conalloc(char *iname, char *oname) | |||
366 | return (s); | 368 | return (s); |
367 | } | 369 | } |
368 | 370 | ||
369 | void | 371 | static void |
370 | confree(int s) | 372 | confree(int s) |
371 | { | 373 | { |
372 | if (s >= maxfd || fdcon[s].c_status == CS_UNUSED) | 374 | if (s >= maxfd || fdcon[s].c_status == CS_UNUSED) |
@@ -382,7 +384,7 @@ confree(int s) | |||
382 | ncon--; | 384 | ncon--; |
383 | } | 385 | } |
384 | 386 | ||
385 | void | 387 | static void |
386 | contouch(int s) | 388 | contouch(int s) |
387 | { | 389 | { |
388 | TAILQ_REMOVE(&tq, &fdcon[s], c_link); | 390 | TAILQ_REMOVE(&tq, &fdcon[s], c_link); |
@@ -391,7 +393,7 @@ contouch(int s) | |||
391 | TAILQ_INSERT_TAIL(&tq, &fdcon[s], c_link); | 393 | TAILQ_INSERT_TAIL(&tq, &fdcon[s], c_link); |
392 | } | 394 | } |
393 | 395 | ||
394 | int | 396 | static int |
395 | conrecycle(int s) | 397 | conrecycle(int s) |
396 | { | 398 | { |
397 | int ret; | 399 | int ret; |
@@ -407,7 +409,7 @@ conrecycle(int s) | |||
407 | return (ret); | 409 | return (ret); |
408 | } | 410 | } |
409 | 411 | ||
410 | void | 412 | static void |
411 | congreet(int s) | 413 | congreet(int s) |
412 | { | 414 | { |
413 | char buf[80], *cp; | 415 | char buf[80], *cp; |
@@ -442,7 +444,7 @@ congreet(int s) | |||
442 | contouch(s); | 444 | contouch(s); |
443 | } | 445 | } |
444 | 446 | ||
445 | void | 447 | static void |
446 | conread(int s) | 448 | conread(int s) |
447 | { | 449 | { |
448 | int n; | 450 | int n; |
@@ -482,7 +484,7 @@ conread(int s) | |||
482 | contouch(s); | 484 | contouch(s); |
483 | } | 485 | } |
484 | 486 | ||
485 | void | 487 | static void |
486 | conloop(void) | 488 | conloop(void) |
487 | { | 489 | { |
488 | fd_set *r, *e; | 490 | fd_set *r, *e; |
@@ -534,7 +536,7 @@ conloop(void) | |||
534 | } | 536 | } |
535 | } | 537 | } |
536 | 538 | ||
537 | char * | 539 | static char * |
538 | nexthost(int argc, char **argv) | 540 | nexthost(int argc, char **argv) |
539 | { | 541 | { |
540 | static Linebuf *lb; | 542 | static Linebuf *lb; |
@@ -577,7 +579,7 @@ nexthost(int argc, char **argv) | |||
577 | } | 579 | } |
578 | } | 580 | } |
579 | 581 | ||
580 | void | 582 | static void |
581 | usage(void) | 583 | usage(void) |
582 | { | 584 | { |
583 | fatal("usage: %s [-t timeout] { [--] host | -f file } ...", __progname); | 585 | fatal("usage: %s [-t timeout] { [--] host | -f file } ...", __progname); |