xref: /titanic_41/usr/src/cmd/ssh/include/hostfile.h (revision 442d23f49355a5d0694c758975be57af39f91a61)
1 /*
2  * Author: Tatu Ylonen <ylo@cs.hut.fi>
3  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4  *                    All rights reserved
5  *
6  * As far as I am concerned, the code I have written for this software
7  * can be used freely for any purpose.  Any derived versions of this
8  * software must be clearly marked as such, and if the derived work is
9  * incompatible with the protocol description in the RFC file, it must be
10  * called by a name other than "ssh" or "Secure Shell".
11  */
12 
13 #ifndef	_HOSTFILE_H
14 #define	_HOSTFILE_H
15 
16 /*	$OpenBSD: hostfile.h,v 1.12 2002/09/08 20:24:08 markus Exp $	*/
17 
18 #pragma ident	"%Z%%M%	%I%	%E% SMI"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 typedef enum {
25 	HOST_OK, HOST_NEW, HOST_CHANGED, HOST_FOUND
26 }       HostStatus;
27 
28 int	 hostfile_read_key(char **, u_int *, Key *);
29 HostStatus
30 check_host_in_hostfile(const char *, const char *, const Key *, Key *, int *);
31 int	add_host_to_hostfile(const char *, const char *, const Key *, int);
32 int
33 lookup_key_in_hostfile_by_type(const char *, const char *, int , Key *, int *);
34 
35 #define HASH_MAGIC	"|1|"
36 #define HASH_DELIM	'|'
37 
38 char	*host_hash(const char *, const char *, u_int);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif /* _HOSTFILE_H */
45