libssh2_knownhost_readline(3)

πŸ“¦
version 1.11.1 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– libssh2_knownhost_readline β€” read a known host line πŸ’–

okay bestie, so this one lives in the libssh2 manual, and it's literally about reading one single line of a known hosts file. that's it. that's the whole vibe. ✨


✨ SYNOPSIS ✨

#include <libssh2.h>

int
libssh2_knownhost_readline(LIBSSH2_KNOWNHOSTS *hosts,
                           const char *line, size_t len, int type):

🌸 DESCRIPTION 🌸

You're telling libssh2 to take a buffer and read it as if it were a line straight out of a known hosts file. no cap, that's the whole job.

  • line β€” points to the start of the line πŸ‘ˆ
  • len β€” the length of the line, in bytes πŸ“
  • type β€” says what kind of file this is, and LIBSSH2_KNOWNHOST_FILE_OPENSSH is the only format supported rn. this file is normally found chilling at ~/.ssh/known_hosts 🏠

πŸ’… RETURN VALUE πŸ’…

It returns a regular libssh2 error code, bestie:

  • negative values = error codes 😭
  • 0 = success πŸŽ‰ (slay)

πŸ¦‹ AVAILABILITY πŸ¦‹

Added in libssh2 1.2 β€” so she's been iconic for a minute. πŸ‘‘


πŸŽ€ SEE ALSO πŸŽ€


later, bestie 🫢 this page came from libssh2, dated 28 May 2009 β€” go read the source if you want the whole lore, and stay hydrated while you parse those known hosts lines. πŸ’–πŸŒΈβœ¨