1libssh2_session_handshake(3)        libssh2       libssh2_session_handshake(3)
2
3
4

NAME

6       libssh2_session_handshake - perform the SSH handshake
7

SYNOPSIS

9       #include <libssh2.h>
10
11       int
12       libssh2_session_handshake(LIBSSH2_SESSION *session, libssh2_socket_t socket);
13

DESCRIPTION

15       session - Session instance as returned by libssh2_session_init_ex(3)
16
17       socket - Connected socket descriptor. Typically a TCP connection though
18       the protocol allows for any reliable transport and the library will at‐
19       tempt to use any berkeley socket.
20
21       Begin transport layer protocol negotiation with the connected host.
22

RETURN VALUE

24       Returns 0 on success, negative on failure.
25

ERRORS

27       LIBSSH2_ERROR_SOCKET_NONE - The socket is invalid.
28
29       LIBSSH2_ERROR_BANNER_SEND - Unable to send banner to remote host.
30
31       LIBSSH2_ERROR_KEX_FAILURE  -  Encryption  key  exchange with the remote
32       host failed.
33
34       LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
35
36       LIBSSH2_ERROR_SOCKET_DISCONNECT - The socket was disconnected.
37
38       LIBSSH2_ERROR_PROTO - An invalid SSH protocol response was received  on
39       the socket.
40
41       LIBSSH2_ERROR_EAGAIN  -  Marked for non-blocking I/O but the call would
42       block.
43

AVAILABILITY

45       Added in 1.2.8
46

SEE ALSO

48       libssh2_session_free(3) libssh2_session_init_ex(3)
49
50
51
52libssh2                           7 Oct 2010      libssh2_session_handshake(3)
Impressum