RTEMS CPU Kit with SuperCore  4.11.3
ftpd.h
Go to the documentation of this file.
1 /*
2  * FTP Server Information
3  */
4 
5 #ifndef _RTEMS_FTPD_H
6 #define _RTEMS_FTPD_H
7 
8 #include <rtems/rtems/tasks.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 
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 };
58 
59 /*
60  * Reply codes.
61  */
62 #define PRELIM 1 /* positive preliminary */
63 #define COMPLETE 2 /* positive completion */
64 #define CONTINUE 3 /* positive intermediate */
65 #define TRANSIENT 4 /* transient negative completion */
66 #define ERROR 5 /* permanent negative completion */
67 
68 int rtems_initialize_ftpd(void);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* _RTEMS_FTPD_H */
Priority_Control rtems_task_priority
Define the type for an RTEMS API task priority.
Definition: tasks.h:79
Definition: ftpd.h:42
#define RTEMS_MINIMUM_STACK_SIZE
Minimum stack size which every thread must exceed.
Definition: rtems.h:147
Definition: ftpd.h:36