Helper functions for SCP server. More...
Go to the source code of this file.
Functions | |
void | scpServerTick (ScpServerContext *context) |
Handle periodic operations. More... | |
error_t | scpServerChannelRequestCallback (SshChannel *channel, const SshString *type, const uint8_t *data, size_t length, void *param) |
SSH channel request callback. More... | |
void | scpServerParseCommandLine (ScpServerSession *session, const SshExecParams *requestParams) |
SCP command line parsing. More... | |
ScpServerSession * | scpServerFindSession (ScpServerContext *context, SshChannel *channel) |
Find the SCP session that matches a given SSH channel. More... | |
ScpServerSession * | scpServerOpenSession (ScpServerContext *context, SshChannel *channel) |
Open a new SCP session. More... | |
void | scpServerCloseSession (ScpServerSession *session) |
Close an SCP session. More... | |
void | scpServerRegisterSessionEvents (ScpServerSession *session, SshChannelEventDesc *eventDesc) |
Register session events. More... | |
void | scpServerProcessSessionEvents (ScpServerSession *session) |
Session event handler. More... | |
error_t | scpServerSendDirective (ScpServerSession *session, const ScpDirective *directive) |
Send a SCP directive to the client. More... | |
error_t | scpServerReceiveDirective (ScpServerSession *session, ScpDirective *directive) |
Receive a SCP directive from the client. More... | |
void | scpServerProcessDirective (ScpServerSession *session, const ScpDirective *directive) |
Process SCP directive. More... | |
uint_t | scpServerGetFilePermissions (ScpServerSession *session, const char_t *path) |
Get permissions for the specified file or directory. More... | |
error_t | scpServerGetPath (ScpServerSession *session, const SshString *path, char_t *fullPath, size_t maxLen) |
Retrieve the full pathname. More... | |
const char_t * | scpServerStripRootDir (ScpServerSession *session, const char_t *path) |
Strip root dir from specified pathname. More... | |
Detailed Description
Helper functions for SCP server.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneSSH Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file scp_server_misc.h.
Function Documentation
◆ scpServerChannelRequestCallback()
error_t scpServerChannelRequestCallback | ( | SshChannel * | channel, |
const SshString * | type, | ||
const uint8_t * | data, | ||
size_t | length, | ||
void * | param | ||
) |
SSH channel request callback.
- Parameters
-
[in] channel Handle referencing an SSH channel [in] type Request type [in] data Request-specific data [in] length Length of the request-specific data, in bytes [in] param Pointer to the SCP server context
- Returns
- Error code
Definition at line 69 of file scp_server_misc.c.
◆ scpServerCloseSession()
void scpServerCloseSession | ( | ScpServerSession * | session | ) |
Close an SCP session.
- Parameters
-
[in] session Handle referencing an SCP session
Definition at line 389 of file scp_server_misc.c.
◆ scpServerFindSession()
ScpServerSession* scpServerFindSession | ( | ScpServerContext * | context, |
SshChannel * | channel | ||
) |
Find the SCP session that matches a given SSH channel.
- Parameters
-
[in] context Pointer to the SCP server context [in] channel Handle referencing an SSH channel
- Returns
- Pointer to the matching SCP session
Definition at line 308 of file scp_server_misc.c.
◆ scpServerGetFilePermissions()
uint_t scpServerGetFilePermissions | ( | ScpServerSession * | session, |
const char_t * | path | ||
) |
Get permissions for the specified file or directory.
- Parameters
-
[in] session Handle referencing an SCP session [in] path Canonical path of the file
- Returns
- Access rights for the specified file
Definition at line 1125 of file scp_server_misc.c.
◆ scpServerGetPath()
error_t scpServerGetPath | ( | ScpServerSession * | session, |
const SshString * | path, | ||
char_t * | fullPath, | ||
size_t | maxLen | ||
) |
Retrieve the full pathname.
- Parameters
-
[in] session Handle referencing an SCP session [in] path Relative or absolute path [out] fullPath Resulting full path [in] maxLen Maximum acceptable path length
- Returns
- Error code
Definition at line 1178 of file scp_server_misc.c.
◆ scpServerOpenSession()
ScpServerSession* scpServerOpenSession | ( | ScpServerContext * | context, |
SshChannel * | channel | ||
) |
Open a new SCP session.
- Parameters
-
[in] context Pointer to the SCP server context [in] channel Handle referencing an SSH channel
- Returns
- Pointer to the newly created SCP session
Definition at line 343 of file scp_server_misc.c.
◆ scpServerParseCommandLine()
void scpServerParseCommandLine | ( | ScpServerSession * | session, |
const SshExecParams * | requestParams | ||
) |
SCP command line parsing.
- Parameters
-
[in] session Handle referencing an SCP session [in] requestParams Pointer to the "exec" request parameters
Definition at line 170 of file scp_server_misc.c.
◆ scpServerProcessDirective()
void scpServerProcessDirective | ( | ScpServerSession * | session, |
const ScpDirective * | directive | ||
) |
Process SCP directive.
- Parameters
-
[in] session Handle referencing an SCP session [in] directive SCP directive sent by the client
Definition at line 1008 of file scp_server_misc.c.
◆ scpServerProcessSessionEvents()
void scpServerProcessSessionEvents | ( | ScpServerSession * | session | ) |
Session event handler.
- Parameters
-
[in] session Handle referencing an SCP session
Definition at line 501 of file scp_server_misc.c.
◆ scpServerReceiveDirective()
error_t scpServerReceiveDirective | ( | ScpServerSession * | session, |
ScpDirective * | directive | ||
) |
Receive a SCP directive from the client.
- Parameters
-
[in] session Handle referencing an SCP session [in] directive SCP directive parameters
- Returns
- Error code
Definition at line 896 of file scp_server_misc.c.
◆ scpServerRegisterSessionEvents()
void scpServerRegisterSessionEvents | ( | ScpServerSession * | session, |
SshChannelEventDesc * | eventDesc | ||
) |
Register session events.
- Parameters
-
[in] session Handle referencing an SCP session [in] eventDesc SSH channel events to be registered
Definition at line 429 of file scp_server_misc.c.
◆ scpServerSendDirective()
error_t scpServerSendDirective | ( | ScpServerSession * | session, |
const ScpDirective * | directive | ||
) |
Send a SCP directive to the client.
- Parameters
-
[in] session Handle referencing an SCP session [in] directive SCP directive parameters
- Returns
- Error code
Definition at line 837 of file scp_server_misc.c.
◆ scpServerStripRootDir()
const char_t* scpServerStripRootDir | ( | ScpServerSession * | session, |
const char_t * | path | ||
) |
Strip root dir from specified pathname.
- Parameters
-
[in] session Handle referencing an SCP session [in] path input pathname
- Returns
- Resulting pathname with root dir stripped
Definition at line 1246 of file scp_server_misc.c.
◆ scpServerTick()
void scpServerTick | ( | ScpServerContext * | context | ) |
Handle periodic operations.
- Parameters
-
[in] context Pointer to the SCP server context
Definition at line 54 of file scp_server_misc.c.