libssh 0.11.1 The SSH library

Loading...
Searching...
No Matches
sftpserver.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2022 Zeyu Sheng <shengzeyu19_98@163.com>
5 * Copyright (c) 2023 Red Hat, Inc.
6 *
7 * Authors: Jakub Jelen <jjelen@redhat.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#ifndef SFTP_SERVER_H
25#define SFTP_SERVER_H
26
27#ifdef __cplusplus
28 extern "C" {
29#endif
30
31#include <stdint.h>
42#define SSH_SFTP_CALLBACK(name) \
43 static int name(sftp_client_message message)
44
45 typedef int (*sftp_server_message_callback)(sftp_client_message message);
46
47 struct sftp_message_handler
48{
49 const char *name;
50 const char *extended_name;
51 uint8_t type;
52
53 sftp_server_message_callback cb;
54};
55
56LIBSSH_API int sftp_channel_default_subsystem_request(ssh_session session,
57 ssh_channel channel,
58 const char *subsystem,
59 void *userdata);
60LIBSSH_API int sftp_channel_default_data_callback(ssh_session session,
61 ssh_channel channel,
62 void *data,
63 uint32_t len,
64 int is_stderr,
65 void *userdata);
66
69#ifdef __cplusplus
70}
71#endif
72
73#endif /* SFTP_SERVER_H */
sftp_channel_default_subsystem_request
LIBSSH_API int sftp_channel_default_subsystem_request(ssh_session session, ssh_channel channel, const char *subsystem, void *userdata)
Default subsystem request handler for SFTP subsystem.
Definition sftpserver.c:1781
sftp_message_handler
Definition sftpserver.h:48