Definitions common to SFTP client and server. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL SFTP_TRACE_LEVEL |
Functions | |
error_t | sftpFormatName (SftpVersion version, const SftpName *name, uint8_t *p, size_t *written) |
Format name structure. More... | |
error_t | sftpFormatLongFilename (const SshString *filename, const SftpFileAttrs *attributes, char_t *p, size_t *written) |
Format long file name. More... | |
error_t | sftpFormatAttributes (SftpVersion version, const SftpFileAttrs *attributes, uint8_t *p, size_t *written) |
Format file attributes. More... | |
error_t | sftpParseName (SftpVersion version, SftpName *name, const uint8_t *data, size_t length, size_t *consumed) |
Parse name structure. More... | |
error_t | sftpParseAttributes (SftpVersion version, SftpFileAttrs *attributes, const uint8_t *data, size_t length, size_t *consumed) |
Parse file attributes. More... | |
SftpFileType | sftpConvertPermToFileType (uint32_t permissions) |
Extract file type from permission bits. More... | |
uint32_t | sftpConvertFileTypeToPerm (SftpFileType type) |
Convert file type to permission bits. More... | |
Detailed Description
Definitions common to SFTP client and 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 CycloneTCP 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_common.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL SFTP_TRACE_LEVEL |
Definition at line 32 of file sftp_common.c.
Function Documentation
◆ sftpConvertFileTypeToPerm()
uint32_t sftpConvertFileTypeToPerm | ( | SftpFileType | type | ) |
Convert file type to permission bits.
- Parameters
-
[in] type File type
- Returns
- Permission bits
Definition at line 708 of file sftp_common.c.
◆ sftpConvertPermToFileType()
SftpFileType sftpConvertPermToFileType | ( | uint32_t | permissions | ) |
Extract file type from permission bits.
- Parameters
-
[in] permissions Permission bits
- Returns
- File type
Definition at line 656 of file sftp_common.c.
◆ sftpFormatAttributes()
error_t sftpFormatAttributes | ( | SftpVersion | version, |
const SftpFileAttrs * | attributes, | ||
uint8_t * | p, | ||
size_t * | written | ||
) |
Format file attributes.
- Parameters
-
[in] version Protocol version [in] attributes File attributes [in] p Buffer where to format the attributes [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 255 of file sftp_common.c.
◆ sftpFormatLongFilename()
error_t sftpFormatLongFilename | ( | const SshString * | filename, |
const SftpFileAttrs * | attributes, | ||
char_t * | p, | ||
size_t * | written | ||
) |
Format long file name.
- Parameters
-
[in] filename File name [in] attributes File attributes [in] p Buffer where to format the long file name [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 111 of file sftp_common.c.
◆ sftpFormatName()
error_t sftpFormatName | ( | SftpVersion | version, |
const SftpName * | name, | ||
uint8_t * | p, | ||
size_t * | written | ||
) |
Format name structure.
- Parameters
-
[in] version Protocol version [in] name Pointer to the name structure [in] p Buffer where to format the name structure [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 50 of file sftp_common.c.
◆ sftpParseAttributes()
error_t sftpParseAttributes | ( | SftpVersion | version, |
SftpFileAttrs * | attributes, | ||
const uint8_t * | data, | ||
size_t | length, | ||
size_t * | consumed | ||
) |
Parse file attributes.
- Parameters
-
[in] version Protocol version [out] attributes File attributes [in] data Pointer to ATTRS compound data [in] length Number of bytes available in the input stream [out] consumed Total number of bytes that have been consumed
- Returns
- Error code
Definition at line 454 of file sftp_common.c.
◆ sftpParseName()
error_t sftpParseName | ( | SftpVersion | version, |
SftpName * | name, | ||
const uint8_t * | data, | ||
size_t | length, | ||
size_t * | consumed | ||
) |
Parse name structure.
- Parameters
-
[in] version Protocol version [out] name Pointer to the name structure [in] data Input data stream [in] length Number of bytes available in the input stream [out] consumed Total number of bytes that have been consumed
- Returns
- Error code
Definition at line 370 of file sftp_common.c.