aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-09-23 21:55:54 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2009-09-23 21:55:54 +0200
commit9a8d4cd0fdd18127065cacbc11296933669ea9ca (patch)
treecccf507167e28aa5038cea357d1f220668a4e937 /include
parentffed8b03bb6e170abbd9564547ba439302840618 (diff)
downloadlibssh-9a8d4cd0fdd18127065cacbc11296933669ea9ca.tar.gz
libssh-9a8d4cd0fdd18127065cacbc11296933669ea9ca.tar.xz
libssh-9a8d4cd0fdd18127065cacbc11296933669ea9ca.zip
get rid of SSH_SESSION
Diffstat (limited to 'include')
-rw-r--r--include/libssh/libssh.h78
-rw-r--r--include/libssh/priv.h134
-rw-r--r--include/libssh/server.h6
-rw-r--r--include/libssh/sftp.h6
4 files changed, 112 insertions, 112 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index cfb2583..21dfb26 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -302,7 +302,7 @@ 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 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);
@@ -330,46 +330,46 @@ 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,
+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,
+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 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 int ssh_connect(ssh_session session);
LIBSSH_API const char *ssh_copyright(void);
-LIBSSH_API void ssh_disconnect(SSH_SESSION *session);
+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_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 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 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 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_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 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 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_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);
@@ -413,32 +413,32 @@ 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);
+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,
+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,
+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 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 int ssh_write_knownhost(ssh_session session);
LIBSSH_API void string_burn(ssh_string str);
LIBSSH_API ssh_string string_copy(ssh_string str);
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 87bf1bf..83e4473 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -321,7 +321,7 @@ typedef struct ssh_crypto_struct {
struct ssh_channel_struct {
struct ssh_channel_struct *prev;
struct ssh_channel_struct *next;
- SSH_SESSION *session; /* SSH_SESSION pointer */
+ ssh_session session; /* SSH_SESSION pointer */
uint32_t local_channel;
uint32_t local_window;
int local_eof;
@@ -513,7 +513,7 @@ struct ssh_channel_request {
};
struct ssh_message_struct {
- SSH_SESSION *session;
+ ssh_session session;
int type;
struct ssh_auth_request auth_request;
struct ssh_channel_request_open channel_request_open;
@@ -601,7 +601,7 @@ int ssh_poll_ctx(SSH_POLL_CTX *ctx, int timeout);
struct socket;
int ssh_socket_init(void);
-struct socket *ssh_socket_new(SSH_SESSION *session);
+struct socket *ssh_socket_new(ssh_session session);
void ssh_socket_free(struct socket *s);
void ssh_socket_set_fd(struct socket *s, socket_t fd);
socket_t ssh_socket_get_fd(struct socket *s);
@@ -616,7 +616,7 @@ int ssh_socket_fd_isset(struct socket *s, fd_set *set);
void ssh_socket_fd_set(struct socket *s, fd_set *set, int *fd_max);
int ssh_socket_completeread(struct socket *s, void *buffer, uint32_t len);
int ssh_socket_completewrite(struct socket *s, const void *buffer, uint32_t len);
-int ssh_socket_wait_for_data(struct socket *s, SSH_SESSION *session, uint32_t len);
+int ssh_socket_wait_for_data(struct socket *s, ssh_session session, uint32_t len);
int ssh_socket_nonblocking_flush(struct socket *s);
int ssh_socket_blocking_flush(struct socket *s);
int ssh_socket_poll(struct socket *s, int *writeable, int *except);
@@ -628,12 +628,12 @@ int ssh_socket_data_available(struct socket *s);
int ssh_socket_data_writable(struct socket *s);
/* session.c */
-void ssh_cleanup(SSH_SESSION *session);
+void ssh_cleanup(ssh_session session);
/* client.c */
-int ssh_send_banner(SSH_SESSION *session, int is_server);
-char *ssh_get_banner(SSH_SESSION *session);
+int ssh_send_banner(ssh_session session, int is_server);
+char *ssh_get_banner(ssh_session session);
/* config.c */
int ssh_config_parse_file(ssh_options opt, const char *filename);
@@ -644,103 +644,103 @@ void ssh_set_error(void *error, int code, const char *descr, ...) PRINTF_ATTRIBU
/* in dh.c */
/* DH key generation */
void ssh_print_bignum(const char *which,bignum num);
-int dh_generate_e(SSH_SESSION *session);
-int dh_generate_f(SSH_SESSION *session);
-int dh_generate_x(SSH_SESSION *session);
-int dh_generate_y(SSH_SESSION *session);
+int dh_generate_e(ssh_session session);
+int dh_generate_f(ssh_session session);
+int dh_generate_x(ssh_session session);
+int dh_generate_y(ssh_session session);
int ssh_crypto_init(void);
void ssh_crypto_finalize(void);
-ssh_string dh_get_e(SSH_SESSION *session);
-ssh_string dh_get_f(SSH_SESSION *session);
-int dh_import_f(SSH_SESSION *session,ssh_string f_string);
-int dh_import_e(SSH_SESSION *session, ssh_string e_string);
-void dh_import_pubkey(SSH_SESSION *session,ssh_string pubkey_string);
-int dh_build_k(SSH_SESSION *session);
-int make_sessionid(SSH_SESSION *session);
+ssh_string dh_get_e(ssh_session session);
+ssh_string dh_get_f(ssh_session session);
+int dh_import_f(ssh_session session,ssh_string f_string);
+int dh_import_e(ssh_session session, ssh_string e_string);
+void dh_import_pubkey(ssh_session session,ssh_string pubkey_string);
+int dh_build_k(ssh_session session);
+int make_sessionid(ssh_session session);
/* add data for the final cookie */
-int hashbufin_add_cookie(SSH_SESSION *session, unsigned char *cookie);
-int hashbufout_add_cookie(SSH_SESSION *session);
-int generate_session_keys(SSH_SESSION *session);
-int sig_verify(SSH_SESSION *session, ssh_public_key pubkey,
+int hashbufin_add_cookie(ssh_session session, unsigned char *cookie);
+int hashbufout_add_cookie(ssh_session session);
+int generate_session_keys(ssh_session session);
+int sig_verify(ssh_session session, ssh_public_key pubkey,
SIGNATURE *signature, unsigned char *digest, int size);
/* returns 1 if server signature ok, 0 otherwise. The NEXT crypto is checked, not the current one */
-int signature_verify(SSH_SESSION *session,ssh_string signature);
+int signature_verify(ssh_session session,ssh_string signature);
bignum make_string_bn(ssh_string string);
ssh_string make_bignum_string(bignum num);
/* in crypt.c */
-uint32_t packet_decrypt_len(SSH_SESSION *session,char *crypted);
-int packet_decrypt(SSH_SESSION *session, void *packet,unsigned int len);
-unsigned char *packet_encrypt(SSH_SESSION *session,void *packet,unsigned int len);
+uint32_t packet_decrypt_len(ssh_session session,char *crypted);
+int packet_decrypt(ssh_session session, void *packet,unsigned int len);
+unsigned char *packet_encrypt(ssh_session session,void *packet,unsigned int len);
/* it returns the hmac buffer if exists*/
-int packet_hmac_verify(SSH_SESSION *session,ssh_buffer buffer,unsigned char *mac);
+int packet_hmac_verify(ssh_session session,ssh_buffer buffer,unsigned char *mac);
/* in packet.c */
-void packet_parse(SSH_SESSION *session);
-int packet_send(SSH_SESSION *session);
+void packet_parse(ssh_session session);
+int packet_send(ssh_session session);
-int packet_read(SSH_SESSION *session);
-int packet_translate(SSH_SESSION *session);
-int packet_wait(SSH_SESSION *session,int type,int blocking);
-int packet_flush(SSH_SESSION *session, int enforce_blocking);
+int packet_read(ssh_session session);
+int packet_translate(ssh_session session);
+int packet_wait(ssh_session session,int type,int blocking);
+int packet_flush(ssh_session session, int enforce_blocking);
/* connect.c */
int ssh_regex_init(void);
void ssh_regex_finalize(void);
-SSH_SESSION *ssh_session_new();
-socket_t ssh_connect_host(SSH_SESSION *session, const char *host,const char
+ssh_session ssh_session_new();
+socket_t ssh_connect_host(ssh_session session, const char *host,const char
*bind_addr, int port, long timeout, long usec);
/* in kex.c */
extern const char *ssh_kex_nums[];
-int ssh_send_kex(SSH_SESSION *session, int server_kex);
-void ssh_list_kex(SSH_SESSION *session, KEX *kex);
-int set_kex(SSH_SESSION *session);
-int ssh_get_kex(SSH_SESSION *session, int server_kex);
+int ssh_send_kex(ssh_session session, int server_kex);
+void ssh_list_kex(ssh_session session, KEX *kex);
+int set_kex(ssh_session session);
+int ssh_get_kex(ssh_session session, int server_kex);
int verify_existing_algo(int algo, const char *name);
char **space_tokenize(const char *chain);
-int ssh_get_kex1(SSH_SESSION *session);
+int ssh_get_kex1(ssh_session session);
char *ssh_find_matching(const char *in_d, const char *what_d);
/* in keyfiles.c */
ssh_private_key _privatekey_from_file(void *session, const char *filename,
int type);
-ssh_string try_publickey_from_file(SSH_SESSION *session,
+ssh_string try_publickey_from_file(ssh_session session,
struct ssh_keys_struct keytab,
char **privkeyfile, int *type);
/* in keys.c */
const char *ssh_type_to_char(int type);
int ssh_type_from_name(const char *name);
-ssh_buffer ssh_userauth_build_digest(SSH_SESSION *session, ssh_message msg, char *service);
+ssh_buffer ssh_userauth_build_digest(ssh_session session, ssh_message msg, char *service);
-ssh_private_key privatekey_make_dss(SSH_SESSION *session, ssh_buffer buffer);
-ssh_private_key privatekey_make_rsa(SSH_SESSION *session, ssh_buffer buffer,
+ssh_private_key privatekey_make_dss(ssh_session session, ssh_buffer buffer);
+ssh_private_key privatekey_make_rsa(ssh_session session, ssh_buffer buffer,
const char *type);
-ssh_private_key privatekey_from_string(SSH_SESSION *session, ssh_string privkey_s);
+ssh_private_key privatekey_from_string(ssh_session session, ssh_string privkey_s);
-ssh_public_key publickey_make_dss(SSH_SESSION *session, ssh_buffer buffer);
-ssh_public_key publickey_make_rsa(SSH_SESSION *session, ssh_buffer buffer, int type);
-ssh_public_key publickey_from_string(SSH_SESSION *session, ssh_string pubkey_s);
-SIGNATURE *signature_from_string(SSH_SESSION *session, ssh_string signature,ssh_public_key pubkey,int needed_type);
+ssh_public_key publickey_make_dss(ssh_session session, ssh_buffer buffer);
+ssh_public_key publickey_make_rsa(ssh_session session, ssh_buffer buffer, int type);
+ssh_public_key publickey_from_string(ssh_session session, ssh_string pubkey_s);
+SIGNATURE *signature_from_string(ssh_session session, ssh_string signature,ssh_public_key pubkey,int needed_type);
void signature_free(SIGNATURE *sign);
ssh_string ssh_do_sign_with_agent(struct ssh_session_struct *session,
struct ssh_buffer_struct *buf, struct ssh_public_key_struct *publickey);
-ssh_string ssh_do_sign(SSH_SESSION *session,ssh_buffer sigbuf,
+ssh_string ssh_do_sign(ssh_session session,ssh_buffer sigbuf,
ssh_private_key privatekey);
-ssh_string ssh_sign_session_id(SSH_SESSION *session, ssh_private_key privatekey);
-ssh_string ssh_encrypt_rsa1(SSH_SESSION *session, ssh_string data, ssh_public_key key);
+ssh_string ssh_sign_session_id(ssh_session session, ssh_private_key privatekey);
+ssh_string ssh_encrypt_rsa1(ssh_session session, ssh_string data, ssh_public_key key);
/* channel.c */
-void channel_handle(SSH_SESSION *session, int type);
-ssh_channel channel_new(SSH_SESSION *session);
+void channel_handle(ssh_session session, int type);
+ssh_channel channel_new(ssh_session session);
int channel_default_bufferize(ssh_channel channel, void *data, int len,
int is_stderr);
-uint32_t ssh_channel_new_id(SSH_SESSION *session);
-ssh_channel ssh_channel_from_local(SSH_SESSION *session, uint32_t id);
+uint32_t ssh_channel_new_id(ssh_session session);
+ssh_channel ssh_channel_from_local(ssh_session session, uint32_t id);
int channel_write_common(ssh_channel channel, const void *data,
uint32_t len, int is_stderr);
@@ -785,12 +785,12 @@ ssh_buffer base64_to_bin(const char *source);
unsigned char *bin_to_base64(const unsigned char *source, int len);
/* gzip.c */
-int compress_buffer(SSH_SESSION *session,ssh_buffer buf);
-int decompress_buffer(SSH_SESSION *session,ssh_buffer buf, size_t maxlen);
+int compress_buffer(ssh_session session,ssh_buffer buf);
+int decompress_buffer(ssh_session session,ssh_buffer buf, size_t maxlen);
/* wrapper.c */
-int crypt_set_algorithms(SSH_SESSION *);
-int crypt_set_algorithms_server(SSH_SESSION *session);
+int crypt_set_algorithms(ssh_session );
+int crypt_set_algorithms_server(ssh_session session);
CRYPTO *crypto_new(void);
void crypto_free(CRYPTO *crypto);
@@ -798,10 +798,10 @@ void crypto_free(CRYPTO *crypto);
uint32_t ssh_crc32(const char *buf, uint32_t len);
/* auth1.c */
-int ssh_userauth1_none(SSH_SESSION *session, const char *username);
-int ssh_userauth1_offer_pubkey(SSH_SESSION *session, const char *username,
+int ssh_userauth1_none(ssh_session session, const char *username);
+int ssh_userauth1_offer_pubkey(ssh_session session, const char *username,
int type, ssh_string pubkey);
-int ssh_userauth1_password(SSH_SESSION *session, const char *username,
+int ssh_userauth1_password(ssh_session session, const char *username,
const char *password);
/* in misc.c */
/* gets the user home dir. */
@@ -854,20 +854,20 @@ int channel_request_pty_size1(ssh_channel channel, const char *terminal,
int channel_change_pty_size1(ssh_channel channel, int cols, int rows);
int channel_request_shell1(ssh_channel channel);
int channel_request_exec1(ssh_channel channel, const char *cmd);
-int channel_handle1(SSH_SESSION *session, int type);
+int channel_handle1(ssh_session session, int type);
int channel_write1(ssh_channel channel, const void *data, int len);
/* session.c */
-int ssh_handle_packets(SSH_SESSION *session);
+int ssh_handle_packets(ssh_session session);
/* match.c */
int match_hostname(const char *host, const char *pattern, unsigned int len);
/* messages.c */
-void message_handle(SSH_SESSION *session, uint32_t type);
-int ssh_execute_message_callbacks(SSH_SESSION *session);
+void message_handle(ssh_session session, uint32_t type);
+int ssh_execute_message_callbacks(ssh_session session);
/* scp.c */
int ssh_scp_read_string(ssh_scp scp, char *buffer, size_t len);
diff --git a/include/libssh/server.h b/include/libssh/server.h
index 26f16b5..fefee1b 100644
--- a/include/libssh/server.h
+++ b/include/libssh/server.h
@@ -103,7 +103,7 @@ LIBSSH_API void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind);
*
* @return A newly allocated ssh session, NULL on error.
*/
-LIBSSH_API SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind);
+LIBSSH_API ssh_session ssh_bind_accept(SSH_BIND *ssh_bind);
/**
* @brief Free a ssh servers bind.
@@ -119,7 +119,7 @@ LIBSSH_API void ssh_bind_free(SSH_BIND *ssh_bind);
*
* @return 0 on success, < 0 on error.
*/
-LIBSSH_API int ssh_accept(SSH_SESSION *session);
+LIBSSH_API int ssh_accept(ssh_session session);
LIBSSH_API int channel_write_stderr(ssh_channel channel, const void *data, uint32_t len);
@@ -136,7 +136,7 @@ LIBSSH_API int ssh_message_auth_set_methods(SSH_MESSAGE *msg, int methods);
LIBSSH_API int ssh_message_service_reply_success(SSH_MESSAGE *msg);
LIBSSH_API char *ssh_message_service_service(SSH_MESSAGE *msg);
-LIBSSH_API void ssh_set_message_callback(SSH_SESSION *session,
+LIBSSH_API void ssh_set_message_callback(ssh_session session,
int(*ssh_message_callback)(ssh_session session, ssh_message msg));
LIBSSH_API char *ssh_message_channel_request_open_originator(SSH_MESSAGE *msg);
diff --git a/include/libssh/sftp.h b/include/libssh/sftp.h
index fd35460..3bb242b 100644
--- a/include/libssh/sftp.h
+++ b/include/libssh/sftp.h
@@ -70,7 +70,7 @@ extern "C" {
typedef struct sftp_ext_struct *sftp_ext;
typedef struct sftp_session_struct {
- SSH_SESSION *session;
+ ssh_session session;
ssh_channel channel;
int server_version;
int client_version;
@@ -194,7 +194,7 @@ typedef struct sftp_statvfs_struct {
*
* @return A new sftp session or NULL on error.
*/
-LIBSSH_API SFTP_SESSION *sftp_new(SSH_SESSION *session);
+LIBSSH_API SFTP_SESSION *sftp_new(ssh_session session);
/**
* @brief Close and deallocate a sftp session.
@@ -764,7 +764,7 @@ LIBSSH_API int sftp_server_version(SFTP_SESSION *sftp);
*
* @return A new sftp server session.
*/
-LIBSSH_API SFTP_SESSION *sftp_server_new(SSH_SESSION *session, ssh_channel chan);
+LIBSSH_API SFTP_SESSION *sftp_server_new(ssh_session session, ssh_channel chan);
/**
* @brief Intialize the sftp server.