RTEMS: cpukit/include/rtems/ftpd.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
ftpd.h
1/*
2 * FTP Server Information
3 */
4
5#ifndef _RTEMS_FTPD_H
6#define _RTEMS_FTPD_H
7
8#include <rtems.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#define FTPD_CONTROL_PORT 21
15
16/* Various buffer sizes */
17enum {
18 FTPD_BUFSIZE = 256, /* Size for temporary buffers */
19 FTPD_DATASIZE = 4 * 1024, /* Size for file transfer buffers */
20 FTPD_STACKSIZE = RTEMS_MINIMUM_STACK_SIZE + FTPD_DATASIZE /* Tasks stack size */
21};
22
23/* FTPD access control flags */
24enum
25{
26 FTPD_NO_WRITE = 0x1,
27 FTPD_NO_READ = 0x2,
28 FTPD_NO_RW = FTPD_NO_WRITE | FTPD_NO_READ
29};
30
31typedef int (*rtems_ftpd_hookfunction)(char *, size_t);
32
33#include <rtems/shell.h>
34
35 struct rtems_ftpd_hook
36{
37 char *filename;
38 rtems_ftpd_hookfunction hook_function;
39};
40
41 struct rtems_ftpd_configuration
42{
43 rtems_task_priority priority; /* FTPD task priority */
44 unsigned long max_hook_filesize; /* Maximum buffersize */
45 /* for hooks */
46 int port; /* Well-known port */
47 struct rtems_ftpd_hook *hooks; /* List of hooks */
48 char const *root; /* Root for FTPD or 0 for / */
49 int tasks_count; /* Max. connections */
50 int idle; /* Idle timeout in seoconds
51 or 0 for no (inf) timeout */
52 int access; /* 0 - r/w, 1 - read-only,
53 2 - write-only,
54 3 - browse-only */
55 rtems_shell_login_check_t login; /* Login check or 0 to ignore
56 user/passwd. */
57 bool verbose; /* Say hello! */
58};
59
60 rtems_status_code rtems_ftpd_start(
61 const struct rtems_ftpd_configuration *config
62);
63
64extern struct rtems_ftpd_configuration rtems_ftpd_configuration;
65
66 rtems_status_code rtems_initialize_ftpd(void);
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif /* _RTEMS_FTPD_H */
rtems_status_code
rtems_status_code
Classic API Status.
Definition: status.h:43
rtems_task_priority
uint32_t rtems_task_priority
Definition: tasks.h:55
RTEMS_MINIMUM_STACK_SIZE
#define RTEMS_MINIMUM_STACK_SIZE
Minimum stack size which every thread must exceed.
Definition: rtems.h:151
rtems.h
shell.h
Instantatiate a New Terminal Shell.
config_s
Definition: deflate.c:115
rtems_ftpd_configuration
Definition: ftpd.h:42
rtems_ftpd_hook
Definition: ftpd.h:36