libssh2
1.\" Copyright (C) Daniel Stenberg
2.\" SPDX-License-Identifier: BSD-3-Clause
3.TH libssh2_knownhost_readfile 3 "28 May 2009" "libssh2" "libssh2"
4.SH NAME
5libssh2_knownhost_readfile - parse a file of known hosts
6.SH SYNOPSIS
7.nf
8#include <libssh2.h>
9
10int
11libssh2_knownhost_readfile(LIBSSH2_KNOWNHOSTS *hosts,
12const char *filename, int type);
13.fi
14.SH DESCRIPTION
15Reads a collection of known hosts from a specified file and adds them to the
16collection of known hosts.
17
18\fIfilename\fP specifies which file to read
19
20\fItype\fP specifies what file type it is, and
21\fILIBSSH2_KNOWNHOST_FILE_OPENSSH\fP is the only currently supported
22format. This file is normally found named ~/.ssh/known_hosts
23.SH RETURN VALUE
24Returns a negative value, a regular libssh2 error code for errors, or a
25positive number as number of parsed known hosts in the file.
26.SH AVAILABILITY
27Added in libssh2 1.2
28.SH SEE ALSO
29.BR libssh2_knownhost_init(3)
30.BR libssh2_knownhost_free(3)
31.BR libssh2_knownhost_check(3)
32