Ben Lindstrom | 36579d3 | 2001-01-29 07:39:26 +0000 | [diff] [blame] | 1 | /* $OpenBSD: hostfile.h,v 1.6 2001/01/29 01:58:16 niklas Exp $ */ |
| 2 | |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 3 | /* |
| 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
| 5 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
| 6 | * All rights reserved |
| 7 | * |
| 8 | * As far as I am concerned, the code I have written for this software |
| 9 | * can be used freely for any purpose. Any derived versions of this |
| 10 | * software must be clearly marked as such, and if the derived work is |
| 11 | * incompatible with the protocol description in the RFC file, it must be |
| 12 | * called by a name other than "ssh" or "Secure Shell". |
| 13 | */ |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 14 | #ifndef HOSTFILE_H |
| 15 | #define HOSTFILE_H |
| 16 | |
| 17 | /* |
| 18 | * Checks whether the given host is already in the list of our known hosts. |
| 19 | * Returns HOST_OK if the host is known and has the specified key, HOST_NEW |
| 20 | * if the host is not known, and HOST_CHANGED if the host is known but used |
| 21 | * to have a different host key. The host must be in all lowercase. |
| 22 | */ |
| 23 | typedef enum { |
| 24 | HOST_OK, HOST_NEW, HOST_CHANGED |
| 25 | } HostStatus; |
Ben Lindstrom | 46c1622 | 2000-12-22 01:43:59 +0000 | [diff] [blame] | 26 | |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 27 | HostStatus |
Ben Lindstrom | 46c1622 | 2000-12-22 01:43:59 +0000 | [diff] [blame] | 28 | check_host_in_hostfile(const char *filename, const char *host, Key *key, |
| 29 | Key *found, int *line); |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 30 | |
| 31 | /* |
| 32 | * Appends an entry to the host file. Returns false if the entry could not |
| 33 | * be appended. |
| 34 | */ |
| 35 | int add_host_to_hostfile(const char *filename, const char *host, Key *key); |
| 36 | |
| 37 | #endif |