Webserver+3d print
ftp_client.c File Reference
FTP client (File Transfer Protocol) More...
Go to the source code of this file.
Functions | |
error_t | ftpSetPort (FtpClientContext *context, const IpAddr *ipAddr, uint16_t port) |
Set the port to be used in data connection. | |
error_t | ftpSetPassiveMode (FtpClientContext *context, uint16_t *port) |
Enter passive mode. | |
error_t | ftpSetType (FtpClientContext *context, char_t type) |
Set representation type. | |
error_t | ftpSetProtectionBufferSize (FtpClientContext *context, uint32_t size) |
Set protection buffer size. | |
error_t | ftpSetDataChannelProtectionLevel (FtpClientContext *context, char_t level) |
Set data channel protection level. | |
error_t | ftpConnect (FtpClientContext *context, NetInterface *interface, const IpAddr *serverIpAddr, uint16_t serverPort, uint_t flags) |
Establish a connection with the specified FTP server. | |
error_t | ftpAuth (FtpClientContext *context) |
Request authentication. | |
error_t | ftpLogin (FtpClientContext *context, const char_t *username, const char_t *password, const char_t *account) |
Login to the FTP server using the provided username and password. | |
error_t | ftpGetWorkingDir (FtpClientContext *context, char_t *path, size_t size) |
Get the working directory from the FTP server. | |
error_t | ftpChangeWorkingDir (FtpClientContext *context, const char_t *path) |
Change the current working directory of the FTP session. | |
error_t | ftpChangeToParentDir (FtpClientContext *context) |
Change the current working directory to the parent directory. | |
error_t | ftpMakeDir (FtpClientContext *context, const char_t *path) |
Create a new directory. | |
error_t | ftpRemoveDir (FtpClientContext *context, const char_t *path) |
Remove a directory on the FTP server. | |
error_t | ftpOpenFile (FtpClientContext *context, const char_t *path, uint_t flags) |
Open a file for reading, writing, or appending. | |
error_t | ftpWriteFile (FtpClientContext *context, const void *data, size_t length, uint_t flags) |
Write to a remote file. | |
error_t | ftpReadFile (FtpClientContext *context, void *data, size_t size, size_t *length, uint_t flags) |
Read from a remote file. | |
error_t | ftpCloseFile (FtpClientContext *context) |
Close file. | |
error_t | ftpRenameFile (FtpClientContext *context, const char_t *oldName, const char_t *newName) |
Rename a remote file. | |
error_t | ftpDeleteFile (FtpClientContext *context, const char_t *path) |
Delete a file. | |
error_t | ftpClose (FtpClientContext *context) |
Close the connection with the FTP server. | |
error_t | ftpSendCommand (FtpClientContext *context, const char_t *command, uint_t *replyCode) |
Send FTP command and wait for a reply. | |
error_t | ftpRegisterTlsInitCallback (FtpClientContext *context, FtpClientTlsInitCallback callback) |
Register SSL initialization callback function. | |
error_t | ftpInitControlTlsContext (FtpClientContext *context) |
SSL initialization (control connection) | |
error_t | ftpInitDataTlsContext (FtpClientContext *context) |
SSL initialization (data connection) |
Detailed Description
FTP client (File Transfer Protocol)
License
Copyright (C) 2010-2017 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.
Description
File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one host to another host over a TCP-based network. Refer to the following RFCs for complete details:
- RFC 959: File Transfer Protocol (FTP)
- RFC 2428: FTP Extensions for IPv6 and NATs
- Version:
- 1.7.6
Definition in file ftp_client.c.
Function Documentation
error_t ftpAuth | ( | FtpClientContext * | context ) |
Request authentication.
- Parameters:
-
[in] context Pointer to the FTP client context
- Returns:
- Error code
Definition at line 502 of file ftp_client.c.
error_t ftpChangeToParentDir | ( | FtpClientContext * | context ) |
Change the current working directory to the parent directory.
- Parameters:
-
[in] context Pointer to the FTP client context
- Returns:
- Error code
Definition at line 695 of file ftp_client.c.
error_t ftpChangeWorkingDir | ( | FtpClientContext * | context, |
const char_t * | path | ||
) |
Change the current working directory of the FTP session.
- Parameters:
-
[in] context Pointer to the FTP client context [in] path The new current working directory
- Returns:
- Error code
Definition at line 662 of file ftp_client.c.
error_t ftpClose | ( | FtpClientContext * | context ) |
Close the connection with the FTP server.
- Parameters:
-
[in] context Pointer to the FTP client context
- Returns:
- Error code
Definition at line 1242 of file ftp_client.c.
error_t ftpCloseFile | ( | FtpClientContext * | context ) |
Close file.
- Parameters:
-
[in] context Pointer to the FTP client context
- Returns:
- Error code
Definition at line 1110 of file ftp_client.c.
error_t ftpConnect | ( | FtpClientContext * | context, |
NetInterface * | interface, | ||
const IpAddr * | serverIpAddr, | ||
uint16_t | serverPort, | ||
uint_t | flags | ||
) |
Establish a connection with the specified FTP server.
- Parameters:
-
[in] context Pointer to the FTP client context [in] interface Underlying network interface (optional parameter) [in] serverIpAddr IP address of the FTP server [in] serverPort Port number [in] flags Connection options
- Returns:
- Error code
Definition at line 353 of file ftp_client.c.
error_t ftpDeleteFile | ( | FtpClientContext * | context, |
const char_t * | path | ||
) |
Delete a file.
- Parameters:
-
[in] context Pointer to the FTP client context [in] path Path to the file to be be deleted
- Returns:
- Error code
Definition at line 1209 of file ftp_client.c.
error_t ftpGetWorkingDir | ( | FtpClientContext * | context, |
char_t * | path, | ||
size_t | size | ||
) |
Get the working directory from the FTP server.
- Parameters:
-
[in] context Pointer to the FTP client context [out] path Output buffer where to store the current directory [in] size Size of the output buffer
- Returns:
- Error code
Definition at line 601 of file ftp_client.c.
error_t ftpInitControlTlsContext | ( | FtpClientContext * | context ) |
SSL initialization (control connection)
- Parameters:
-
[in] context Pointer to the FTP client context
- Returns:
- Error code
Definition at line 1418 of file ftp_client.c.
error_t ftpInitDataTlsContext | ( | FtpClientContext * | context ) |
SSL initialization (data connection)
- Parameters:
-
[in] context Pointer to the FTP client context
- Returns:
- Error code
Definition at line 1498 of file ftp_client.c.
error_t ftpLogin | ( | FtpClientContext * | context, |
const char_t * | username, | ||
const char_t * | password, | ||
const char_t * | account | ||
) |
Login to the FTP server using the provided username and password.
- Parameters:
-
[in] context Pointer to the FTP client context [in] username The username to login under [in] password The password to use [in] account Account name
- Returns:
- Error code
Definition at line 535 of file ftp_client.c.
error_t ftpMakeDir | ( | FtpClientContext * | context, |
const char_t * | path | ||
) |
Create a new directory.
- Parameters:
-
[in] context Pointer to the FTP client context [in] path The name of the new directory
- Returns:
- Error code
Definition at line 726 of file ftp_client.c.
error_t ftpOpenFile | ( | FtpClientContext * | context, |
const char_t * | path, | ||
uint_t | flags | ||
) |
Open a file for reading, writing, or appending.
- Parameters:
-
[in] context Pointer to the FTP client context [in] path Path to the file to be be opened [in] flags Access mode
- Returns:
- Error code
Definition at line 795 of file ftp_client.c.
error_t ftpReadFile | ( | FtpClientContext * | context, |
void * | data, | ||
size_t | size, | ||
size_t * | length, | ||
uint_t | flags | ||
) |
Read from a remote file.
- Parameters:
-
[in] context Pointer to the FTP client context [out] data Buffer where to store the incoming data [in] size Maximum number of bytes that can be read [out] length Actual number of bytes that have been read [in] flags Set of flags that influences the behavior of this function
- Returns:
- Error code
Definition at line 1077 of file ftp_client.c.
error_t ftpRegisterTlsInitCallback | ( | FtpClientContext * | context, |
FtpClientTlsInitCallback | callback | ||
) |
Register SSL initialization callback function.
- Parameters:
-
[in] context Pointer to the FTP client context [in] callback SSL initialization callback function
- Returns:
- Error code
Definition at line 1397 of file ftp_client.c.
error_t ftpRemoveDir | ( | FtpClientContext * | context, |
const char_t * | path | ||
) |
Remove a directory on the FTP server.
- Parameters:
-
[in] context Pointer to the FTP client context [in] path Path to the directory to be removed
- Returns:
- Error code
Definition at line 760 of file ftp_client.c.
error_t ftpRenameFile | ( | FtpClientContext * | context, |
const char_t * | oldName, | ||
const char_t * | newName | ||
) |
Rename a remote file.
- Parameters:
-
[in] context Pointer to the FTP client context [in] oldName The name of the remote file to rename [in] newName The new name of the remote file
- Returns:
- Error code
Definition at line 1161 of file ftp_client.c.
error_t ftpSendCommand | ( | FtpClientContext * | context, |
const char_t * | command, | ||
uint_t * | replyCode | ||
) |
Send FTP command and wait for a reply.
- Parameters:
-
[in] context Pointer to the FTP client context [in] command Command line [out] replyCode Response code from the FTP server
- Returns:
- Error code
Definition at line 1299 of file ftp_client.c.
error_t ftpSetDataChannelProtectionLevel | ( | FtpClientContext * | context, |
char_t | level | ||
) |
Set data channel protection level.
- Parameters:
-
[in] context Pointer to the FTP client context [in] level Character specifying the data channel protection level
- Returns:
- Error code
Definition at line 316 of file ftp_client.c.
error_t ftpSetPassiveMode | ( | FtpClientContext * | context, |
uint16_t * | port | ||
) |
Enter passive mode.
- Parameters:
-
[in] context Pointer to the FTP client context [out] port The port number the server is listening on
- Returns:
- Error code
Definition at line 137 of file ftp_client.c.
Set the port to be used in data connection.
- Parameters:
-
[in] context Pointer to the FTP client context [in] ipAddr Host address [in] port Port number
- Returns:
- Error code
Definition at line 60 of file ftp_client.c.
error_t ftpSetProtectionBufferSize | ( | FtpClientContext * | context, |
uint32_t | size | ||
) |
Set protection buffer size.
- Parameters:
-
[in] context Pointer to the FTP client context [in] size Protection buffer size
- Returns:
- Error code
Definition at line 282 of file ftp_client.c.
error_t ftpSetType | ( | FtpClientContext * | context, |
char_t | type | ||
) |
Set representation type.
- Parameters:
-
[in] context Pointer to the FTP client context [in] type Single character identifying the desired type
- Returns:
- Error code
Definition at line 248 of file ftp_client.c.
error_t ftpWriteFile | ( | FtpClientContext * | context, |
const void * | data, | ||
size_t | length, | ||
uint_t | flags | ||
) |
Write to a remote file.
- Parameters:
-
[in] context Pointer to the FTP client context [in] data Pointer to a buffer containing the data to be written [in] length Number of data bytes to write [in] flags Set of flags that influences the behavior of this function
- Returns:
- Error code
Definition at line 1040 of file ftp_client.c.
Generated on Tue Jul 12 2022 17:10:19 by
