Changeset View
Changeset View
Standalone View
Standalone View
hostfile.h
/* $OpenBSD: hostfile.h,v 1.24 2015/02/16 22:08:57 djm Exp $ */ | /* $OpenBSD: hostfile.h,v 1.26 2020/06/26 05:02:03 dtucker Exp $ */ | ||||
/* | /* | ||||
* Author: Tatu Ylonen <ylo@cs.hut.fi> | * Author: Tatu Ylonen <ylo@cs.hut.fi> | ||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | ||||
* All rights reserved | * All rights reserved | ||||
* | * | ||||
* As far as I am concerned, the code I have written for this software | * As far as I am concerned, the code I have written for this software | ||||
* can be used freely for any purpose. Any derived versions of this | * can be used freely for any purpose. Any derived versions of this | ||||
Show All 24 Lines | |||||
struct hostkeys *init_hostkeys(void); | struct hostkeys *init_hostkeys(void); | ||||
void load_hostkeys(struct hostkeys *, const char *, const char *); | void load_hostkeys(struct hostkeys *, const char *, const char *); | ||||
void free_hostkeys(struct hostkeys *); | void free_hostkeys(struct hostkeys *); | ||||
HostStatus check_key_in_hostkeys(struct hostkeys *, struct sshkey *, | HostStatus check_key_in_hostkeys(struct hostkeys *, struct sshkey *, | ||||
const struct hostkey_entry **); | const struct hostkey_entry **); | ||||
int lookup_key_in_hostkeys_by_type(struct hostkeys *, int, | int lookup_key_in_hostkeys_by_type(struct hostkeys *, int, | ||||
const struct hostkey_entry **); | const struct hostkey_entry **); | ||||
int lookup_marker_in_hostkeys(struct hostkeys *, int); | |||||
int hostfile_read_key(char **, u_int *, struct sshkey *); | int hostfile_read_key(char **, u_int *, struct sshkey *); | ||||
int add_host_to_hostfile(const char *, const char *, | int add_host_to_hostfile(const char *, const char *, | ||||
const struct sshkey *, int); | const struct sshkey *, int); | ||||
int hostfile_replace_entries(const char *filename, | int hostfile_replace_entries(const char *filename, | ||||
const char *host, const char *ip, struct sshkey **keys, size_t nkeys, | const char *host, const char *ip, struct sshkey **keys, size_t nkeys, | ||||
int store_hash, int quiet, int hash_alg); | int store_hash, int quiet, int hash_alg); | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
* is set). The foreach loop will terminate if the callback returns a non- | * is set). The foreach loop will terminate if the callback returns a non- | ||||
* zero exit status. | * zero exit status. | ||||
*/ | */ | ||||
typedef int hostkeys_foreach_fn(struct hostkey_foreach_line *l, void *ctx); | typedef int hostkeys_foreach_fn(struct hostkey_foreach_line *l, void *ctx); | ||||
/* Iterate over a hostkeys file */ | /* Iterate over a hostkeys file */ | ||||
int hostkeys_foreach(const char *path, hostkeys_foreach_fn *callback, void *ctx, | int hostkeys_foreach(const char *path, hostkeys_foreach_fn *callback, void *ctx, | ||||
const char *host, const char *ip, u_int options); | const char *host, const char *ip, u_int options); | ||||
void hostfile_create_user_ssh_dir(const char *, int); | |||||
#endif | #endif |