libssh 0.12.0
The SSH library
Loading...
Searching...
No Matches
The libssh SFTP server API

SFTP server handling functions. More...

Data Structures

struct  sftp_message_handler
 Maps an SFTP message type to its handler callback. More...

Macros

#define SSH_SFTP_CALLBACK(name)
 Macro to declare an SFTP message callback function.

Typedefs

typedef int(* sftp_server_message_callback) (sftp_client_message message)
 Callback for handling SFTP client messages.

Functions

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.
LIBSSH_API int sftp_channel_default_data_callback (ssh_session session, ssh_channel channel, void *data, uint32_t len, int is_stderr, void *userdata)

Detailed Description

SFTP server handling functions.

TODO

Macro Definition Documentation

◆ SSH_SFTP_CALLBACK

#define SSH_SFTP_CALLBACK ( name)
Value:
static int name(sftp_client_message message)

Macro to declare an SFTP message callback function.

Parameters
nameThe name of the callback function to declare.

Typedef Documentation

◆ sftp_server_message_callback

typedef int(* sftp_server_message_callback) (sftp_client_message message)

Callback for handling SFTP client messages.

Parameters
messageThe SFTP client message to handle.
Returns
0 on success, -1 on error.

Function Documentation

◆ 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.

Parameters
[in]sessionThe ssh session
[in]channelThe existing ssh channel
[in]subsystemThe subsystem name. Only "sftp" is handled
[out]userdataThe pointer to sftp_session which will get the resulting SFTP session
Returns
SSH_OK when the SFTP server was successfully initialized, SSH_ERROR otherwise.