scp_server_misc.c
Go to the documentation of this file.
Debugging facilities.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
const char_t * pathGetFilename(const char_t *path)
Extract the file name from the supplied path.
Definition: path.c:73
void pathAddSlash(char_t *path, size_t maxLen)
Add a slash to the end of a string.
Definition: path.c:312
void pathRemoveFilename(char_t *path)
Remove the trailing file name from the supplied path.
Definition: path.c:112
void pathRemoveSlash(char_t *path)
Remove the trailing slash from a given path.
Definition: path.c:340
Path manipulation helper functions.
size_t scpFormatDirective(const ScpDirective *directive, char_t *buffer)
Format SCP directive.
Definition: scp_common.c:48
error_t scpParseDirective(const char_t *buffer, ScpDirective *directive)
Parse SCP directive.
Definition: scp_common.c:127
SCP server.
@ SCP_SERVER_SESSION_STATE_WRITE_COMMAND
Definition: scp_server.h:152
@ SCP_SERVER_SESSION_STATE_READ_STATUS
Definition: scp_server.h:161
@ SCP_SERVER_SESSION_STATE_WRITE_STATUS
Definition: scp_server.h:155
@ SCP_SERVER_SESSION_STATE_WRITE_INIT
Definition: scp_server.h:151
@ SCP_SERVER_SESSION_STATE_WRITE_DATA
Definition: scp_server.h:154
@ SCP_SERVER_SESSION_STATE_READ_COMMAND
Definition: scp_server.h:158
error_t scpServerOpenDir(ScpServerSession *session)
Open a directory.
Definition: scp_server_directory.c:113
void scpServerGetNextDirEntry(ScpServerSession *session)
Fetch the next entry from the directory.
Definition: scp_server_directory.c:159
error_t scpServerCreateDir(ScpServerSession *session, const char_t *name)
Create a directory.
Definition: scp_server_directory.c:54
Directory operations.
error_t scpServerReadData(ScpServerSession *session)
Read data from the specified file.
Definition: scp_server_file.c:291
error_t scpServerWriteData(ScpServerSession *session)
Write data to the specified file.
Definition: scp_server_file.c:205
error_t scpServerOpenFileForReading(ScpServerSession *session)
Open a file for reading.
Definition: scp_server_file.c:122
error_t scpServerOpenFileForWriting(ScpServerSession *session, const char_t *filename, uint32_t mode, uint64_t size)
Open a file for writing.
Definition: scp_server_file.c:55
File operations.
ScpServerSession * scpServerOpenSession(ScpServerContext *context, SshChannel *channel)
Open a new SCP session.
Definition: scp_server_misc.c:343
uint_t scpServerGetFilePermissions(ScpServerSession *session, const char_t *path)
Get permissions for the specified file or directory.
Definition: scp_server_misc.c:1126
error_t scpServerGetPath(ScpServerSession *session, const SshString *path, char_t *fullPath, size_t maxLen)
Retrieve the full pathname.
Definition: scp_server_misc.c:1179
ScpServerSession * scpServerFindSession(ScpServerContext *context, SshChannel *channel)
Find the SCP session that matches a given SSH channel.
Definition: scp_server_misc.c:308
void scpServerTick(ScpServerContext *context)
Handle periodic operations.
Definition: scp_server_misc.c:54
void scpServerParseCommandLine(ScpServerSession *session, const SshExecParams *requestParams)
SCP command line parsing.
Definition: scp_server_misc.c:170
void scpServerProcessDirective(ScpServerSession *session, const ScpDirective *directive)
Process SCP directive.
Definition: scp_server_misc.c:1009
error_t scpServerChannelRequestCallback(SshChannel *channel, const SshString *type, const uint8_t *data, size_t length, void *param)
SSH channel request callback.
Definition: scp_server_misc.c:69
error_t scpServerReceiveDirective(ScpServerSession *session, ScpDirective *directive)
Receive a SCP directive from the client.
Definition: scp_server_misc.c:896
void scpServerProcessSessionEvents(ScpServerSession *session)
Session event handler.
Definition: scp_server_misc.c:501
error_t scpServerSendDirective(ScpServerSession *session, const ScpDirective *directive)
Send a SCP directive to the client.
Definition: scp_server_misc.c:837
void scpServerRegisterSessionEvents(ScpServerSession *session, SshChannelEventDesc *eventDesc)
Register session events.
Definition: scp_server_misc.c:429
const char_t * scpServerStripRootDir(ScpServerSession *session, const char_t *path)
Strip root dir from specified pathname.
Definition: scp_server_misc.c:1247
void scpServerCloseSession(ScpServerSession *session)
Close an SCP session.
Definition: scp_server_misc.c:389
Helper functions for SCP server.
error_t sshSetChannelTimeout(SshChannel *channel, systime_t timeout)
Set timeout for read/write operations.
Definition: ssh.c:2027
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
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
Secure Shell (SSH)
bool_t sshCompareString(const SshString *string, const char_t *value)
Compare a binary string against the supplied value.
Definition: ssh_misc.c:1586
SSH helper functions.
bool_t sshGetExecArg(const SshExecParams *params, uint_t index, SshString *arg)
Retrieve the specified argument from an "exec" request.
Definition: ssh_request.c:1540
error_t sshParseExecParams(const uint8_t *p, size_t length, SshExecParams *params)
Parse "exec" channel request parameters.
Definition: ssh_request.c:1512
Global request and channel request handling.