1 /*	$NetBSD: hostfile.h,v 1.3 2010/11/21 18:29:48 adam Exp $	*/
2 /* $OpenBSD: hostfile.h,v 1.18 2010/03/04 10:36:03 djm Exp $ */
3 
4 /*
5  * Author: Tatu Ylonen <ylo@cs.hut.fi>
6  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
7  *                    All rights reserved
8  *
9  * As far as I am concerned, the code I have written for this software
10  * can be used freely for any purpose.  Any derived versions of this
11  * software must be clearly marked as such, and if the derived work is
12  * incompatible with the protocol description in the RFC file, it must be
13  * called by a name other than "ssh" or "Secure Shell".
14  */
15 #ifndef HOSTFILE_H
16 #define HOSTFILE_H
17 
18 typedef enum {
19 	HOST_OK, HOST_NEW, HOST_CHANGED, HOST_REVOKED, HOST_FOUND
20 }       HostStatus;
21 
22 int	 hostfile_read_key(char **, u_int *, Key *);
23 HostStatus check_host_in_hostfile(const char *, const char *,
24 	    const Key *, Key *, int *);
25 int	add_host_to_hostfile(const char *, const char *, const Key *, int);
26 int	lookup_key_in_hostfile_by_type(const char *, const char *,
27 	    int, Key *, int *);
28 
29 #define HASH_MAGIC	"|1|"
30 #define HASH_DELIM	'|'
31 
32 #define CA_MARKER	"@cert-authority"
33 #define REVOKE_MARKER	"@revoked"
34 
35 char	*host_hash(const char *, const char *, u_int);
36 
37 #endif
38