@brief SSH authentication callback. Tries to authenticates user with the "gssapi-with-mic" method @param session Current session handler @param user Username of the user (can be spoofed) @param principal Authenticated principal of the user, including realm. @param userdata Userdata to be passed to the callback function. @returns SSH_AUTH_SUCCESS Authentication is accepted. @returns SSH_AUTH_PARTIAL Partial authentication, more authentication means are needed. @returns SSH_AUTH_DENIED Authentication failed. @warning Implementations should verify that parameter user matches in some way the principal. user and principal can be different. Only the latter is guaranteed to be safe.
@brief SSH authentication callback. Tries to authenticates user with the "none" method which is anonymous or passwordless. @param session Current session handler @param user User that wants to authenticate @param userdata Userdata to be passed to the callback function. @returns SSH_AUTH_SUCCESS Authentication is accepted. @returns SSH_AUTH_PARTIAL Partial authentication, more authentication means are needed. @returns SSH_AUTH_DENIED Authentication failed.
@brief SSH authentication callback. @param session Current session handler @param user User that wants to authenticate @param password Password used for authentication @param userdata Userdata to be passed to the callback function. @returns SSH_AUTH_SUCCESS Authentication is accepted. @returns SSH_AUTH_PARTIAL Partial authentication, more authentication means are needed. @returns SSH_AUTH_DENIED Authentication failed.
@brief SSH authentication callback. @param session Current session handler @param user User that wants to authenticate @param pubkey public key used for authentication @param signature_state SSH_PUBLICKEY_STATE_NONE if the key is not signed (simple public key probe), SSH_PUBLICKEY_STATE_VALID if the signature is valid. Others values should be replied with a SSH_AUTH_DENIED. @param userdata Userdata to be passed to the callback function. @returns SSH_AUTH_SUCCESS Authentication is accepted. @returns SSH_AUTH_PARTIAL Partial authentication, more authentication means are needed. @returns SSH_AUTH_DENIED Authentication failed.
@internal @brief callback for data received messages. @param data data retrieved from the socket or stream @param len number of bytes available from this stream @param user user-supplied pointer sent along with all callback messages @returns number of bytes processed by the callee. The remaining bytes will be sent in the next callback message, when more data is available.
@internal @brief callback to process simple codes @param code value to transmit @param user Userdata to pass in callback
@brief SSH auth-agent-request from the client. This request is sent by a client when agent forwarding is available. Server is free to ignore this callback, no answer is expected. @param channel the channel @param userdata Userdata to be passed to the callback function.
@brief SSH channel close callback. Called when a channel is closed by remote peer @param session Current session handler @param channel the actual channel @param userdata Userdata to be passed to the callback function.
@brief SSH channel data callback. Called when data is available on a channel @param session Current session handler @param channel the actual channel @param data the data that has been read on the channel @param len the length of the data @param is_stderr is 0 for stdout or 1 for stderr @param userdata Userdata to be passed to the callback function. @returns number of bytes processed by the callee. The remaining bytes will be sent in the next callback message, when more data is available.
@brief SSH channel environment request from a client. @param channel the channel @param env_name name of the environment value to be set @param env_value value of the environment value to be set @param userdata Userdata to be passed to the callback function. @returns 0 if the env request is accepted @returns 1 if the request is denied @warning some environment variables can be dangerous if changed (e.g. LD_PRELOAD) and should not be fulfilled.
@brief SSH channel eof callback. Called when a channel receives EOF @param session Current session handler @param channel the actual channel @param userdata Userdata to be passed to the callback function.
@brief SSH channel Exec request from a client. @param channel the channel @param command the shell command to be executed @param userdata Userdata to be passed to the callback function. @returns 0 if the exec request is accepted @returns 1 if the request is denied
@brief SSH channel exit signal callback. Called when a channel has received an exit signal @param session Current session handler @param channel the actual channel @param signal the signal name (without the SIG prefix) @param core a boolean telling wether a core has been dumped or not @param errmsg the description of the exception @param lang the language of the description (format: RFC 3066) @param userdata Userdata to be passed to the callback function.
@brief SSH channel exit status callback. Called when a channel has received an exit status @param session Current session handler @param channel the actual channel @param userdata Userdata to be passed to the callback function.
@brief Handles an SSH new channel open session request @param session current session handler @param userdata Userdata to be passed to the callback function. @returns a valid ssh_channel handle if the request is to be allowed @returns NULL if the request should not be allowed @warning The channel pointer returned by this callback must be closed by the application.
@brief Handles an SSH new channel open X11 request. This happens when the server sends back an X11 connection attempt. This is a client-side API @param session current session handler @param userdata Userdata to be passed to the callback function. @returns a valid ssh_channel handle if the request is to be allowed @returns NULL if the request should not be allowed @warning The channel pointer returned by this callback must be closed by the application.
@brief SSH channel PTY request from a client. @param channel the channel @param term The type of terminal emulation @param width width of the terminal, in characters @param height height of the terminal, in characters @param pxwidth width of the terminal, in pixels @param pxheight height of the terminal, in pixels @param userdata Userdata to be passed to the callback function. @returns 0 if the pty request is accepted @returns -1 if the request is denied
@brief SSH channel PTY windows change (terminal size) from a client. @param channel the channel @param width width of the terminal, in characters @param height height of the terminal, in characters @param pxwidth width of the terminal, in pixels @param pxheight height of the terminal, in pixels @param userdata Userdata to be passed to the callback function. @returns 0 if the pty request is accepted @returns -1 if the request is denied
@brief SSH channel Shell request from a client. @param channel the channel @param userdata Userdata to be passed to the callback function. @returns 0 if the shell request is accepted @returns 1 if the request is denied
@brief SSH channel signal callback. Called when a channel has received a signal @param session Current session handler @param channel the actual channel @param signal the signal name (without the SIG prefix) @param userdata Userdata to be passed to the callback function.
@brief SSH channel subsystem request from a client. @param channel the channel @param subsystem the subsystem required @param userdata Userdata to be passed to the callback function. @returns 0 if the subsystem request is accepted @returns 1 if the request is denied
@brief SSH X11 request from the client. This request is sent by a client when X11 forwarding is requested(and available). Server is free to ignore this callback, no answer is expected. @param channel the channel @param userdata Userdata to be passed to the callback function.
@brief SSH global request callback. All global request will go through this callback. @param session Current session handler @param message the actual message @param userdata Userdata to be passed to the callback function.
@brief SSH log callback. All logging messages will go through this callback @param session Current session handler @param priority Priority of the log, the smaller being the more important @param message the actual message @param userdata Userdata to be passed to the callback function.
@brief SSH log callback.
@brief Prototype for a packet callback, to be called when a new packet arrives @param session The current session of the packet @param type packet type (see ssh2.h) @param packet buffer containing the packet, excluding size, type and padding fields @param user user argument to the callback and are called each time a packet shows up @returns SSH_PACKET_USED Packet was parsed and used @returns SSH_PACKET_NOT_USED Packet was not used or understood, processing must continue
@brief Handles an SSH service request @param session current session handler @param service name of the service (e.g. "ssh-userauth") requested @param userdata Userdata to be passed to the callback function. @returns 0 if the request is to be allowed @returns -1 if the request should not be allowed
@brief SSH Connection status callback. @param session Current session handler @param status Percentage of connection status, going from 0.0 to 1.0 once connection is done. @param userdata Userdata to be passed to the callback function.
@group libssh_threads @{
@brief Initializes an ssh_callbacks_struct A call to this macro is mandatory when you have set a new ssh_callback_struct structure. Its goal is to maintain the binary compatibility with future versions of libssh as the structure evolves with time.
@brief Get the pointer to the logging callback function.
@brief Set the session callback functions.
@brief Set the channel callback functions.
@brief Set the logging callback function.
@brief Set the session server callback functions.
@brief Get the noop threads callbacks structure
@brief returns a pointer on the pthread threads callbacks, to be used with ssh_threads_set_callbacks. @warning you have to link with the library ssh_threads. @see ssh_threads_set_callbacks
@brief Set the thread callbacks structure.
Packet was not used and should be passed to any other callback * available
Packet was used and should not be parsed by another callback
The structure to replace libssh functions with appropriate callbacks.
This structure can be used to implement a libssh server, with appropriate callbacks.
These are the callbacks exported by the socket structure They are called by the socket module when a socket event appears