libssh: /build/libssh/src/libssh-0.12.2/include/libssh/sftpserver.h Source File

libssh 0.12.2 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
28extern "C" {
29#endif
30
31#include <stdint.h>
32
33#include "libssh/libssh.h"
34#include "libssh/sftp.h"
35
45
55#define SSH_SFTP_CALLBACK(name) \
56 static int name(sftp_client_message message)
57
58typedef int (*sftp_server_message_callback)(sftp_client_message message);
59
60 struct sftp_message_handler
61{
62 const char *name;
63 const char *extended_name;
64 uint8_t type;
65
66 sftp_server_message_callback cb;
67};
68
69LIBSSH_API int sftp_channel_default_subsystem_request(ssh_session session,
70 ssh_channel channel,
71 const char *subsystem,
72 void *userdata);
73LIBSSH_API int sftp_channel_default_data_callback(ssh_session session,
74 ssh_channel channel,
75 void *data,
76 uint32_t len,
77 int is_stderr,
78 void *userdata);
79
81
82#ifdef __cplusplus
83}
84#endif
85
86#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:2072
sftp_message_handler
Definition sftpserver.h:61