#ifndef OPENSSH_PINCHED_H
#define OPENSSH_PINCHED_H

/*
 *
 * ssh.h
 *
 * Author: Tatu Ylonen <ylo@cs.hut.fi>
 *
 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
 *                    All rights reserved
 *
 * Created: Fri Mar 17 17:09:37 1995 ylo
 *
 * Generic header file for ssh.
 *
 */

/*#include "def.h"
#include "syslogif.h"*/
#define error(s) /*xsyslogf_irq(SYSLOG_FILE,LOG_ERROR,s)*/

#include "bn.h"

/*
 * Returns true if the given string matches the pattern (which may contain ?
 * and * as wildcards), and zero if it does not match.
 */
int     match_pattern(const char *s, const char *pattern);



/*
 * Tries to match the host name (which must be in all lowercase) against the
 * comma-separated sequence of subpatterns (each possibly preceded by ! to
 * indicate negation).  Returns true if there is a positive match; zero
 * otherwise.
 */
int     match_hostname(const char *host, const char *pattern, unsigned int len);

/*
 * Checks whether the given host is already in the list of our known hosts.
 * Returns HOST_OK if the host is known and has the specified key, HOST_NEW
 * if the host is not known, and HOST_CHANGED if the host is known but used
 * to have a different host key.  The host must be in all lowercase.
 */
typedef enum {
	HOST_OK, HOST_NEW, HOST_CHANGED
}       HostStatus;
HostStatus
check_host_in_hostfile(const char *filename, const char *host,
    BIGNUM * e, BIGNUM * n, BIGNUM * ke, BIGNUM * kn);

/*
 * Appends an entry to the host file.  Returns false if the entry could not
 * be appended.
 */
int
add_host_to_hostfile(const char *filename, const char *host,
    BIGNUM * e, BIGNUM * n);

#endif
