libssh 0.11.1 The SSH library

Loading...
Searching...
No Matches
callbacks.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2009 Aris Adamantiadis <aris@0xbadc0de.be>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/* callback.h
22 * This file includes the public declarations for the libssh callback mechanism
23 */
24
25#ifndef _SSH_CALLBACK_H
26#define _SSH_CALLBACK_H
27
28#include <libssh/libssh.h>
29#include <string.h>
30#include <stdbool.h>
31
32#ifdef __cplusplus
33 extern "C" {
34#endif
35
50 typedef void (*ssh_callback_int) (int code, void *user);
51
60 typedef size_t (*ssh_callback_data) (const void *data, size_t len, void *user);
61
62 typedef void (*ssh_callback_int_int) (int code, int errno_code, void *user);
63
64 typedef int (*ssh_message_callback) (ssh_session, ssh_message message, void *user);
65 typedef int (*ssh_channel_callback_int) (ssh_channel channel, int code, void *user);
66 typedef int (*ssh_channel_callback_data) (ssh_channel channel, int code, void *data, size_t len, void *user);
67
75 typedef void (*ssh_log_callback) (ssh_session session, int priority,
76 const char *message, void *userdata);
77
91 typedef void (*ssh_logging_callback) (int priority,
92 const char *function,
93 const char *buffer,
94 void *userdata);
95
103 typedef void (*ssh_status_callback) (ssh_session session, float status,
104 void *userdata);
105
113 typedef void (*ssh_global_request_callback) (ssh_session session,
114 ssh_message message, void *userdata);
115
127 typedef ssh_channel (*ssh_channel_open_request_x11_callback) (ssh_session session,
128 const char * originator_address, int originator_port, void *userdata);
129
139 typedef ssh_channel (*ssh_channel_open_request_auth_agent_callback) (ssh_session session,
140 void *userdata);
141
157 typedef ssh_channel (*ssh_channel_open_request_forwarded_tcpip_callback) (ssh_session session,
158 const char *destination_address, int destination_port,
159 const char *originator_address, int originator_port,
160 void *userdata);
161
165 struct ssh_callbacks_struct {
167 size_t size;
171 void *userdata;
175 ssh_auth_callback auth_function;
179 ssh_log_callback log_function;
184 void (*connect_status_function)(void *userdata, float status);
188 ssh_global_request_callback global_request_function;
191 ssh_channel_open_request_x11_callback channel_open_request_x11_function;
194 ssh_channel_open_request_auth_agent_callback channel_open_request_auth_agent_function;
199 ssh_channel_open_request_forwarded_tcpip_callback channel_open_request_forwarded_tcpip_function;
200};
201 typedef struct ssh_callbacks_struct *ssh_callbacks;
202
216 typedef int (*ssh_auth_password_callback) (ssh_session session, const char *user, const char *password,
217 void *userdata);
218
229 typedef int (*ssh_auth_none_callback) (ssh_session session, const char *user, void *userdata);
230
243 typedef int (*ssh_auth_gssapi_mic_callback) (ssh_session session, const char *user, const char *principal,
244 void *userdata);
245
259 typedef int (*ssh_auth_pubkey_callback) (ssh_session session, const char *user, struct ssh_key_struct *pubkey,
260 char signature_state, void *userdata);
261
262
272 typedef int (*ssh_service_request_callback) (ssh_session session, const char *service, void *userdata);
273
282 typedef ssh_channel (*ssh_channel_open_request_session_callback) (ssh_session session, void *userdata);
283
284/*
285 * @brief handle the beginning of a GSSAPI authentication, server side.
286 * Callback should select the oid and also acquire the server credential.
287 * @param session current session handler
288 * @param user the username of the client
289 * @param n_oid number of available oids
290 * @param oids OIDs provided by the client
291 * @returns an ssh_string containing the chosen OID, that's supported by both
292 * client and server.
293 * @warning It is not necessary to fill this callback in if libssh is linked
294 * with libgssapi.
295 */
296 typedef ssh_string (*ssh_gssapi_select_oid_callback) (ssh_session session, const char *user,
297 int n_oid, ssh_string *oids, void *userdata);
298
299/*
300 * @brief handle the negotiation of a security context, server side.
301 * @param session current session handler
302 * @param[in] input_token input token provided by client
303 * @param[out] output_token output of the gssapi accept_sec_context method,
304 * NULL after completion.
305 * @returns SSH_OK if the token was generated correctly or accept_sec_context
306 * returned GSS_S_COMPLETE
307 * @returns SSH_ERROR in case of error
308 * @warning It is not necessary to fill this callback in if libssh is linked
309 * with libgssapi.
310 */
311 typedef int (*ssh_gssapi_accept_sec_ctx_callback) (ssh_session session,
312 ssh_string input_token, ssh_string *output_token, void *userdata);
313
314/*
315 * @brief Verify and authenticates a MIC, server side.
316 * @param session current session handler
317 * @param[in] mic input mic to be verified provided by client
318 * @param[in] mic_buffer buffer of data to be signed.
319 * @param[in] mic_buffer_size size of mic_buffer
320 * @returns SSH_OK if the MIC was authenticated correctly
321 * @returns SSH_ERROR in case of error
322 * @warning It is not necessary to fill this callback in if libssh is linked
323 * with libgssapi.
324 */
325 typedef int (*ssh_gssapi_verify_mic_callback) (ssh_session session,
326 ssh_string mic, void *mic_buffer, size_t mic_buffer_size, void *userdata);
327
328
333 struct ssh_server_callbacks_struct {
335 size_t size;
339 void *userdata;
343 ssh_auth_password_callback auth_password_function;
344
348 ssh_auth_none_callback auth_none_function;
349
353 ssh_auth_gssapi_mic_callback auth_gssapi_mic_function;
354
358 ssh_auth_pubkey_callback auth_pubkey_function;
359
363 ssh_service_request_callback service_request_function;
367 ssh_channel_open_request_session_callback channel_open_request_session_function;
371 ssh_gssapi_select_oid_callback gssapi_select_oid_function;
374 ssh_gssapi_accept_sec_ctx_callback gssapi_accept_sec_ctx_function;
375 /* This function will be called when a MIC needs to be verified.
376 */
377 ssh_gssapi_verify_mic_callback gssapi_verify_mic_function;
378};
379 typedef struct ssh_server_callbacks_struct *ssh_server_callbacks;
380
405LIBSSH_API int ssh_set_server_callbacks(ssh_session session, ssh_server_callbacks cb);
406
411 struct ssh_socket_callbacks_struct {
415 void *userdata;
420 ssh_callback_data data;
424 ssh_callback_int controlflow;
428 ssh_callback_int_int exception;
432 ssh_callback_int_int connected;
433};
434 typedef struct ssh_socket_callbacks_struct *ssh_socket_callbacks;
435
436#define SSH_SOCKET_FLOW_WRITEWILLBLOCK 1
437#define SSH_SOCKET_FLOW_WRITEWONTBLOCK 2
438
439#define SSH_SOCKET_EXCEPTION_EOF 1
440#define SSH_SOCKET_EXCEPTION_ERROR 2
441
442#define SSH_SOCKET_CONNECTED_OK 1
443#define SSH_SOCKET_CONNECTED_ERROR 2
444#define SSH_SOCKET_CONNECTED_TIMEOUT 3
445
453#define ssh_callbacks_init(p) do {\
454 (p)->size=sizeof(*(p)); \
455} while(0);
456
466#define ssh_callbacks_exists(p,c) (\
467 (p != NULL) && ( (char *)&((p)-> c) < (char *)(p) + (p)->size ) && \
468 ((p)-> c != NULL) \
469 )
470
487#define ssh_callbacks_execute_list(list, cbtype, c, ...) \
488 do { \
489 struct ssh_iterator *i = ssh_list_get_iterator(list); \
490 cbtype cb; \
491 while (i != NULL){ \
492 cb = ssh_iterator_value(cbtype, i); \
493 if (ssh_callbacks_exists(cb, c)) \
494 cb-> c (__VA_ARGS__, cb->userdata); \
495 i = i->next; \
496 } \
497 } while(0)
498
519#define ssh_callbacks_iterate(_cb_list, _cb_type, _cb_name) \
520 do { \
521 struct ssh_iterator *_cb_i = ssh_list_get_iterator(_cb_list); \
522 _cb_type _cb; \
523 for (; _cb_i != NULL; _cb_i = _cb_i->next) { \
524 _cb = ssh_iterator_value(_cb_type, _cb_i); \
525 if (ssh_callbacks_exists(_cb, _cb_name))
526
527#define ssh_callbacks_iterate_exec(_cb_name, ...) \
528 _cb->_cb_name(__VA_ARGS__, _cb->userdata)
529
530#define ssh_callbacks_iterate_end() \
531 } \
532 } while(0)
533
543 typedef int (*ssh_packet_callback) (ssh_session session, uint8_t type, ssh_buffer packet, void *user);
544
547#define SSH_PACKET_USED 1
550#define SSH_PACKET_NOT_USED 2
551
552
560#define SSH_PACKET_CALLBACK(name) \
561 int name (ssh_session session, uint8_t type, ssh_buffer packet, void *user)
562
563 struct ssh_packet_callbacks_struct {
565 uint8_t start;
567 uint8_t n_callbacks;
569 ssh_packet_callback *callbacks;
573 void *user;
574};
575
576 typedef struct ssh_packet_callbacks_struct *ssh_packet_callbacks;
577
602LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb);
603
615 typedef int (*ssh_channel_data_callback) (ssh_session session,
616 ssh_channel channel,
617 void *data,
618 uint32_t len,
619 int is_stderr,
620 void *userdata);
621
628 typedef void (*ssh_channel_eof_callback) (ssh_session session,
629 ssh_channel channel,
630 void *userdata);
631
638 typedef void (*ssh_channel_close_callback) (ssh_session session,
639 ssh_channel channel,
640 void *userdata);
641
649 typedef void (*ssh_channel_signal_callback) (ssh_session session,
650 ssh_channel channel,
651 const char *signal,
652 void *userdata);
653
661 typedef void (*ssh_channel_exit_status_callback) (ssh_session session,
662 ssh_channel channel,
663 int exit_status,
664 void *userdata);
665
676 typedef void (*ssh_channel_exit_signal_callback) (ssh_session session,
677 ssh_channel channel,
678 const char *signal,
679 int core,
680 const char *errmsg,
681 const char *lang,
682 void *userdata);
683
697 typedef int (*ssh_channel_pty_request_callback) (ssh_session session,
698 ssh_channel channel,
699 const char *term,
700 int width, int height,
701 int pxwidth, int pwheight,
702 void *userdata);
703
712 typedef int (*ssh_channel_shell_request_callback) (ssh_session session,
713 ssh_channel channel,
714 void *userdata);
723 typedef void (*ssh_channel_auth_agent_req_callback) (ssh_session session,
724 ssh_channel channel,
725 void *userdata);
726
739 typedef void (*ssh_channel_x11_req_callback) (ssh_session session,
740 ssh_channel channel,
741 int single_connection,
742 const char *auth_protocol,
743 const char *auth_cookie,
744 uint32_t screen_number,
745 void *userdata);
758 typedef int (*ssh_channel_pty_window_change_callback) (ssh_session session,
759 ssh_channel channel,
760 int width, int height,
761 int pxwidth, int pwheight,
762 void *userdata);
763
773 typedef int (*ssh_channel_exec_request_callback) (ssh_session session,
774 ssh_channel channel,
775 const char *command,
776 void *userdata);
777
790 typedef int (*ssh_channel_env_request_callback) (ssh_session session,
791 ssh_channel channel,
792 const char *env_name,
793 const char *env_value,
794 void *userdata);
804 typedef int (*ssh_channel_subsystem_request_callback) (ssh_session session,
805 ssh_channel channel,
806 const char *subsystem,
807 void *userdata);
808
823 typedef int (*ssh_channel_write_wontblock_callback) (ssh_session session,
824 ssh_channel channel,
825 uint32_t bytes,
826 void *userdata);
827
835 typedef void (*ssh_channel_open_resp_callback) (ssh_session session,
836 ssh_channel channel,
837 bool is_success,
838 void *userdata);
839
846 typedef void (*ssh_channel_request_resp_callback) (ssh_session session,
847 ssh_channel channel,
848 void *userdata);
849
850 struct ssh_channel_callbacks_struct {
852 size_t size;
856 void *userdata;
860 ssh_channel_data_callback channel_data_function;
864 ssh_channel_eof_callback channel_eof_function;
868 ssh_channel_close_callback channel_close_function;
872 ssh_channel_signal_callback channel_signal_function;
876 ssh_channel_exit_status_callback channel_exit_status_function;
880 ssh_channel_exit_signal_callback channel_exit_signal_function;
884 ssh_channel_pty_request_callback channel_pty_request_function;
888 ssh_channel_shell_request_callback channel_shell_request_function;
892 ssh_channel_auth_agent_req_callback channel_auth_agent_req_function;
896 ssh_channel_x11_req_callback channel_x11_req_function;
900 ssh_channel_pty_window_change_callback channel_pty_window_change_function;
904 ssh_channel_exec_request_callback channel_exec_request_function;
908 ssh_channel_env_request_callback channel_env_request_function;
912 ssh_channel_subsystem_request_callback channel_subsystem_request_function;
916 ssh_channel_write_wontblock_callback channel_write_wontblock_function;
920 ssh_channel_open_resp_callback channel_open_response_function;
924 ssh_channel_request_resp_callback channel_request_response_function;
925};
926
927 typedef struct ssh_channel_callbacks_struct *ssh_channel_callbacks;
928
956LIBSSH_API int ssh_set_channel_callbacks(ssh_channel channel,
957 ssh_channel_callbacks cb);
958
975LIBSSH_API int ssh_add_channel_callbacks(ssh_channel channel,
976 ssh_channel_callbacks cb);
977
990LIBSSH_API int ssh_remove_channel_callbacks(ssh_channel channel,
991 ssh_channel_callbacks cb);
992
999 typedef int (*ssh_thread_callback) (void **lock);
1000
1001 typedef unsigned long (*ssh_thread_id_callback) (void);
1002 struct ssh_threads_callbacks_struct {
1003 const char *type;
1004 ssh_thread_callback mutex_init;
1005 ssh_thread_callback mutex_destroy;
1006 ssh_thread_callback mutex_lock;
1007 ssh_thread_callback mutex_unlock;
1008 ssh_thread_id_callback thread_id;
1009};
1010
1028LIBSSH_API int ssh_threads_set_callbacks(struct ssh_threads_callbacks_struct
1029 *cb);
1030
1040LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_default(void);
1041
1048LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_pthread(void);
1049
1060LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_noop(void);
1070LIBSSH_API int ssh_set_log_callback(ssh_logging_callback cb);
1071
1077LIBSSH_API ssh_logging_callback ssh_get_log_callback(void);
1078
1087 typedef int (*ssh_jump_before_connection_callback)(ssh_session session,
1088 void *userdata);
1089
1098 typedef int (*ssh_jump_verify_knownhost_callback)(ssh_session session,
1099 void *userdata);
1100
1108 typedef int (*ssh_jump_authenticate_callback)(ssh_session session,
1109 void *userdata);
1110
1111 struct ssh_jump_callbacks_struct {
1112 void *userdata;
1113 ssh_jump_before_connection_callback before_connection;
1114 ssh_jump_verify_knownhost_callback verify_knownhost;
1115 ssh_jump_authenticate_callback authenticate;
1116};
1117
1118#ifdef __cplusplus
1119}
1120#endif
1121
1122#endif /*_SSH_CALLBACK_H */
1123
1124/* @} */
ssh_auth_callback
int(* ssh_auth_callback)(const char *prompt, char *buf, size_t len, int echo, int verify, void *userdata)
SSH authentication callback for password and publickey auth.
Definition libssh.h:699
ssh_channel_request_resp_callback
void(* ssh_channel_request_resp_callback)(ssh_session session, ssh_channel channel, void *userdata)
SSH channel request response callback. Called when a response to the pending request is received.
Definition callbacks.h:846
ssh_channel_pty_request_callback
int(* ssh_channel_pty_request_callback)(ssh_session session, ssh_channel channel, const char *term, int width, int height, int pxwidth, int pwheight, void *userdata)
SSH channel PTY request from a client.
Definition callbacks.h:697
ssh_set_callbacks
LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb)
Set the session callback functions.
Definition callbacks.c:57
ssh_add_channel_callbacks
LIBSSH_API int ssh_add_channel_callbacks(ssh_channel channel, ssh_channel_callbacks cb)
Add channel callback functions.
Definition callbacks.c:118
ssh_channel_pty_window_change_callback
int(* ssh_channel_pty_window_change_callback)(ssh_session session, ssh_channel channel, int width, int height, int pxwidth, int pwheight, void *userdata)
SSH channel PTY windows change (terminal size) from a client.
Definition callbacks.h:758
ssh_channel_exec_request_callback
int(* ssh_channel_exec_request_callback)(ssh_session session, ssh_channel channel, const char *command, void *userdata)
SSH channel Exec request from a client.
Definition callbacks.h:773
ssh_channel_x11_req_callback
void(* ssh_channel_x11_req_callback)(ssh_session session, ssh_channel channel, int single_connection, const char *auth_protocol, const char *auth_cookie, uint32_t screen_number, void *userdata)
SSH X11 request from the client. This request is sent by a client when X11 forwarding is requested(an...
Definition callbacks.h:739
ssh_channel_shell_request_callback
int(* ssh_channel_shell_request_callback)(ssh_session session, ssh_channel channel, void *userdata)
SSH channel Shell request from a client.
Definition callbacks.h:712
ssh_channel_data_callback
int(* ssh_channel_data_callback)(ssh_session session, ssh_channel channel, void *data, uint32_t len, int is_stderr, void *userdata)
SSH channel data callback. Called when data is available on a channel.
Definition callbacks.h:615
ssh_channel_eof_callback
void(* ssh_channel_eof_callback)(ssh_session session, ssh_channel channel, void *userdata)
SSH channel eof callback. Called when a channel receives EOF.
Definition callbacks.h:628
ssh_channel_close_callback
void(* ssh_channel_close_callback)(ssh_session session, ssh_channel channel, void *userdata)
SSH channel close callback. Called when a channel is closed by remote peer.
Definition callbacks.h:638
ssh_channel_signal_callback
void(* ssh_channel_signal_callback)(ssh_session session, ssh_channel channel, const char *signal, void *userdata)
SSH channel signal callback. Called when a channel has received a signal.
Definition callbacks.h:649
ssh_auth_pubkey_callback
int(* ssh_auth_pubkey_callback)(ssh_session session, const char *user, struct ssh_key_struct *pubkey, char signature_state, void *userdata)
SSH authentication callback.
Definition callbacks.h:259
ssh_packet_callback
int(* ssh_packet_callback)(ssh_session session, uint8_t type, ssh_buffer packet, void *user)
Prototype for a packet callback, to be called when a new packet arrives.
Definition callbacks.h:543
ssh_channel_exit_status_callback
void(* ssh_channel_exit_status_callback)(ssh_session session, ssh_channel channel, int exit_status, void *userdata)
SSH channel exit status callback. Called when a channel has received an exit status.
Definition callbacks.h:661
ssh_channel_open_request_x11_callback
ssh_channel(* ssh_channel_open_request_x11_callback)(ssh_session session, const char *originator_address, int originator_port, void *userdata)
Handles an SSH new channel open X11 request. This happens when the server sends back an X11 connectio...
Definition callbacks.h:127
ssh_auth_none_callback
int(* ssh_auth_none_callback)(ssh_session session, const char *user, void *userdata)
SSH authentication callback. Tries to authenticates user with the "none" method which is anonymous or...
Definition callbacks.h:229
ssh_channel_open_resp_callback
void(* ssh_channel_open_resp_callback)(ssh_session session, ssh_channel channel, bool is_success, void *userdata)
SSH channel open callback. Called when a channel open succeeds or fails.
Definition callbacks.h:835
ssh_log_callback
void(* ssh_log_callback)(ssh_session session, int priority, const char *message, void *userdata)
SSH log callback. All logging messages will go through this callback.
Definition callbacks.h:75
ssh_service_request_callback
int(* ssh_service_request_callback)(ssh_session session, const char *service, void *userdata)
Handles an SSH service request.
Definition callbacks.h:272
ssh_channel_open_request_forwarded_tcpip_callback
ssh_channel(* ssh_channel_open_request_forwarded_tcpip_callback)(ssh_session session, const char *destination_address, int destination_port, const char *originator_address, int originator_port, void *userdata)
Handles an SSH new channel open "forwarded-tcpip" request. This happens when the server forwards an i...
Definition callbacks.h:157
ssh_set_server_callbacks
LIBSSH_API int ssh_set_server_callbacks(ssh_session session, ssh_server_callbacks cb)
Set the session server callback functions.
Definition callbacks.c:142
ssh_channel_open_request_auth_agent_callback
ssh_channel(* ssh_channel_open_request_auth_agent_callback)(ssh_session session, void *userdata)
Handles an SSH new channel open "auth-agent" request. This happens when the server sends back an "aut...
Definition callbacks.h:139
ssh_channel_write_wontblock_callback
int(* ssh_channel_write_wontblock_callback)(ssh_session session, ssh_channel channel, uint32_t bytes, void *userdata)
SSH channel write will not block (flow control).
Definition callbacks.h:823
ssh_auth_gssapi_mic_callback
int(* ssh_auth_gssapi_mic_callback)(ssh_session session, const char *user, const char *principal, void *userdata)
SSH authentication callback. Tries to authenticates user with the "gssapi-with-mic" method.
Definition callbacks.h:243
ssh_logging_callback
void(* ssh_logging_callback)(int priority, const char *function, const char *buffer, void *userdata)
SSH log callback.
Definition callbacks.h:91
ssh_status_callback
void(* ssh_status_callback)(ssh_session session, float status, void *userdata)
SSH Connection status callback.
Definition callbacks.h:103
ssh_channel_open_request_session_callback
ssh_channel(* ssh_channel_open_request_session_callback)(ssh_session session, void *userdata)
Handles an SSH new channel open session request.
Definition callbacks.h:282
ssh_channel_exit_signal_callback
void(* ssh_channel_exit_signal_callback)(ssh_session session, ssh_channel channel, const char *signal, int core, const char *errmsg, const char *lang, void *userdata)
SSH channel exit signal callback. Called when a channel has received an exit signal.
Definition callbacks.h:676
ssh_set_channel_callbacks
LIBSSH_API int ssh_set_channel_callbacks(ssh_channel channel, ssh_channel_callbacks cb)
Set the channel callback functions.
Definition callbacks.c:113
ssh_auth_password_callback
int(* ssh_auth_password_callback)(ssh_session session, const char *user, const char *password, void *userdata)
SSH authentication callback.
Definition callbacks.h:216
ssh_remove_channel_callbacks
LIBSSH_API int ssh_remove_channel_callbacks(ssh_channel channel, ssh_channel_callbacks cb)
Remove a channel callback.
Definition callbacks.c:123
ssh_channel_env_request_callback
int(* ssh_channel_env_request_callback)(ssh_session session, ssh_channel channel, const char *env_name, const char *env_value, void *userdata)
SSH channel environment request from a client.
Definition callbacks.h:790
ssh_global_request_callback
void(* ssh_global_request_callback)(ssh_session session, ssh_message message, void *userdata)
SSH global request callback. All global request will go through this callback.
Definition callbacks.h:113
ssh_channel_auth_agent_req_callback
void(* ssh_channel_auth_agent_req_callback)(ssh_session session, ssh_channel channel, void *userdata)
SSH auth-agent-request from the client. This request is sent by a client when agent forwarding is ava...
Definition callbacks.h:723
ssh_channel_subsystem_request_callback
int(* ssh_channel_subsystem_request_callback)(ssh_session session, ssh_channel channel, const char *subsystem, void *userdata)
SSH channel subsystem request from a client.
Definition callbacks.h:804
ssh_get_log_callback
LIBSSH_API ssh_logging_callback ssh_get_log_callback(void)
Get the pointer to the logging callback function.
Definition log.c:230
ssh_set_log_callback
LIBSSH_API int ssh_set_log_callback(ssh_logging_callback cb)
Set the logging callback function.
Definition log.c:214
ssh_threads_get_pthread
LIBSSH_API struct ssh_threads_callbacks_struct * ssh_threads_get_pthread(void)
Returns a pointer on the pthread threads callbacks, to be used with ssh_threads_set_callbacks.
Definition pthread.c:137
ssh_threads_get_default
LIBSSH_API struct ssh_threads_callbacks_struct * ssh_threads_get_default(void)
Returns a pointer to the appropriate callbacks structure for the environment, to be used with ssh_thr...
Definition noop.c:65
ssh_threads_get_noop
LIBSSH_API struct ssh_threads_callbacks_struct * ssh_threads_get_noop(void)
Get the noop threads callbacks structure.
Definition noop.c:71
ssh_threads_set_callbacks
LIBSSH_API int ssh_threads_set_callbacks(struct ssh_threads_callbacks_struct *cb)
Set the thread callbacks structure.
Definition threads.c:71
ssh_callbacks_struct
Definition callbacks.h:165
ssh_callbacks_struct::channel_open_request_auth_agent_function
ssh_channel_open_request_auth_agent_callback channel_open_request_auth_agent_function
Definition callbacks.h:194
ssh_callbacks_struct::log_function
ssh_log_callback log_function
Definition callbacks.h:179
ssh_callbacks_struct::auth_function
ssh_auth_callback auth_function
Definition callbacks.h:175
ssh_callbacks_struct::channel_open_request_x11_function
ssh_channel_open_request_x11_callback channel_open_request_x11_function
Definition callbacks.h:191
ssh_callbacks_struct::userdata
void * userdata
Definition callbacks.h:171
ssh_callbacks_struct::channel_open_request_forwarded_tcpip_function
ssh_channel_open_request_forwarded_tcpip_callback channel_open_request_forwarded_tcpip_function
Definition callbacks.h:199
ssh_callbacks_struct::size
size_t size
Definition callbacks.h:167
ssh_callbacks_struct::connect_status_function
void(* connect_status_function)(void *userdata, float status)
Definition callbacks.h:184
ssh_callbacks_struct::global_request_function
ssh_global_request_callback global_request_function
Definition callbacks.h:188
ssh_jump_callbacks_struct
Definition callbacks.h:1111
ssh_server_callbacks_struct
Definition callbacks.h:333
ssh_server_callbacks_struct::gssapi_accept_sec_ctx_function
ssh_gssapi_accept_sec_ctx_callback gssapi_accept_sec_ctx_function
Definition callbacks.h:374
ssh_server_callbacks_struct::service_request_function
ssh_service_request_callback service_request_function
Definition callbacks.h:363
ssh_server_callbacks_struct::size
size_t size
Definition callbacks.h:335
ssh_server_callbacks_struct::auth_none_function
ssh_auth_none_callback auth_none_function
Definition callbacks.h:348
ssh_server_callbacks_struct::auth_gssapi_mic_function
ssh_auth_gssapi_mic_callback auth_gssapi_mic_function
Definition callbacks.h:353
ssh_server_callbacks_struct::channel_open_request_session_function
ssh_channel_open_request_session_callback channel_open_request_session_function
Definition callbacks.h:367
ssh_server_callbacks_struct::auth_password_function
ssh_auth_password_callback auth_password_function
Definition callbacks.h:343
ssh_server_callbacks_struct::auth_pubkey_function
ssh_auth_pubkey_callback auth_pubkey_function
Definition callbacks.h:358
ssh_server_callbacks_struct::userdata
void * userdata
Definition callbacks.h:339
ssh_server_callbacks_struct::gssapi_select_oid_function
ssh_gssapi_select_oid_callback gssapi_select_oid_function
Definition callbacks.h:371
ssh_socket_callbacks_struct
Definition callbacks.h:411
ssh_socket_callbacks_struct::userdata
void * userdata
Definition callbacks.h:415
ssh_socket_callbacks_struct::data
ssh_callback_data data
Definition callbacks.h:420
ssh_socket_callbacks_struct::connected
ssh_callback_int_int connected
Definition callbacks.h:432
ssh_socket_callbacks_struct::controlflow
ssh_callback_int controlflow
Definition callbacks.h:424
ssh_socket_callbacks_struct::exception
ssh_callback_int_int exception
Definition callbacks.h:428