Libssh2 session callback set
From Libssh2
void *libssh2_session_callback_set(LIBSSH2_SESSION *session, int cbtype, void *callback);
Contents |
[edit]
About
Sets a custom callback handler for a previously initialized session object. Callbacks are triggered by the receipt of special packets at the Transport layer. To disable a callback, set it to NULL.
[edit]
Parameters
- session
- Session instance as returned by libssh2_session_init().
- cbtype
- Callback type. One of the types listed in Callback Types.
- callback
- Pointer to custom callback function. The prototype for this function must match the associated callback declaration macro.
[edit]
Returns
- Pointer to previous callback handler. Returns NULL if no prior callback handler was set.
[edit]
Callback Types
- LIBSSH2_CALLBACK_IGNORE
- Triggered on receipt of an SSH_IGNORE packet.
- LIBSSH2_CALLBACK_DEBUG
- Triggered on receipt of an SSH_DEBUG packet.
- LIBSSH2_CALLBACK_DISCONNECT
- Triggered on receipt of an SSH_DISCONNECT packet.
- LIBSSH2_CALLBACK_MACERROR
- Triggered on failure to validate a Message Authentication Code.
- LIBSSH2_CALLBACK_X11
- Triggered on receipt of an X11 request.
