|
libssh
0.7.2
|
00001 /* 00002 * This file is part of the SSH Library 00003 * 00004 * Copyright (c) 2010 by Aris Adamantiadis 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 /* Since libssh.h includes legacy.h, it's important that libssh.h is included 00022 * first. we don't define LEGACY_H now because we want it to be defined when 00023 * included from libssh.h 00024 * All function calls declared in this header are deprecated and meant to be 00025 * removed in future. 00026 */ 00027 00028 #ifndef LEGACY_H_ 00029 #define LEGACY_H_ 00030 00031 typedef struct ssh_private_key_struct* ssh_private_key; 00032 typedef struct ssh_public_key_struct* ssh_public_key; 00033 00034 LIBSSH_API int ssh_auth_list(ssh_session session); 00035 LIBSSH_API int ssh_userauth_offer_pubkey(ssh_session session, const char *username, int type, ssh_string publickey); 00036 LIBSSH_API int ssh_userauth_pubkey(ssh_session session, const char *username, ssh_string publickey, ssh_private_key privatekey); 00037 #ifndef _WIN32 00038 LIBSSH_API int ssh_userauth_agent_pubkey(ssh_session session, const char *username, 00039 ssh_public_key publickey); 00040 #endif 00041 LIBSSH_API int ssh_userauth_autopubkey(ssh_session session, const char *passphrase); 00042 LIBSSH_API int ssh_userauth_privatekey_file(ssh_session session, const char *username, 00043 const char *filename, const char *passphrase); 00044 00045 SSH_DEPRECATED LIBSSH_API void buffer_free(ssh_buffer buffer); 00046 SSH_DEPRECATED LIBSSH_API void *buffer_get(ssh_buffer buffer); 00047 SSH_DEPRECATED LIBSSH_API uint32_t buffer_get_len(ssh_buffer buffer); 00048 SSH_DEPRECATED LIBSSH_API ssh_buffer buffer_new(void); 00049 00050 SSH_DEPRECATED LIBSSH_API ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms); 00051 SSH_DEPRECATED LIBSSH_API int channel_change_pty_size(ssh_channel channel,int cols,int rows); 00052 SSH_DEPRECATED LIBSSH_API ssh_channel channel_forward_accept(ssh_session session, int timeout_ms); 00053 SSH_DEPRECATED LIBSSH_API int channel_close(ssh_channel channel); 00054 SSH_DEPRECATED LIBSSH_API int channel_forward_cancel(ssh_session session, const char *address, int port); 00055 SSH_DEPRECATED LIBSSH_API int channel_forward_listen(ssh_session session, const char *address, int port, int *bound_port); 00056 SSH_DEPRECATED LIBSSH_API void channel_free(ssh_channel channel); 00057 SSH_DEPRECATED LIBSSH_API int channel_get_exit_status(ssh_channel channel); 00058 SSH_DEPRECATED LIBSSH_API ssh_session channel_get_session(ssh_channel channel); 00059 SSH_DEPRECATED LIBSSH_API int channel_is_closed(ssh_channel channel); 00060 SSH_DEPRECATED LIBSSH_API int channel_is_eof(ssh_channel channel); 00061 SSH_DEPRECATED LIBSSH_API int channel_is_open(ssh_channel channel); 00062 SSH_DEPRECATED LIBSSH_API ssh_channel channel_new(ssh_session session); 00063 SSH_DEPRECATED LIBSSH_API int channel_open_forward(ssh_channel channel, const char *remotehost, 00064 int remoteport, const char *sourcehost, int localport); 00065 SSH_DEPRECATED LIBSSH_API int channel_open_session(ssh_channel channel); 00066 SSH_DEPRECATED LIBSSH_API int channel_poll(ssh_channel channel, int is_stderr); 00067 SSH_DEPRECATED LIBSSH_API int channel_read(ssh_channel channel, void *dest, uint32_t count, int is_stderr); 00068 00069 SSH_DEPRECATED LIBSSH_API int channel_read_buffer(ssh_channel channel, ssh_buffer buffer, uint32_t count, 00070 int is_stderr); 00071 00072 SSH_DEPRECATED LIBSSH_API int channel_read_nonblocking(ssh_channel channel, void *dest, uint32_t count, 00073 int is_stderr); 00074 SSH_DEPRECATED LIBSSH_API int channel_request_env(ssh_channel channel, const char *name, const char *value); 00075 SSH_DEPRECATED LIBSSH_API int channel_request_exec(ssh_channel channel, const char *cmd); 00076 SSH_DEPRECATED LIBSSH_API int channel_request_pty(ssh_channel channel); 00077 SSH_DEPRECATED LIBSSH_API int channel_request_pty_size(ssh_channel channel, const char *term, 00078 int cols, int rows); 00079 SSH_DEPRECATED LIBSSH_API int channel_request_shell(ssh_channel channel); 00080 SSH_DEPRECATED LIBSSH_API int channel_request_send_signal(ssh_channel channel, const char *signum); 00081 SSH_DEPRECATED LIBSSH_API int channel_request_sftp(ssh_channel channel); 00082 SSH_DEPRECATED LIBSSH_API int channel_request_subsystem(ssh_channel channel, const char *subsystem); 00083 SSH_DEPRECATED LIBSSH_API int channel_request_x11(ssh_channel channel, int single_connection, const char *protocol, 00084 const char *cookie, int screen_number); 00085 SSH_DEPRECATED LIBSSH_API int channel_send_eof(ssh_channel channel); 00086 SSH_DEPRECATED LIBSSH_API int channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct 00087 timeval * timeout); 00088 SSH_DEPRECATED LIBSSH_API void channel_set_blocking(ssh_channel channel, int blocking); 00089 SSH_DEPRECATED LIBSSH_API int channel_write(ssh_channel channel, const void *data, uint32_t len); 00090 00091 LIBSSH_API void privatekey_free(ssh_private_key prv); 00092 LIBSSH_API ssh_private_key privatekey_from_file(ssh_session session, const char *filename, 00093 int type, const char *passphrase); 00094 LIBSSH_API void publickey_free(ssh_public_key key); 00095 LIBSSH_API int ssh_publickey_to_file(ssh_session session, const char *file, 00096 ssh_string pubkey, int type); 00097 LIBSSH_API ssh_string publickey_from_file(ssh_session session, const char *filename, 00098 int *type); 00099 LIBSSH_API ssh_public_key publickey_from_privatekey(ssh_private_key prv); 00100 LIBSSH_API ssh_string publickey_to_string(ssh_public_key key); 00101 LIBSSH_API int ssh_try_publickey_from_file(ssh_session session, const char *keyfile, 00102 ssh_string *publickey, int *type); 00103 LIBSSH_API enum ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey); 00104 00105 LIBSSH_API ssh_string ssh_get_pubkey(ssh_session session); 00106 00107 LIBSSH_API ssh_message ssh_message_retrieve(ssh_session session, uint32_t packettype); 00108 LIBSSH_API ssh_public_key ssh_message_auth_publickey(ssh_message msg); 00109 00110 SSH_DEPRECATED LIBSSH_API void string_burn(ssh_string str); 00111 SSH_DEPRECATED LIBSSH_API ssh_string string_copy(ssh_string str); 00112 SSH_DEPRECATED LIBSSH_API void *string_data(ssh_string str); 00113 SSH_DEPRECATED LIBSSH_API int string_fill(ssh_string str, const void *data, size_t len); 00114 SSH_DEPRECATED LIBSSH_API void string_free(ssh_string str); 00115 SSH_DEPRECATED LIBSSH_API ssh_string string_from_char(const char *what); 00116 SSH_DEPRECATED LIBSSH_API size_t string_len(ssh_string str); 00117 SSH_DEPRECATED LIBSSH_API ssh_string string_new(size_t size); 00118 SSH_DEPRECATED LIBSSH_API char *string_to_char(ssh_string str); 00119 00120 #endif /* LEGACY_H_ */
1.7.5.1