sftp_client_packet.h
Go to the documentation of this file.
1 /**
2  * @file sftp_client_packet.h
3  * @brief SFTP packet parsing and formatting
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneSSH Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _SFTP_CLIENT_PACKET_H
32 #define _SFTP_CLIENT_PACKET_H
33 
34 //Dependencies
35 #include "sftp/sftp_client.h"
36 
37 //C++ guard
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 //SFTP client related functions
44  uint32_t version);
45 
47  const char_t *filename, uint32_t pflags);
48 
50  const uint8_t *handle, size_t handleLen);
51 
53  const uint8_t *handle, size_t handleLen, uint64_t offset, uint32_t dataLen);
54 
56  const uint8_t *handle, size_t handleLen, uint64_t offset, uint32_t dataLen);
57 
59  const char_t *path);
60 
62  const uint8_t *handle, size_t handleLen);
63 
65  const char_t *filename);
66 
68  const char_t *path);
69 
71  const char_t *path);
72 
74  const char_t *path);
75 
77  const char_t *path);
78 
80  const char_t *oldPath, const char_t *newPath);
81 
83  const uint8_t *packet, size_t length);
84 
86  const uint8_t *packet, size_t length);
87 
89  const uint8_t *packet, size_t length);
90 
92  const uint8_t *packet, size_t fragLen, size_t totalLen);
93 
95  const uint8_t *packet, size_t fragLen, size_t totalLen);
96 
98  const uint8_t *packet, size_t length);
99 
100 //C++ guard
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif
error_t sftpClientFormatFxpRmDir(SftpClientContext *context, const char_t *path)
Format SSH_FXP_RMDIR packet.
error_t sftpClientFormatFxpReadDir(SftpClientContext *context, const uint8_t *handle, size_t handleLen)
Format SSH_FXP_READDIR packet.
error_t sftpClientFormatFxpClose(SftpClientContext *context, const uint8_t *handle, size_t handleLen)
Format SSH_FXP_CLOSE packet.
uint8_t version
Definition: coap_common.h:177
error_t sftpClientParseFxpAttrs(SftpClientContext *context, const uint8_t *packet, size_t length)
Parse SSH_FXP_ATTRS packet.
error_t sftpClientParseFxpName(SftpClientContext *context, const uint8_t *packet, size_t fragLen, size_t totalLen)
Parse SSH_FXP_NAME packet.
error_t sftpClientFormatFxpMkDir(SftpClientContext *context, const char_t *path)
Format SSH_FXP_MKDIR packet.
error_t
Error codes.
Definition: error.h:43
error_t sftpClientFormatFxpRealPath(SftpClientContext *context, const char_t *path)
Format SSH_FXP_REALPATH packet.
error_t sftpClientFormatFxpStat(SftpClientContext *context, const char_t *path)
Format SSH_FXP_STAT packet.
char_t filename[]
Definition: tftp_common.h:93
SFTP client.
uint8_t length
Definition: tcp.h:368
uint32_t dataLen
Definition: sftp_common.h:229
error_t sftpClientFormatFxpRead(SftpClientContext *context, const uint8_t *handle, size_t handleLen, uint64_t offset, uint32_t dataLen)
Format SSH_FXP_READ packet.
error_t sftpClientFormatFxpWrite(SftpClientContext *context, const uint8_t *handle, size_t handleLen, uint64_t offset, uint32_t dataLen)
Format SSH_FXP_WRITE packet.
char char_t
Definition: compiler_port.h:48
error_t sftpClientParseFxpStatus(SftpClientContext *context, const uint8_t *packet, size_t length)
Parse SSH_FXP_STATUS packet.
error_t sftpClientFormatFxpOpen(SftpClientContext *context, const char_t *filename, uint32_t pflags)
Format SSH_FXP_OPEN packet.
#define SftpClientContext
Definition: sftp_client.h:103
error_t sftpClientParseFxpHandle(SftpClientContext *context, const uint8_t *packet, size_t length)
Parse SSH_FXP_HANDLE packet.
error_t sftpClientParseFxpData(SftpClientContext *context, const uint8_t *packet, size_t fragLen, size_t totalLen)
Parse SSH_FXP_DATA packet.
error_t sftpClientParseFxpVersion(SftpClientContext *context, const uint8_t *packet, size_t length)
Parse SSH_FXP_VERSION packet.
error_t sftpClientFormatFxpInit(SftpClientContext *context, uint32_t version)
Format SSH_FXP_INIT packet.
error_t sftpClientFormatFxpOpenDir(SftpClientContext *context, const char_t *path)
Format SSH_FXP_OPENDIR packet.
error_t sftpClientFormatFxpRemove(SftpClientContext *context, const char_t *filename)
Format SSH_FXP_REMOVE packet.
error_t sftpClientFormatFxpRename(SftpClientContext *context, const char_t *oldPath, const char_t *newPath)
Format SSH_FXP_RENAME packet.