libssh2_session_startup(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_session_startup β€” the manual page, but make it make sense πŸ’–

okay bestie, welcome to the libssh2 girlies' corner of the man pages. this one lives in the libssh2 manual, section 3, and it's literally all about kicking off the transport layer. let's get into it 🫢


✨ NAME ✨

libssh2_session_startup β€” begin transport layer


🌸 SYNOPSIS 🌸

#include <libssh2.h>

int
libssh2_session_startup(LIBSSH2_SESSION *session, int socket);

πŸ¦‹ DESCRIPTION πŸ¦‹

⚠️ warning bestie ⚠️ starting in libssh2 version 1.2.8, this function is considered deprecated. use libssh2_session_handshake(3) instead. like, fr fr, it's giving legacy code energy πŸ’€

  • session β€” the Session instance as returned by libssh2_session_init_ex(3)
  • socket β€” Connected socket descriptor. Typically a TCP connection though the protocol allows for any reliable transport and the library will attempt to use any berkeley socket.

so what does it actually do? it begins the transport layer protocol negotiation with the connected host. that's the whole vibe. ✨


πŸ‘‘ RETURN VALUE πŸ‘‘

Returns 0 on success, negative on failure. iconic. simple. periodt πŸ’…


πŸ”₯ ERRORS πŸ”₯

  • LIBSSH2_ERROR_SOCKET_NONE β€” The socket is invalid.
  • LIBSSH2_ERROR_BANNER_SEND β€” Unable to send banner to remote host.
  • LIBSSH2_ERROR_KEX_FAILURE β€” Encryption key exchange with the remote host failed.
  • LIBSSH2_ERROR_SOCKET_SEND β€” Unable to send data on socket.
  • LIBSSH2_ERROR_SOCKET_DISCONNECT β€” The socket was disconnected.
  • LIBSSH2_ERROR_PROTO β€” An invalid SSH protocol response was received on the socket.
  • LIBSSH2_ERROR_EAGAIN β€” Marked for non-blocking I/O but the call would block.

ngl that's a lot of ways for things to go wrong, but we stay hydrated and we read the error codes πŸ’§


πŸŽ€ SEE ALSO πŸŽ€


that's the whole page, bestie 🌈 this one's from libssh2 0.15, dated 1 Jun 2007 β€” vintage but still slaying in the archive. mwah πŸ’–πŸ¦‹βœ¨