Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 1 | #ifndef HOSTFILE_H |
| 2 | #define HOSTFILE_H |
| 3 | |
| 4 | /* |
| 5 | * Checks whether the given host is already in the list of our known hosts. |
| 6 | * Returns HOST_OK if the host is known and has the specified key, HOST_NEW |
| 7 | * if the host is not known, and HOST_CHANGED if the host is known but used |
| 8 | * to have a different host key. The host must be in all lowercase. |
| 9 | */ |
| 10 | typedef enum { |
| 11 | HOST_OK, HOST_NEW, HOST_CHANGED |
| 12 | } HostStatus; |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 13 | HostStatus |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 14 | check_host_in_hostfile(const char *filename, const char *host, Key *key, Key *found); |
| 15 | |
| 16 | /* |
| 17 | * Appends an entry to the host file. Returns false if the entry could not |
| 18 | * be appended. |
| 19 | */ |
| 20 | int add_host_to_hostfile(const char *filename, const char *host, Key *key); |
| 21 | |
| 22 | #endif |