libssh 0.12.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 "config.h"
25
26#include <stdbool.h>
27#include <stdint.h>
28
29#include "libssh/sftp.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35sftp_packet sftp_packet_read(sftp_session sftp);
36int sftp_packet_write(sftp_session sftp, uint8_t type, ssh_buffer payload);
37void sftp_packet_free(sftp_packet packet);
38int buffer_add_attributes(ssh_buffer buffer, sftp_attributes attr);
39sftp_attributes sftp_parse_attr(sftp_session session,
40 ssh_buffer buf,
41 int expectname);
51int sftp_reply_version(sftp_client_message client_msg);
62int sftp_decode_channel_data_to_packet(sftp_session sftp, void *data, uint32_t len);
63
64void sftp_set_error(sftp_session sftp, int errnum);
65
66void sftp_message_free(sftp_message msg);
67
68int sftp_read_and_dispatch(sftp_session sftp);
69
70sftp_message sftp_dequeue(sftp_session sftp, uint32_t id);
71
100int sftp_recv_response_msg(sftp_session sftp,
101 uint32_t id,
102 bool blocking,
103 sftp_message *msg_ptr);
104
105/*
106 * Assigns a new SFTP ID for new requests and assures there is no collision
107 * between them.
108 * Returns a new ID ready to use in a request
109 */
110static inline uint32_t sftp_get_new_id(sftp_session session)
111{
112 return ++session->id_counter;
113}
114
115sftp_status_message parse_status_msg(sftp_message msg);
116
117void status_msg_free(sftp_status_message status);
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* SFTP_PRIV_H */
struct sftp_session_struct * sftp_session
SFTP session handle.
Definition sftp.h:93