ftp_server_misc.h File Reference

Helper functions for FTP server. More...

#include "ftp/ftp_server.h"

Go to the source code of this file.

Functions

uint16_t ftpServerGetPassivePort (FtpServerContext *context)
 Get a passive port number. More...
 
void ftpServerCloseConnection (FtpServerContext *context, FtpClientConnection *connection)
 Close client connection properly. More...
 
FtpClientConnectionftpServerAcceptControlConnection (FtpServerContext *context)
 Accept control connection. More...
 
void ftpServerCloseControlConnection (FtpClientConnection *connection)
 Close control connection. More...
 
error_t ftpServerOpenDataConnection (FtpServerContext *context, FtpClientConnection *connection)
 Open data connection. More...
 
void ftpServerAcceptDataConnection (FtpClientConnection *connection)
 Accept data connection. More...
 
void ftpServerCloseDataConnection (FtpClientConnection *connection)
 Close data connection. More...
 
error_t ftpServerGetPath (FtpClientConnection *connection, const char_t *inputPath, char_t *outputPath, size_t maxLen)
 Retrieve the full pathname. More...
 
uint_t ftpServerGetFilePermissions (FtpServerContext *context, FtpClientConnection *connection, const char_t *path)
 Get permissions for the specified file or directory. More...
 
const char_tftpServerStripRootDir (FtpServerContext *context, const char_t *path)
 Strip root dir from specified pathname. More...
 
const char_tftpServerStripHomeDir (FtpClientConnection *connection, const char_t *path)
 Strip home directory from specified pathname. More...
 

Detailed Description

Helper functions for FTP server.

License

Copyright (C) 2010-2018 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.9.0

Definition in file ftp_server_misc.h.

Function Documentation

◆ ftpServerAcceptControlConnection()

FtpClientConnection* ftpServerAcceptControlConnection ( FtpServerContext context)

Accept control connection.

Parameters
[in]contextPointer to the FTP server context
Returns
Pointer to the connection

Definition at line 137 of file ftp_server_misc.c.

◆ ftpServerAcceptDataConnection()

void ftpServerAcceptDataConnection ( FtpClientConnection connection)

Accept data connection.

Parameters
[in]connectionPointer to the client connection

Definition at line 363 of file ftp_server_misc.c.

◆ ftpServerCloseConnection()

void ftpServerCloseConnection ( FtpServerContext context,
FtpClientConnection connection 
)

Close client connection properly.

Parameters
[in]contextPointer to the FTP server context
[in]connectionPointer to the client connection to be closed

Definition at line 91 of file ftp_server_misc.c.

◆ ftpServerCloseControlConnection()

void ftpServerCloseControlConnection ( FtpClientConnection connection)

Close control connection.

Parameters
[in]connectionPointer to the client connection

Definition at line 241 of file ftp_server_misc.c.

◆ ftpServerCloseDataConnection()

void ftpServerCloseDataConnection ( FtpClientConnection connection)

Close data connection.

Parameters
[in]connectionPointer to the client connection

Definition at line 422 of file ftp_server_misc.c.

◆ ftpServerGetFilePermissions()

uint_t ftpServerGetFilePermissions ( FtpServerContext context,
FtpClientConnection connection,
const char_t path 
)

Get permissions for the specified file or directory.

Parameters
[in]contextPointer to the FTP server context
[in]connectionPointer to the client connection
[in]pathCanonical path of the file
Returns
Access rights for the specified file

Definition at line 517 of file ftp_server_misc.c.

◆ ftpServerGetPassivePort()

uint16_t ftpServerGetPassivePort ( FtpServerContext context)

Get a passive port number.

Parameters
[in]contextPointer to the FTP server context
Returns
Passive port number

Definition at line 52 of file ftp_server_misc.c.

◆ ftpServerGetPath()

error_t ftpServerGetPath ( FtpClientConnection connection,
const char_t inputPath,
char_t outputPath,
size_t  maxLen 
)

Retrieve the full pathname.

Parameters
[in]connectionPointer to the client connection
[in]inputPathRelative or absolute path
[out]outputPathResulting full path
[in]maxLenMaximum acceptable path length
Returns
Error code

Definition at line 464 of file ftp_server_misc.c.

◆ ftpServerOpenDataConnection()

error_t ftpServerOpenDataConnection ( FtpServerContext context,
FtpClientConnection connection 
)

Open data connection.

Parameters
[in]contextPointer to the FTP server context
[in]connectionPointer to the client connection
Returns
Error code

Definition at line 273 of file ftp_server_misc.c.

◆ ftpServerStripHomeDir()

const char_t* ftpServerStripHomeDir ( FtpClientConnection connection,
const char_t path 
)

Strip home directory from specified pathname.

Parameters
[in]connectionPointer to the client connection
[in]pathinput pathname
Returns
Resulting pathname with home directory stripped

Definition at line 593 of file ftp_server_misc.c.

◆ ftpServerStripRootDir()

const char_t* ftpServerStripRootDir ( FtpServerContext context,
const char_t path 
)

Strip root dir from specified pathname.

Parameters
[in]contextPointer to the FTP server context
[in]pathinput pathname
Returns
Resulting pathname with root dir stripped

Definition at line 562 of file ftp_server_misc.c.