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#include <stdbool.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30sftp_packet sftp_packet_read(sftp_session sftp);
31int sftp_packet_write(sftp_session sftp, uint8_t type, ssh_buffer payload);
32void sftp_packet_free(sftp_packet packet);
33int buffer_add_attributes(ssh_buffer buffer, sftp_attributes attr);
34sftp_attributes sftp_parse_attr(sftp_session session,
35 ssh_buffer buf,
36 int expectname);
46int sftp_reply_version(sftp_client_message client_msg);
57int sftp_decode_channel_data_to_packet(sftp_session sftp, void *data, uint32_t len);
58
59void sftp_set_error(sftp_session sftp, int errnum);
60
61void sftp_message_free(sftp_message msg);
62
63int sftp_read_and_dispatch(sftp_session sftp);
64
65sftp_message sftp_dequeue(sftp_session sftp, uint32_t id);
66
95int sftp_recv_response_msg(sftp_session sftp,
96 uint32_t id,
97 bool blocking,
98 sftp_message *msg_ptr);
99
100/*
101 * Assigns a new SFTP ID for new requests and assures there is no collision
102 * between them.
103 * Returns a new ID ready to use in a request
104 */
105static inline uint32_t sftp_get_new_id(sftp_session session)
106{
107 return ++session->id_counter;
108}
109
110sftp_status_message parse_status_msg(sftp_message msg);
111
112void status_msg_free(sftp_status_message status);
113
114#ifdef __cplusplus
115}
116#endif
117
118#endif /* SFTP_PRIV_H */