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

libssh 0.12.0 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
33extern "C" {
34#endif
35
44
50typedef void (*ssh_callback_int) (int code, void *user);
51
60typedef size_t (*ssh_callback_data) (const void *data, size_t len, void *user);
61
62typedef void (*ssh_callback_int_int) (int code, int errno_code, void *user);
63
64typedef int (*ssh_message_callback) (ssh_session, ssh_message message, void *user);
65typedef int (*ssh_channel_callback_int) (ssh_channel channel, int code, void *user);
66typedef 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
125 typedef void (*ssh_connect_status_callback)(void *userdata, float status);
126
138 typedef ssh_channel (*ssh_channel_open_request_x11_callback) (ssh_session session,
139 const char * originator_address, int originator_port, void *userdata);
140
150 typedef ssh_channel (*ssh_channel_open_request_auth_agent_callback) (ssh_session session,
151 void *userdata);
152
168 typedef ssh_channel (*ssh_channel_open_request_forwarded_tcpip_callback) (ssh_session session,
169 const char *destination_address, int destination_port,
170 const char *originator_address, int originator_port,
171 void *userdata);
172
176 struct ssh_callbacks_struct {
178 size_t size;
182 void *userdata;
186 ssh_auth_callback auth_function;
190 ssh_log_callback log_function;
195 ssh_connect_status_callback connect_status_function;
199 ssh_global_request_callback global_request_function;
202 ssh_channel_open_request_x11_callback channel_open_request_x11_function;
205 ssh_channel_open_request_auth_agent_callback channel_open_request_auth_agent_function;
210 ssh_channel_open_request_forwarded_tcpip_callback channel_open_request_forwarded_tcpip_function;
211};
212typedef struct ssh_callbacks_struct *ssh_callbacks;
213
216
228 typedef int (*ssh_auth_password_callback) (ssh_session session, const char *user, const char *password,
229 void *userdata);
230
242 typedef int (*ssh_auth_none_callback) (ssh_session session, const char *user, void *userdata);
243
259 typedef int (*ssh_auth_gssapi_mic_callback) (ssh_session session, const char *user, const char *principal,
260 void *userdata);
261
276 typedef int (*ssh_auth_pubkey_callback) (ssh_session session, const char *user, struct ssh_key_struct *pubkey,
277 char signature_state, void *userdata);
278
289 typedef int (*ssh_auth_kbdint_callback) (ssh_message message, ssh_session session, void *userdata);
290
299 typedef int (*ssh_service_request_callback) (ssh_session session, const char *service, void *userdata);
300
309 typedef ssh_channel (*ssh_channel_open_request_session_callback) (ssh_session session, void *userdata);
310
323typedef ssh_string (*ssh_gssapi_select_oid_callback) (ssh_session session, const char *user,
324 int n_oid, ssh_string *oids, void *userdata);
325
338typedef int (*ssh_gssapi_accept_sec_ctx_callback) (ssh_session session,
339 ssh_string input_token, ssh_string *output_token, void *userdata);
340
352typedef int (*ssh_gssapi_verify_mic_callback) (ssh_session session,
353 ssh_string mic, void *mic_buffer, size_t mic_buffer_size, void *userdata);
354
370 typedef ssh_channel (*ssh_channel_open_request_direct_tcpip_callback)(
371 ssh_session session,
372 const char *destination_address,
373 int destination_port,
374 const char *originator_address,
375 int originator_port,
376 void *userdata);
377
381
382 struct ssh_server_callbacks_struct {
384 size_t size;
388 void *userdata;
392 ssh_auth_password_callback auth_password_function;
393
397 ssh_auth_none_callback auth_none_function;
398
402 ssh_auth_gssapi_mic_callback auth_gssapi_mic_function;
403
407 ssh_auth_pubkey_callback auth_pubkey_function;
408
412 ssh_service_request_callback service_request_function;
416 ssh_channel_open_request_session_callback channel_open_request_session_function;
420 ssh_gssapi_select_oid_callback gssapi_select_oid_function;
423 ssh_gssapi_accept_sec_ctx_callback gssapi_accept_sec_ctx_function;
426 ssh_gssapi_verify_mic_callback gssapi_verify_mic_function;
431 ssh_channel_open_request_direct_tcpip_callback
432 channel_open_request_direct_tcpip_function;
433
437 ssh_auth_kbdint_callback auth_kbdint_function;
438
439};
440typedef struct ssh_server_callbacks_struct *ssh_server_callbacks;
441
466LIBSSH_API int ssh_set_server_callbacks(ssh_session session, ssh_server_callbacks cb);
467
472 struct ssh_socket_callbacks_struct {
476 void *userdata;
481 ssh_callback_data data;
485 ssh_callback_int controlflow;
489 ssh_callback_int_int exception;
493 ssh_callback_int_int connected;
494};
495typedef struct ssh_socket_callbacks_struct *ssh_socket_callbacks;
496
497#define SSH_SOCKET_FLOW_WRITEWILLBLOCK 1
498#define SSH_SOCKET_FLOW_WRITEWONTBLOCK 2
499
500#define SSH_SOCKET_EXCEPTION_EOF 1
501#define SSH_SOCKET_EXCEPTION_ERROR 2
502
503#define SSH_SOCKET_CONNECTED_OK 1
504#define SSH_SOCKET_CONNECTED_ERROR 2
505#define SSH_SOCKET_CONNECTED_TIMEOUT 3
506
514#define ssh_callbacks_init(p) do {\
515 (p)->size=sizeof(*(p)); \
516} while(0);
517
527#define ssh_callbacks_exists(p,c) (\
528 (p != NULL) && ( (char *)&((p)-> c) < (char *)(p) + (p)->size ) && \
529 ((p)-> c != NULL) \
530 )
531
548#define ssh_callbacks_execute_list(list, cbtype, c, ...) \
549 do { \
550 struct ssh_iterator *i = ssh_list_get_iterator(list); \
551 cbtype cb; \
552 while (i != NULL){ \
553 cb = ssh_iterator_value(cbtype, i); \
554 if (ssh_callbacks_exists(cb, c)) \
555 cb-> c (__VA_ARGS__, cb->userdata); \
556 i = i->next; \
557 } \
558 } while(0)
559
580#define ssh_callbacks_iterate(_cb_list, _cb_type, _cb_name) \
581 do { \
582 struct ssh_iterator *_cb_i = ssh_list_get_iterator(_cb_list); \
583 _cb_type _cb; \
584 for (; _cb_i != NULL; _cb_i = _cb_i->next) { \
585 _cb = ssh_iterator_value(_cb_type, _cb_i); \
586 if (ssh_callbacks_exists(_cb, _cb_name))
587
588#define ssh_callbacks_iterate_exec(_cb_name, ...) \
589 _cb->_cb_name(__VA_ARGS__, _cb->userdata)
590
591#define ssh_callbacks_iterate_end() \
592 } \
593 } while(0)
594
607 typedef int (*ssh_packet_callback) (ssh_session session, uint8_t type, ssh_buffer packet, void *user);
608
611#define SSH_PACKET_USED 1
614#define SSH_PACKET_NOT_USED 2
615
616
624#define SSH_PACKET_CALLBACK(name) \
625 int name (ssh_session session, uint8_t type, ssh_buffer packet, void *user)
626
627struct ssh_packet_callbacks_struct {
629 uint8_t start;
631 uint8_t n_callbacks;
633 ssh_packet_callback *callbacks;
637 void *user;
638};
639
640typedef struct ssh_packet_callbacks_struct *ssh_packet_callbacks;
641
666LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb);
667
679 typedef int (*ssh_channel_data_callback) (ssh_session session,
680 ssh_channel channel,
681 void *data,
682 uint32_t len,
683 int is_stderr,
684 void *userdata);
685
692 typedef void (*ssh_channel_eof_callback) (ssh_session session,
693 ssh_channel channel,
694 void *userdata);
695
702 typedef void (*ssh_channel_close_callback) (ssh_session session,
703 ssh_channel channel,
704 void *userdata);
705
713 typedef void (*ssh_channel_signal_callback) (ssh_session session,
714 ssh_channel channel,
715 const char *signal,
716 void *userdata);
717
725 typedef void (*ssh_channel_exit_status_callback) (ssh_session session,
726 ssh_channel channel,
727 int exit_status,
728 void *userdata);
729
740 typedef void (*ssh_channel_exit_signal_callback) (ssh_session session,
741 ssh_channel channel,
742 const char *signal,
743 int core,
744 const char *errmsg,
745 const char *lang,
746 void *userdata);
747
761 typedef int (*ssh_channel_pty_request_callback) (ssh_session session,
762 ssh_channel channel,
763 const char *term,
764 int width, int height,
765 int pxwidth, int pwheight,
766 void *userdata);
767
776 typedef int (*ssh_channel_shell_request_callback) (ssh_session session,
777 ssh_channel channel,
778 void *userdata);
787 typedef void (*ssh_channel_auth_agent_req_callback) (ssh_session session,
788 ssh_channel channel,
789 void *userdata);
790
803 typedef void (*ssh_channel_x11_req_callback) (ssh_session session,
804 ssh_channel channel,
805 int single_connection,
806 const char *auth_protocol,
807 const char *auth_cookie,
808 uint32_t screen_number,
809 void *userdata);
822 typedef int (*ssh_channel_pty_window_change_callback) (ssh_session session,
823 ssh_channel channel,
824 int width, int height,
825 int pxwidth, int pwheight,
826 void *userdata);
827
837 typedef int (*ssh_channel_exec_request_callback) (ssh_session session,
838 ssh_channel channel,
839 const char *command,
840 void *userdata);
841
854 typedef int (*ssh_channel_env_request_callback) (ssh_session session,
855 ssh_channel channel,
856 const char *env_name,
857 const char *env_value,
858 void *userdata);
868 typedef int (*ssh_channel_subsystem_request_callback) (ssh_session session,
869 ssh_channel channel,
870 const char *subsystem,
871 void *userdata);
872
887 typedef int (*ssh_channel_write_wontblock_callback) (ssh_session session,
888 ssh_channel channel,
889 uint32_t bytes,
890 void *userdata);
891
899 typedef void (*ssh_channel_open_resp_callback) (ssh_session session,
900 ssh_channel channel,
901 bool is_success,
902 void *userdata);
903
910 typedef void (*ssh_channel_request_resp_callback) (ssh_session session,
911 ssh_channel channel,
912 void *userdata);
913
914struct ssh_channel_callbacks_struct {
916 size_t size;
920 void *userdata;
924 ssh_channel_data_callback channel_data_function;
928 ssh_channel_eof_callback channel_eof_function;
932 ssh_channel_close_callback channel_close_function;
936 ssh_channel_signal_callback channel_signal_function;
940 ssh_channel_exit_status_callback channel_exit_status_function;
944 ssh_channel_exit_signal_callback channel_exit_signal_function;
948 ssh_channel_pty_request_callback channel_pty_request_function;
952 ssh_channel_shell_request_callback channel_shell_request_function;
956 ssh_channel_auth_agent_req_callback channel_auth_agent_req_function;
960 ssh_channel_x11_req_callback channel_x11_req_function;
964 ssh_channel_pty_window_change_callback channel_pty_window_change_function;
968 ssh_channel_exec_request_callback channel_exec_request_function;
972 ssh_channel_env_request_callback channel_env_request_function;
976 ssh_channel_subsystem_request_callback channel_subsystem_request_function;
980 ssh_channel_write_wontblock_callback channel_write_wontblock_function;
984 ssh_channel_open_resp_callback channel_open_response_function;
988 ssh_channel_request_resp_callback channel_request_response_function;
989};
990
991typedef struct ssh_channel_callbacks_struct *ssh_channel_callbacks;
992
1020LIBSSH_API int ssh_set_channel_callbacks(ssh_channel channel,
1021 ssh_channel_callbacks cb);
1022
1039LIBSSH_API int ssh_add_channel_callbacks(ssh_channel channel,
1040 ssh_channel_callbacks cb);
1041
1054LIBSSH_API int ssh_remove_channel_callbacks(ssh_channel channel,
1055 ssh_channel_callbacks cb);
1056
1058
1062
1063typedef int (*ssh_thread_callback) (void **lock);
1064
1065typedef unsigned long (*ssh_thread_id_callback) (void);
1066struct ssh_threads_callbacks_struct {
1067 const char *type;
1068 ssh_thread_callback mutex_init;
1069 ssh_thread_callback mutex_destroy;
1070 ssh_thread_callback mutex_lock;
1071 ssh_thread_callback mutex_unlock;
1072 ssh_thread_id_callback thread_id;
1073};
1074
1092LIBSSH_API int ssh_threads_set_callbacks(struct ssh_threads_callbacks_struct
1093 *cb);
1094
1104LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_default(void);
1105
1112LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_pthread(void);
1113
1124LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_noop(void);
1126
1134LIBSSH_API int ssh_set_log_callback(ssh_logging_callback cb);
1135
1141LIBSSH_API ssh_logging_callback ssh_get_log_callback(void);
1142
1151typedef int (*ssh_jump_before_connection_callback)(ssh_session session,
1152 void *userdata);
1153
1162typedef int (*ssh_jump_verify_knownhost_callback)(ssh_session session,
1163 void *userdata);
1164
1172typedef int (*ssh_jump_authenticate_callback)(ssh_session session,
1173 void *userdata);
1174
1175 struct ssh_jump_callbacks_struct {
1176 void *userdata;
1177 ssh_jump_before_connection_callback before_connection;
1178 ssh_jump_verify_knownhost_callback verify_knownhost;
1179 ssh_jump_authenticate_callback authenticate;
1180};
1181
1182/* Security key callbacks */
1183
1184/*
1185 * Forward declarations for structs that have been defined in sk_api.h.
1186 * If you need to work with the fields inside them, please include
1187 * libssh/sk_api.h
1188 */
1189struct sk_enroll_response;
1190struct sk_sign_response;
1191struct sk_resident_key;
1192struct sk_option;
1193
1194#define LIBSSH_SK_API_VERSION_MAJOR 0x000a0000
1195
1217typedef uint32_t (*sk_api_version_callback)(void);
1218
1238typedef int (*sk_enroll_callback)(uint32_t alg,
1239 const uint8_t *challenge,
1240 size_t challenge_len,
1241 const char *application,
1242 uint8_t flags,
1243 const char *pin,
1244 struct sk_option **options,
1245 struct sk_enroll_response **enroll_response);
1246
1268typedef int (*sk_sign_callback)(uint32_t alg,
1269 const uint8_t *data,
1270 size_t data_len,
1271 const char *application,
1272 const uint8_t *key_handle,
1273 size_t key_handle_len,
1274 uint8_t flags,
1275 const char *pin,
1276 struct sk_option **options,
1277 struct sk_sign_response **sign_response);
1278
1295typedef int (*sk_load_resident_keys_callback)(
1296 const char *pin,
1297 struct sk_option **options,
1298 struct sk_resident_key ***resident_keys,
1299 size_t *num_keys_found);
1300
1311 struct ssh_sk_callbacks_struct {
1313 size_t size;
1314
1321 sk_api_version_callback api_version;
1322
1330 sk_enroll_callback enroll;
1331
1338 sk_sign_callback sign;
1339
1346 sk_load_resident_keys_callback load_resident_keys;
1347};
1348
1349typedef struct ssh_sk_callbacks_struct *ssh_sk_callbacks;
1350
1351const struct ssh_sk_callbacks_struct *ssh_sk_get_default_callbacks(void);
1352
1353#ifdef __cplusplus
1354}
1355#endif
1356
1357#endif /*_SSH_CALLBACK_H */
1358
1359/* @} */
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:713
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:910
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:761
ssh_set_callbacks
LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb)
Set the session callback functions.
Definition callbacks.c:56
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:822
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:837
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:803
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:776
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:679
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:692
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:702
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:713
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:276
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:607
ssh_auth_kbdint_callback
int(* ssh_auth_kbdint_callback)(ssh_message message, ssh_session session, void *userdata)
SSH authentication callback. Tries to authenticates user with the "keyboard-interactive" method.
Definition callbacks.h:289
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:725
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:138
ssh_channel_open_request_direct_tcpip_callback
ssh_channel(* ssh_channel_open_request_direct_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 "direct-tcpip" request. This happens when the client forwards an inco...
Definition callbacks.h:370
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:242
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:899
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:299
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:168
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:141
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:150
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:887
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:259
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:309
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:740
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:228
ssh_connect_status_callback
void(* ssh_connect_status_callback)(void *userdata, float status)
SSH connect status callback. These are functions that report the status of the connection i,...
Definition callbacks.h:125
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:854
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:787
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:868
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
sk_enroll_response
Response structure for FIDO2/U2F key enrollment operations.
Definition sk_api.h:84
sk_enroll_response::key_handle
uint8_t * key_handle
Opaque credential handle/ID used to identify this key.
Definition sk_api.h:113
sk_enroll_response::flags
uint8_t flags
FIDO2/U2F authenticator flags from the enrollment operation.
Definition sk_api.h:91
sk_enroll_response::key_handle_len
size_t key_handle_len
Length of key_handle buffer in bytes.
Definition sk_api.h:119
sk_option
Configuration option structure for FIDO2/U2F operations.
Definition sk_api.h:263
sk_resident_key
Structure representing a resident/discoverable credential.
Definition sk_api.h:204
sk_sign_response
Response structure for FIDO2/U2F key signing operations.
Definition sk_api.h:167
ssh_callbacks_struct
Definition callbacks.h:176
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:205
ssh_callbacks_struct::connect_status_function
ssh_connect_status_callback connect_status_function
Definition callbacks.h:195
ssh_callbacks_struct::log_function
ssh_log_callback log_function
Definition callbacks.h:190
ssh_callbacks_struct::auth_function
ssh_auth_callback auth_function
Definition callbacks.h:186
ssh_callbacks_struct::channel_open_request_x11_function
ssh_channel_open_request_x11_callback channel_open_request_x11_function
Definition callbacks.h:202
ssh_callbacks_struct::userdata
void * userdata
Definition callbacks.h:182
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:210
ssh_callbacks_struct::size
size_t size
Definition callbacks.h:178
ssh_callbacks_struct::global_request_function
ssh_global_request_callback global_request_function
Definition callbacks.h:199
ssh_jump_callbacks_struct
Definition callbacks.h:1175
ssh_server_callbacks_struct
Definition callbacks.h:382
ssh_server_callbacks_struct::gssapi_accept_sec_ctx_function
ssh_gssapi_accept_sec_ctx_callback gssapi_accept_sec_ctx_function
Definition callbacks.h:423
ssh_server_callbacks_struct::service_request_function
ssh_service_request_callback service_request_function
Definition callbacks.h:412
ssh_server_callbacks_struct::gssapi_verify_mic_function
ssh_gssapi_verify_mic_callback gssapi_verify_mic_function
Definition callbacks.h:426
ssh_server_callbacks_struct::size
size_t size
Definition callbacks.h:384
ssh_server_callbacks_struct::auth_kbdint_function
ssh_auth_kbdint_callback auth_kbdint_function
Definition callbacks.h:437
ssh_server_callbacks_struct::auth_none_function
ssh_auth_none_callback auth_none_function
Definition callbacks.h:397
ssh_server_callbacks_struct::auth_gssapi_mic_function
ssh_auth_gssapi_mic_callback auth_gssapi_mic_function
Definition callbacks.h:402
ssh_server_callbacks_struct::channel_open_request_session_function
ssh_channel_open_request_session_callback channel_open_request_session_function
Definition callbacks.h:416
ssh_server_callbacks_struct::auth_password_function
ssh_auth_password_callback auth_password_function
Definition callbacks.h:392
ssh_server_callbacks_struct::auth_pubkey_function
ssh_auth_pubkey_callback auth_pubkey_function
Definition callbacks.h:407
ssh_server_callbacks_struct::channel_open_request_direct_tcpip_function
ssh_channel_open_request_direct_tcpip_callback channel_open_request_direct_tcpip_function
Definition callbacks.h:432
ssh_server_callbacks_struct::userdata
void * userdata
Definition callbacks.h:388
ssh_server_callbacks_struct::gssapi_select_oid_function
ssh_gssapi_select_oid_callback gssapi_select_oid_function
Definition callbacks.h:420
ssh_sk_callbacks_struct
FIDO2/U2F security key callbacks structure.
Definition callbacks.h:1311
ssh_sk_callbacks_struct::sign
sk_sign_callback sign
Definition callbacks.h:1338
ssh_sk_callbacks_struct::enroll
sk_enroll_callback enroll
Definition callbacks.h:1330
ssh_sk_callbacks_struct::api_version
sk_api_version_callback api_version
Definition callbacks.h:1321
ssh_sk_callbacks_struct::size
size_t size
Definition callbacks.h:1313
ssh_sk_callbacks_struct::load_resident_keys
sk_load_resident_keys_callback load_resident_keys
Definition callbacks.h:1346
ssh_socket_callbacks_struct
Definition callbacks.h:472
ssh_socket_callbacks_struct::userdata
void * userdata
Definition callbacks.h:476
ssh_socket_callbacks_struct::data
ssh_callback_data data
Definition callbacks.h:481
ssh_socket_callbacks_struct::connected
ssh_callback_int_int connected
Definition callbacks.h:493
ssh_socket_callbacks_struct::controlflow
ssh_callback_int controlflow
Definition callbacks.h:485
ssh_socket_callbacks_struct::exception
ssh_callback_int_int exception
Definition callbacks.h:489