1
.\" Copyright (C) Daniel Stenberg
2
.\" SPDX-License-Identifier: BSD-3-Clause
3
.TH libssh2_knownhost_writeline 3 "28 May 2009" "libssh2" "libssh2"
5
libssh2_knownhost_writeline - convert a known host to a line for storage
11
libssh2_knownhost_writeline(LIBSSH2_KNOWNHOSTS *hosts,
12
struct libssh2_knownhost *known,
13
char *buffer, size_t buflen,
18
Converts a single known host to a single line of output for storage, using
19
the 'type' output format.
21
\fIknown\fP identifies which particular known host
23
\fIbuffer\fP points to an allocated buffer
25
\fIbuflen\fP is the size of the \fIbuffer\fP. See RETURN VALUE about the size.
27
\fIoutlen\fP must be a pointer to a size_t variable that will get the output
28
length of the stored data chunk. The number does not included the trailing
31
\fItype\fP specifies what file type it is, and
32
\fILIBSSH2_KNOWNHOST_FILE_OPENSSH\fP is the only currently supported
35
Returns a regular libssh2 error code, where negative values are error codes
36
and 0 indicates success.
38
If the provided buffer is deemed too small to fit the data libssh2 wants to
39
store in it, LIBSSH2_ERROR_BUFFER_TOO_SMALL will be returned. The application
40
is then advised to call the function again with a larger buffer. The
41
\fIoutlen\fP size will then hold the requested size.
45
.BR libssh2_knownhost_get(3)
46
.BR libssh2_knownhost_readline(3)
47
.BR libssh2_knownhost_writefile(3)