libssh2_knownhost_init(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_init β€” bestie edition πŸ’–

okay so real quick: this page lives in the libssh2 manual, and it's literally about spinning up your very own collection of known hosts. yes, like that known hosts. the guest list for your SSH era. let's get into it πŸŽ€


✨ NAME ✨

libssh2_knownhost_init β€” init a collection of known hosts, no big deal, just birthing a whole host-collection from scratch πŸ’…


🌸 SYNOPSIS 🌸

#include <libssh2.h>

LIBSSH2_KNOWNHOSTS *
libssh2_knownhost_init(LIBSSH2_SESSION *session);

look at her. one include, one function call, infinite potential. icon behavior honestly πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

so what this does is init a collection of known hosts for this session. that's the whole vibe. it hands you back a handle to an internal representation of a known host collection β€” like, the library's own little private notebook where it keeps track of who's who in your host world 🫢

not me telling you this though: call libssh2_knownhost_free(3) to free the collection again after you are done using it. (the original says "after you are doing using it" and honestly? relatable typo energy, we've all been there 😭) anyway β€” free your stuff, bestie. memory doesn't clean itself.

⭐ RETURN VALUE ⭐

returns a handle pointer, or NULL if something went wrong 😭 (sad girl hours). that returned handle is what you feed into all the other known host related functions libssh2 provides β€” so like, guard it with your life, she's the main character πŸ”₯


🌈 AVAILABILITY 🌈

added in libssh2 1.2. so if you're on something older than that… bestie, we need to talk πŸ’€


🧚 SEE ALSO 🧚


and that's the whole page, periodt πŸ’… this was the libssh2 manual, this page dated 28 May 2009 β€” yeah she's an elder but she still ate. go forth and init responsibly πŸ‘‘πŸ’–