xref: /titanic_41/usr/src/cmd/ssh/include/hostfile.h (revision 442d23f49355a5d0694c758975be57af39f91a61)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * Author: Tatu Ylonen <ylo@cs.hut.fi>
37c478bd9Sstevel@tonic-gate  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
47c478bd9Sstevel@tonic-gate  *                    All rights reserved
57c478bd9Sstevel@tonic-gate  *
67c478bd9Sstevel@tonic-gate  * As far as I am concerned, the code I have written for this software
77c478bd9Sstevel@tonic-gate  * can be used freely for any purpose.  Any derived versions of this
87c478bd9Sstevel@tonic-gate  * software must be clearly marked as such, and if the derived work is
97c478bd9Sstevel@tonic-gate  * incompatible with the protocol description in the RFC file, it must be
107c478bd9Sstevel@tonic-gate  * called by a name other than "ssh" or "Secure Shell".
117c478bd9Sstevel@tonic-gate  */
127c478bd9Sstevel@tonic-gate 
13*442d23f4Sjp161948 #ifndef	_HOSTFILE_H
14*442d23f4Sjp161948 #define	_HOSTFILE_H
15*442d23f4Sjp161948 
16*442d23f4Sjp161948 /*	$OpenBSD: hostfile.h,v 1.12 2002/09/08 20:24:08 markus Exp $	*/
17*442d23f4Sjp161948 
18*442d23f4Sjp161948 #pragma ident	"%Z%%M%	%I%	%E% SMI"
19*442d23f4Sjp161948 
20*442d23f4Sjp161948 #ifdef __cplusplus
21*442d23f4Sjp161948 extern "C" {
22*442d23f4Sjp161948 #endif
23*442d23f4Sjp161948 
247c478bd9Sstevel@tonic-gate typedef enum {
257c478bd9Sstevel@tonic-gate 	HOST_OK, HOST_NEW, HOST_CHANGED, HOST_FOUND
267c478bd9Sstevel@tonic-gate }       HostStatus;
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate int	 hostfile_read_key(char **, u_int *, Key *);
297c478bd9Sstevel@tonic-gate HostStatus
30*442d23f4Sjp161948 check_host_in_hostfile(const char *, const char *, const Key *, Key *, int *);
31*442d23f4Sjp161948 int	add_host_to_hostfile(const char *, const char *, const Key *, int);
327c478bd9Sstevel@tonic-gate int
337c478bd9Sstevel@tonic-gate lookup_key_in_hostfile_by_type(const char *, const char *, int , Key *, int *);
347c478bd9Sstevel@tonic-gate 
35*442d23f4Sjp161948 #define HASH_MAGIC	"|1|"
36*442d23f4Sjp161948 #define HASH_DELIM	'|'
37*442d23f4Sjp161948 
38*442d23f4Sjp161948 char	*host_hash(const char *, const char *, u_int);
39*442d23f4Sjp161948 
407c478bd9Sstevel@tonic-gate #ifdef __cplusplus
417c478bd9Sstevel@tonic-gate }
427c478bd9Sstevel@tonic-gate #endif
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #endif /* _HOSTFILE_H */
45