libssh: /build/libssh/src/libssh-0.9.4/include/libssh/callbacks.h Source File

libssh 0.9.4 The SSH library

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
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
49 typedef void (*ssh_callback_int) (int code, void *user);
50
59 typedef int (*ssh_callback_data) (const void *data, size_t len, void *user);
60
61 typedef void (*ssh_callback_int_int) (int code, int errno_code, void *user);
62
63 typedef int (*ssh_message_callback) (ssh_session, ssh_message message, void *user);
64 typedef int (*ssh_channel_callback_int) (ssh_channel channel, int code, void *user);
65 typedef int (*ssh_channel_callback_data) (ssh_channel channel, int code, void *data, size_t len, void *user);
66
74 typedef void (*ssh_log_callback) (ssh_session session, int priority,
75 const char *message, void *userdata);
76
90 typedef void (*ssh_logging_callback) (int priority,
91 const char *function,
92 const char *buffer,
93 void *userdata);
94
102 typedef void (*ssh_status_callback) (ssh_session session, float status,
103 void *userdata);
104
112 typedef void (*ssh_global_request_callback) (ssh_session session,
113 ssh_message message, void *userdata);
114
124 typedef ssh_channel (*ssh_channel_open_request_x11_callback) (ssh_session session,
125 const char * originator_address, int originator_port, void *userdata);
126
136 typedef ssh_channel (*ssh_channel_open_request_auth_agent_callback) (ssh_session session,
137 void *userdata);
138
142 struct ssh_callbacks_struct {
144 size_t size;
148 void *userdata;
152 ssh_auth_callback auth_function;
156 ssh_log_callback log_function;
161 void (*connect_status_function)(void *userdata, float status);
165 ssh_global_request_callback global_request_function;
168 ssh_channel_open_request_x11_callback channel_open_request_x11_function;
171 ssh_channel_open_request_auth_agent_callback channel_open_request_auth_agent_function;
172 };
173 typedef struct ssh_callbacks_struct *ssh_callbacks;
174
188 typedef int (*ssh_auth_password_callback) (ssh_session session, const char *user, const char *password,
189 void *userdata);
190
201 typedef int (*ssh_auth_none_callback) (ssh_session session, const char *user, void *userdata);
202
215 typedef int (*ssh_auth_gssapi_mic_callback) (ssh_session session, const char *user, const char *principal,
216 void *userdata);
217
231 typedef int (*ssh_auth_pubkey_callback) (ssh_session session, const char *user, struct ssh_key_struct *pubkey,
232 char signature_state, void *userdata);
233
234
244 typedef int (*ssh_service_request_callback) (ssh_session session, const char *service, void *userdata);
245
254 typedef ssh_channel (*ssh_channel_open_request_session_callback) (ssh_session session, void *userdata);
255
256 /*
257 * @brief handle the beginning of a GSSAPI authentication, server side.
258 * @param session current session handler
259 * @param user the username of the client
260 * @param n_oid number of available oids
261 * @param oids OIDs provided by the client
262 * @returns an ssh_string containing the chosen OID, that's supported by both
263 * client and server.
264 * @warning It is not necessary to fill this callback in if libssh is linked
265 * with libgssapi.
266 */
267 typedef ssh_string (*ssh_gssapi_select_oid_callback) (ssh_session session, const char *user,
268 int n_oid, ssh_string *oids, void *userdata);
269
270 /*
271 * @brief handle the negociation of a security context, server side.
272 * @param session current session handler
273 * @param[in] input_token input token provided by client
274 * @param[out] output_token output of the gssapi accept_sec_context method,
275 * NULL after completion.
276 * @returns SSH_OK if the token was generated correctly or accept_sec_context
277 * returned GSS_S_COMPLETE
278 * @returns SSH_ERROR in case of error
279 * @warning It is not necessary to fill this callback in if libssh is linked
280 * with libgssapi.
281 */
282 typedef int (*ssh_gssapi_accept_sec_ctx_callback) (ssh_session session,
283 ssh_string input_token, ssh_string *output_token, void *userdata);
284
285 /*
286 * @brief Verify and authenticates a MIC, server side.
287 * @param session current session handler
288 * @param[in] mic input mic to be verified provided by client
289 * @param[in] mic_buffer buffer of data to be signed.
290 * @param[in] mic_buffer_size size of mic_buffer
291 * @returns SSH_OK if the MIC was authenticated correctly
292 * @returns SSH_ERROR in case of error
293 * @warning It is not necessary to fill this callback in if libssh is linked
294 * with libgssapi.
295 */
296 typedef int (*ssh_gssapi_verify_mic_callback) (ssh_session session,
297 ssh_string mic, void *mic_buffer, size_t mic_buffer_size, void *userdata);
298
299
304 struct ssh_server_callbacks_struct {
306 size_t size;
310 void *userdata;
314 ssh_auth_password_callback auth_password_function;
315
319 ssh_auth_none_callback auth_none_function;
320
324 ssh_auth_gssapi_mic_callback auth_gssapi_mic_function;
325
329 ssh_auth_pubkey_callback auth_pubkey_function;
330
334 ssh_service_request_callback service_request_function;
338 ssh_channel_open_request_session_callback channel_open_request_session_function;
341 ssh_gssapi_select_oid_callback gssapi_select_oid_function;
344 ssh_gssapi_accept_sec_ctx_callback gssapi_accept_sec_ctx_function;
345 /* This function will be called when a MIC needs to be verified.
346 */
347 ssh_gssapi_verify_mic_callback gssapi_verify_mic_function;
348 };
349 typedef struct ssh_server_callbacks_struct *ssh_server_callbacks;
350
372 LIBSSH_API int ssh_set_server_callbacks(ssh_session session, ssh_server_callbacks cb);
373
378 struct ssh_socket_callbacks_struct {
382 void *userdata;
387 ssh_callback_data data;
391 ssh_callback_int controlflow;
395 ssh_callback_int_int exception;
399 ssh_callback_int_int connected;
400 };
401 typedef struct ssh_socket_callbacks_struct *ssh_socket_callbacks;
402
403 #define SSH_SOCKET_FLOW_WRITEWILLBLOCK 1
404 #define SSH_SOCKET_FLOW_WRITEWONTBLOCK 2
405
406 #define SSH_SOCKET_EXCEPTION_EOF 1
407 #define SSH_SOCKET_EXCEPTION_ERROR 2
408
409 #define SSH_SOCKET_CONNECTED_OK 1
410 #define SSH_SOCKET_CONNECTED_ERROR 2
411 #define SSH_SOCKET_CONNECTED_TIMEOUT 3
412
420 #define ssh_callbacks_init(p) do {\
421 (p)->size=sizeof(*(p)); \
422 } while(0);
423
433 #define ssh_callbacks_exists(p,c) (\
434 (p != NULL) && ( (char *)&((p)-> c) < (char *)(p) + (p)->size ) && \
435 ((p)-> c != NULL) \
436 )
437
454 #define ssh_callbacks_execute_list(list, cbtype, c, ...) \
455 do { \
456 struct ssh_iterator *i = ssh_list_get_iterator(list); \
457 cbtype cb; \
458 while (i != NULL){ \
459 cb = ssh_iterator_value(cbtype, i); \
460 if (ssh_callbacks_exists(cb, c)) \
461 cb-> c (__VA_ARGS__, cb->userdata); \
462 i = i->next; \
463 } \
464 } while(0)
465
486 #define ssh_callbacks_iterate(_cb_list, _cb_type, _cb_name) \
487 do { \
488 struct ssh_iterator *_cb_i = ssh_list_get_iterator(_cb_list); \
489 _cb_type _cb; \
490 for (; _cb_i != NULL; _cb_i = _cb_i->next) { \
491 _cb = ssh_iterator_value(_cb_type, _cb_i); \
492 if (ssh_callbacks_exists(_cb, _cb_name))
493
494 #define ssh_callbacks_iterate_exec(_cb_name, ...) \
495 _cb->_cb_name(__VA_ARGS__, _cb->userdata)
496
497 #define ssh_callbacks_iterate_end() \
498 } \
499 } while(0)
500
510 typedef int (*ssh_packet_callback) (ssh_session session, uint8_t type, ssh_buffer packet, void *user);
511
514 #define SSH_PACKET_USED 1
515
517 #define SSH_PACKET_NOT_USED 2
518
519
527 #define SSH_PACKET_CALLBACK(name) \
528 int name (ssh_session session, uint8_t type, ssh_buffer packet, void *user)
529
530 struct ssh_packet_callbacks_struct {
532 uint8_t start;
534 uint8_t n_callbacks;
536 ssh_packet_callback *callbacks;
540 void *user;
541 };
542
543 typedef struct ssh_packet_callbacks_struct *ssh_packet_callbacks;
544
566 LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb);
567
579 typedef int (*ssh_channel_data_callback) (ssh_session session,
580 ssh_channel channel,
581 void *data,
582 uint32_t len,
583 int is_stderr,
584 void *userdata);
585
592 typedef void (*ssh_channel_eof_callback) (ssh_session session,
593 ssh_channel channel,
594 void *userdata);
595
602 typedef void (*ssh_channel_close_callback) (ssh_session session,
603 ssh_channel channel,
604 void *userdata);
605
613 typedef void (*ssh_channel_signal_callback) (ssh_session session,
614 ssh_channel channel,
615 const char *signal,
616 void *userdata);
617
624 typedef void (*ssh_channel_exit_status_callback) (ssh_session session,
625 ssh_channel channel,
626 int exit_status,
627 void *userdata);
628
639 typedef void (*ssh_channel_exit_signal_callback) (ssh_session session,
640 ssh_channel channel,
641 const char *signal,
642 int core,
643 const char *errmsg,
644 const char *lang,
645 void *userdata);
646
659 typedef int (*ssh_channel_pty_request_callback) (ssh_session session,
660 ssh_channel channel,
661 const char *term,
662 int width, int height,
663 int pxwidth, int pwheight,
664 void *userdata);
665
673 typedef int (*ssh_channel_shell_request_callback) (ssh_session session,
674 ssh_channel channel,
675 void *userdata);
683 typedef void (*ssh_channel_auth_agent_req_callback) (ssh_session session,
684 ssh_channel channel,
685 void *userdata);
686
694 typedef void (*ssh_channel_x11_req_callback) (ssh_session session,
695 ssh_channel channel,
696 int single_connection,
697 const char *auth_protocol,
698 const char *auth_cookie,
699 uint32_t screen_number,
700 void *userdata);
712 typedef int (*ssh_channel_pty_window_change_callback) (ssh_session session,
713 ssh_channel channel,
714 int width, int height,
715 int pxwidth, int pwheight,
716 void *userdata);
717
726 typedef int (*ssh_channel_exec_request_callback) (ssh_session session,
727 ssh_channel channel,
728 const char *command,
729 void *userdata);
730
742 typedef int (*ssh_channel_env_request_callback) (ssh_session session,
743 ssh_channel channel,
744 const char *env_name,
745 const char *env_value,
746 void *userdata);
755 typedef int (*ssh_channel_subsystem_request_callback) (ssh_session session,
756 ssh_channel channel,
757 const char *subsystem,
758 void *userdata);
759
772 typedef int (*ssh_channel_write_wontblock_callback) (ssh_session session,
773 ssh_channel channel,
774 size_t bytes,
775 void *userdata);
776
777 struct ssh_channel_callbacks_struct {
779 size_t size;
783 void *userdata;
787 ssh_channel_data_callback channel_data_function;
791 ssh_channel_eof_callback channel_eof_function;
795 ssh_channel_close_callback channel_close_function;
799 ssh_channel_signal_callback channel_signal_function;
803 ssh_channel_exit_status_callback channel_exit_status_function;
807 ssh_channel_exit_signal_callback channel_exit_signal_function;
811 ssh_channel_pty_request_callback channel_pty_request_function;
815 ssh_channel_shell_request_callback channel_shell_request_function;
819 ssh_channel_auth_agent_req_callback channel_auth_agent_req_function;
823 ssh_channel_x11_req_callback channel_x11_req_function;
827 ssh_channel_pty_window_change_callback channel_pty_window_change_function;
831 ssh_channel_exec_request_callback channel_exec_request_function;
835 ssh_channel_env_request_callback channel_env_request_function;
839 ssh_channel_subsystem_request_callback channel_subsystem_request_function;
843 ssh_channel_write_wontblock_callback channel_write_wontblock_function;
844 };
845
846 typedef struct ssh_channel_callbacks_struct *ssh_channel_callbacks;
847
871 LIBSSH_API int ssh_set_channel_callbacks(ssh_channel channel,
872 ssh_channel_callbacks cb);
873
890 LIBSSH_API int ssh_add_channel_callbacks(ssh_channel channel,
891 ssh_channel_callbacks cb);
892
905 LIBSSH_API int ssh_remove_channel_callbacks(ssh_channel channel,
906 ssh_channel_callbacks cb);
907
914 typedef int (*ssh_thread_callback) (void **lock);
915
916 typedef unsigned long (*ssh_thread_id_callback) (void);
917 struct ssh_threads_callbacks_struct {
918 const char *type;
919 ssh_thread_callback mutex_init;
920 ssh_thread_callback mutex_destroy;
921 ssh_thread_callback mutex_lock;
922 ssh_thread_callback mutex_unlock;
923 ssh_thread_id_callback thread_id;
924 };
925
943 LIBSSH_API int ssh_threads_set_callbacks(struct ssh_threads_callbacks_struct
944 *cb);
945
955 LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_default(void);
956
963 LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_pthread(void);
964
975 LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_noop(void);
976
984 LIBSSH_API int ssh_set_log_callback(ssh_logging_callback cb);
985
991 LIBSSH_API ssh_logging_callback ssh_get_log_callback(void);
992
994 #ifdef __cplusplus
995 }
996 #endif
997
998 #endif /*_SSH_CALLBACK_H */
999
1000 /* @} */
ssh_channel_struct
Definition: channels.h:62
ssh_status_callback
void(* ssh_status_callback)(ssh_session session, float status, void *userdata)
SSH Connection status callback.
Definition: callbacks.h:102
ssh_packet_callbacks_struct::n_callbacks
uint8_t n_callbacks
Definition: callbacks.h:534
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:602
ssh_set_callbacks
LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb)
Set the session callback functions.
Definition: callbacks.c:48
ssh_socket_callbacks_struct
Definition: callbacks.h:378
ssh_server_callbacks_struct::service_request_function
ssh_service_request_callback service_request_function
Definition: callbacks.h:334
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:124
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:201
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:659
ssh_channel_callbacks_struct::channel_env_request_function
ssh_channel_env_request_callback channel_env_request_function
Definition: callbacks.h:835
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:171
ssh_server_callbacks_struct::auth_none_function
ssh_auth_none_callback auth_none_function
Definition: callbacks.h:319
ssh_server_callbacks_struct::gssapi_select_oid_function
ssh_gssapi_select_oid_callback gssapi_select_oid_function
Definition: callbacks.h:341
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:673
ssh_channel_callbacks_struct::channel_signal_function
ssh_channel_signal_callback channel_signal_function
Definition: callbacks.h:799
ssh_key_struct
Definition: pki.h:50
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:104
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:726
ssh_callbacks_struct
Definition: callbacks.h:142
ssh_callbacks_struct::userdata
void * userdata
Definition: callbacks.h:148
ssh_callbacks_struct::log_function
ssh_log_callback log_function
Definition: callbacks.h:156
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:231
ssh_callbacks_struct::channel_open_request_x11_function
ssh_channel_open_request_x11_callback channel_open_request_x11_function
Definition: callbacks.h:168
ssh_socket_callbacks_struct::controlflow
ssh_callback_int controlflow
Definition: callbacks.h:391
ssh_server_callbacks_struct::userdata
void * userdata
Definition: callbacks.h:310
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:639
ssh_server_callbacks_struct::gssapi_accept_sec_ctx_function
ssh_gssapi_accept_sec_ctx_callback gssapi_accept_sec_ctx_function
Definition: callbacks.h:344
ssh_message_struct
Definition: messages.h:84
ssh_callbacks_struct::connect_status_function
void(* connect_status_function)(void *userdata, float status)
Definition: callbacks.h:161
ssh_socket_callbacks_struct::data
ssh_callback_data data
Definition: callbacks.h:387
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:74
ssh_channel_callbacks_struct::channel_exec_request_function
ssh_channel_exec_request_callback channel_exec_request_function
Definition: callbacks.h:831
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:683
ssh_buffer_struct
Definition: buffer.c:47
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:613
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:244
ssh_callbacks_struct::auth_function
ssh_auth_callback auth_function
Definition: callbacks.h:152
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:215
ssh_server_callbacks_struct::size
size_t size
Definition: callbacks.h:306
ssh_channel_callbacks_struct::channel_data_function
ssh_channel_data_callback channel_data_function
Definition: callbacks.h:787
ssh_server_callbacks_struct::auth_pubkey_function
ssh_auth_pubkey_callback auth_pubkey_function
Definition: callbacks.h:329
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:654
ssh_server_callbacks_struct::auth_password_function
ssh_auth_password_callback auth_password_function
Definition: callbacks.h:314
ssh_server_callbacks_struct::auth_gssapi_mic_function
ssh_auth_gssapi_mic_callback auth_gssapi_mic_function
Definition: callbacks.h:324
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:109
ssh_channel_callbacks_struct::channel_close_function
ssh_channel_close_callback channel_close_function
Definition: callbacks.h:795
ssh_session_struct
Definition: session.h:109
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:188
ssh_server_callbacks_struct::channel_open_request_session_function
ssh_channel_open_request_session_callback channel_open_request_session_function
Definition: callbacks.h:338
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:712
ssh_callbacks_struct::global_request_function
ssh_global_request_callback global_request_function
Definition: callbacks.h:165
ssh_packet_callbacks_struct::start
uint8_t start
Definition: callbacks.h:532
ssh_channel_callbacks_struct::channel_exit_signal_function
ssh_channel_exit_signal_callback channel_exit_signal_function
Definition: callbacks.h:807
ssh_channel_callbacks_struct::userdata
void * userdata
Definition: callbacks.h:783
ssh_threads_callbacks_struct
Definition: callbacks.h:917
ssh_channel_callbacks_struct::channel_write_wontblock_function
ssh_channel_write_wontblock_callback channel_write_wontblock_function
Definition: callbacks.h:843
ssh_channel_callbacks_struct::channel_x11_req_function
ssh_channel_x11_req_callback channel_x11_req_function
Definition: callbacks.h:823
ssh_socket_callbacks_struct::connected
ssh_callback_int_int connected
Definition: callbacks.h:399
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:133
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:510
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:254
ssh_channel_callbacks_struct::size
size_t size
Definition: callbacks.h:779
ssh_packet_callbacks_struct::user
void * user
Definition: callbacks.h:540
ssh_logging_callback
void(* ssh_logging_callback)(int priority, const char *function, const char *buffer, void *userdata)
SSH log callback.
Definition: callbacks.h:90
ssh_callbacks_struct::size
size_t size
Definition: callbacks.h:144
ssh_channel_callbacks_struct::channel_eof_function
ssh_channel_eof_callback channel_eof_function
Definition: callbacks.h:791
ssh_channel_callbacks_struct::channel_shell_request_function
ssh_channel_shell_request_callback channel_shell_request_function
Definition: callbacks.h:815
ssh_channel_callbacks_struct::channel_auth_agent_req_function
ssh_channel_auth_agent_req_callback channel_auth_agent_req_function
Definition: callbacks.h:819
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:112
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:579
ssh_channel_write_wontblock_callback
int(* ssh_channel_write_wontblock_callback)(ssh_session session, ssh_channel channel, size_t bytes, void *userdata)
SSH channel write will not block (flow control).
Definition: callbacks.h:772
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:210
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_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:624
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:755
ssh_string_struct
Definition: string.h:29
ssh_channel_callbacks_struct::channel_exit_status_function
ssh_channel_exit_status_callback channel_exit_status_function
Definition: callbacks.h:803
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:742
ssh_channel_callbacks_struct::channel_pty_request_function
ssh_channel_pty_request_callback channel_pty_request_function
Definition: callbacks.h:811
ssh_packet_callbacks_struct
Definition: callbacks.h:530
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:592
ssh_channel_callbacks_struct::channel_subsystem_request_function
ssh_channel_subsystem_request_callback channel_subsystem_request_function
Definition: callbacks.h:839
ssh_socket_callbacks_struct::exception
ssh_callback_int_int exception
Definition: callbacks.h:395
ssh_socket_callbacks_struct::userdata
void * userdata
Definition: callbacks.h:382
ssh_server_callbacks_struct
Definition: callbacks.h:304
ssh_channel_callbacks_struct
Definition: callbacks.h:777
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:114
ssh_packet_callbacks_struct::callbacks
ssh_packet_callback * callbacks
Definition: callbacks.h:536
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:694
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:136
ssh_set_log_callback
LIBSSH_API int ssh_set_log_callback(ssh_logging_callback cb)
Set the logging callback function.
Definition: log.c:200
ssh_channel_callbacks_struct::channel_pty_window_change_function
ssh_channel_pty_window_change_callback channel_pty_window_change_function
Definition: callbacks.h:827