Ordered functions in libssh.h alphabeticaly
Этот коммит содержится в:
родитель
5223fa5740
Коммит
ab60d1d678
@ -107,20 +107,22 @@ typedef struct ssh_channel_struct CHANNEL;
|
||||
typedef struct ssh_agent_struct AGENT;
|
||||
#endif
|
||||
|
||||
typedef struct ssh_kbdint_struct SSH_KBDINT;
|
||||
typedef struct ssh_message_struct SSH_MESSAGE;
|
||||
typedef struct ssh_options_struct SSH_OPTIONS;
|
||||
typedef struct ssh_session_struct SSH_SESSION;
|
||||
typedef struct ssh_kbdint_struct SSH_KBDINT;
|
||||
|
||||
typedef struct ssh_string_struct* ssh_string;
|
||||
typedef struct ssh_buffer_struct* ssh_buffer;
|
||||
typedef struct ssh_public_key_struct* ssh_public_key;
|
||||
typedef struct ssh_private_key_struct* ssh_private_key;
|
||||
typedef struct ssh_options_struct* ssh_options;
|
||||
typedef struct ssh_channel_struct* ssh_channel;
|
||||
typedef struct ssh_agent_struct* ssh_agent;
|
||||
typedef struct ssh_session_struct* ssh_session;
|
||||
typedef struct ssh_buffer_struct* ssh_buffer;
|
||||
typedef struct ssh_channel_struct* ssh_channel;
|
||||
typedef struct ssh_kbdint_struct* ssh_kbdint;
|
||||
typedef struct ssh_message_struct *ssh_message;
|
||||
typedef struct ssh_options_struct* ssh_options;
|
||||
typedef struct ssh_private_key_struct* ssh_private_key;
|
||||
typedef struct ssh_public_key_struct* ssh_public_key;
|
||||
typedef struct ssh_scp_struct* ssh_scp;
|
||||
typedef struct ssh_session_struct* ssh_session;
|
||||
typedef struct ssh_string_struct* ssh_string;
|
||||
|
||||
/* Socket type */
|
||||
#ifdef _WIN32
|
||||
@ -209,12 +211,6 @@ typedef int socket_t;
|
||||
#define SSH_AGAIN -2 /* The nonblocking call must be repeated */
|
||||
#define SSH_EOF -127 /* We have already a eof */
|
||||
|
||||
LIBSSH_API const char *ssh_get_error(void *error);
|
||||
LIBSSH_API int ssh_get_error_code(void *error);
|
||||
|
||||
/* version checks */
|
||||
LIBSSH_API const char *ssh_version(int req_version);
|
||||
|
||||
/** \addtogroup ssh_log
|
||||
* @{
|
||||
*/
|
||||
@ -240,126 +236,6 @@ enum {
|
||||
};
|
||||
/** @}
|
||||
*/
|
||||
/*#define SSH_LOG_NOLOG 0 // no log
|
||||
#define SSH_LOG_RARE 1 // rare conditions
|
||||
#define SSH_LOG_ENTRY 2 // user-accessible entrypoints
|
||||
#define SSH_LOG_PACKET 3 // packet id and size
|
||||
#define SSH_LOG_FUNCTIONS 4 // every function in and return
|
||||
*/
|
||||
/* log.c */
|
||||
LIBSSH_API void ssh_log(SSH_SESSION *session, int prioriry, const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
|
||||
|
||||
/* session.c */
|
||||
LIBSSH_API SSH_SESSION *ssh_new(void);
|
||||
LIBSSH_API socket_t ssh_get_fd(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_get_version(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_get_status(SSH_SESSION *session);
|
||||
LIBSSH_API const char *ssh_get_disconnect_message(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_set_options(SSH_SESSION *session, SSH_OPTIONS *options);
|
||||
LIBSSH_API void ssh_set_fd_toread(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_set_fd_towrite(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_set_fd_except(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_set_blocking(SSH_SESSION *session, int blocking);
|
||||
LIBSSH_API void ssh_silent_disconnect(SSH_SESSION *session);
|
||||
|
||||
|
||||
/* client.c */
|
||||
LIBSSH_API int ssh_connect(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_disconnect(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_service_request(SSH_SESSION *session, const char *service);
|
||||
LIBSSH_API char *ssh_get_issue_banner(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_get_openssh_version(ssh_session session);
|
||||
/* get copyright informations */
|
||||
LIBSSH_API const char *ssh_copyright(void);
|
||||
|
||||
/* string.h */
|
||||
|
||||
/* You can use these functions, they won't change */
|
||||
/* string_from_char returns a newly allocated string from a char *ptr */
|
||||
LIBSSH_API ssh_string string_from_char(const char *what);
|
||||
/* it returns the string len in host byte orders. str->size is big endian warning ! */
|
||||
LIBSSH_API size_t string_len(ssh_string str);
|
||||
LIBSSH_API ssh_string string_new(size_t size);
|
||||
/* string_fill copies the data in the string. */
|
||||
LIBSSH_API int string_fill(ssh_string str, const void *data, size_t len);
|
||||
/* returns a newly allocated char array with the str string and a final nul caracter */
|
||||
LIBSSH_API char *string_to_char(ssh_string str);
|
||||
LIBSSH_API ssh_string string_copy(ssh_string str);
|
||||
/* burns the data inside a string */
|
||||
LIBSSH_API void string_burn(ssh_string str);
|
||||
LIBSSH_API void *string_data(ssh_string str);
|
||||
LIBSSH_API void string_free(ssh_string str);
|
||||
|
||||
/* useful for debug */
|
||||
LIBSSH_API char *ssh_get_hexa(const unsigned char *what, size_t len);
|
||||
LIBSSH_API void ssh_print_hexa(const char *descr, const unsigned char *what, size_t len);
|
||||
LIBSSH_API int ssh_get_random(void *where,int len,int strong);
|
||||
|
||||
/* this one can be called by the client to see the hash of the public key before accepting it */
|
||||
LIBSSH_API int ssh_get_pubkey_hash(SSH_SESSION *session, unsigned char **hash);
|
||||
LIBSSH_API void ssh_clean_pubkey_hash(unsigned char **hash);
|
||||
LIBSSH_API ssh_string ssh_get_pubkey(SSH_SESSION *session);
|
||||
|
||||
/* in connect.c */
|
||||
LIBSSH_API int ssh_select(ssh_channel *channels, ssh_channel *outchannels, socket_t maxfd,
|
||||
fd_set *readfds, struct timeval *timeout);
|
||||
|
||||
LIBSSH_API void publickey_free(ssh_public_key key);
|
||||
|
||||
/* in keyfiles.c */
|
||||
|
||||
LIBSSH_API ssh_private_key privatekey_from_file(SSH_SESSION *session, const char *filename,
|
||||
int type, const char *passphrase);
|
||||
LIBSSH_API ssh_string publickey_to_string(ssh_public_key key);
|
||||
LIBSSH_API ssh_public_key publickey_from_privatekey(ssh_private_key prv);
|
||||
LIBSSH_API void privatekey_free(ssh_private_key prv);
|
||||
LIBSSH_API ssh_string publickey_from_file(SSH_SESSION *session, const char *filename,
|
||||
int *type);
|
||||
LIBSSH_API int ssh_is_server_known(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_write_knownhost(SSH_SESSION *session);
|
||||
|
||||
/* in channels.c */
|
||||
|
||||
LIBSSH_API ssh_channel channel_new(SSH_SESSION *session);
|
||||
LIBSSH_API int channel_open_forward(ssh_channel channel, const char *remotehost,
|
||||
int remoteport, const char *sourcehost, int localport);
|
||||
LIBSSH_API int channel_open_session(ssh_channel channel);
|
||||
LIBSSH_API void channel_free(ssh_channel channel);
|
||||
LIBSSH_API int channel_request_pty(ssh_channel channel);
|
||||
LIBSSH_API int channel_request_pty_size(ssh_channel channel, const char *term,
|
||||
int cols, int rows);
|
||||
LIBSSH_API int channel_change_pty_size(ssh_channel channel,int cols,int rows);
|
||||
LIBSSH_API int channel_request_shell(ssh_channel channel);
|
||||
LIBSSH_API int channel_request_subsystem(ssh_channel channel, const char *system);
|
||||
LIBSSH_API int channel_request_env(ssh_channel channel, const char *name, const char *value);
|
||||
LIBSSH_API int channel_request_exec(ssh_channel channel, const char *cmd);
|
||||
LIBSSH_API int channel_request_send_signal(ssh_channel channel, const char *signal);
|
||||
LIBSSH_API int channel_request_sftp(ssh_channel channel);
|
||||
LIBSSH_API int channel_request_x11(ssh_channel channel, int single_connection, const char *protocol,
|
||||
const char *cookie, int screen_number);
|
||||
LIBSSH_API ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms);
|
||||
LIBSSH_API int channel_forward_listen(ssh_session session, const char *address, int port, int *bound_port);
|
||||
LIBSSH_API ssh_channel channel_forward_accept(ssh_session session, int timeout_ms);
|
||||
LIBSSH_API int channel_forward_cancel(ssh_session session, const char *address, int port);
|
||||
LIBSSH_API int channel_write(ssh_channel channel, const void *data, uint32_t len);
|
||||
LIBSSH_API int channel_send_eof(ssh_channel channel);
|
||||
LIBSSH_API int channel_is_eof(ssh_channel channel);
|
||||
LIBSSH_API int channel_read(ssh_channel channel, void *dest, uint32_t count, int is_stderr);
|
||||
LIBSSH_API int channel_read_buffer(ssh_channel channel, ssh_buffer buffer, uint32_t count,
|
||||
int is_stderr);
|
||||
LIBSSH_API int channel_poll(ssh_channel channel, int is_stderr);
|
||||
LIBSSH_API int channel_close(ssh_channel channel);
|
||||
LIBSSH_API void channel_set_blocking(ssh_channel channel, int blocking);
|
||||
LIBSSH_API int channel_read_nonblocking(ssh_channel channel, void *dest, uint32_t count,
|
||||
int is_stderr);
|
||||
LIBSSH_API int channel_is_open(ssh_channel channel);
|
||||
LIBSSH_API int channel_is_closed(ssh_channel channel);
|
||||
LIBSSH_API int channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct
|
||||
timeval * timeout);
|
||||
LIBSSH_API SSH_SESSION *channel_get_session(ssh_channel channel);
|
||||
LIBSSH_API int channel_get_exit_status(ssh_channel channel);
|
||||
|
||||
/* in options.c */
|
||||
|
||||
enum ssh_options_e {
|
||||
SSH_OPTIONS_HOST,
|
||||
@ -395,118 +271,6 @@ enum ssh_options_e {
|
||||
SSH_OPTIONS_SERVER_RSAKEY,
|
||||
SSH_OPTIONS_SERVER_BANNER,
|
||||
};
|
||||
|
||||
LIBSSH_API int ssh_options_set(ssh_options opt, enum ssh_options_e type,
|
||||
const void *value);
|
||||
|
||||
/**
|
||||
* @brief SSH authentication callback.
|
||||
*
|
||||
* @param prompt Prompt to be displayed.
|
||||
* @param buf Buffer to save the password. You should null-terminate it.
|
||||
* @param len Length of the buffer.
|
||||
* @param echo Enable or disable the echo of what you type.
|
||||
* @param verify Should the password be verified?
|
||||
* @param userdata Userdata to be passed to the callback function. Useful
|
||||
* for GUI applications.
|
||||
*
|
||||
* @return 0 on success, < 0 on error.
|
||||
*/
|
||||
typedef int (*ssh_auth_callback) (const char *prompt, char *buf, size_t len,
|
||||
int echo, int verify, void *userdata);
|
||||
|
||||
typedef void (*ssh_log_callback) (ssh_session session, int priority,
|
||||
const char *message, void *userdata);
|
||||
|
||||
LIBSSH_API SSH_OPTIONS *ssh_options_new(void);
|
||||
LIBSSH_API SSH_OPTIONS *ssh_options_copy(SSH_OPTIONS *opt);
|
||||
LIBSSH_API void ssh_options_free(SSH_OPTIONS *opt);
|
||||
LIBSSH_API int ssh_options_set_wanted_algos(SSH_OPTIONS *opt, int algo, const char *list);
|
||||
LIBSSH_API int ssh_options_set_username(SSH_OPTIONS *opt, const char *username);
|
||||
LIBSSH_API int ssh_options_set_port(SSH_OPTIONS *opt, unsigned int port);
|
||||
LIBSSH_API int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv);
|
||||
LIBSSH_API int ssh_options_set_host(SSH_OPTIONS *opt, const char *host);
|
||||
LIBSSH_API int ssh_options_set_fd(SSH_OPTIONS *opt, socket_t fd);
|
||||
LIBSSH_API int ssh_options_set_bind(SSH_OPTIONS *opt, const char *bindaddr, int port);
|
||||
LIBSSH_API int ssh_options_set_ssh_dir(SSH_OPTIONS *opt, const char *dir);
|
||||
LIBSSH_API int ssh_options_set_known_hosts_file(SSH_OPTIONS *opt, const char *dir);
|
||||
LIBSSH_API int ssh_options_set_identity(SSH_OPTIONS *opt, const char *identity);
|
||||
LIBSSH_API int ssh_options_set_banner(SSH_OPTIONS *opt, const char *banner);
|
||||
LIBSSH_API int ssh_options_set_status_callback(SSH_OPTIONS *opt, void (*callback)
|
||||
(void *arg, float status), void *arg);
|
||||
LIBSSH_API int ssh_options_set_timeout(SSH_OPTIONS *opt, long seconds, long usec);
|
||||
LIBSSH_API int ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow);
|
||||
LIBSSH_API int ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow);
|
||||
LIBSSH_API int ssh_options_set_log_function(SSH_OPTIONS *opt,
|
||||
ssh_log_callback cb, void *userdata);
|
||||
LIBSSH_API int ssh_options_set_log_verbosity(SSH_OPTIONS *opt, int verbosity);
|
||||
LIBSSH_API int ssh_options_set_dsa_server_key(SSH_OPTIONS *opt, const char *dsakey);
|
||||
LIBSSH_API int ssh_options_set_rsa_server_key(SSH_OPTIONS *opt, const char *rsakey);
|
||||
LIBSSH_API int ssh_options_set_auth_callback(SSH_OPTIONS *opt, ssh_auth_callback cb,
|
||||
void *userdata);
|
||||
LIBSSH_API int ssh_options_parse_config(SSH_OPTIONS *opt, const char *filename);
|
||||
|
||||
|
||||
/* buffer.c */
|
||||
|
||||
/** creates a new buffer
|
||||
*/
|
||||
LIBSSH_API ssh_buffer buffer_new(void);
|
||||
LIBSSH_API void buffer_free(ssh_buffer buffer);
|
||||
/* buffer_get returns a pointer to the begining of the buffer. no position is taken into account */
|
||||
LIBSSH_API void *buffer_get(ssh_buffer buffer);
|
||||
/* same here */
|
||||
/* FIXME should be size_t */
|
||||
LIBSSH_API uint32_t buffer_get_len(ssh_buffer buffer);
|
||||
|
||||
|
||||
/* in auth.c */
|
||||
LIBSSH_API int ssh_auth_list(SSH_SESSION *session);
|
||||
/* these functions returns AUTH_ERROR is some serious error has happened,
|
||||
AUTH_SUCCESS if success,
|
||||
AUTH_PARTIAL if partial success,
|
||||
AUTH_DENIED if refused */
|
||||
LIBSSH_API int ssh_userauth_list(SSH_SESSION *session, const char *username);
|
||||
LIBSSH_API int ssh_userauth_none(SSH_SESSION *session, const char *username);
|
||||
LIBSSH_API int ssh_userauth_password(SSH_SESSION *session, const char *username, const char *password);
|
||||
LIBSSH_API int ssh_userauth_offer_pubkey(SSH_SESSION *session, const char *username, int type, ssh_string publickey);
|
||||
LIBSSH_API int ssh_userauth_pubkey(SSH_SESSION *session, const char *username, ssh_string publickey, ssh_private_key privatekey);
|
||||
#ifndef _WIN32
|
||||
LIBSSH_API int ssh_userauth_agent_pubkey(SSH_SESSION *session, const char *username,
|
||||
ssh_public_key publickey);
|
||||
#endif
|
||||
LIBSSH_API int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase);
|
||||
LIBSSH_API int ssh_userauth_kbdint(SSH_SESSION *session, const char *user, const char *submethods);
|
||||
LIBSSH_API int ssh_userauth_kbdint_getnprompts(SSH_SESSION *session);
|
||||
LIBSSH_API const char *ssh_userauth_kbdint_getname(SSH_SESSION *session);
|
||||
LIBSSH_API const char *ssh_userauth_kbdint_getinstruction(SSH_SESSION *session);
|
||||
LIBSSH_API const char *ssh_userauth_kbdint_getprompt(SSH_SESSION *session, unsigned int i, char *echo);
|
||||
LIBSSH_API int ssh_userauth_kbdint_setanswer(SSH_SESSION *session, unsigned int i,
|
||||
const char *answer);
|
||||
|
||||
/* init.c */
|
||||
LIBSSH_API int ssh_init(void);
|
||||
LIBSSH_API int ssh_finalize(void);
|
||||
|
||||
/* misc.c */
|
||||
LIBSSH_API int ssh_mkdir (const char *pathname, mode_t mode);
|
||||
LIBSSH_API char *ssh_dirname (const char *path);
|
||||
LIBSSH_API char *ssh_basename (const char *path);
|
||||
|
||||
/* messages.c */
|
||||
typedef struct ssh_message_struct SSH_MESSAGE;
|
||||
typedef struct ssh_message_struct *ssh_message;
|
||||
|
||||
LIBSSH_API SSH_MESSAGE *ssh_message_retrieve(SSH_SESSION *session, uint32_t packettype);
|
||||
LIBSSH_API SSH_MESSAGE *ssh_message_get(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_message_type(SSH_MESSAGE *msg);
|
||||
LIBSSH_API int ssh_message_subtype(SSH_MESSAGE *msg);
|
||||
LIBSSH_API void ssh_message_free(SSH_MESSAGE *msg);
|
||||
|
||||
LIBSSH_API ssh_channel ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg);
|
||||
LIBSSH_API int ssh_message_channel_request_reply_success(SSH_MESSAGE *msg);
|
||||
|
||||
/* scp.c */
|
||||
enum {
|
||||
/** Code is going to write/create remote files */
|
||||
SSH_SCP_WRITE,
|
||||
@ -528,22 +292,195 @@ enum ssh_scp_request_types {
|
||||
SSH_SCP_REQUEST_WARNING
|
||||
};
|
||||
|
||||
LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location);
|
||||
LIBSSH_API int ssh_scp_init(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_close(ssh_scp scp);
|
||||
LIBSSH_API void ssh_scp_free(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, int mode);
|
||||
LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms);
|
||||
LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len);
|
||||
LIBSSH_API int ssh_scp_pull_request(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_deny_request(ssh_scp scp, const char *reason);
|
||||
/**
|
||||
* @brief SSH authentication callback.
|
||||
*
|
||||
* @param prompt Prompt to be displayed.
|
||||
* @param buf Buffer to save the password. You should null-terminate it.
|
||||
* @param len Length of the buffer.
|
||||
* @param echo Enable or disable the echo of what you type.
|
||||
* @param verify Should the password be verified?
|
||||
* @param userdata Userdata to be passed to the callback function. Useful
|
||||
* for GUI applications.
|
||||
*
|
||||
* @return 0 on success, < 0 on error.
|
||||
*/
|
||||
typedef int (*ssh_auth_callback) (const char *prompt, char *buf, size_t len,
|
||||
int echo, int verify, void *userdata);
|
||||
typedef void (*ssh_log_callback) (ssh_session session, int priority,
|
||||
const char *message, void *userdata);
|
||||
|
||||
|
||||
LIBSSH_API void buffer_free(ssh_buffer buffer);
|
||||
LIBSSH_API void *buffer_get(ssh_buffer buffer);
|
||||
LIBSSH_API uint32_t buffer_get_len(ssh_buffer buffer);
|
||||
LIBSSH_API ssh_buffer buffer_new(void);
|
||||
|
||||
LIBSSH_API ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms);
|
||||
LIBSSH_API int channel_change_pty_size(ssh_channel channel,int cols,int rows);
|
||||
LIBSSH_API ssh_channel channel_forward_accept(ssh_session session, int timeout_ms);
|
||||
LIBSSH_API int channel_close(ssh_channel channel);
|
||||
LIBSSH_API int channel_forward_cancel(ssh_session session, const char *address, int port);
|
||||
LIBSSH_API int channel_forward_listen(ssh_session session, const char *address, int port, int *bound_port);
|
||||
LIBSSH_API void channel_free(ssh_channel channel);
|
||||
LIBSSH_API int channel_get_exit_status(ssh_channel channel);
|
||||
LIBSSH_API ssh_session channel_get_session(ssh_channel channel);
|
||||
LIBSSH_API int channel_is_closed(ssh_channel channel);
|
||||
LIBSSH_API int channel_is_eof(ssh_channel channel);
|
||||
LIBSSH_API int channel_is_open(ssh_channel channel);
|
||||
LIBSSH_API ssh_channel channel_new(SSH_SESSION *session);
|
||||
LIBSSH_API int channel_open_forward(ssh_channel channel, const char *remotehost,
|
||||
int remoteport, const char *sourcehost, int localport);
|
||||
LIBSSH_API int channel_open_session(ssh_channel channel);
|
||||
LIBSSH_API int channel_poll(ssh_channel channel, int is_stderr);
|
||||
LIBSSH_API int channel_read(ssh_channel channel, void *dest, uint32_t count, int is_stderr);
|
||||
LIBSSH_API int channel_read_buffer(ssh_channel channel, ssh_buffer buffer, uint32_t count,
|
||||
int is_stderr);
|
||||
LIBSSH_API int channel_read_nonblocking(ssh_channel channel, void *dest, uint32_t count,
|
||||
int is_stderr);
|
||||
LIBSSH_API int channel_request_env(ssh_channel channel, const char *name, const char *value);
|
||||
LIBSSH_API int channel_request_exec(ssh_channel channel, const char *cmd);
|
||||
LIBSSH_API int channel_request_pty(ssh_channel channel);
|
||||
LIBSSH_API int channel_request_pty_size(ssh_channel channel, const char *term,
|
||||
int cols, int rows);
|
||||
LIBSSH_API int channel_request_shell(ssh_channel channel);
|
||||
LIBSSH_API int channel_request_send_signal(ssh_channel channel, const char *signal);
|
||||
LIBSSH_API int channel_request_sftp(ssh_channel channel);
|
||||
LIBSSH_API int channel_request_subsystem(ssh_channel channel, const char *system);
|
||||
LIBSSH_API int channel_request_x11(ssh_channel channel, int single_connection, const char *protocol,
|
||||
const char *cookie, int screen_number);
|
||||
LIBSSH_API int channel_send_eof(ssh_channel channel);
|
||||
LIBSSH_API int channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct
|
||||
timeval * timeout);
|
||||
LIBSSH_API void channel_set_blocking(ssh_channel channel, int blocking);
|
||||
LIBSSH_API int channel_write(ssh_channel channel, const void *data, uint32_t len);
|
||||
|
||||
LIBSSH_API void privatekey_free(ssh_private_key prv);
|
||||
LIBSSH_API ssh_private_key privatekey_from_file(SSH_SESSION *session, const char *filename,
|
||||
int type, const char *passphrase);
|
||||
LIBSSH_API void publickey_free(ssh_public_key key);
|
||||
LIBSSH_API ssh_string publickey_from_file(SSH_SESSION *session, const char *filename,
|
||||
int *type);
|
||||
LIBSSH_API ssh_public_key publickey_from_privatekey(ssh_private_key prv);
|
||||
LIBSSH_API ssh_string publickey_to_string(ssh_public_key key);
|
||||
|
||||
LIBSSH_API int ssh_auth_list(SSH_SESSION *session);
|
||||
LIBSSH_API char *ssh_basename (const char *path);
|
||||
LIBSSH_API void ssh_clean_pubkey_hash(unsigned char **hash);
|
||||
LIBSSH_API int ssh_connect(SSH_SESSION *session);
|
||||
LIBSSH_API const char *ssh_copyright(void);
|
||||
LIBSSH_API void ssh_disconnect(SSH_SESSION *session);
|
||||
LIBSSH_API char *ssh_dirname (const char *path);
|
||||
LIBSSH_API int ssh_finalize(void);
|
||||
LIBSSH_API const char *ssh_get_disconnect_message(SSH_SESSION *session);
|
||||
LIBSSH_API const char *ssh_get_error(void *error);
|
||||
LIBSSH_API int ssh_get_error_code(void *error);
|
||||
LIBSSH_API socket_t ssh_get_fd(SSH_SESSION *session);
|
||||
LIBSSH_API char *ssh_get_hexa(const unsigned char *what, size_t len);
|
||||
LIBSSH_API char *ssh_get_issue_banner(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_get_openssh_version(ssh_session session);
|
||||
LIBSSH_API ssh_string ssh_get_pubkey(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_get_pubkey_hash(SSH_SESSION *session, unsigned char **hash);
|
||||
LIBSSH_API int ssh_get_random(void *where,int len,int strong);
|
||||
LIBSSH_API int ssh_get_version(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_get_status(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_init(void);
|
||||
LIBSSH_API int ssh_is_server_known(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_log(SSH_SESSION *session, int prioriry, const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
|
||||
LIBSSH_API ssh_channel ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg);
|
||||
LIBSSH_API int ssh_message_channel_request_reply_success(SSH_MESSAGE *msg);
|
||||
LIBSSH_API void ssh_message_free(SSH_MESSAGE *msg);
|
||||
LIBSSH_API SSH_MESSAGE *ssh_message_get(SSH_SESSION *session);
|
||||
LIBSSH_API SSH_MESSAGE *ssh_message_retrieve(SSH_SESSION *session, uint32_t packettype);
|
||||
LIBSSH_API int ssh_message_subtype(SSH_MESSAGE *msg);
|
||||
LIBSSH_API int ssh_message_type(SSH_MESSAGE *msg);
|
||||
LIBSSH_API int ssh_mkdir (const char *pathname, mode_t mode);
|
||||
LIBSSH_API SSH_SESSION *ssh_new(void);
|
||||
LIBSSH_API SSH_OPTIONS *ssh_options_copy(SSH_OPTIONS *opt);
|
||||
LIBSSH_API void ssh_options_free(SSH_OPTIONS *opt);
|
||||
LIBSSH_API SSH_OPTIONS *ssh_options_new(void);
|
||||
|
||||
LIBSSH_API int ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow);
|
||||
LIBSSH_API int ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow);
|
||||
LIBSSH_API int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv);
|
||||
LIBSSH_API int ssh_options_parse_config(SSH_OPTIONS *opt, const char *filename);
|
||||
LIBSSH_API int ssh_options_set(ssh_options opt, enum ssh_options_e type,
|
||||
const void *value);
|
||||
LIBSSH_API int ssh_options_set_auth_callback(SSH_OPTIONS *opt, ssh_auth_callback cb,
|
||||
void *userdata);
|
||||
LIBSSH_API int ssh_options_set_banner(SSH_OPTIONS *opt, const char *banner);
|
||||
LIBSSH_API int ssh_options_set_bind(SSH_OPTIONS *opt, const char *bindaddr, int port);
|
||||
LIBSSH_API int ssh_options_set_dsa_server_key(SSH_OPTIONS *opt, const char *dsakey);
|
||||
LIBSSH_API int ssh_options_set_fd(SSH_OPTIONS *opt, socket_t fd);
|
||||
LIBSSH_API int ssh_options_set_host(SSH_OPTIONS *opt, const char *host);
|
||||
LIBSSH_API int ssh_options_set_identity(SSH_OPTIONS *opt, const char *identity);
|
||||
LIBSSH_API int ssh_options_set_log_function(SSH_OPTIONS *opt,
|
||||
ssh_log_callback cb, void *userdata);
|
||||
LIBSSH_API int ssh_options_set_log_verbosity(SSH_OPTIONS *opt, int verbosity);
|
||||
LIBSSH_API int ssh_options_set_known_hosts_file(SSH_OPTIONS *opt, const char *dir);
|
||||
LIBSSH_API int ssh_options_set_port(SSH_OPTIONS *opt, unsigned int port);
|
||||
LIBSSH_API int ssh_options_set_rsa_server_key(SSH_OPTIONS *opt, const char *rsakey);
|
||||
LIBSSH_API int ssh_options_set_ssh_dir(SSH_OPTIONS *opt, const char *dir);
|
||||
LIBSSH_API int ssh_options_set_status_callback(SSH_OPTIONS *opt, void (*callback)
|
||||
(void *arg, float status), void *arg);
|
||||
LIBSSH_API int ssh_options_set_timeout(SSH_OPTIONS *opt, long seconds, long usec);
|
||||
LIBSSH_API int ssh_options_set_username(SSH_OPTIONS *opt, const char *username);
|
||||
LIBSSH_API int ssh_options_set_wanted_algos(SSH_OPTIONS *opt, int algo, const char *list);
|
||||
LIBSSH_API void ssh_print_hexa(const char *descr, const unsigned char *what, size_t len);
|
||||
LIBSSH_API int ssh_scp_accept_request(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_close(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_deny_request(ssh_scp scp, const char *reason);
|
||||
LIBSSH_API void ssh_scp_free(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_init(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp);
|
||||
LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location);
|
||||
LIBSSH_API int ssh_scp_pull_request(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, int mode);
|
||||
LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms);
|
||||
LIBSSH_API int ssh_scp_read(ssh_scp scp, void *buffer, size_t size);
|
||||
LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_request_get_permissions(ssh_scp scp);
|
||||
LIBSSH_API size_t ssh_scp_request_get_size(ssh_scp scp);
|
||||
LIBSSH_API const char *ssh_scp_request_get_warning(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len);
|
||||
LIBSSH_API int ssh_select(ssh_channel *channels, ssh_channel *outchannels, socket_t maxfd,
|
||||
fd_set *readfds, struct timeval *timeout);
|
||||
LIBSSH_API int ssh_service_request(SSH_SESSION *session, const char *service);
|
||||
LIBSSH_API void ssh_set_blocking(SSH_SESSION *session, int blocking);
|
||||
LIBSSH_API void ssh_set_fd_except(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_set_fd_toread(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_set_fd_towrite(SSH_SESSION *session);
|
||||
LIBSSH_API void ssh_set_options(SSH_SESSION *session, SSH_OPTIONS *options);
|
||||
LIBSSH_API void ssh_silent_disconnect(SSH_SESSION *session);
|
||||
#ifndef _WIN32
|
||||
LIBSSH_API int ssh_userauth_agent_pubkey(SSH_SESSION *session, const char *username,
|
||||
ssh_public_key publickey);
|
||||
#endif
|
||||
LIBSSH_API int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase);
|
||||
LIBSSH_API int ssh_userauth_kbdint(SSH_SESSION *session, const char *user, const char *submethods);
|
||||
LIBSSH_API const char *ssh_userauth_kbdint_getinstruction(SSH_SESSION *session);
|
||||
LIBSSH_API const char *ssh_userauth_kbdint_getname(SSH_SESSION *session);
|
||||
LIBSSH_API int ssh_userauth_kbdint_getnprompts(SSH_SESSION *session);
|
||||
LIBSSH_API const char *ssh_userauth_kbdint_getprompt(SSH_SESSION *session, unsigned int i, char *echo);
|
||||
LIBSSH_API int ssh_userauth_kbdint_setanswer(SSH_SESSION *session, unsigned int i,
|
||||
const char *answer);
|
||||
LIBSSH_API int ssh_userauth_list(SSH_SESSION *session, const char *username);
|
||||
LIBSSH_API int ssh_userauth_none(SSH_SESSION *session, const char *username);
|
||||
LIBSSH_API int ssh_userauth_offer_pubkey(SSH_SESSION *session, const char *username, int type, ssh_string publickey);
|
||||
LIBSSH_API int ssh_userauth_password(SSH_SESSION *session, const char *username, const char *password);
|
||||
LIBSSH_API int ssh_userauth_pubkey(SSH_SESSION *session, const char *username, ssh_string publickey, ssh_private_key privatekey);
|
||||
LIBSSH_API const char *ssh_version(int req_version);
|
||||
LIBSSH_API int ssh_write_knownhost(SSH_SESSION *session);
|
||||
|
||||
LIBSSH_API void string_burn(ssh_string str);
|
||||
LIBSSH_API ssh_string string_copy(ssh_string str);
|
||||
LIBSSH_API void *string_data(ssh_string str);
|
||||
LIBSSH_API int string_fill(ssh_string str, const void *data, size_t len);
|
||||
LIBSSH_API void string_free(ssh_string str);
|
||||
LIBSSH_API ssh_string string_from_char(const char *what);
|
||||
LIBSSH_API size_t string_len(ssh_string str);
|
||||
LIBSSH_API ssh_string string_new(size_t size);
|
||||
LIBSSH_API char *string_to_char(ssh_string str);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user