Helper functions for SFTP client. More...
#include "sftp/sftp_client.h"
Go to the source code of this file.
Functions | |
void | sftpClientChangeState (SftpClientContext *context, SftpClientState newState) |
Update SFTP client state. More... | |
error_t | sftpClientOpenConnection (SftpClientContext *context) |
Open SSH connection. More... | |
error_t | sftpClientEstablishConnection (SftpClientContext *context) |
Establish SSH connection. More... | |
void | sftpClientCloseConnection (SftpClientContext *context) |
Close SSH connection. More... | |
error_t | sftpClientSendCommand (SftpClientContext *context) |
Send SFTP request and wait for a response. More... | |
error_t | sftpClientProcessEvents (SftpClientContext *context) |
Process SFTP client events. More... | |
error_t | sftpClientParsePacketLength (SftpClientContext *context, const uint8_t *packet) |
Retrieve the length of an incoming SFTP packet. More... | |
error_t | sftpClientParsePacket (SftpClientContext *context, const uint8_t *packet, size_t fragLen, size_t totalLen) |
SFTP packet processing. More... | |
error_t | sftpClientCheckTimeout (SftpClientContext *context) |
Determine whether a timeout error has occurred. More... | |
error_t | sftpFormatPath (SftpClientContext *context, const char_t *path, uint8_t *p, size_t *written) |
Format pathname. More... | |
void | sftpGetAbsolutePath (SftpClientContext *context, const char_t *path, char_t *fullPath) |
Retrieve the full pathname. More... | |
Detailed Description
Helper functions for SFTP client.
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 sftp_client_misc.h.
Function Documentation
◆ sftpClientChangeState()
void sftpClientChangeState | ( | SftpClientContext * | context, |
SftpClientState | newState | ||
) |
Update SFTP client state.
- Parameters
-
[in] context Pointer to the SFTP client context [in] newState New state to switch to
Definition at line 55 of file sftp_client_misc.c.
◆ sftpClientCheckTimeout()
error_t sftpClientCheckTimeout | ( | SftpClientContext * | context | ) |
Determine whether a timeout error has occurred.
- Parameters
-
[in] context Pointer to the SFTP client context
- Returns
- Error code
Definition at line 630 of file sftp_client_misc.c.
◆ sftpClientCloseConnection()
void sftpClientCloseConnection | ( | SftpClientContext * | context | ) |
Close SSH connection.
- Parameters
-
[in] context Pointer to the SFTP client context
Definition at line 295 of file sftp_client_misc.c.
◆ sftpClientEstablishConnection()
error_t sftpClientEstablishConnection | ( | SftpClientContext * | context | ) |
Establish SSH connection.
- Parameters
-
[in] context Pointer to the SFTP client context
- Returns
- Error code
Definition at line 141 of file sftp_client_misc.c.
◆ sftpClientOpenConnection()
error_t sftpClientOpenConnection | ( | SftpClientContext * | context | ) |
Open SSH connection.
- Parameters
-
[in] context Pointer to the SFTP client context
- Returns
- Error code
Definition at line 72 of file sftp_client_misc.c.
◆ sftpClientParsePacket()
error_t sftpClientParsePacket | ( | SftpClientContext * | context, |
const uint8_t * | packet, | ||
size_t | fragLen, | ||
size_t | totalLen | ||
) |
SFTP packet processing.
- Parameters
-
[in] context Pointer to the SFTP client context [in] packet Pointer to received SFTP packet [in] fragLen Number of bytes available on hand [in] totalLen Total length of the packet, in bytes
- Returns
- Error code
Definition at line 552 of file sftp_client_misc.c.
◆ sftpClientParsePacketLength()
error_t sftpClientParsePacketLength | ( | SftpClientContext * | context, |
const uint8_t * | packet | ||
) |
Retrieve the length of an incoming SFTP packet.
- Parameters
-
[in] context Pointer to the SFTP client context [in] packet Pointer to received SFTP packet
- Returns
- Error code
Definition at line 484 of file sftp_client_misc.c.
◆ sftpClientProcessEvents()
error_t sftpClientProcessEvents | ( | SftpClientContext * | context | ) |
Process SFTP client events.
- Parameters
-
[in] context Pointer to the SFTP client context
- Returns
- Error code
Definition at line 409 of file sftp_client_misc.c.
◆ sftpClientSendCommand()
error_t sftpClientSendCommand | ( | SftpClientContext * | context | ) |
Send SFTP request and wait for a response.
- Parameters
-
[in] context Pointer to the SFTP client context
- Returns
- Error code
Definition at line 315 of file sftp_client_misc.c.
◆ sftpFormatPath()
error_t sftpFormatPath | ( | SftpClientContext * | context, |
const char_t * | path, | ||
uint8_t * | p, | ||
size_t * | written | ||
) |
Format pathname.
- Parameters
-
[in] context Pointer to the SFTP client context [in] path NULL-terminated string that contains the pathname [out] p Output stream where to write the string [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 669 of file sftp_client_misc.c.
◆ sftpGetAbsolutePath()
void sftpGetAbsolutePath | ( | SftpClientContext * | context, |
const char_t * | path, | ||
char_t * | fullPath | ||
) |
Retrieve the full pathname.
- Parameters
-
[in] context Pointer to the SFTP client context [in] path Absolute or relative path [in] fullPath Output buffer where to store the resulting full pathname
Definition at line 699 of file sftp_client_misc.c.