libssh  0.5.4
legacy.h
1 /*
2  * This file is part of the SSH Library
3  *
4  * Copyright (c) 2010 by Aris Adamantiadis
5  *
6  * The SSH Library is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at your
9  * option) any later version.
10  *
11  * The SSH Library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with the SSH Library; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19  * MA 02111-1307, USA.
20  */
21 
22 /* Since libssh.h includes legacy.h, it's important that libssh.h is included
23  * first. we don't define LEGACY_H now because we want it to be defined when
24  * included from libssh.h
25  * All function calls declared in this header are deprecated and meant to be
26  * removed in future.
27  */
28 
29 #include "libssh/libssh.h"
30 
31 #ifndef LEGACY_H_
32 #define LEGACY_H_
33 LIBSSH_API void buffer_free(ssh_buffer buffer);
34 LIBSSH_API void *buffer_get(ssh_buffer buffer);
35 LIBSSH_API uint32_t buffer_get_len(ssh_buffer buffer);
36 LIBSSH_API ssh_buffer buffer_new(void);
37 
38 LIBSSH_API ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms);
39 LIBSSH_API int channel_change_pty_size(ssh_channel channel,int cols,int rows);
40 LIBSSH_API ssh_channel channel_forward_accept(ssh_session session, int timeout_ms);
41 LIBSSH_API int channel_close(ssh_channel channel);
42 LIBSSH_API int channel_forward_cancel(ssh_session session, const char *address, int port);
43 LIBSSH_API int channel_forward_listen(ssh_session session, const char *address, int port, int *bound_port);
44 LIBSSH_API void channel_free(ssh_channel channel);
45 LIBSSH_API int channel_get_exit_status(ssh_channel channel);
46 LIBSSH_API ssh_session channel_get_session(ssh_channel channel);
47 LIBSSH_API int channel_is_closed(ssh_channel channel);
48 LIBSSH_API int channel_is_eof(ssh_channel channel);
49 LIBSSH_API int channel_is_open(ssh_channel channel);
50 LIBSSH_API ssh_channel channel_new(ssh_session session);
51 LIBSSH_API int channel_open_forward(ssh_channel channel, const char *remotehost,
52  int remoteport, const char *sourcehost, int localport);
53 LIBSSH_API int channel_open_session(ssh_channel channel);
54 LIBSSH_API int channel_poll(ssh_channel channel, int is_stderr);
55 LIBSSH_API int channel_read(ssh_channel channel, void *dest, uint32_t count, int is_stderr);
56 
57 LIBSSH_API int channel_read_buffer(ssh_channel channel, ssh_buffer buffer, uint32_t count,
58  int is_stderr);
59 
60 LIBSSH_API int channel_read_nonblocking(ssh_channel channel, void *dest, uint32_t count,
61  int is_stderr);
62 LIBSSH_API int channel_request_env(ssh_channel channel, const char *name, const char *value);
63 LIBSSH_API int channel_request_exec(ssh_channel channel, const char *cmd);
64 LIBSSH_API int channel_request_pty(ssh_channel channel);
65 LIBSSH_API int channel_request_pty_size(ssh_channel channel, const char *term,
66  int cols, int rows);
67 LIBSSH_API int channel_request_shell(ssh_channel channel);
68 LIBSSH_API int channel_request_send_signal(ssh_channel channel, const char *signum);
69 LIBSSH_API int channel_request_sftp(ssh_channel channel);
70 LIBSSH_API int channel_request_subsystem(ssh_channel channel, const char *subsystem);
71 LIBSSH_API int channel_request_x11(ssh_channel channel, int single_connection, const char *protocol,
72  const char *cookie, int screen_number);
73 LIBSSH_API int channel_send_eof(ssh_channel channel);
74 LIBSSH_API int channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct
75  timeval * timeout);
76 LIBSSH_API void channel_set_blocking(ssh_channel channel, int blocking);
77 LIBSSH_API int channel_write(ssh_channel channel, const void *data, uint32_t len);
78 
79 LIBSSH_API void privatekey_free(ssh_private_key prv);
80 LIBSSH_API ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
81  int type, const char *passphrase);
82 LIBSSH_API void publickey_free(ssh_public_key key);
83 LIBSSH_API int ssh_publickey_to_file(ssh_session session, const char *file,
84  ssh_string pubkey, int type);
85 LIBSSH_API ssh_string publickey_from_file(ssh_session session, const char *filename,
86  int *type);
87 LIBSSH_API ssh_public_key publickey_from_privatekey(ssh_private_key prv);
88 LIBSSH_API ssh_string publickey_to_string(ssh_public_key key);
89 LIBSSH_API ssh_message ssh_message_retrieve(ssh_session session, uint32_t packettype);
90 LIBSSH_API void string_burn(ssh_string str);
91 LIBSSH_API ssh_string string_copy(ssh_string str);
92 LIBSSH_API void *string_data(ssh_string str);
93 LIBSSH_API int string_fill(ssh_string str, const void *data, size_t len);
94 LIBSSH_API void string_free(ssh_string str);
95 LIBSSH_API ssh_string string_from_char(const char *what);
96 LIBSSH_API size_t string_len(ssh_string str);
97 LIBSSH_API ssh_string string_new(size_t size);
98 LIBSSH_API char *string_to_char(ssh_string str);
99 
100 #endif /* LEGACY_H_ */