1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-07 08:02:56 +03:00

introducing libssh2_knownhost_writeline() and some cleanups to use more

defined error codes instead of the simplified -1 previously used a little too
much here
This commit is contained in:
Daniel Stenberg
2009-05-29 10:00:45 +02:00
parent 82bdd12a8b
commit 1afbbf4507
2 changed files with 153 additions and 51 deletions

View File

@@ -350,6 +350,7 @@ typedef struct _LIBSSH2_POLLFD {
#define LIBSSH2_ERROR_INVALID_POLL_TYPE -35
#define LIBSSH2_ERROR_PUBLICKEY_PROTOCOL -36
#define LIBSSH2_ERROR_EAGAIN -37
#define LIBSSH2_ERROR_BUFFER_TOO_SMALL -38
/* Session API */
LIBSSH2_API LIBSSH2_SESSION *
@@ -808,6 +809,25 @@ LIBSSH2_API int
libssh2_knownhost_readfile(LIBSSH2_KNOWNHOSTS *hosts,
const char *filename, int type);
/*
* libssh2_knownhost_writeline()
*
* Ask libssh2 to convert a known host to an output line for storage.
*
* Note that this function returns LIBSSH2_ERROR_BUFFER_TOO_SMALL if the given
* output buffer is too small to hold the desired output.
*
* This implementation currently only knows one 'type' (openssh), all others
* are reserved for future use.
*
*/
LIBSSH2_API int
libssh2_knownhost_writeline(LIBSSH2_KNOWNHOSTS *hosts,
struct libssh2_knownhost *known,
char *buffer, size_t buflen,
size_t *outlen, /* the amount of written data */
int type);
/*
* libssh2_knownhost_writefile
*