25 #if defined _WIN32 || defined __CYGWIN__
31 #define LIBSSH_API __attribute__((dllexport))
33 #define LIBSSH_API __declspec(dllexport)
37 #define LIBSSH_API __attribute__((dllimport))
39 #define LIBSSH_API __declspec(dllimport)
44 #if __GNUC__ >= 4 && !defined(__OS2__)
45 #define LIBSSH_API __attribute__((visibility("default")))
54 typedef unsigned int uint32_t;
55 typedef unsigned short uint16_t;
56 typedef unsigned char uint8_t;
57 typedef unsigned long long uint64_t;
67 #include <sys/select.h>
71 #define SSH_STRINGIFY(s) SSH_TOSTRING(s)
72 #define SSH_TOSTRING(s) #s
75 #define SSH_VERSION_INT(a, b, c) ((a) << 16 | (b) << 8 | (c))
76 #define SSH_VERSION_DOT(a, b, c) a ##.## b ##.## c
77 #define SSH_VERSION(a, b, c) SSH_VERSION_DOT(a, b, c)
80 #define LIBSSH_VERSION_MAJOR 0
81 #define LIBSSH_VERSION_MINOR 5
82 #define LIBSSH_VERSION_MICRO 2
84 #define LIBSSH_VERSION_INT SSH_VERSION_INT(LIBSSH_VERSION_MAJOR, \
85 LIBSSH_VERSION_MINOR, \
87 #define LIBSSH_VERSION SSH_VERSION(LIBSSH_VERSION_MAJOR, \
88 LIBSSH_VERSION_MINOR, \
93 #define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
95 #define PRINTF_ATTRIBUTE(a,b)
99 #define SSH_DEPRECATED __attribute__ ((deprecated))
101 #define SSH_DEPRECATED
109 typedef struct ssh_agent_struct* ssh_agent;
110 typedef struct ssh_buffer_struct* ssh_buffer;
111 typedef struct ssh_channel_struct* ssh_channel;
112 typedef struct ssh_message_struct* ssh_message;
113 typedef struct ssh_pcap_file_struct* ssh_pcap_file;
114 typedef struct ssh_private_key_struct* ssh_private_key;
115 typedef struct ssh_public_key_struct* ssh_public_key;
116 typedef struct ssh_key_struct* ssh_key;
117 typedef struct ssh_scp_struct* ssh_scp;
118 typedef struct ssh_session_struct* ssh_session;
119 typedef struct ssh_string_struct* ssh_string;
124 typedef SOCKET socket_t;
128 typedef int socket_t;
132 #define SSH_INVALID_SOCKET ((socket_t) -1)
135 enum ssh_kex_types_e {
163 #define SSH_AUTH_METHOD_UNKNOWN 0
164 #define SSH_AUTH_METHOD_NONE 0x0001
165 #define SSH_AUTH_METHOD_PASSWORD 0x0002
166 #define SSH_AUTH_METHOD_PUBLICKEY 0x0004
167 #define SSH_AUTH_METHOD_HOSTBASED 0x0008
168 #define SSH_AUTH_METHOD_INTERACTIVE 0x0010
171 enum ssh_requests_e {
173 SSH_REQUEST_CHANNEL_OPEN,
179 enum ssh_channel_type_e {
180 SSH_CHANNEL_UNKNOWN=0,
182 SSH_CHANNEL_DIRECT_TCPIP,
183 SSH_CHANNEL_FORWARDED_TCPIP,
187 enum ssh_channel_requests_e {
188 SSH_CHANNEL_REQUEST_UNKNOWN=0,
189 SSH_CHANNEL_REQUEST_PTY,
190 SSH_CHANNEL_REQUEST_EXEC,
191 SSH_CHANNEL_REQUEST_SHELL,
192 SSH_CHANNEL_REQUEST_ENV,
193 SSH_CHANNEL_REQUEST_SUBSYSTEM,
194 SSH_CHANNEL_REQUEST_WINDOW_CHANGE
197 enum ssh_global_requests_e {
198 SSH_GLOBAL_REQUEST_UNKNOWN=0,
199 SSH_GLOBAL_REQUEST_TCPIP_FORWARD,
200 SSH_GLOBAL_REQUEST_CANCEL_TCPIP_FORWARD,
203 enum ssh_publickey_state_e {
204 SSH_PUBLICKEY_STATE_ERROR=-1,
205 SSH_PUBLICKEY_STATE_NONE=0,
206 SSH_PUBLICKEY_STATE_VALID=1,
207 SSH_PUBLICKEY_STATE_WRONG=2
211 #define SSH_CLOSED 0x01
212 #define SSH_READ_PENDING 0x02
213 #define SSH_CLOSED_ERROR 0x04
215 enum ssh_server_known_e {
217 SSH_SERVER_NOT_KNOWN=0,
219 SSH_SERVER_KNOWN_CHANGED,
220 SSH_SERVER_FOUND_OTHER,
221 SSH_SERVER_FILE_NOT_FOUND
224 #ifndef MD5_DIGEST_LEN
225 #define MD5_DIGEST_LEN 16
229 enum ssh_error_types_e {
238 SSH_KEYTYPE_UNKNOWN=0,
281 SSH_OPTIONS_PORT_STR,
285 SSH_OPTIONS_IDENTITY,
286 SSH_OPTIONS_ADD_IDENTITY,
287 SSH_OPTIONS_KNOWNHOSTS,
289 SSH_OPTIONS_TIMEOUT_USEC,
292 SSH_OPTIONS_LOG_VERBOSITY,
293 SSH_OPTIONS_LOG_VERBOSITY_STR,
294 SSH_OPTIONS_CIPHERS_C_S,
295 SSH_OPTIONS_CIPHERS_S_C,
296 SSH_OPTIONS_COMPRESSION_C_S,
297 SSH_OPTIONS_COMPRESSION_S_C,
298 SSH_OPTIONS_PROXYCOMMAND,
299 SSH_OPTIONS_BINDADDR,
300 SSH_OPTIONS_STRICTHOSTKEYCHECK,
301 SSH_OPTIONS_COMPRESSION,
302 SSH_OPTIONS_COMPRESSION_LEVEL
310 SSH_SCP_RECURSIVE=0x10
313 enum ssh_scp_request_types {
315 SSH_SCP_REQUEST_NEWDIR=1,
317 SSH_SCP_REQUEST_NEWFILE,
321 SSH_SCP_REQUEST_ENDDIR,
323 SSH_SCP_REQUEST_WARNING
338 int remoteport,
const char *sourcehost,
int localport);
341 LIBSSH_API
int ssh_channel_read(ssh_channel channel,
void *dest, uint32_t count,
int is_stderr);
351 LIBSSH_API
int ssh_channel_request_sftp(ssh_channel channel);
354 const char *cookie,
int screen_number);
356 LIBSSH_API
int ssh_channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans,
struct
359 LIBSSH_API
int ssh_channel_write(ssh_channel channel,
const void *data, uint32_t len);
360 LIBSSH_API uint32_t ssh_channel_window_size(ssh_channel channel);
363 ssh_string *publickey,
int *type);
369 LIBSSH_API
const char *ssh_copyright(
void);
374 LIBSSH_API
int ssh_forward_cancel(ssh_session session,
const char *address,
int port);
375 LIBSSH_API
int ssh_forward_listen(ssh_session session,
const char *address,
int port,
int *bound_port);
376 LIBSSH_API
void ssh_free(ssh_session session);
380 LIBSSH_API socket_t
ssh_get_fd(ssh_session session);
381 LIBSSH_API
char *ssh_get_hexa(
const unsigned char *what,
size_t len);
384 LIBSSH_API ssh_string ssh_get_pubkey(ssh_session session);
386 LIBSSH_API
int ssh_get_random(
void *where,
int len,
int strong);
393 LIBSSH_API
void ssh_log(ssh_session session,
int prioriry,
const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
394 LIBSSH_API ssh_channel ssh_message_channel_request_open_reply_accept(ssh_message msg);
395 LIBSSH_API
int ssh_message_channel_request_reply_success(ssh_message msg);
396 LIBSSH_API
void ssh_message_free(ssh_message msg);
398 LIBSSH_API
int ssh_message_subtype(ssh_message msg);
399 LIBSSH_API
int ssh_message_type(ssh_message msg);
400 LIBSSH_API
int ssh_mkdir (const
char *pathname, mode_t mode);
401 LIBSSH_API ssh_session
ssh_new(
void);
406 LIBSSH_API
int ssh_options_set(ssh_session session, enum ssh_options_e type,
408 LIBSSH_API
int ssh_pcap_file_close(ssh_pcap_file pcap);
409 LIBSSH_API
void ssh_pcap_file_free(ssh_pcap_file pcap);
410 LIBSSH_API ssh_pcap_file ssh_pcap_file_new(
void);
411 LIBSSH_API
int ssh_pcap_file_open(ssh_pcap_file pcap, const
char *filename);
415 LIBSSH_API
void ssh_print_hexa(const
char *descr, const
unsigned char *what,
size_t len);
417 LIBSSH_API
int ssh_scp_close(ssh_scp scp);
419 LIBSSH_API
void ssh_scp_free(ssh_scp scp);
420 LIBSSH_API
int ssh_scp_init(ssh_scp scp);
422 LIBSSH_API ssh_scp
ssh_scp_new(ssh_session session,
int mode, const
char *location);
425 LIBSSH_API
int ssh_scp_push_file(ssh_scp scp, const
char *filename,
size_t size,
int perms);
426 LIBSSH_API
int ssh_scp_read(ssh_scp scp,
void *buffer,
size_t size);
431 LIBSSH_API
int ssh_scp_write(ssh_scp scp, const
void *buffer,
size_t len);
432 LIBSSH_API
int ssh_select(ssh_channel *channels, ssh_channel *outchannels, socket_t maxfd,
433 fd_set *readfds, struct timeval *timeout);
434 LIBSSH_API
int ssh_service_request(ssh_session session, const
char *service);
440 LIBSSH_API
int ssh_set_pcap_file(ssh_session session, ssh_pcap_file pcapfile);
443 ssh_public_key publickey);
446 LIBSSH_API
int ssh_userauth_kbdint(ssh_session session,
const char *user,
const char *submethods);
456 LIBSSH_API
int ssh_userauth_password(ssh_session session,
const char *username,
const char *password);
457 LIBSSH_API
int ssh_userauth_pubkey(ssh_session session,
const char *username, ssh_string publickey, ssh_private_key privatekey);
459 const char *filename,
const char *passphrase);
460 LIBSSH_API
const char *
ssh_version(
int req_version);
466 LIBSSH_API
int ssh_string_fill(ssh_string str,
const void *data,
size_t len);
474 LIBSSH_API
int ssh_getpass(
const char *prompt,
char *buf,
size_t len,
int echo,
477 #ifndef LIBSSH_LEGACY_0_4
478 #include "libssh/legacy.h"
int ssh_userauth_offer_pubkey(ssh_session session, const char *username, int type, ssh_string publickey)
Try to authenticate through public key.
Definition: auth.c:494
int ssh_userauth_kbdint(ssh_session session, const char *user, const char *submethods)
Try to authenticate through the "keyboard-interactive" method.
Definition: auth.c:1687
int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash)
Allocates a buffer with the MD5 hash of the server public key.
Definition: dh.c:844
char * ssh_string_to_char(struct ssh_string_struct *s)
Convert a SSH string to a C nul-terminated string.
Definition: string.c:147
int ssh_channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct timeval *timeout)
Act like the standard select(2) on channels.
Definition: channels.c:2661
int ssh_userauth_agent_pubkey(ssh_session session, const char *username, ssh_public_key publickey)
Try to authenticate through public key with an ssh agent.
Definition: auth.c:839
int ssh_options_parse_config(ssh_session session, const char *filename)
Parse the ssh config file.
Definition: options.c:868
int ssh_channel_request_x11(ssh_channel channel, int single_connection, const char *protocol, const char *cookie, int screen_number)
Sends the "x11-req" channel request over an existing session channel.
Definition: channels.c:1711
int ssh_channel_request_shell(ssh_channel channel)
Request a shell.
Definition: channels.c:1622
int ssh_init(void)
Initialize global cryptographic data structures.
Definition: init.c:53
int ssh_channel_open_forward(ssh_channel channel, const char *remotehost, int remoteport, const char *sourcehost, int localport)
Open a TCP/IP forwarding channel.
Definition: channels.c:925
void ssh_log(ssh_session session, int prioriry, const char *format,...)
Log a SSH event.
Definition: log.c:76
int ssh_channel_is_eof(ssh_channel channel)
Check if remote has sent an EOF.
Definition: channels.c:1304
ssh_channel ssh_forward_accept(ssh_session session, int timeout_ms)
Accept an incoming TCP/IP forwarding channel.
Definition: channels.c:2029
int ssh_channel_send_eof(ssh_channel channel)
Send an end of file on the channel.
Definition: channels.c:1038
Only rare and noteworthy events.
Definition: libssh.h:265
void ssh_clean_pubkey_hash(unsigned char **hash)
Deallocate the hash obtained by ssh_get_pubkey_hash.
Definition: dh.c:890
int ssh_channel_close(ssh_channel channel)
Close a channel.
Definition: channels.c:1082
int ssh_forward_cancel(ssh_session session, const char *address, int port)
Sends the "cancel-tcpip-forward" global request to ask the server to cancel the tcpip-forward request...
Definition: channels.c:2045
void ssh_set_fd_toread(ssh_session session)
Tell the session it has data to read on the file descriptor without blocking.
Definition: session.c:373
int ssh_userauth_pubkey(ssh_session session, const char *username, ssh_string publickey, ssh_private_key privatekey)
Try to authenticate through public key.
Definition: auth.c:619
int ssh_scp_leave_directory(ssh_scp scp)
Leave a directory.
Definition: scp.c:236
ssh_string ssh_string_new(size_t size)
Create a new SSH String object.
Definition: string.c:53
int ssh_scp_deny_request(ssh_scp scp, const char *reason)
Deny the transfer of a file or creation of a directory coming from the remote party.
Definition: scp.c:584
int ssh_get_openssh_version(ssh_session session)
Get the version of the OpenSSH server, if it is not an OpenSSH server then 0 will be returned...
Definition: client.c:743
const char * ssh_version(int req_version)
Check if libssh is the required version or get the version string.
Definition: misc.c:361
ssh_message ssh_message_get(ssh_session session)
Retrieve a SSH message from a SSH session.
Definition: messages.c:172
int ssh_userauth_list(ssh_session session, const char *username)
retrieves available authentication methods for this session
Definition: auth.c:325
const char * ssh_get_error(void *error)
Retrieve the error text message from the last error.
Definition: error.c:97
Lower level protocol infomations, packet level.
Definition: libssh.h:271
int ssh_channel_write(ssh_channel channel, const void *data, uint32_t len)
Blocking write on a channel.
Definition: channels.c:1267
int ssh_scp_accept_request(ssh_scp scp)
Accepts transfer of a file or creation of a directory coming from the remote party.
Definition: scp.c:613
int ssh_channel_request_pty_size(ssh_channel channel, const char *term, int cols, int rows)
Request a pty with a specific type and size.
Definition: channels.c:1498
int ssh_channel_request_subsystem(ssh_channel channel, const char *subsystem)
Request a subsystem (for example "sftp").
Definition: channels.c:1642
ssh_string ssh_string_from_char(const char *what)
Create a ssh string using a C string.
Definition: string.c:100
int ssh_getpass(const char *prompt, char *buf, size_t len, int echo, int verify)
Get a password from the console.
Definition: getpass.c:207
int ssh_get_version(ssh_session session)
Get the protocol version of the session.
Definition: session.c:573
int ssh_channel_request_env(ssh_channel channel, const char *name, const char *value)
Set environment variables.
Definition: channels.c:2089
void ssh_set_fd_except(ssh_session session)
Tell the session it has an exception to catch on the file descriptor.
Definition: session.c:399
char * ssh_get_issue_banner(ssh_session session)
Get the issue banner from the server.
Definition: client.c:725
int ssh_string_fill(struct ssh_string_struct *s, const void *data, size_t len)
Fill a string with given data.
Definition: string.c:80
int ssh_userauth_kbdint_getnprompts(ssh_session session)
Get the number of prompts (questions) the server has given.
Definition: auth.c:1744
int ssh_options_copy(ssh_session src, ssh_session *dest)
Duplicate the options of a session structure.
Definition: options.c:62
const char * ssh_userauth_kbdint_getinstruction(ssh_session session)
Get the "instruction" of the message block.
Definition: auth.c:1785
int ssh_userauth_privatekey_file(ssh_session session, const char *username, const char *filename, const char *passphrase)
Try to authenticate through a private key file.
Definition: auth.c:774
int ssh_channel_open_session(ssh_channel channel)
Open a session channel (suited for a shell, not TCP forwarding).
Definition: channels.c:889
struct ssh_string_struct * ssh_string_copy(struct ssh_string_struct *s)
Copy a string, return a newly allocated string.
Definition: string.c:186
int ssh_userauth_autopubkey(ssh_session session, const char *passphrase)
Tries to automatically authenticate with public key and "none".
Definition: auth.c:1113
void ssh_set_blocking(ssh_session session, int blocking)
Set the session in blocking/nonblocking mode.
Definition: session.c:290
int ssh_channel_is_open(ssh_channel channel)
Check if the channel is open or not.
Definition: channels.c:1280
int ssh_write_knownhost(ssh_session session)
Write the current server as known in the known hosts file.
Definition: known_hosts.c:530
int ssh_channel_is_closed(ssh_channel channel)
Check if the channel is closed or not.
Definition: channels.c:1293
Every function path.
Definition: libssh.h:274
ssh_session ssh_channel_get_session(ssh_channel channel)
Recover the session in which belongs a channel.
Definition: channels.c:2537
ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location)
Create a new scp session.
Definition: scp.c:53
const char * ssh_scp_request_get_filename(ssh_scp scp)
Get the name of the directory or file being pushed from the other party.
Definition: scp.c:694
int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len)
Write into a remote scp file.
Definition: scp.c:381
int ssh_channel_poll(ssh_channel channel, int is_stderr)
Polls a channel for data to read.
Definition: channels.c:2499
int ssh_is_connected(ssh_session session)
Check if we are connected.
Definition: session.c:341
No logging at all.
Definition: libssh.h:262
ssh_channel ssh_channel_new(ssh_session session)
Allocate a new channel.
Definition: channels.c:79
int ssh_options_set(ssh_session session, enum ssh_options_e type, const void *value)
This function can set all possible ssh options.
Definition: options.c:348
int ssh_options_getopt(ssh_session session, int *argcptr, char **argv)
Parse command line arguments.
Definition: options.c:696
const char * ssh_userauth_kbdint_getprompt(ssh_session session, unsigned int i, char *echo)
Get a prompt from a message block.
Definition: auth.c:1811
const char * ssh_userauth_kbdint_getname(ssh_session session)
Get the "name" of the message block.
Definition: auth.c:1764
int ssh_userauth_password(ssh_session session, const char *username, const char *password)
Try to authenticate by password.
Definition: auth.c:974
int ssh_userauth_kbdint_setanswer(ssh_session session, unsigned int i, const char *answer)
Set the answer for a question from a message block.
Definition: auth.c:1845
int ssh_select(ssh_channel *channels, ssh_channel *outchannels, socket_t maxfd, fd_set *readfds, struct timeval *timeout)
A wrapper for the select syscall.
Definition: connect.c:434
socket_t ssh_get_fd(ssh_session session)
Get the fd of a connection.
Definition: session.c:359
int ssh_channel_change_pty_size(ssh_channel channel, int cols, int rows)
Change the size of the terminal associated to a channel.
Definition: channels.c:1578
int ssh_connect(ssh_session session)
Connect to the ssh server.
Definition: client.c:621
void ssh_disconnect(ssh_session session)
Disconnect from a session (client or server).
Definition: client.c:757
int ssh_userauth_none(ssh_session session, const char *username)
Try to authenticate through the "none" method.
Definition: auth.c:358
void ssh_string_free(struct ssh_string_struct *s)
Deallocate a SSH string object.
Definition: string.c:235
ssh_channel ssh_channel_accept_x11(ssh_channel channel, int timeout_ms)
Accept an X11 forwarding channel.
Definition: channels.c:1811
int ssh_mkdir(const char *pathname, mode_t mode)
Attempts to create a directory with the given pathname.
Definition: misc.c:618
int ssh_blocking_flush(ssh_session session, int timeout)
Blocking flush of the outgoing buffer.
Definition: session.c:319
int ssh_channel_request_send_signal(ssh_channel channel, const char *signum)
Send a signal to remote process (as described in RFC 4254, section 6.9).
Definition: channels.c:2226
void ssh_set_fd_towrite(ssh_session session)
Tell the session it may write to the file descriptor without blocking.
Definition: session.c:386
High level protocol information.
Definition: libssh.h:268
const char * ssh_scp_request_get_warning(ssh_scp scp)
Get the warning string from a scp handle.
Definition: scp.c:756
int ssh_scp_request_get_permissions(ssh_scp scp)
Get the permissions of the directory or file being pushed from the other party.
Definition: scp.c:706
size_t ssh_scp_request_get_size(ssh_scp scp)
Get the size of the file being pushed from the other party.
Definition: scp.c:716
void * ssh_string_data(struct ssh_string_struct *s)
Get the payload of the string.
Definition: string.c:222
int ssh_scp_read(ssh_scp scp, void *buffer, size_t size)
Read from a remote scp file.
Definition: scp.c:643
char * ssh_basename(const char *path)
basename - parse filename component.
Definition: misc.c:567
int ssh_finalize(void)
Finalize and cleanup all libssh and cryptographic data structures.
Definition: init.c:73
void ssh_string_burn(struct ssh_string_struct *s)
Destroy the data in a string so it couldn't appear in a core dump.
Definition: string.c:208
int ssh_channel_request_exec(ssh_channel channel, const char *cmd)
Run a shell command without an interactive shell.
Definition: channels.c:2158
enum ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey)
returns the type of a private key
Definition: keyfiles.c:839
int ssh_channel_request_pty(ssh_channel channel)
Request a PTY.
Definition: channels.c:1559
void ssh_silent_disconnect(ssh_session session)
Disconnect impolitely from a remote host by closing the socket.
Definition: session.c:268
int ssh_forward_listen(ssh_session session, const char *address, int port, int *bound_port)
Sends the "tcpip-forward" global request to ask the server to begin listening for inbound connections...
Definition: channels.c:1982
const char * ssh_get_disconnect_message(ssh_session session)
Get the disconnect message from the server.
Definition: session.c:545
size_t ssh_string_len(struct ssh_string_struct *s)
Return the size of a SSH string.
Definition: string.c:128
void ssh_channel_set_blocking(ssh_channel channel, int blocking)
Put the channel into blocking or nonblocking mode.
Definition: channels.c:1325
ssh_session ssh_new(void)
Create a new ssh session.
Definition: session.c:55
int ssh_get_status(ssh_session session)
Get session status.
Definition: session.c:511
void ssh_channel_free(ssh_channel channel)
Close and free a channel.
Definition: channels.c:997
int ssh_scp_pull_request(ssh_scp scp)
Wait for a scp request (file, directory).
Definition: scp.c:487
void ssh_string_free_char(char *s)
Deallocate a char string object.
Definition: string.c:174
int ssh_is_server_known(ssh_session session)
Check if the server is known.
Definition: known_hosts.c:414
int ssh_is_blocking(ssh_session session)
Return the blocking mode of libssh.
Definition: session.c:304
int ssh_channel_get_exit_status(ssh_channel channel)
Get the exit status of the channel (error code from the executed instruction).
Definition: channels.c:2550
int ssh_try_publickey_from_file(ssh_session session, const char *keyfile, ssh_string *publickey, int *type)
Try to read the public key from a given file.
Definition: keyfiles.c:1149
int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms)
Initialize the sending of a file to a scp in sink mode.
Definition: scp.c:280
int ssh_scp_push_directory(ssh_scp scp, const char *dirname, int mode)
Create a directory in a scp in sink mode.
Definition: scp.c:192
int ssh_channel_read(ssh_channel channel, void *dest, uint32_t count, int is_stderr)
Reads data from a channel.
Definition: channels.c:2364
void ssh_free(ssh_session session)
Deallocate a SSH session handle.
Definition: session.c:159
int ssh_channel_read_nonblocking(ssh_channel channel, void *dest, uint32_t count, int is_stderr)
Do a nonblocking read on the channel.
Definition: channels.c:2461
int ssh_auth_list(ssh_session session)
retrieves available authentication methods for this session
Definition: auth.c:310
char * ssh_dirname(const char *path)
Parse directory component.
Definition: misc.c:512
int ssh_get_error_code(void *error)
Retrieve the error code from the last error.
Definition: error.c:117