blob: 1d460c1a915dd572acb8f2a73b9b1553358e0022 [file] [log] [blame]
Damien Miller1aed65e2010-03-04 21:53:35 +11001/* $OpenBSD: hostfile.h,v 1.18 2010/03/04 10:36:03 djm Exp $ */
Ben Lindstrom36579d32001-01-29 07:39:26 +00002
Damien Millere4340be2000-09-16 13:29:08 +11003/*
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 Miller450a7a12000-03-26 13:04:51 +100014#ifndef HOSTFILE_H
15#define HOSTFILE_H
16
Damien Miller450a7a12000-03-26 13:04:51 +100017typedef enum {
Damien Miller1aed65e2010-03-04 21:53:35 +110018 HOST_OK, HOST_NEW, HOST_CHANGED, HOST_REVOKED, HOST_FOUND
Damien Miller450a7a12000-03-26 13:04:51 +100019} HostStatus;
Ben Lindstrom46c16222000-12-22 01:43:59 +000020
Damien Miller5b2aea92001-12-21 12:47:09 +110021int hostfile_read_key(char **, u_int *, Key *);
Ben Lindstrom93576d92002-12-23 02:06:19 +000022HostStatus check_host_in_hostfile(const char *, const char *,
Damien Millerf58b58c2003-11-17 21:18:23 +110023 const Key *, Key *, int *);
Damien Millere1776152005-03-01 21:47:37 +110024int add_host_to_hostfile(const char *, const char *, const Key *, int);
Ben Lindstrom93576d92002-12-23 02:06:19 +000025int lookup_key_in_hostfile_by_type(const char *, const char *,
26 int, Key *, int *);
Damien Miller450a7a12000-03-26 13:04:51 +100027
Damien Millere1776152005-03-01 21:47:37 +110028#define HASH_MAGIC "|1|"
29#define HASH_DELIM '|'
30
Damien Miller0a80ca12010-02-27 07:55:05 +110031#define CA_MARKER "@cert-authority"
Damien Miller1aed65e2010-03-04 21:53:35 +110032#define REVOKE_MARKER "@revoked"
Damien Miller0a80ca12010-02-27 07:55:05 +110033
Damien Millere1776152005-03-01 21:47:37 +110034char *host_hash(const char *, const char *, u_int);
35
Damien Miller450a7a12000-03-26 13:04:51 +100036#endif