libssh: /build/libssh/src/libssh-0.8.6/include/libssh/legacy.h Source File

libssh 0.8.6 The SSH library

legacy.h
1 /*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2010 by Aris Adamantiadis
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 /* Since libssh.h includes legacy.h, it's important that libssh.h is included
22 * first. we don't define LEGACY_H now because we want it to be defined when
23 * included from libssh.h
24 * All function calls declared in this header are deprecated and meant to be
25 * removed in future.
26 */
27
28 #ifndef LEGACY_H_
29 #define LEGACY_H_
30
31 typedef struct ssh_private_key_struct* ssh_private_key;
32 typedef struct ssh_public_key_struct* ssh_public_key;
33
34 LIBSSH_API int ssh_auth_list(ssh_session session);
35 LIBSSH_API int ssh_userauth_offer_pubkey(ssh_session session, const char *username, int type, ssh_string publickey);
36 LIBSSH_API int ssh_userauth_pubkey(ssh_session session, const char *username, ssh_string publickey, ssh_private_key privatekey);
37 #ifndef _WIN32
38 LIBSSH_API int ssh_userauth_agent_pubkey(ssh_session session, const char *username,
39 ssh_public_key publickey);
40 #endif
41 LIBSSH_API int ssh_userauth_autopubkey(ssh_session session, const char *passphrase);
42 LIBSSH_API int ssh_userauth_privatekey_file(ssh_session session, const char *username,
43 const char *filename, const char *passphrase);
44
45 SSH_DEPRECATED LIBSSH_API void buffer_free(ssh_buffer buffer);
46 SSH_DEPRECATED LIBSSH_API void *buffer_get(ssh_buffer buffer);
47 SSH_DEPRECATED LIBSSH_API uint32_t buffer_get_len(ssh_buffer buffer);
48 SSH_DEPRECATED LIBSSH_API ssh_buffer buffer_new(void);
49
50 SSH_DEPRECATED LIBSSH_API ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms);
51 SSH_DEPRECATED LIBSSH_API int channel_change_pty_size(ssh_channel channel,int cols,int rows);
52 SSH_DEPRECATED LIBSSH_API ssh_channel channel_forward_accept(ssh_session session, int timeout_ms);
53 SSH_DEPRECATED LIBSSH_API int channel_close(ssh_channel channel);
54 SSH_DEPRECATED LIBSSH_API int channel_forward_cancel(ssh_session session, const char *address, int port);
55 SSH_DEPRECATED LIBSSH_API int channel_forward_listen(ssh_session session, const char *address, int port, int *bound_port);
56 SSH_DEPRECATED LIBSSH_API void channel_free(ssh_channel channel);
57 SSH_DEPRECATED LIBSSH_API int channel_get_exit_status(ssh_channel channel);
58 SSH_DEPRECATED LIBSSH_API ssh_session channel_get_session(ssh_channel channel);
59 SSH_DEPRECATED LIBSSH_API int channel_is_closed(ssh_channel channel);
60 SSH_DEPRECATED LIBSSH_API int channel_is_eof(ssh_channel channel);
61 SSH_DEPRECATED LIBSSH_API int channel_is_open(ssh_channel channel);
62 SSH_DEPRECATED LIBSSH_API ssh_channel channel_new(ssh_session session);
63 SSH_DEPRECATED LIBSSH_API int channel_open_forward(ssh_channel channel, const char *remotehost,
64 int remoteport, const char *sourcehost, int localport);
65 SSH_DEPRECATED LIBSSH_API int channel_open_session(ssh_channel channel);
66 SSH_DEPRECATED LIBSSH_API int channel_poll(ssh_channel channel, int is_stderr);
67 SSH_DEPRECATED LIBSSH_API int channel_read(ssh_channel channel, void *dest, uint32_t count, int is_stderr);
68
69 SSH_DEPRECATED LIBSSH_API int channel_read_buffer(ssh_channel channel, ssh_buffer buffer, uint32_t count,
70 int is_stderr);
71
72 SSH_DEPRECATED LIBSSH_API int channel_read_nonblocking(ssh_channel channel, void *dest, uint32_t count,
73 int is_stderr);
74 SSH_DEPRECATED LIBSSH_API int channel_request_env(ssh_channel channel, const char *name, const char *value);
75 SSH_DEPRECATED LIBSSH_API int channel_request_exec(ssh_channel channel, const char *cmd);
76 SSH_DEPRECATED LIBSSH_API int channel_request_pty(ssh_channel channel);
77 SSH_DEPRECATED LIBSSH_API int channel_request_pty_size(ssh_channel channel, const char *term,
78 int cols, int rows);
79 SSH_DEPRECATED LIBSSH_API int channel_request_shell(ssh_channel channel);
80 SSH_DEPRECATED LIBSSH_API int channel_request_send_signal(ssh_channel channel, const char *signum);
81 SSH_DEPRECATED LIBSSH_API int channel_request_sftp(ssh_channel channel);
82 SSH_DEPRECATED LIBSSH_API int channel_request_subsystem(ssh_channel channel, const char *subsystem);
83 SSH_DEPRECATED LIBSSH_API int channel_request_x11(ssh_channel channel, int single_connection, const char *protocol,
84 const char *cookie, int screen_number);
85 SSH_DEPRECATED LIBSSH_API int channel_send_eof(ssh_channel channel);
86 SSH_DEPRECATED LIBSSH_API int channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct
87 timeval * timeout);
88 SSH_DEPRECATED LIBSSH_API void channel_set_blocking(ssh_channel channel, int blocking);
89 SSH_DEPRECATED LIBSSH_API int channel_write(ssh_channel channel, const void *data, uint32_t len);
90
91 LIBSSH_API void privatekey_free(ssh_private_key prv);
92 LIBSSH_API ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
93 int type, const char *passphrase);
94 LIBSSH_API void publickey_free(ssh_public_key key);
95 LIBSSH_API int ssh_publickey_to_file(ssh_session session, const char *file,
96 ssh_string pubkey, int type);
97 LIBSSH_API ssh_string publickey_from_file(ssh_session session, const char *filename,
98 int *type);
99 LIBSSH_API ssh_public_key publickey_from_privatekey(ssh_private_key prv);
100 LIBSSH_API ssh_string publickey_to_string(ssh_public_key key);
101 LIBSSH_API int ssh_try_publickey_from_file(ssh_session session, const char *keyfile,
102 ssh_string *publickey, int *type);
103 LIBSSH_API enum ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey);
104
105 LIBSSH_API ssh_string ssh_get_pubkey(ssh_session session);
106
107 LIBSSH_API ssh_message ssh_message_retrieve(ssh_session session, uint32_t packettype);
108 LIBSSH_API ssh_public_key ssh_message_auth_publickey(ssh_message msg);
109
110 SSH_DEPRECATED LIBSSH_API void string_burn(ssh_string str);
111 SSH_DEPRECATED LIBSSH_API ssh_string string_copy(ssh_string str);
112 SSH_DEPRECATED LIBSSH_API void *string_data(ssh_string str);
113 SSH_DEPRECATED LIBSSH_API int string_fill(ssh_string str, const void *data, size_t len);
114 SSH_DEPRECATED LIBSSH_API void string_free(ssh_string str);
115 SSH_DEPRECATED LIBSSH_API ssh_string string_from_char(const char *what);
116 SSH_DEPRECATED LIBSSH_API size_t string_len(ssh_string str);
117 SSH_DEPRECATED LIBSSH_API ssh_string string_new(size_t size);
118 SSH_DEPRECATED LIBSSH_API char *string_to_char(ssh_string str);
119
120 #endif /* LEGACY_H_ */
ssh_message_struct
Definition: messages.h:84
ssh_channel_struct
Definition: channels.h:62
ssh_session_struct
Definition: session.h:102
ssh_public_key_struct
Definition: keys.h:28
ssh_string_struct
Definition: string.h:29
ssh_private_key_struct
Definition: keys.h:43
channel_read_buffer
SSH_DEPRECATED LIBSSH_API int channel_read_buffer(ssh_channel channel, ssh_buffer buffer, uint32_t count, int is_stderr)
Read data from a channel into a buffer.
Definition: channels.c:2591
ssh_buffer_struct
Definition: buffer.c:47