libssh  0.11.0
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
25extern "C" {
26#endif
27
28sftp_packet sftp_packet_read(sftp_session sftp);
29int sftp_packet_write(sftp_session sftp, uint8_t type, ssh_buffer payload);
30void sftp_packet_free(sftp_packet packet);
31int buffer_add_attributes(ssh_buffer buffer, sftp_attributes attr);
32sftp_attributes sftp_parse_attr(sftp_session session,
33 ssh_buffer buf,
34 int expectname);
44int sftp_reply_version(sftp_client_message client_msg);
55int sftp_decode_channel_data_to_packet(sftp_session sftp, void *data, uint32_t len);
56
57void sftp_set_error(sftp_session sftp, int errnum);
58
59void sftp_message_free(sftp_message msg);
60
61int 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 */
70static 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
77void status_msg_free(sftp_status_message status);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* SFTP_PRIV_H */