sftp_server_misc.c
error_t sftpServerParseFxpMkDir(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_MKDIR packet.
Definition: sftp_server_packet.c:679
Path manipulation helper functions.
error_t sftpServerParseFxpSetStat(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_SETSTAT packet.
Definition: sftp_server_packet.c:1025
String manipulation helper functions.
error_t sftpServerParseFxpFstat(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_FSTAT packet.
Definition: sftp_server_packet.c:959
void sftpServerCloseSession(SftpServerSession *session)
Close an SFTP session.
Definition: sftp_server_misc.c:246
error_t sftpServerParseFxpRename(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_RENAME packet.
Definition: sftp_server_packet.c:1184
@ SFTP_SERVER_SESSION_STATE_RECEIVING_DATA
Definition: sftp_server.h:160
error_t sftpServerReadData(SftpServerSession *session)
Read data from the specified file.
Definition: sftp_server_file.c:731
error_t sftpServerParseFxpSetFstat(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_FSETSTAT packet.
Definition: sftp_server_packet.c:1105
SftpServerSession * sftpServerFindSession(SftpServerContext *context, SshChannel *channel)
Find the SFTP session that matches a given SSH channel.
Definition: sftp_server_misc.c:165
SFTP server.
SftpServerSession * sftpServerOpenSession(SftpServerContext *context, SshChannel *channel)
Open a new SFTP session.
Definition: sftp_server_misc.c:200
error_t sftpServerParseFxpRead(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_READ packet.
Definition: sftp_server_packet.c:269
bool_t sshCompareString(const SshString *string, const char_t *value)
Compare a binary string against the supplied value.
Definition: ssh_misc.c:1586
void sftpServerRegisterSessionEvents(SftpServerSession *session, SshChannelEventDesc *eventDesc)
Register session events.
Definition: sftp_server_misc.c:302
error_t sshReadChannel(SshChannel *channel, void *data, size_t size, size_t *received, uint_t flags)
Receive data from the specified channel.
Definition: ssh.c:2180
error_t sftpServerChannelRequestCallback(SshChannel *channel, const SshString *type, const uint8_t *data, size_t length, void *param)
SSH channel request callback.
Definition: sftp_server_misc.c:71
error_t sftpServerParseFxpInit(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_INIT packet.
Definition: sftp_server_packet.c:56
Directory operations.
error_t sftpServerParseFxpOpen(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_OPEN packet.
Definition: sftp_server_packet.c:98
error_t sftpServerParseFxpExtended(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_EXTENDED packet.
Definition: sftp_server_packet.c:1262
uint32_t sftpServerGenerateHandle(SftpServerSession *session)
Generate a unique handle.
Definition: sftp_server_misc.c:803
File operations.
error_t sftpServerParseFxpOpenDir(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_OPENDIR packet.
Definition: sftp_server_packet.c:462
void sftpServerProcessSessionEvents(SftpServerSession *session)
Session event handler.
Definition: sftp_server_misc.c:384
error_t sftpServerParseFxpWrite(SftpServerSession *session, const uint8_t *packet, size_t fragLen, size_t totalLen)
Parse SSH_FXP_WRITE packet.
Definition: sftp_server_packet.c:375
error_t sftpFormatFxpStatus(SftpServerSession *session, uint32_t id, uint32_t statusCode, const char_t *message)
Format SSH_FXP_STATUS message.
Definition: sftp_server_packet.c:1365
error_t sshWriteChannel(SshChannel *channel, const void *data, size_t length, size_t *written, uint_t flags)
Write data to the specified channel.
Definition: ssh.c:2051
void pathAddSlash(char_t *path, size_t maxLen)
Add a slash to the end of a string.
Definition: path.c:332
SFTP packet parsing and formatting.
@ SFTP_SERVER_SESSION_STATE_SENDING_DATA
Definition: sftp_server.h:161
error_t sftpServerParseFxpClose(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_CLOSE packet.
Definition: sftp_server_packet.c:195
error_t sftpServerParseFxpRealPath(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_REALPATH packet.
Definition: sftp_server_packet.c:825
error_t sftpServerParseFxpStat(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_STAT packet.
Definition: sftp_server_packet.c:892
error_t sftpServerParsePacketLength(SftpServerSession *session, const uint8_t *packet)
Retrieve the length of an incoming SFTP packet.
Definition: sftp_server_misc.c:574
error_t sshParseSubsystemParams(const uint8_t *p, size_t length, SshSubsystemParams *params)
Parse "subsystem" channel request parameters.
Definition: ssh_request.c:1590
error_t sftpServerParseFxpReadDir(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_READDIR packet.
Definition: sftp_server_packet.c:534
Helper functions for SFTP server.
error_t sftpServerParsePacket(SftpServerSession *session, const uint8_t *packet, size_t fragLen, size_t totalLen)
SFTP packet processing.
Definition: sftp_server_misc.c:635
error_t sftpServerWriteData(SftpServerSession *session)
Write data to the specified file.
Definition: sftp_server_file.c:623
SSH helper functions.
@ SFTP_SERVER_SESSION_STATE_RECEIVING
Definition: sftp_server.h:158
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
void pathRemoveSlash(char_t *path)
Remove the trailing slash from a given path.
Definition: path.c:360
uint_t sftpServerGetFilePermissions(SftpServerSession *session, const char_t *path)
Get permissions for the specified file or directory.
Definition: sftp_server_misc.c:852
error_t sshSetChannelTimeout(SshChannel *channel, systime_t timeout)
Set timeout for read/write operations.
Definition: ssh.c:2027
Secure Shell (SSH)
const char_t * sftpServerStripRootDir(SftpServerSession *session, const char_t *path)
Strip root dir from specified pathname.
Definition: sftp_server_misc.c:971
error_t sftpServerGetPath(SftpServerSession *session, const SshString *path, char_t *fullPath, size_t maxLen)
Retrieve the full pathname.
Definition: sftp_server_misc.c:905
error_t sftpServerParseFxpRemove(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_REMOVE packet.
Definition: sftp_server_packet.c:612
Global request and channel request handling.
void sftpServerTick(SftpServerContext *context)
Handle periodic operations.
Definition: sftp_server_misc.c:56
Debugging facilities.
error_t sftpServerParseFxpRmDir(SftpServerSession *session, const uint8_t *packet, size_t length)
Parse SSH_FXP_RMDIR packet.
Definition: sftp_server_packet.c:758