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 |
---|
11 | extern "C" { |
---|
12 | #endif |
---|
13 | |
---|
14 | #define FTPD_CONTROL_PORT 21 |
---|
15 | |
---|
16 | /* Various buffer sizes */ |
---|
17 | enum { |
---|
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 */ |
---|
24 | enum |
---|
25 | { |
---|
26 | FTPD_NO_WRITE = 0x1, |
---|
27 | FTPD_NO_READ = 0x2, |
---|
28 | FTPD_NO_RW = FTPD_NO_WRITE | FTPD_NO_READ |
---|
29 | }; |
---|
30 | |
---|
31 | typedef 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 | /* |
---|
61 | * Reply codes. |
---|
62 | */ |
---|
63 | #define PRELIM 1 /* positive preliminary */ |
---|
64 | #define COMPLETE 2 /* positive completion */ |
---|
65 | #define CONTINUE 3 /* positive intermediate */ |
---|
66 | #define TRANSIENT 4 /* transient negative completion */ |
---|
67 | #define ERROR 5 /* permanent negative completion */ |
---|
68 | |
---|
69 | int rtems_ftpd_start(const struct rtems_ftpd_configuration *config); |
---|
70 | |
---|
71 | extern struct rtems_ftpd_configuration rtems_ftpd_configuration; |
---|
72 | |
---|
73 | int rtems_initialize_ftpd(void); |
---|
74 | |
---|
75 | #ifdef __cplusplus |
---|
76 | } |
---|
77 | #endif |
---|
78 | |
---|
79 | #endif /* _RTEMS_FTPD_H */ |
---|