Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

ftp_client.h File Reference

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.

Author:
Oryx Embedded SARL (www.oryx-embedded.com)
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

Connection options.

Definition at line 114 of file ftp_client.h.

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]contextPointer 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]contextPointer 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]contextPointer to the FTP client context
[in]pathThe 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]contextPointer 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]contextPointer 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]contextPointer to the FTP client context
[in]interfaceUnderlying network interface (optional parameter)
[in]serverIpAddrIP address of the FTP server
[in]serverPortPort number
[in]flagsConnection 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]contextPointer to the FTP client context
[in]pathPath 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]contextPointer to the FTP client context
[out]pathOutput buffer where to store the current directory
[in]sizeSize 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]contextPointer 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]contextPointer 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]contextPointer to the FTP client context
[in]usernameThe username to login under
[in]passwordThe password to use
[in]accountAccount 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]contextPointer to the FTP client context
[in]pathThe 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]contextPointer to the FTP client context
[in]pathPath to the file to be be opened
[in]flagsAccess 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]contextPointer to the FTP client context
[out]dataBuffer where to store the incoming data
[in]sizeMaximum number of bytes that can be read
[out]lengthActual number of bytes that have been read
[in]flagsSet 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]contextPointer to the FTP client context
[in]callbackSSL 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]contextPointer to the FTP client context
[in]pathPath 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]contextPointer to the FTP client context
[in]oldNameThe name of the remote file to rename
[in]newNameThe 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]contextPointer to the FTP client context
[in]commandCommand line
[out]replyCodeResponse 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]contextPointer to the FTP client context
[in]dataPointer to a buffer containing the data to be written
[in]lengthNumber of data bytes to write
[in]flagsSet of flags that influences the behavior of this function
Returns:
Error code

Definition at line 1040 of file ftp_client.c.