libssh 0.11.1 The SSH library

Loading...
Searching...
No Matches
sftp_priv.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2003-2008 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#ifndef SFTP_PRIV_H
22#define SFTP_PRIV_H
23
24#ifdef __cplusplus
25 extern "C" {
26#endif
27
28sftp_packet sftp_packet_read(sftp_session sftp);
29 int sftp_packet_write(sftp_session sftp, uint8_t type, ssh_buffer payload);
30 void sftp_packet_free(sftp_packet packet);
31 int buffer_add_attributes(ssh_buffer buffer, sftp_attributes attr);
32sftp_attributes sftp_parse_attr(sftp_session session,
33 ssh_buffer buf,
34 int expectname);
44 int sftp_reply_version(sftp_client_message client_msg);
55 int sftp_decode_channel_data_to_packet(sftp_session sftp, void *data, uint32_t len);
56
57 void sftp_set_error(sftp_session sftp, int errnum);
58
59 void sftp_message_free(sftp_message msg);
60
61 int sftp_read_and_dispatch(sftp_session sftp);
62
63sftp_message sftp_dequeue(sftp_session sftp, uint32_t id);
64
65/*
66 * Assigns a new SFTP ID for new requests and assures there is no collision
67 * between them.
68 * Returns a new ID ready to use in a request
69 */
70 static inline uint32_t sftp_get_new_id(sftp_session session)
71{
72 return ++session->id_counter;
73}
74
75sftp_status_message parse_status_msg(sftp_message msg);
76
77 void status_msg_free(sftp_status_message status);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* SFTP_PRIV_H */