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

libssh 0.12.2 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
260 typedef int (*ssh_auth_gssapi_mic_callback) (ssh_session session, const char *user, const char *principal,
261 void *userdata);
262
277 typedef int (*ssh_auth_pubkey_callback) (ssh_session session, const char *user, struct ssh_key_struct *pubkey,
278 char signature_state, void *userdata);
279
290 typedef int (*ssh_auth_kbdint_callback) (ssh_message message, ssh_session session, void *userdata);
291
300 typedef int (*ssh_service_request_callback) (ssh_session session, const char *service, void *userdata);
301
310 typedef ssh_channel (*ssh_channel_open_request_session_callback) (ssh_session session, void *userdata);
311
324typedef ssh_string (*ssh_gssapi_select_oid_callback) (ssh_session session, const char *user,
325 int n_oid, ssh_string *oids, void *userdata);
326
339typedef int (*ssh_gssapi_accept_sec_ctx_callback) (ssh_session session,
340 ssh_string input_token, ssh_string *output_token, void *userdata);
341
353typedef int (*ssh_gssapi_verify_mic_callback) (ssh_session session,
354 ssh_string mic, void *mic_buffer, size_t mic_buffer_size, void *userdata);
355
371 typedef ssh_channel (*ssh_channel_open_request_direct_tcpip_callback)(
372 ssh_session session,
373 const char *destination_address,
374 int destination_port,
375 const char *originator_address,
376 int originator_port,
377 void *userdata);
378
382
383 struct ssh_server_callbacks_struct {
385 size_t size;
389 void *userdata;
393 ssh_auth_password_callback auth_password_function;
394
398 ssh_auth_none_callback auth_none_function;
399
403 ssh_auth_gssapi_mic_callback auth_gssapi_mic_function;
404
408 ssh_auth_pubkey_callback auth_pubkey_function;
409
413 ssh_service_request_callback service_request_function;
417 ssh_channel_open_request_session_callback channel_open_request_session_function;
421 ssh_gssapi_select_oid_callback gssapi_select_oid_function;
424 ssh_gssapi_accept_sec_ctx_callback gssapi_accept_sec_ctx_function;
427 ssh_gssapi_verify_mic_callback gssapi_verify_mic_function;
432 ssh_channel_open_request_direct_tcpip_callback
433 channel_open_request_direct_tcpip_function;
434
438 ssh_auth_kbdint_callback auth_kbdint_function;
439
440};
441typedef struct ssh_server_callbacks_struct *ssh_server_callbacks;
442
467LIBSSH_API int ssh_set_server_callbacks(ssh_session session, ssh_server_callbacks cb);
468
473 struct ssh_socket_callbacks_struct {
477 void *userdata;
482 ssh_callback_data data;
486 ssh_callback_int controlflow;
490 ssh_callback_int_int exception;
494 ssh_callback_int_int connected;
495};
496typedef struct ssh_socket_callbacks_struct *ssh_socket_callbacks;
497
498#define SSH_SOCKET_FLOW_WRITEWILLBLOCK 1
499#define SSH_SOCKET_FLOW_WRITEWONTBLOCK 2
500
501#define SSH_SOCKET_EXCEPTION_EOF 1
502#define SSH_SOCKET_EXCEPTION_ERROR 2
503
504#define SSH_SOCKET_CONNECTED_OK 1
505#define SSH_SOCKET_CONNECTED_ERROR 2
506#define SSH_SOCKET_CONNECTED_TIMEOUT 3
507
515#define ssh_callbacks_init(p) do {\
516 (p)->size=sizeof(*(p)); \
517} while(0);
518
528#define ssh_callbacks_exists(p,c) (\
529 (p != NULL) && ( (char *)&((p)-> c) < (char *)(p) + (p)->size ) && \
530 ((p)-> c != NULL) \
531 )
532
549#define ssh_callbacks_execute_list(list, cbtype, c, ...) \
550 do { \
551 struct ssh_iterator *i = ssh_list_get_iterator(list); \
552 cbtype cb; \
553 while (i != NULL){ \
554 cb = ssh_iterator_value(cbtype, i); \
555 if (ssh_callbacks_exists(cb, c)) \
556 cb-> c (__VA_ARGS__, cb->userdata); \
557 i = i->next; \
558 } \
559 } while(0)
560
581#define ssh_callbacks_iterate(_cb_list, _cb_type, _cb_name) \
582 do { \
583 struct ssh_iterator *_cb_i = ssh_list_get_iterator(_cb_list); \
584 _cb_type _cb; \
585 for (; _cb_i != NULL; _cb_i = _cb_i->next) { \
586 _cb = ssh_iterator_value(_cb_type, _cb_i); \
587 if (ssh_callbacks_exists(_cb, _cb_name))
588
589#define ssh_callbacks_iterate_exec(_cb_name, ...) \
590 _cb->_cb_name(__VA_ARGS__, _cb->userdata)
591
592#define ssh_callbacks_iterate_end() \
593 } \
594 } while(0)
595
608 typedef int (*ssh_packet_callback) (ssh_session session, uint8_t type, ssh_buffer packet, void *user);
609
612#define SSH_PACKET_USED 1
615#define SSH_PACKET_NOT_USED 2
616
617
625#define SSH_PACKET_CALLBACK(name) \
626 int name (ssh_session session, uint8_t type, ssh_buffer packet, void *user)
627
628struct ssh_packet_callbacks_struct {
630 uint8_t start;
632 uint8_t n_callbacks;
634 ssh_packet_callback *callbacks;
638 void *user;
639};
640
641typedef struct ssh_packet_callbacks_struct *ssh_packet_callbacks;
642
667LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb);
668
680 typedef int (*ssh_channel_data_callback) (ssh_session session,
681 ssh_channel channel,
682 void *data,
683 uint32_t len,
684 int is_stderr,
685 void *userdata);
686
693 typedef void (*ssh_channel_eof_callback) (ssh_session session,
694 ssh_channel channel,
695 void *userdata);
696
703 typedef void (*ssh_channel_close_callback) (ssh_session session,
704 ssh_channel channel,
705 void *userdata);
706
714 typedef void (*ssh_channel_signal_callback) (ssh_session session,
715 ssh_channel channel,
716 const char *signal,
717 void *userdata);
718
726 typedef void (*ssh_channel_exit_status_callback) (ssh_session session,
727 ssh_channel channel,
728 int exit_status,
729 void *userdata);
730
741 typedef void (*ssh_channel_exit_signal_callback) (ssh_session session,
742 ssh_channel channel,
743 const char *signal,
744 int core,
745 const char *errmsg,
746 const char *lang,
747 void *userdata);
748
762 typedef int (*ssh_channel_pty_request_callback) (ssh_session session,
763 ssh_channel channel,
764 const char *term,
765 int width, int height,
766 int pxwidth, int pwheight,
767 void *userdata);
768
777 typedef int (*ssh_channel_shell_request_callback) (ssh_session session,
778 ssh_channel channel,
779 void *userdata);
788 typedef void (*ssh_channel_auth_agent_req_callback) (ssh_session session,
789 ssh_channel channel,
790 void *userdata);
791
804 typedef void (*ssh_channel_x11_req_callback) (ssh_session session,
805 ssh_channel channel,
806 int single_connection,
807 const char *auth_protocol,
808 const char *auth_cookie,
809 uint32_t screen_number,
810 void *userdata);
823 typedef int (*ssh_channel_pty_window_change_callback) (ssh_session session,
824 ssh_channel channel,
825 int width, int height,
826 int pxwidth, int pwheight,
827 void *userdata);
828
838 typedef int (*ssh_channel_exec_request_callback) (ssh_session session,
839 ssh_channel channel,
840 const char *command,
841 void *userdata);
842
855 typedef int (*ssh_channel_env_request_callback) (ssh_session session,
856 ssh_channel channel,
857 const char *env_name,
858 const char *env_value,
859 void *userdata);
869 typedef int (*ssh_channel_subsystem_request_callback) (ssh_session session,
870 ssh_channel channel,
871 const char *subsystem,
872 void *userdata);
873
888 typedef int (*ssh_channel_write_wontblock_callback) (ssh_session session,
889 ssh_channel channel,
890 uint32_t bytes,
891 void *userdata);
892
900 typedef void (*ssh_channel_open_resp_callback) (ssh_session session,
901 ssh_channel channel,
902 bool is_success,
903 void *userdata);
904
911 typedef void (*ssh_channel_request_resp_callback) (ssh_session session,
912 ssh_channel channel,
913 void *userdata);
914
915struct ssh_channel_callbacks_struct {
917 size_t size;
921 void *userdata;
925 ssh_channel_data_callback channel_data_function;
929 ssh_channel_eof_callback channel_eof_function;
933 ssh_channel_close_callback channel_close_function;
937 ssh_channel_signal_callback channel_signal_function;
941 ssh_channel_exit_status_callback channel_exit_status_function;
945 ssh_channel_exit_signal_callback channel_exit_signal_function;
949 ssh_channel_pty_request_callback channel_pty_request_function;
953 ssh_channel_shell_request_callback channel_shell_request_function;
957 ssh_channel_auth_agent_req_callback channel_auth_agent_req_function;
961 ssh_channel_x11_req_callback channel_x11_req_function;
965 ssh_channel_pty_window_change_callback channel_pty_window_change_function;
969 ssh_channel_exec_request_callback channel_exec_request_function;
973 ssh_channel_env_request_callback channel_env_request_function;
977 ssh_channel_subsystem_request_callback channel_subsystem_request_function;
981 ssh_channel_write_wontblock_callback channel_write_wontblock_function;
985 ssh_channel_open_resp_callback channel_open_response_function;
989 ssh_channel_request_resp_callback channel_request_response_function;
990};
991
992typedef struct ssh_channel_callbacks_struct *ssh_channel_callbacks;
993
1021LIBSSH_API int ssh_set_channel_callbacks(ssh_channel channel,
1022 ssh_channel_callbacks cb);
1023
1040LIBSSH_API int ssh_add_channel_callbacks(ssh_channel channel,
1041 ssh_channel_callbacks cb);
1042
1055LIBSSH_API int ssh_remove_channel_callbacks(ssh_channel channel,
1056 ssh_channel_callbacks cb);
1057
1059
1063
1064typedef int (*ssh_thread_callback) (void **lock);
1065
1066typedef unsigned long (*ssh_thread_id_callback) (void);
1067struct ssh_threads_callbacks_struct {
1068 const char *type;
1069 ssh_thread_callback mutex_init;
1070 ssh_thread_callback mutex_destroy;
1071 ssh_thread_callback mutex_lock;
1072 ssh_thread_callback mutex_unlock;
1073 ssh_thread_id_callback thread_id;
1074};
1075
1093LIBSSH_API int ssh_threads_set_callbacks(struct ssh_threads_callbacks_struct
1094 *cb);
1095
1105LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_default(void);
1106
1113LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_pthread(void);
1114
1125LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_noop(void);
1127
1135LIBSSH_API int ssh_set_log_callback(ssh_logging_callback cb);
1136
1142LIBSSH_API ssh_logging_callback ssh_get_log_callback(void);
1143
1152typedef int (*ssh_jump_before_connection_callback)(ssh_session session,
1153 void *userdata);
1154
1163typedef int (*ssh_jump_verify_knownhost_callback)(ssh_session session,
1164 void *userdata);
1165
1173typedef int (*ssh_jump_authenticate_callback)(ssh_session session,
1174 void *userdata);
1175
1176 struct ssh_jump_callbacks_struct {
1177 void *userdata;
1178 ssh_jump_before_connection_callback before_connection;
1179 ssh_jump_verify_knownhost_callback verify_knownhost;
1180 ssh_jump_authenticate_callback authenticate;
1181};
1182
1183/* Security key callbacks */
1184
1185/*
1186 * Forward declarations for structs that have been defined in sk_api.h.
1187 * If you need to work with the fields inside them, please include
1188 * libssh/sk_api.h
1189 */
1190struct sk_enroll_response;
1191struct sk_sign_response;
1192struct sk_resident_key;
1193struct sk_option;
1194
1195#define LIBSSH_SK_API_VERSION_MAJOR 0x000a0000
1196
1218typedef uint32_t (*sk_api_version_callback)(void);
1219
1239typedef int (*sk_enroll_callback)(uint32_t alg,
1240 const uint8_t *challenge,
1241 size_t challenge_len,
1242 const char *application,
1243 uint8_t flags,
1244 const char *pin,
1245 struct sk_option **options,
1246 struct sk_enroll_response **enroll_response);
1247
1269typedef int (*sk_sign_callback)(uint32_t alg,
1270 const uint8_t *data,
1271 size_t data_len,
1272 const char *application,
1273 const uint8_t *key_handle,
1274 size_t key_handle_len,
1275 uint8_t flags,
1276 const char *pin,
1277 struct sk_option **options,
1278 struct sk_sign_response **sign_response);
1279
1296typedef int (*sk_load_resident_keys_callback)(
1297 const char *pin,
1298 struct sk_option **options,
1299 struct sk_resident_key ***resident_keys,
1300 size_t *num_keys_found);
1301
1312 struct ssh_sk_callbacks_struct {
1314 size_t size;
1315
1322 sk_api_version_callback api_version;
1323
1331 sk_enroll_callback enroll;
1332
1339 sk_sign_callback sign;
1340
1347 sk_load_resident_keys_callback load_resident_keys;
1348};
1349
1350typedef struct ssh_sk_callbacks_struct *ssh_sk_callbacks;
1351
1352const struct ssh_sk_callbacks_struct *ssh_sk_get_default_callbacks(void);
1353
1354#ifdef __cplusplus
1355}
1356#endif
1357
1358#endif /*_SSH_CALLBACK_H */
1359
1360/* @} */
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:911
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:762
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:823
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:838
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:804
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:777
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:680
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:693
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:703
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:714
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:277
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:608
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:290
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:726
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:371
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:900
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:300
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:888
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 authenticate user with the "gssapi-with-mic" or "gssapi-keyex" ...
Definition callbacks.h:260
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: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:741
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:855
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:788
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:869
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:1176
ssh_server_callbacks_struct
Definition callbacks.h:383
ssh_server_callbacks_struct::gssapi_accept_sec_ctx_function
ssh_gssapi_accept_sec_ctx_callback gssapi_accept_sec_ctx_function
Definition callbacks.h:424
ssh_server_callbacks_struct::service_request_function
ssh_service_request_callback service_request_function
Definition callbacks.h:413
ssh_server_callbacks_struct::gssapi_verify_mic_function
ssh_gssapi_verify_mic_callback gssapi_verify_mic_function
Definition callbacks.h:427
ssh_server_callbacks_struct::size
size_t size
Definition callbacks.h:385
ssh_server_callbacks_struct::auth_kbdint_function
ssh_auth_kbdint_callback auth_kbdint_function
Definition callbacks.h:438
ssh_server_callbacks_struct::auth_none_function
ssh_auth_none_callback auth_none_function
Definition callbacks.h:398
ssh_server_callbacks_struct::auth_gssapi_mic_function
ssh_auth_gssapi_mic_callback auth_gssapi_mic_function
Definition callbacks.h:403
ssh_server_callbacks_struct::channel_open_request_session_function
ssh_channel_open_request_session_callback channel_open_request_session_function
Definition callbacks.h:417
ssh_server_callbacks_struct::auth_password_function
ssh_auth_password_callback auth_password_function
Definition callbacks.h:393
ssh_server_callbacks_struct::auth_pubkey_function
ssh_auth_pubkey_callback auth_pubkey_function
Definition callbacks.h:408
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:433
ssh_server_callbacks_struct::userdata
void * userdata
Definition callbacks.h:389
ssh_server_callbacks_struct::gssapi_select_oid_function
ssh_gssapi_select_oid_callback gssapi_select_oid_function
Definition callbacks.h:421
ssh_sk_callbacks_struct
FIDO2/U2F security key callbacks structure.
Definition callbacks.h:1312
ssh_sk_callbacks_struct::sign
sk_sign_callback sign
Definition callbacks.h:1339
ssh_sk_callbacks_struct::enroll
sk_enroll_callback enroll
Definition callbacks.h:1331
ssh_sk_callbacks_struct::api_version
sk_api_version_callback api_version
Definition callbacks.h:1322
ssh_sk_callbacks_struct::size
size_t size
Definition callbacks.h:1314
ssh_sk_callbacks_struct::load_resident_keys
sk_load_resident_keys_callback load_resident_keys
Definition callbacks.h:1347
ssh_socket_callbacks_struct
Definition callbacks.h:473
ssh_socket_callbacks_struct::userdata
void * userdata
Definition callbacks.h:477
ssh_socket_callbacks_struct::data
ssh_callback_data data
Definition callbacks.h:482
ssh_socket_callbacks_struct::connected
ssh_callback_int_int connected
Definition callbacks.h:494
ssh_socket_callbacks_struct::controlflow
ssh_callback_int controlflow
Definition callbacks.h:486
ssh_socket_callbacks_struct::exception
ssh_callback_int_int exception
Definition callbacks.h:490