ftp_server.h
Go to the documentation of this file.
1 /**
2  * @file ftp_server.h
3  * @brief FTP server (File Transfer Protocol)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 1.9.8
29  **/
30 
31 #ifndef _FTP_SERVER_H
32 #define _FTP_SERVER_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "core/socket.h"
37 #include "fs_port.h"
38 
39 //FTP server support
40 #ifndef FTP_SERVER_SUPPORT
41  #define FTP_SERVER_SUPPORT ENABLED
42 #elif (FTP_SERVER_SUPPORT != ENABLED && FTP_SERVER_SUPPORT != DISABLED)
43  #error FTP_SERVER_SUPPORT parameter is not valid
44 #endif
45 
46 //FTP over TLS
47 #ifndef FTP_SERVER_TLS_SUPPORT
48  #define FTP_SERVER_TLS_SUPPORT DISABLED
49 #elif (FTP_SERVER_TLS_SUPPORT != ENABLED && FTP_SERVER_TLS_SUPPORT != DISABLED)
50  #error FTP_SERVER_TLS_SUPPORT parameter is not valid
51 #endif
52 
53 //Stack size required to run the FTP server
54 #ifndef FTP_SERVER_STACK_SIZE
55  #define FTP_SERVER_STACK_SIZE 650
56 #elif (FTP_SERVER_STACK_SIZE < 1)
57  #error FTP_SERVER_STACK_SIZE parameter is not valid
58 #endif
59 
60 //Priority at which the FTP server should run
61 #ifndef FTP_SERVER_PRIORITY
62  #define FTP_SERVER_PRIORITY OS_TASK_PRIORITY_NORMAL
63 #endif
64 
65 //Maximum number of simultaneous connections
66 #ifndef FTP_SERVER_MAX_CONNECTIONS
67  #define FTP_SERVER_MAX_CONNECTIONS 10
68 #elif (FTP_SERVER_MAX_CONNECTIONS < 1)
69  #error FTP_SERVER_MAX_CONNECTIONS parameter is not valid
70 #endif
71 
72 //Maximum time the server will wait before closing the connection
73 #ifndef FTP_SERVER_TIMEOUT
74  #define FTP_SERVER_TIMEOUT 60000
75 #elif (FTP_SERVER_TIMEOUT < 1000)
76  #error FTP_SERVER_TIMEOUT parameter is not valid
77 #endif
78 
79 //FTP server tick interval
80 #ifndef FTP_SERVER_TICK_INTERVAL
81  #define FTP_SERVER_TICK_INTERVAL 1000
82 #elif (FTP_SERVER_TICK_INTERVAL < 100)
83  #error FTP_SERVER_TICK_INTERVAL parameter is not valid
84 #endif
85 
86 //Maximum length of the pending connection queue
87 #ifndef FTP_SERVER_BACKLOG
88  #define FTP_SERVER_BACKLOG 4
89 #elif (FTP_SERVER_BACKLOG < 1)
90  #error FTP_SERVER_BACKLOG parameter is not valid
91 #endif
92 
93 //Maximum line length
94 #ifndef FTP_SERVER_MAX_LINE_LEN
95  #define FTP_SERVER_MAX_LINE_LEN 255
96 #elif (FTP_SERVER_MAX_LINE_LEN < 64)
97  #error FTP_SERVER_MAX_LINE_LEN parameter is not valid
98 #endif
99 
100 //Size of buffer used for input/output operations
101 #ifndef FTP_SERVER_BUFFER_SIZE
102  #define FTP_SERVER_BUFFER_SIZE 1024
103 #elif (FTP_SERVER_BUFFER_SIZE < 128)
104  #error FTP_SERVER_BUFFER_SIZE parameter is not valid
105 #endif
106 
107 //Maximum size of root directory
108 #ifndef FTP_SERVER_MAX_ROOT_DIR_LEN
109  #define FTP_SERVER_MAX_ROOT_DIR_LEN 63
110 #elif (FTP_SERVER_MAX_ROOT_DIR_LEN < 7)
111  #error FTP_SERVER_MAX_ROOT_DIR_LEN parameter is not valid
112 #endif
113 
114 //Maximum size of home directory
115 #ifndef FTP_SERVER_MAX_HOME_DIR_LEN
116  #define FTP_SERVER_MAX_HOME_DIR_LEN 63
117 #elif (FTP_SERVER_MAX_HOME_DIR_LEN < 7)
118  #error FTP_SERVER_MAX_HOME_DIR_LEN parameter is not valid
119 #endif
120 
121 //Maximum user name length
122 #ifndef FTP_SERVER_MAX_USERNAME_LEN
123  #define FTP_SERVER_MAX_USERNAME_LEN 63
124 #elif (FTP_SERVER_MAX_USERNAME_LEN < 7)
125  #error FTP_SERVER_MAX_USERNAME_LEN parameter is not valid
126 #endif
127 
128 //Maximum path length
129 #ifndef FTP_SERVER_MAX_PATH_LEN
130  #define FTP_SERVER_MAX_PATH_LEN 255
131 #elif (FTP_SERVER_MAX_PATH_LEN < 7)
132  #error FTP_SERVER_MAX_PATH_LEN parameter is not valid
133 #endif
134 
135 //Minimum buffer size for TCP sockets
136 #ifndef FTP_SERVER_MIN_TCP_BUFFER_SIZE
137  #define FTP_SERVER_MIN_TCP_BUFFER_SIZE 1430
138 #elif (FTP_SERVER_MIN_TCP_BUFFER_SIZE < 512)
139  #error FTP_SERVER_MIN_TCP_BUFFER_SIZE parameter is not valid
140 #endif
141 
142 //Maximum buffer size for TCP sockets
143 #ifndef FTP_SERVER_MAX_TCP_BUFFER_SIZE
144  #define FTP_SERVER_MAX_TCP_BUFFER_SIZE 2860
145 #elif (FTP_SERVER_MAX_TCP_BUFFER_SIZE < 512)
146  #error FTP_SERVER_MAX_TCP_BUFFER_SIZE parameter is not valid
147 #endif
148 
149 //TX buffer size for TLS connections
150 #ifndef FTP_SERVER_TLS_TX_BUFFER_SIZE
151  #define FTP_SERVER_TLS_TX_BUFFER_SIZE 4096
152 #elif (FTP_SERVER_TLS_TX_BUFFER_SIZE < 512)
153  #error FTP_SERVER_TLS_TX_BUFFER_SIZE parameter is not valid
154 #endif
155 
156 //Minimum RX buffer size for TLS connections
157 #ifndef FTP_SERVER_MIN_TLS_RX_BUFFER_SIZE
158  #define FTP_SERVER_MIN_TLS_RX_BUFFER_SIZE 2048
159 #elif (FTP_SERVER_MIN_TLS_RX_BUFFER_SIZE < 512)
160  #error FTP_SERVER_MIN_TLS_RX_BUFFER_SIZE parameter is not valid
161 #endif
162 
163 //Maximum RX buffer size for TLS connections
164 #ifndef FTP_SERVER_MAX_TLS_RX_BUFFER_SIZE
165  #define FTP_SERVER_MAX_TLS_RX_BUFFER_SIZE 16384
166 #elif (FTP_SERVER_MAX_TLS_RX_BUFFER_SIZE < 512)
167  #error FTP_SERVER_MAX_TLS_RX_BUFFER_SIZE parameter is not valid
168 #endif
169 
170 //Passive port range (lower limit)
171 #ifndef FTP_SERVER_PASSIVE_PORT_MIN
172  #define FTP_SERVER_PASSIVE_PORT_MIN 48128
173 #elif (FTP_SERVER_PASSIVE_PORT_MIN < 1024)
174  #error FTP_SERVER_PASSIVE_PORT_MIN parameter is not valid
175 #endif
176 
177 //Passive port range (upper limit)
178 #ifndef FTP_SERVER_PASSIVE_PORT_MAX
179  #define FTP_SERVER_PASSIVE_PORT_MAX 49151
180 #elif (FTP_SERVER_PASSIVE_PORT_MAX <= FTP_SERVER_PASSIVE_PORT_MIN || FTP_SERVER_PASSIVE_PORT_MAX > 65535)
181  #error FTP_SERVER_PASSIVE_PORT_MAX parameter is not valid
182 #endif
183 
184 //TLS supported?
185 #if (FTP_SERVER_TLS_SUPPORT == ENABLED)
186  #include "core/crypto.h"
187  #include "tls.h"
188  #include "tls_ticket.h"
189 #endif
190 
191 //FTP port number
192 #define FTP_PORT 21
193 //FTP data port number
194 #define FTP_DATA_PORT 20
195 
196 //FTPS port number (implicit mode)
197 #define FTPS_PORT 990
198 //FTPS data port number (implicit mode)
199 #define FTPS_DATA_PORT 989
200 
201 //Forward declaration of FtpServerContext structure
202 struct _FtpServerContext;
203 #define FtpServerContext struct _FtpServerContext
204 
205 //Forward declaration of FtpClientConnection structure
206 struct _FtpClientConnection;
207 #define FtpClientConnection struct _FtpClientConnection
208 
209 //C++ guard
210 #ifdef __cplusplus
211 extern "C" {
212 #endif
213 
214 
215 /**
216  * @brief Channel state
217  **/
218 
219 typedef enum
220 {
241 
242 
243 /**
244  * @brief Security modes
245  **/
246 
247 typedef enum
248 {
252 } FtpServerMode;
253 
254 
255 /**
256  * @brief FTP server access status
257  **/
258 
259 typedef enum
260 {
265 
266 
267 /**
268  * @brief File permissions
269  **/
270 
271 typedef enum
272 {
276 } FtpFilePerm;
277 
278 
279 /**
280  * @brief Connection callback function
281  **/
282 
284  const IpAddr *clientIpAddr, uint16_t clientPort);
285 
286 
287 /**
288  * @brief Disconnection callback function
289  **/
290 
292  const IpAddr *clientIpAddr, uint16_t clientPort);
293 
294 
295 //TLS supported?
296 #if (FTP_SERVER_TLS_SUPPORT == ENABLED)
297 
298 /**
299  * @brief TLS initialization callback function
300  **/
301 
303  TlsContext *tlsContext);
304 
305 #endif
306 
307 
308 /**
309  * @brief User verification callback function
310  **/
311 
313  const char_t *user);
314 
315 
316 /**
317  * @brief Password verification callback function
318  **/
319 
321  const char_t *user, const char_t *password);
322 
323 
324 /**
325  * @brief Callback used to retrieve file permissions
326  **/
327 
329  const char_t *user, const char_t *path);
330 
331 
332 /**
333  * @brief Unknown command callback function
334  **/
335 
337  const char_t *command, const char_t *param);
338 
339 
340 /**
341  * @brief FTP server settings
342  **/
343 
344 typedef struct
345 {
346  NetInterface *interface; ///<Underlying network interface
347  uint16_t port; ///<FTP command port number
348  uint16_t dataPort; ///<FTP data port number
349  uint16_t passivePortMin; ///<Passive port range (lower value)
350  uint16_t passivePortMax; ///<Passive port range (upper value)
351  Ipv4Addr publicIpv4Addr; ///<Public IPv4 address to be used in PASV replies
352  uint_t mode; ///<Security modes
353  uint_t maxConnections; ///<Maximum number of client connections
354  FtpClientConnection *connections; ///<Client connections
355  char_t rootDir[FTP_SERVER_MAX_ROOT_DIR_LEN + 1]; ///<Root directory
356  FtpServerConnectCallback connectCallback; ///<Connection callback function
357  FtpServerDisconnectCallback disconnectCallback; ///<Disconnection callback function
358 #if (FTP_SERVER_TLS_SUPPORT == ENABLED)
359  FtpServerTlsInitCallback tlsInitCallback; ///<TLS initialization callback function
360 #endif
361  FtpServerCheckUserCallback checkUserCallback; ///<User verification callback function
362  FtpServerCheckPasswordCallback checkPasswordCallback; ///<Password verification callback function
363  FtpServerGetFilePermCallback getFilePermCallback; ///<Callback used to retrieve file permissions
364  FtpServerUnknownCommandCallback unknownCommandCallback; ///<Unknown command callback function
366 
367 
368 /**
369  * @brief Control or data channel
370  **/
371 
372 typedef struct
373 {
374  FtpServerChannelState state; ///<Channel state
375  Socket *socket; ///<Underlying TCP socket
376 #if (FTP_SERVER_TLS_SUPPORT == ENABLED)
377  TlsContext *tlsContext; ///<TLS context
378 #endif
380 
381 
382 /**
383  * @brief FTP client connection
384  **/
385 
387 {
388  FtpServerContext *context; ///<FTP server context
389  NetInterface *interface; ///<Underlying network interface
390  bool_t userLoggedIn; ///<This flag tells whether the user is logged in
391  systime_t timestamp; ///<Time stamp to manage timeout
392  FtpServerChannel controlChannel; ///<Control channel
393  FtpServerChannel dataChannel; ///<Data channel
394  FsFile *file; ///<File pointer
395  FsDir *dir; ///<Directory pointer
396  bool_t passiveMode; ///<Passive data transfer
397  IpAddr remoteIpAddr; ///<Remote IP address
398  uint16_t remotePort; ///<Remote port number
400  char_t homeDir[FTP_SERVER_MAX_HOME_DIR_LEN + 1]; ///<Home directory
401  char_t currentDir[FTP_SERVER_MAX_PATH_LEN + 1]; ///<Current directory
403  char_t command[FTP_SERVER_MAX_LINE_LEN + 1]; ///<Incoming command
404  size_t commandLen; ///<Number of bytes available in the command buffer
405  char_t response[FTP_SERVER_MAX_LINE_LEN + 1]; ///<Response buffer
406  size_t responseLen; ///<Number of bytes available in the response buffer
407  size_t responsePos; ///<Current position in the response buffer
408  char_t buffer[FTP_SERVER_BUFFER_SIZE]; ///<Memory buffer for input/output operations
409  size_t bufferLength; ///<Length of the buffer, in bytes
410  size_t bufferPos; ///<Current position in the buffer
411 };
412 
413 
414 /**
415  * @brief FTP server context
416  **/
417 
419 {
420  FtpServerSettings settings; ///<User settings
421  bool_t running; ///<This flag tells whether the FTP server is running or not
422  bool_t stop; ///<Stop request
423  OsEvent event; ///<Event object used to poll the sockets
424  Socket *socket; ///<Listening socket
425  uint16_t passivePort; ///<Current passive port number
426  FtpClientConnection *connections; ///<Client connections
427  SocketEventDesc eventDesc[2 * FTP_SERVER_MAX_CONNECTIONS + 1]; ///<The events the application is interested in
428 #if (FTP_SERVER_TLS_SUPPORT == ENABLED && TLS_TICKET_SUPPORT == ENABLED)
429  TlsTicketContext tlsTicketContext; ///<TLS ticket encryption context
430 #endif
431 };
432 
433 
434 //FTP server related functions
436 
438  const FtpServerSettings *settings);
439 
442 
444  const char_t *homeDir);
445 
446 void ftpServerTask(FtpServerContext *context);
447 
448 void ftpServerDeinit(FtpServerContext *context);
449 
450 //C++ guard
451 #ifdef __cplusplus
452 }
453 #endif
454 
455 #endif
size_t responsePos
Current position in the response buffer.
Definition: ftp_server.h:407
#define FtpServerContext
Definition: ftp_server.h:203
Control or data channel.
Definition: ftp_server.h:372
uint_t(* FtpServerGetFilePermCallback)(FtpClientConnection *connection, const char_t *user, const char_t *path)
Callback used to retrieve file permissions.
Definition: ftp_server.h:328
error_t(* FtpServerUnknownCommandCallback)(FtpClientConnection *connection, const char_t *command, const char_t *param)
Unknown command callback function.
Definition: ftp_server.h:336
int bool_t
Definition: compiler_port.h:49
Socket * socket
Listening socket.
Definition: ftp_server.h:424
uint16_t passivePortMin
Passive port range (lower value)
Definition: ftp_server.h:349
FtpServerConnectCallback connectCallback
Connection callback function.
Definition: ftp_server.h:356
IP network address.
Definition: ip.h:78
FtpClientConnection * connections
Client connections.
Definition: ftp_server.h:426
FtpServerChannelState
Channel state.
Definition: ftp_server.h:219
Event object.
#define FTP_SERVER_MAX_PATH_LEN
Definition: ftp_server.h:130
error_t ftpServerInit(FtpServerContext *context, const FtpServerSettings *settings)
FTP server initialization.
Definition: ftp_server.c:115
#define FTP_SERVER_MAX_USERNAME_LEN
Definition: ftp_server.h:123
FtpServerChannel controlChannel
Control channel.
Definition: ftp_server.h:392
void(* FtpServerDisconnectCallback)(FtpClientConnection *connection, const IpAddr *clientIpAddr, uint16_t clientPort)
Disconnection callback function.
Definition: ftp_server.h:291
FTP server context.
Definition: ftp_server.h:418
NetInterface * interface
Underlying network interface.
Definition: ftp_server.h:346
FtpServerContext * context
FTP server context.
Definition: ftp_server.h:388
void ftpServerTask(FtpServerContext *context)
FTP server task.
Definition: ftp_server.c:354
NetInterface * interface
Underlying network interface.
Definition: ftp_server.h:389
uint16_t dataPort
FTP data port number.
Definition: ftp_server.h:348
FtpAccessStatus
FTP server access status.
Definition: ftp_server.h:259
uint16_t remotePort
Remote port number.
Definition: ftp_server.h:398
Directory descriptor.
Definition: fs_port_posix.h:59
char_t buffer[FTP_SERVER_BUFFER_SIZE]
Memory buffer for input/output operations.
Definition: ftp_server.h:408
#define FTP_SERVER_MAX_ROOT_DIR_LEN
Definition: ftp_server.h:109
uint32_t Ipv4Addr
IPv4 network address.
Definition: ipv4.h:239
uint_t mode
Security modes.
Definition: ftp_server.h:352
Structure describing socket events.
Definition: socket.h:348
uint16_t passivePortMax
Passive port range (upper value)
Definition: ftp_server.h:350
void ftpServerGetDefaultSettings(FtpServerSettings *settings)
Initialize settings with default values.
Definition: ftp_server.c:60
uint_t(* FtpServerCheckPasswordCallback)(FtpClientConnection *connection, const char_t *user, const char_t *password)
Password verification callback function.
Definition: ftp_server.h:320
FTP server settings.
Definition: ftp_server.h:344
FtpServerMode
Security modes.
Definition: ftp_server.h:247
FtpServerChannelState state
Channel state.
Definition: ftp_server.h:374
Session ticket encryption context.
Definition: tls_ticket.h:90
IpAddr remoteIpAddr
Remote IP address.
Definition: ftp_server.h:397
char_t user[FTP_SERVER_MAX_USERNAME_LEN+1]
User name.
Definition: ftp_server.h:399
FtpServerCheckPasswordCallback checkPasswordCallback
Password verification callback function.
Definition: ftp_server.h:362
FtpServerSettings settings
User settings.
Definition: ftp_server.h:420
FtpServerGetFilePermCallback getFilePermCallback
Callback used to retrieve file permissions.
Definition: ftp_server.h:363
#define TlsContext
Definition: tls.h:36
error_t
Error codes.
Definition: error.h:42
error_t ftpServerStart(FtpServerContext *context)
Start FTP server.
Definition: ftp_server.c:252
Ipv4Addr publicIpv4Addr
Public IPv4 address to be used in PASV replies.
Definition: ftp_server.h:351
char_t command[FTP_SERVER_MAX_LINE_LEN+1]
Incoming command.
Definition: ftp_server.h:403
bool_t userLoggedIn
This flag tells whether the user is logged in.
Definition: ftp_server.h:390
#define NetInterface
Definition: net.h:36
TlsContext * tlsContext
TLS context.
Definition: ftp_server.h:377
bool_t passiveMode
Passive data transfer.
Definition: ftp_server.h:396
char_t currentDir[FTP_SERVER_MAX_PATH_LEN+1]
Current directory.
Definition: ftp_server.h:401
bool_t stop
Stop request.
Definition: ftp_server.h:422
General definitions for cryptographic algorithms.
uint16_t port
FTP command port number.
Definition: ftp_server.h:347
#define FTP_SERVER_MAX_HOME_DIR_LEN
Definition: ftp_server.h:116
TlsTicketContext tlsTicketContext
TLS ticket encryption context.
Definition: ftp_server.h:429
OsEvent event
Event object used to poll the sockets.
Definition: ftp_server.h:423
FsFile * file
File pointer.
Definition: ftp_server.h:394
#define FTP_SERVER_BUFFER_SIZE
Definition: ftp_server.h:102
File system abstraction layer.
error_t ftpServerSetHomeDir(FtpClientConnection *connection, const char_t *homeDir)
Set home directory.
Definition: ftp_server.c:327
TLS session tickets.
FtpServerTlsInitCallback tlsInitCallback
TLS initialization callback function.
Definition: ftp_server.h:359
char char_t
Definition: compiler_port.h:43
SocketEventDesc eventDesc[2 *FTP_SERVER_MAX_CONNECTIONS+1]
The events the application is interested in.
Definition: ftp_server.h:427
size_t commandLen
Number of bytes available in the command buffer.
Definition: ftp_server.h:404
FsDir * dir
Directory pointer.
Definition: ftp_server.h:395
char_t path[FTP_SERVER_MAX_PATH_LEN+1]
Pathname.
Definition: ftp_server.h:402
FtpFilePerm
File permissions.
Definition: ftp_server.h:271
FTP client connection.
Definition: ftp_server.h:386
size_t responseLen
Number of bytes available in the response buffer.
Definition: ftp_server.h:406
error_t(* FtpServerTlsInitCallback)(FtpClientConnection *connection, TlsContext *tlsContext)
TLS initialization callback function.
Definition: ftp_server.h:302
FtpServerChannel dataChannel
Data channel.
Definition: ftp_server.h:393
error_t ftpServerStop(FtpServerContext *context)
Stop FTP server.
Definition: ftp_server.c:295
#define Socket
Definition: socket.h:36
FtpClientConnection * connections
Client connections.
Definition: ftp_server.h:354
char_t homeDir[FTP_SERVER_MAX_HOME_DIR_LEN+1]
Home directory.
Definition: ftp_server.h:400
bool_t running
This flag tells whether the FTP server is running or not.
Definition: ftp_server.h:421
TLS (Transport Layer Security)
Socket API.
Socket * socket
Underlying TCP socket.
Definition: ftp_server.h:375
#define FTP_SERVER_MAX_LINE_LEN
Definition: ftp_server.h:95
FtpServerDisconnectCallback disconnectCallback
Disconnection callback function.
Definition: ftp_server.h:357
#define FtpClientConnection
Definition: ftp_server.h:207
uint16_t passivePort
Current passive port number.
Definition: ftp_server.h:425
FtpServerCheckUserCallback checkUserCallback
User verification callback function.
Definition: ftp_server.h:361
FtpServerUnknownCommandCallback unknownCommandCallback
Unknown command callback function.
Definition: ftp_server.h:364
#define FTP_SERVER_MAX_CONNECTIONS
Definition: ftp_server.h:67
size_t bufferPos
Current position in the buffer.
Definition: ftp_server.h:410
uint_t maxConnections
Maximum number of client connections.
Definition: ftp_server.h:353
char_t response[FTP_SERVER_MAX_LINE_LEN+1]
Response buffer.
Definition: ftp_server.h:405
size_t bufferLength
Length of the buffer, in bytes.
Definition: ftp_server.h:409
unsigned int uint_t
Definition: compiler_port.h:45
TCP/IP stack core.
uint_t(* FtpServerCheckUserCallback)(FtpClientConnection *connection, const char_t *user)
User verification callback function.
Definition: ftp_server.h:312
systime_t timestamp
Time stamp to manage timeout.
Definition: ftp_server.h:391
void ftpServerDeinit(FtpServerContext *context)
Release FTP server context.
Definition: ftp_server.c:502
error_t(* FtpServerConnectCallback)(FtpClientConnection *connection, const IpAddr *clientIpAddr, uint16_t clientPort)
Connection callback function.
Definition: ftp_server.h:283
uint32_t systime_t
Definition: compiler_port.h:46
void FsFile
File descriptor.
Definition: fs_port_fatfs.h:60