sftp_common.h File Reference

Definitions common to SFTP client and server. More...

#include "ssh/ssh.h"
#include "date_time.h"

Go to the source code of this file.

Data Structures

struct  SftpFileAttrs
 File attributes. More...
 
struct  SftpName
 Name structure. More...
 

Macros

#define SFTP_180_DAYS   (180 * 86400)
 
#define SSH_FXF_READ   0x00000001
 
#define SSH_FXF_WRITE   0x00000002
 
#define SSH_FXF_APPEND   0x00000004
 
#define SSH_FXF_CREAT   0x00000008
 
#define SSH_FXF_TRUNC   0x00000010
 
#define SSH_FXF_EXCL   0x00000020
 
#define SSH_FILEXFER_ATTR_SIZE   0x00000001
 
#define SSH_FILEXFER_ATTR_UIDGID   0x00000002
 
#define SSH_FILEXFER_ATTR_PERMISSIONS   0x00000004
 
#define SSH_FILEXFER_ATTR_ACMODTIME   0x00000008
 
#define SSH_FILEXFER_ATTR_ACCESSTIME   0x00000008
 
#define SSH_FILEXFER_ATTR_CREATETIME   0x00000010
 
#define SSH_FILEXFER_ATTR_MODIFYTIME   0x00000020
 
#define SSH_FILEXFER_ATTR_ACL   0x00000040
 
#define SSH_FILEXFER_ATTR_OWNERGROUP   0x00000080
 
#define SSH_FILEXFER_ATTR_SUBSECOND_TIMES   0x00000100
 
#define SSH_FILEXFER_ATTR_BITS   0x00000200
 
#define SSH_FILEXFER_ATTR_ALLOCATION_SIZE   0x00000400
 
#define SSH_FILEXFER_ATTR_TEXT_HINT   0x00000800
 
#define SSH_FILEXFER_ATTR_MIME_TYPE   0x00001000
 
#define SSH_FILEXFER_ATTR_LINK_COUNT   0x00002000
 
#define SSH_FILEXFER_ATTR_UNTRANLATED_NAME   0x00004000
 
#define SSH_FILEXFER_ATTR_EXTENDED   0x80000000
 
#define SSH_FILEXFER_ATTR_FLAGS_READONLY   0x00000001
 
#define SSH_FILEXFER_ATTR_FLAGS_SYSTEM   0x00000002
 
#define SSH_FILEXFER_ATTR_FLAGS_HIDDEN   0x00000004
 
#define SSH_FILEXFER_ATTR_FLAGS_CASE_INSENSITIVE   0x00000008
 
#define SSH_FILEXFER_ATTR_FLAGS_ARCHIVE   0x00000010
 
#define SSH_FILEXFER_ATTR_FLAGS_ENCRYPTED   0x00000020
 
#define SSH_FILEXFER_ATTR_FLAGS_COMPRESSED   0x00000040
 
#define SSH_FILEXFER_ATTR_FLAGS_SPARSE   0x00000080
 
#define SSH_FILEXFER_ATTR_FLAGS_APPEND_ONLY   0x00000100
 
#define SSH_FILEXFER_ATTR_FLAGS_IMMUTABLE   0x00000200
 
#define SSH_FILEXFER_ATTR_FLAGS_SYNC   0x00000400
 
#define SSH_FILEXFER_ATTR_FLAGS_TRANSLATION_ERR   0x00000800
 
#define SFTP_MODE_IXOTH   0x0001
 
#define SFTP_MODE_IWOTH   0x0002
 
#define SFTP_MODE_IROTH   0x0004
 
#define SFTP_MODE_IRWXO   0x0007
 
#define SFTP_MODE_IXGRP   0x0008
 
#define SFTP_MODE_IWGRP   0x0010
 
#define SFTP_MODE_IRGRP   0x0020
 
#define SFTP_MODE_IRWXG   0x0038
 
#define SFTP_MODE_IXUSR   0x0040
 
#define SFTP_MODE_IWUSR   0x0080
 
#define SFTP_MODE_IRUSR   0x0100
 
#define SFTP_MODE_IRWXU   0x01C0
 
#define SFTP_MODE_ISVTX   0x0200
 
#define SFTP_MODE_ISGID   0x0400
 
#define SFTP_MODE_ISUID   0x0800
 
#define SFTP_MODE_IFMT   0xF000
 
#define SFTP_MODE_IFIFO   0x1000
 
#define SFTP_MODE_IFCHR   0x2000
 
#define SFTP_MODE_IFDIR   0x4000
 
#define SFTP_MODE_IFBLK   0x6000
 
#define SFTP_MODE_IFREG   0x8000
 
#define SFTP_MODE_IFLNK   0xA000
 
#define SFTP_MODE_IFSOCK   0xC000
 

Enumerations

enum  SftpVersion {
  SFTP_VERSION_0 = 0 , SFTP_VERSION_1 = 1 , SFTP_VERSION_2 = 2 , SFTP_VERSION_3 = 3 ,
  SFTP_VERSION_4 = 4 , SFTP_VERSION_5 = 5 , SFTP_VERSION_6 = 6
}
 SFTP protocol version. More...
 
enum  SftpPacketType {
  SSH_FXP_INIT = 1 , SSH_FXP_VERSION = 2 , SSH_FXP_OPEN = 3 , SSH_FXP_CLOSE = 4 ,
  SSH_FXP_READ = 5 , SSH_FXP_WRITE = 6 , SSH_FXP_LSTAT = 7 , SSH_FXP_FSTAT = 8 ,
  SSH_FXP_SETSTAT = 9 , SSH_FXP_FSETSTAT = 10 , SSH_FXP_OPENDIR = 11 , SSH_FXP_READDIR = 12 ,
  SSH_FXP_REMOVE = 13 , SSH_FXP_MKDIR = 14 , SSH_FXP_RMDIR = 15 , SSH_FXP_REALPATH = 16 ,
  SSH_FXP_STAT = 17 , SSH_FXP_RENAME = 18 , SSH_FXP_READLINK = 19 , SSH_FXP_SYMLINK = 20 ,
  SSH_FXP_STATUS = 101 , SSH_FXP_HANDLE = 102 , SSH_FXP_DATA = 103 , SSH_FXP_NAME = 104 ,
  SSH_FXP_ATTRS = 105 , SSH_FXP_EXTENDED = 200 , SSH_FXP_EXTENDED_REPLY = 201
}
 SFTP packet types. More...
 
enum  SftpStatusCode {
  SSH_FX_OK = 0 , SSH_FX_EOF = 1 , SSH_FX_NO_SUCH_FILE = 2 , SSH_FX_PERMISSION_DENIED = 3 ,
  SSH_FX_FAILURE = 4 , SSH_FX_BAD_MESSAGE = 5 , SSH_FX_NO_CONNECTION = 6 , SSH_FX_CONNECTION_LOST = 7 ,
  SSH_FX_OP_UNSUPPORTED = 8
}
 Status codes. More...
 
enum  SftpFileType {
  SSH_FILEXFER_TYPE_INVALID = 0 , SSH_FILEXFER_TYPE_REGULAR = 1 , SSH_FILEXFER_TYPE_DIRECTORY = 2 , SSH_FILEXFER_TYPE_SYMLINK = 3 ,
  SSH_FILEXFER_TYPE_SPECIAL = 4 , SSH_FILEXFER_TYPE_UNKNOWN = 5 , SSH_FILEXFER_TYPE_SOCKET = 6 , SSH_FILEXFER_TYPE_CHAR_DEVICE = 7 ,
  SSH_FILEXFER_TYPE_BLOCK_DEVICE = 8 , SSH_FILEXFER_TYPE_FIFO = 9
}
 File types. More...
 

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...
 

Variables

typedef __packed_struct
 SFTP packet header. More...
 
uint8_t type
 
uint8_t payload []
 
 SftpPacketHeader
 
uint32_t dataLen
 
uint8_t data []
 
 SftpFxpDataHeader
 

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 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file sftp_common.h.

Macro Definition Documentation

◆ SFTP_180_DAYS

#define SFTP_180_DAYS   (180 * 86400)

Definition at line 39 of file sftp_common.h.

◆ SFTP_MODE_IFBLK

#define SFTP_MODE_IFBLK   0x6000

Definition at line 102 of file sftp_common.h.

◆ SFTP_MODE_IFCHR

#define SFTP_MODE_IFCHR   0x2000

Definition at line 100 of file sftp_common.h.

◆ SFTP_MODE_IFDIR

#define SFTP_MODE_IFDIR   0x4000

Definition at line 101 of file sftp_common.h.

◆ SFTP_MODE_IFIFO

#define SFTP_MODE_IFIFO   0x1000

Definition at line 99 of file sftp_common.h.

◆ SFTP_MODE_IFLNK

#define SFTP_MODE_IFLNK   0xA000

Definition at line 104 of file sftp_common.h.

◆ SFTP_MODE_IFMT

#define SFTP_MODE_IFMT   0xF000

Definition at line 98 of file sftp_common.h.

◆ SFTP_MODE_IFREG

#define SFTP_MODE_IFREG   0x8000

Definition at line 103 of file sftp_common.h.

◆ SFTP_MODE_IFSOCK

#define SFTP_MODE_IFSOCK   0xC000

Definition at line 105 of file sftp_common.h.

◆ SFTP_MODE_IRGRP

#define SFTP_MODE_IRGRP   0x0020

Definition at line 89 of file sftp_common.h.

◆ SFTP_MODE_IROTH

#define SFTP_MODE_IROTH   0x0004

Definition at line 85 of file sftp_common.h.

◆ SFTP_MODE_IRUSR

#define SFTP_MODE_IRUSR   0x0100

Definition at line 93 of file sftp_common.h.

◆ SFTP_MODE_IRWXG

#define SFTP_MODE_IRWXG   0x0038

Definition at line 90 of file sftp_common.h.

◆ SFTP_MODE_IRWXO

#define SFTP_MODE_IRWXO   0x0007

Definition at line 86 of file sftp_common.h.

◆ SFTP_MODE_IRWXU

#define SFTP_MODE_IRWXU   0x01C0

Definition at line 94 of file sftp_common.h.

◆ SFTP_MODE_ISGID

#define SFTP_MODE_ISGID   0x0400

Definition at line 96 of file sftp_common.h.

◆ SFTP_MODE_ISUID

#define SFTP_MODE_ISUID   0x0800

Definition at line 97 of file sftp_common.h.

◆ SFTP_MODE_ISVTX

#define SFTP_MODE_ISVTX   0x0200

Definition at line 95 of file sftp_common.h.

◆ SFTP_MODE_IWGRP

#define SFTP_MODE_IWGRP   0x0010

Definition at line 88 of file sftp_common.h.

◆ SFTP_MODE_IWOTH

#define SFTP_MODE_IWOTH   0x0002

Definition at line 84 of file sftp_common.h.

◆ SFTP_MODE_IWUSR

#define SFTP_MODE_IWUSR   0x0080

Definition at line 92 of file sftp_common.h.

◆ SFTP_MODE_IXGRP

#define SFTP_MODE_IXGRP   0x0008

Definition at line 87 of file sftp_common.h.

◆ SFTP_MODE_IXOTH

#define SFTP_MODE_IXOTH   0x0001

Definition at line 83 of file sftp_common.h.

◆ SFTP_MODE_IXUSR

#define SFTP_MODE_IXUSR   0x0040

Definition at line 91 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_ACCESSTIME

#define SSH_FILEXFER_ATTR_ACCESSTIME   0x00000008

Definition at line 54 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_ACL

#define SSH_FILEXFER_ATTR_ACL   0x00000040

Definition at line 57 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_ACMODTIME

#define SSH_FILEXFER_ATTR_ACMODTIME   0x00000008

Definition at line 53 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_ALLOCATION_SIZE

#define SSH_FILEXFER_ATTR_ALLOCATION_SIZE   0x00000400

Definition at line 61 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_BITS

#define SSH_FILEXFER_ATTR_BITS   0x00000200

Definition at line 60 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_CREATETIME

#define SSH_FILEXFER_ATTR_CREATETIME   0x00000010

Definition at line 55 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_EXTENDED

#define SSH_FILEXFER_ATTR_EXTENDED   0x80000000

Definition at line 66 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_APPEND_ONLY

#define SSH_FILEXFER_ATTR_FLAGS_APPEND_ONLY   0x00000100

Definition at line 77 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_ARCHIVE

#define SSH_FILEXFER_ATTR_FLAGS_ARCHIVE   0x00000010

Definition at line 73 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_CASE_INSENSITIVE

#define SSH_FILEXFER_ATTR_FLAGS_CASE_INSENSITIVE   0x00000008

Definition at line 72 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_COMPRESSED

#define SSH_FILEXFER_ATTR_FLAGS_COMPRESSED   0x00000040

Definition at line 75 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_ENCRYPTED

#define SSH_FILEXFER_ATTR_FLAGS_ENCRYPTED   0x00000020

Definition at line 74 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_HIDDEN

#define SSH_FILEXFER_ATTR_FLAGS_HIDDEN   0x00000004

Definition at line 71 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_IMMUTABLE

#define SSH_FILEXFER_ATTR_FLAGS_IMMUTABLE   0x00000200

Definition at line 78 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_READONLY

#define SSH_FILEXFER_ATTR_FLAGS_READONLY   0x00000001

Definition at line 69 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_SPARSE

#define SSH_FILEXFER_ATTR_FLAGS_SPARSE   0x00000080

Definition at line 76 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_SYNC

#define SSH_FILEXFER_ATTR_FLAGS_SYNC   0x00000400

Definition at line 79 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_SYSTEM

#define SSH_FILEXFER_ATTR_FLAGS_SYSTEM   0x00000002

Definition at line 70 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_FLAGS_TRANSLATION_ERR

#define SSH_FILEXFER_ATTR_FLAGS_TRANSLATION_ERR   0x00000800

Definition at line 80 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_LINK_COUNT

#define SSH_FILEXFER_ATTR_LINK_COUNT   0x00002000

Definition at line 64 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_MIME_TYPE

#define SSH_FILEXFER_ATTR_MIME_TYPE   0x00001000

Definition at line 63 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_MODIFYTIME

#define SSH_FILEXFER_ATTR_MODIFYTIME   0x00000020

Definition at line 56 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_OWNERGROUP

#define SSH_FILEXFER_ATTR_OWNERGROUP   0x00000080

Definition at line 58 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_PERMISSIONS

#define SSH_FILEXFER_ATTR_PERMISSIONS   0x00000004

Definition at line 52 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_SIZE

#define SSH_FILEXFER_ATTR_SIZE   0x00000001

Definition at line 50 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_SUBSECOND_TIMES

#define SSH_FILEXFER_ATTR_SUBSECOND_TIMES   0x00000100

Definition at line 59 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_TEXT_HINT

#define SSH_FILEXFER_ATTR_TEXT_HINT   0x00000800

Definition at line 62 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_UIDGID

#define SSH_FILEXFER_ATTR_UIDGID   0x00000002

Definition at line 51 of file sftp_common.h.

◆ SSH_FILEXFER_ATTR_UNTRANLATED_NAME

#define SSH_FILEXFER_ATTR_UNTRANLATED_NAME   0x00004000

Definition at line 65 of file sftp_common.h.

◆ SSH_FXF_APPEND

#define SSH_FXF_APPEND   0x00000004

Definition at line 44 of file sftp_common.h.

◆ SSH_FXF_CREAT

#define SSH_FXF_CREAT   0x00000008

Definition at line 45 of file sftp_common.h.

◆ SSH_FXF_EXCL

#define SSH_FXF_EXCL   0x00000020

Definition at line 47 of file sftp_common.h.

◆ SSH_FXF_READ

#define SSH_FXF_READ   0x00000001

Definition at line 42 of file sftp_common.h.

◆ SSH_FXF_TRUNC

#define SSH_FXF_TRUNC   0x00000010

Definition at line 46 of file sftp_common.h.

◆ SSH_FXF_WRITE

#define SSH_FXF_WRITE   0x00000002

Definition at line 43 of file sftp_common.h.

Enumeration Type Documentation

◆ SftpFileType

File types.

Enumerator
SSH_FILEXFER_TYPE_INVALID 
SSH_FILEXFER_TYPE_REGULAR 
SSH_FILEXFER_TYPE_DIRECTORY 
SSH_FILEXFER_TYPE_SYMLINK 
SSH_FILEXFER_TYPE_SPECIAL 
SSH_FILEXFER_TYPE_UNKNOWN 
SSH_FILEXFER_TYPE_SOCKET 
SSH_FILEXFER_TYPE_CHAR_DEVICE 
SSH_FILEXFER_TYPE_BLOCK_DEVICE 
SSH_FILEXFER_TYPE_FIFO 

Definition at line 187 of file sftp_common.h.

◆ SftpPacketType

SFTP packet types.

Enumerator
SSH_FXP_INIT 
SSH_FXP_VERSION 
SSH_FXP_OPEN 
SSH_FXP_CLOSE 
SSH_FXP_READ 
SSH_FXP_WRITE 
SSH_FXP_LSTAT 
SSH_FXP_FSTAT 
SSH_FXP_SETSTAT 
SSH_FXP_FSETSTAT 
SSH_FXP_OPENDIR 
SSH_FXP_READDIR 
SSH_FXP_REMOVE 
SSH_FXP_MKDIR 
SSH_FXP_RMDIR 
SSH_FXP_REALPATH 
SSH_FXP_STAT 
SSH_FXP_RENAME 
SSH_FXP_READLINK 
SSH_FXP_SYMLINK 
SSH_FXP_STATUS 
SSH_FXP_HANDLE 
SSH_FXP_DATA 
SSH_FXP_NAME 
SSH_FXP_ATTRS 
SSH_FXP_EXTENDED 
SSH_FXP_EXTENDED_REPLY 

Definition at line 133 of file sftp_common.h.

◆ SftpStatusCode

Status codes.

Enumerator
SSH_FX_OK 
SSH_FX_EOF 
SSH_FX_NO_SUCH_FILE 
SSH_FX_PERMISSION_DENIED 
SSH_FX_FAILURE 
SSH_FX_BAD_MESSAGE 
SSH_FX_NO_CONNECTION 
SSH_FX_CONNECTION_LOST 
SSH_FX_OP_UNSUPPORTED 

Definition at line 169 of file sftp_common.h.

◆ SftpVersion

SFTP protocol version.

Enumerator
SFTP_VERSION_0 
SFTP_VERSION_1 
SFTP_VERSION_2 
SFTP_VERSION_3 
SFTP_VERSION_4 
SFTP_VERSION_5 
SFTP_VERSION_6 

Definition at line 117 of file sftp_common.h.

Function Documentation

◆ sftpConvertFileTypeToPerm()

uint32_t sftpConvertFileTypeToPerm ( SftpFileType  type)

Convert file type to permission bits.

Parameters
[in]typeFile 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]permissionsPermission 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]versionProtocol version
[in]attributesFile attributes
[in]pBuffer where to format the attributes
[out]writtenTotal 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]filenameFile name
[in]attributesFile attributes
[in]pBuffer where to format the long file name
[out]writtenTotal 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]versionProtocol version
[in]namePointer to the name structure
[in]pBuffer where to format the name structure
[out]writtenTotal 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]versionProtocol version
[out]attributesFile attributes
[in]dataPointer to ATTRS compound data
[in]lengthNumber of bytes available in the input stream
[out]consumedTotal 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]versionProtocol version
[out]namePointer to the name structure
[in]dataInput data stream
[in]lengthNumber of bytes available in the input stream
[out]consumedTotal number of bytes that have been consumed
Returns
Error code

Definition at line 370 of file sftp_common.c.

Variable Documentation

◆ __packed_struct

typedef __packed_struct
Initial value:
{
uint32_t length
uint8_t length
Definition: tcp.h:368

SFTP packet header.

SSH_FXP_DATA packet header.

Definition at line 214 of file sftp_common.h.

◆ data

uint8_t data[]

Definition at line 230 of file sftp_common.h.

◆ dataLen

uint32_t dataLen

Definition at line 229 of file sftp_common.h.

◆ payload

uint8_t payload[]

Definition at line 218 of file sftp_common.h.

◆ SftpFxpDataHeader

SftpFxpDataHeader

Definition at line 231 of file sftp_common.h.

◆ SftpPacketHeader

SftpPacketHeader

Definition at line 219 of file sftp_common.h.

◆ type

uint8_t type

Definition at line 217 of file sftp_common.h.