Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ftp_client.h File Reference
FTP client (File Transfer Protocol) More...
Go to the source code of this file.
Data Structures | |
| struct | _FtpClientContext |
| FTP client context. More... | |
Typedefs | |
| typedef error_t(* | FtpClientTlsInitCallback )(FtpClientContext *context, TlsContext *tlsContext) |
| SSL initialization callback function. | |
Enumerations | |
| enum | FtpConnectionFlags |
Connection options. More... | |
| enum | FtpFileOpeningFlags |
File opening options. More... | |
| enum | FtpFlags |
Flags used by I/O functions. More... | |
Functions | |
| 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.
- Version:
- 1.7.6
Definition in file ftp_client.h.
Typedef Documentation
| typedef error_t(* FtpClientTlsInitCallback)(FtpClientContext *context, TlsContext *tlsContext) |
SSL initialization callback function.
Definition at line 159 of file ftp_client.h.
Enumeration Type Documentation
| enum FtpConnectionFlags |
Connection options.
Definition at line 114 of file ftp_client.h.
| enum FtpFileOpeningFlags |
File opening options.
Definition at line 128 of file ftp_client.h.
| enum FtpFlags |
Flags used by I/O functions.
Definition at line 142 of file ftp_client.h.
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 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:20 by
1.7.2