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