summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c44
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"
10RCSID("$OpenBSD: ssh-keyscan.c,v 1.23 2001/06/05 05:05:39 pvalchev Exp $"); 10RCSID("$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
93Linebuf * 93static Linebuf *
94Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) 94Linebuf_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
127void 127static void
128Linebuf_free(Linebuf * lb) 128Linebuf_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
135void 135#if 0
136static void
136Linebuf_restart(Linebuf * lb) 137Linebuf_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
143int 144static int
144Linebuf_lineno(Linebuf * lb) 145Linebuf_lineno(Linebuf * lb)
145{ 146{
146 return (lb->lineno); 147 return (lb->lineno);
147} 148}
149#endif
148 150
149char * 151static char *
150Linebuf_getline(Linebuf * lb) 152Linebuf_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
186int 188static int
187fdlim_get(int hard) 189fdlim_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
205int 207static int
206fdlim_set(int lim) 208fdlim_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 */
230char * 232static char *
231xstrsep(char **str, const char *delim) 233xstrsep(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 */
252char * 254static char *
253strnnsep(char **stringp, char *delim) 255strnnsep(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
263void 265static void
264keyprint(char *host, char *output_name, char *kd, int len) 266keyprint(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
298int 300static int
299tcpconnect(char *host) 301tcpconnect(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
331int 333static int
332conalloc(char *iname, char *oname) 334conalloc(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
369void 371static void
370confree(int s) 372confree(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
385void 387static void
386contouch(int s) 388contouch(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
394int 396static int
395conrecycle(int s) 397conrecycle(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
410void 412static void
411congreet(int s) 413congreet(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
445void 447static void
446conread(int s) 448conread(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
485void 487static void
486conloop(void) 488conloop(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
537char * 539static char *
538nexthost(int argc, char **argv) 540nexthost(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
580void 582static void
581usage(void) 583usage(void)
582{ 584{
583 fatal("usage: %s [-t timeout] { [--] host | -f file } ...", __progname); 585 fatal("usage: %s [-t timeout] { [--] host | -f file } ...", __progname);