1libssh2_session_callback_set(3) libssh2 manual libssh2_session_callback_set(3)
2
3
4
6 libssh2_session_callback_set - set a callback function
7
9 #include <libssh2.h>
10
11 void *libssh2_session_callback_set(LIBSSH2_SESSION *session,
12 int cbtype, void *callback);
13
15 Sets a custom callback handler for a previously initialized session
16 object. Callbacks are triggered by the receipt of special packets at
17 the Transport layer. To disable a callback, set it to NULL.
18
19 session - Session instance as returned by libssh2_session_init_ex(3)
20
21 cbtype - Callback type. One of the types listed in Callback Types.
22
23 callback - Pointer to custom callback function. The prototype for this
24 function must match the associated callback declaration macro.
25
27 LIBSSH2_CALLBACK_IGNORE
28 Called when a SSH_MSG_IGNORE message is received
29
30 LIBSSH2_CALLBACK_DEBUG
31 Called when a SSH_MSG_DEBUG message is received
32
33 LIBSSH2_CALLBACK_DISCONNECT
34 Called when a SSH_MSG_DISCONNECT message is received
35
36 LIBSSH2_CALLBACK_MACERROR
37 Called when a mismatched MAC has been detected in the transport
38 layer. If the function returns 0, the packet will be accepted
39 nonetheless.
40
41 LIBSSH2_CALLBACK_X11
42 Called when an X11 connection has been accepted
43
44 LIBSSH2_CALLBACK_SEND
45 Called when libssh2 wants to send some data on the connection.
46 Can be set to a custom function to handle I/O your own way.
47
48 LIBSSH2_CALLBACK_RECV
49 Called when libssh2 wants to receive some data from the connecā
50 tion. Can be set to a custom function to handle I/O your own
51 way.
52
54 Pointer to previous callback handler. Returns NULL if no prior callback
55 handler was set or the callback type was unknown.
56
58 libssh2_session_init_ex(3)
59
60
61
62libssh2 0.15 1 Jun 2007 libssh2_session_callback_set(3)