FTP server (command processing) More...
#include <stdlib.h>
#include "ipv4/ipv4_misc.h"
#include "ftp/ftp_server.h"
#include "ftp/ftp_server_commands.h"
#include "ftp/ftp_server_data.h"
#include "ftp/ftp_server_misc.h"
#include "str.h"
#include "path.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL FTP_TRACE_LEVEL |
Functions | |
void | ftpServerProcessCommand (FtpClientConnection *connection) |
FTP command processing. More... | |
void | ftpServerProcessNoop (FtpClientConnection *connection, char_t *param) |
NOOP command processing. More... | |
void | ftpServerProcessSyst (FtpClientConnection *connection, char_t *param) |
SYST command processing. More... | |
void | ftpServerProcessFeat (FtpClientConnection *connection, char_t *param) |
FEAT command processing. More... | |
void | ftpServerProcessAuth (FtpClientConnection *connection, char_t *param) |
AUTH command processing. More... | |
void | ftpServerProcessPbsz (FtpClientConnection *connection, char_t *param) |
PBSZ command processing. More... | |
void | ftpServerProcessProt (FtpClientConnection *connection, char_t *param) |
PROT command processing. More... | |
void | ftpServerProcessType (FtpClientConnection *connection, char_t *param) |
TYPE command processing. More... | |
void | ftpServerProcessStru (FtpClientConnection *connection, char_t *param) |
STRU command processing. More... | |
void | ftpServerProcessMode (FtpClientConnection *connection, char_t *param) |
MODE command processing. More... | |
void | ftpServerProcessUser (FtpClientConnection *connection, char_t *param) |
USER command processing. More... | |
void | ftpServerProcessPass (FtpClientConnection *connection, char_t *param) |
PASS command processing. More... | |
void | ftpServerProcessRein (FtpClientConnection *connection, char_t *param) |
REIN command processing. More... | |
void | ftpServerProcessQuit (FtpClientConnection *connection, char_t *param) |
QUIT command processing. More... | |
void | ftpServerProcessPort (FtpClientConnection *connection, char_t *param) |
PORT command processing. More... | |
void | ftpServerProcessEprt (FtpClientConnection *connection, char_t *param) |
EPRT command processing. More... | |
void | ftpServerProcessPasv (FtpClientConnection *connection, char_t *param) |
PASV command processing. More... | |
void | ftpServerProcessEpsv (FtpClientConnection *connection, char_t *param) |
EPSV command processing. More... | |
void | ftpServerProcessAbor (FtpClientConnection *connection, char_t *param) |
ABOR command processing. More... | |
void | ftpServerProcessPwd (FtpClientConnection *connection, char_t *param) |
PWD command processing. More... | |
void | ftpServerProcessCwd (FtpClientConnection *connection, char_t *param) |
CWD command processing. More... | |
void | ftpServerProcessCdup (FtpClientConnection *connection, char_t *param) |
CDUP command processing. More... | |
void | ftpServerProcessList (FtpClientConnection *connection, char_t *param) |
LIST command processing. More... | |
void | ftpServerProcessNlst (FtpClientConnection *connection, char_t *param) |
NLST command processing. More... | |
void | ftpServerProcessMkd (FtpClientConnection *connection, char_t *param) |
MKD command processing. More... | |
void | ftpServerProcessRmd (FtpClientConnection *connection, char_t *param) |
RMD command processing. More... | |
void | ftpServerProcessSize (FtpClientConnection *connection, char_t *param) |
SIZE command processing. More... | |
void | ftpServerProcessRetr (FtpClientConnection *connection, char_t *param) |
RETR command processing. More... | |
void | ftpServerProcessStor (FtpClientConnection *connection, char_t *param) |
STOR command processing. More... | |
void | ftpServerProcessAppe (FtpClientConnection *connection, char_t *param) |
APPE command processing. More... | |
void | ftpServerProcessRnfr (FtpClientConnection *connection, char_t *param) |
RNFR command processing. More... | |
void | ftpServerProcessRnto (FtpClientConnection *connection, char_t *param) |
RNTO command processing. More... | |
void | ftpServerProcessDele (FtpClientConnection *connection, char_t *param) |
DELE command processing. More... | |
void | ftpServerProcessUnknownCmd (FtpClientConnection *connection, char_t *param) |
Unknown command processing. More... | |
Detailed Description
FTP server (command processing)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 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
- 2.4.4
Definition in file ftp_server_commands.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL FTP_TRACE_LEVEL |
Definition at line 32 of file ftp_server_commands.c.
Function Documentation
◆ ftpServerProcessAbor()
void ftpServerProcessAbor | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
ABOR command processing.
The ABOR command tells the server to abort the previous FTP service command and any associated transfer of data
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1460 of file ftp_server_commands.c.
◆ ftpServerProcessAppe()
void ftpServerProcessAppe | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
APPE command processing.
The APPE command is used to append data to the specified file
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 2351 of file ftp_server_commands.c.
◆ ftpServerProcessAuth()
void ftpServerProcessAuth | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
AUTH command processing.
The AUTH command specifies the security mechanism
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 382 of file ftp_server_commands.c.
◆ ftpServerProcessCdup()
void ftpServerProcessCdup | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
CDUP command processing.
The CDUP command allows the user to change to the parent directory
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1615 of file ftp_server_commands.c.
◆ ftpServerProcessCommand()
void ftpServerProcessCommand | ( | FtpClientConnection * | connection | ) |
FTP command processing.
- Parameters
-
[in] connection Pointer to the client connection
Definition at line 54 of file ftp_server_commands.c.
◆ ftpServerProcessCwd()
void ftpServerProcessCwd | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
CWD command processing.
The CWD command allows the user to work with a different directory
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1540 of file ftp_server_commands.c.
◆ ftpServerProcessDele()
void ftpServerProcessDele | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
DELE command processing.
The DELE command causes the file specified in the pathname to be deleted at the server site
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 2648 of file ftp_server_commands.c.
◆ ftpServerProcessEprt()
void ftpServerProcessEprt | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
EPRT command processing.
The EPRT command allows for the specification of an extended address for the data connection
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1030 of file ftp_server_commands.c.
◆ ftpServerProcessEpsv()
void ftpServerProcessEpsv | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
EPSV command processing.
The EPSV command requests that a server listen on a data port and wait for a connection
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1345 of file ftp_server_commands.c.
◆ ftpServerProcessFeat()
void ftpServerProcessFeat | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
FEAT command processing.
The FEAT command allows a client to discover which optional commands a server supports
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 337 of file ftp_server_commands.c.
◆ ftpServerProcessList()
void ftpServerProcessList | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
LIST command processing.
The LIST command is used to list the content of a directory
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1660 of file ftp_server_commands.c.
◆ ftpServerProcessMkd()
void ftpServerProcessMkd | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
MKD command processing.
The MKD command causes the directory specified in the pathname to be created as a directory
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1909 of file ftp_server_commands.c.
◆ ftpServerProcessMode()
void ftpServerProcessMode | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
MODE command processing.
The MODE command specifies the data transfer mode
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 616 of file ftp_server_commands.c.
◆ ftpServerProcessNlst()
void ftpServerProcessNlst | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
NLST command processing.
The NLST command is used to list the content of a directory
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1784 of file ftp_server_commands.c.
◆ ftpServerProcessNoop()
void ftpServerProcessNoop | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
NOOP command processing.
The NOOP command does not affect any parameters or previously entered commands. It specifies no action other than that the server send an OK reply
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 303 of file ftp_server_commands.c.
◆ ftpServerProcessPass()
void ftpServerProcessPass | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
PASS command processing.
The USER command specifies the user's password
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 751 of file ftp_server_commands.c.
◆ ftpServerProcessPasv()
void ftpServerProcessPasv | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
PASV command processing.
The PASV command requests the server to listen on a data port and to wait for a connection rather than initiate one upon receipt of a transfer command
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1178 of file ftp_server_commands.c.
◆ ftpServerProcessPbsz()
void ftpServerProcessPbsz | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
PBSZ command processing.
The PBSZ command specifies the maximum size, in bytes, of the encoded data blocks to be sent or received during file transfer
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 444 of file ftp_server_commands.c.
◆ ftpServerProcessPort()
void ftpServerProcessPort | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
PORT command processing.
The PORT command specifies the data port to be used for the data connection
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 909 of file ftp_server_commands.c.
◆ ftpServerProcessProt()
void ftpServerProcessProt | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
PROT command processing.
The PROT command specifies the data channel protection level
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 486 of file ftp_server_commands.c.
◆ ftpServerProcessPwd()
void ftpServerProcessPwd | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
PWD command processing.
The PWD command causes the name of the current working directory to be returned in the reply
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1513 of file ftp_server_commands.c.
◆ ftpServerProcessQuit()
void ftpServerProcessQuit | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
QUIT command processing.
The QUIT command is used to terminate a user session
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 854 of file ftp_server_commands.c.
◆ ftpServerProcessRein()
void ftpServerProcessRein | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
REIN command processing.
The REIN command is used to reinitialize a user session
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 819 of file ftp_server_commands.c.
◆ ftpServerProcessRetr()
void ftpServerProcessRetr | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
RETR command processing.
The RETR command is used to retrieve the content of the specified file
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 2134 of file ftp_server_commands.c.
◆ ftpServerProcessRmd()
void ftpServerProcessRmd | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
RMD command processing.
The RMD command causes the directory specified in the pathname to be removed
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 1985 of file ftp_server_commands.c.
◆ ftpServerProcessRnfr()
void ftpServerProcessRnfr | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
RNFR command processing.
The RNFR command specifies the old pathname of the file which is to be renamed
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 2475 of file ftp_server_commands.c.
◆ ftpServerProcessRnto()
void ftpServerProcessRnto | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
RNTO command processing.
The RNTO command specifies the new pathname of the file specified in the immediately preceding RNFR command
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 2549 of file ftp_server_commands.c.
◆ ftpServerProcessSize()
void ftpServerProcessSize | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
SIZE command processing.
The SIZE command is used to obtain the transfer size of the specified file
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 2059 of file ftp_server_commands.c.
◆ ftpServerProcessStor()
void ftpServerProcessStor | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
STOR command processing.
The STOR command is used to store data to the specified file
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 2242 of file ftp_server_commands.c.
◆ ftpServerProcessStru()
void ftpServerProcessStru | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
STRU command processing.
The STRU command specifies the file structure
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 581 of file ftp_server_commands.c.
◆ ftpServerProcessSyst()
void ftpServerProcessSyst | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
SYST command processing.
The SYST command is used to find out the type of operating system at the server side
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 320 of file ftp_server_commands.c.
◆ ftpServerProcessType()
void ftpServerProcessType | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
TYPE command processing.
The TYPE command specifies the representation type
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 540 of file ftp_server_commands.c.
◆ ftpServerProcessUnknownCmd()
void ftpServerProcessUnknownCmd | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
Unknown command processing.
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 2719 of file ftp_server_commands.c.
◆ ftpServerProcessUser()
void ftpServerProcessUser | ( | FtpClientConnection * | connection, |
char_t * | param | ||
) |
USER command processing.
The USER command is used to identify the user
- Parameters
-
[in] connection Pointer to the client connection [in] param Command line parameters
Definition at line 651 of file ftp_server_commands.c.