Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 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 | */ |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 12 | #ifndef HOSTFILE_H |
| 13 | #define HOSTFILE_H |
| 14 | |
| 15 | /* |
| 16 | * Checks whether the given host is already in the list of our known hosts. |
| 17 | * Returns HOST_OK if the host is known and has the specified key, HOST_NEW |
| 18 | * if the host is not known, and HOST_CHANGED if the host is known but used |
| 19 | * to have a different host key. The host must be in all lowercase. |
| 20 | */ |
| 21 | typedef enum { |
| 22 | HOST_OK, HOST_NEW, HOST_CHANGED |
| 23 | } HostStatus; |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 24 | HostStatus |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 25 | check_host_in_hostfile(const char *filename, const char *host, Key *key, Key *found); |
| 26 | |
| 27 | /* |
| 28 | * Appends an entry to the host file. Returns false if the entry could not |
| 29 | * be appended. |
| 30 | */ |
| 31 | int add_host_to_hostfile(const char *filename, const char *host, Key *key); |
| 32 | |
| 33 | #endif |