source: rtems/cpukit/ftpd/ftpd.h @ 09647b7

4.115
Last change on this file since 09647b7 was 09647b7, checked in by Sebastian Huber <sebastian.huber@…>, on 10/26/11 at 10:32:09

2011-10-26 Sebastian Huber <sebastian.huber@…>

  • ftpd/ftpd.h, ftpd/ftpd.c: Moved buffer and stack size constants into header file.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  FTP Server Information
3 *
4 *  $Id$
5 */
6
7#ifndef _RTEMS_FTPD_H
8#define _RTEMS_FTPD_H
9
10#include <rtems/rtems/tasks.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#define FTPD_CONTROL_PORT   21
17
18/* Various buffer sizes */
19enum {
20  FTPD_BUFSIZE  = 256,       /* Size for temporary buffers */
21  FTPD_DATASIZE = 4 * 1024,      /* Size for file transfer buffers */
22  FTPD_STACKSIZE = RTEMS_MINIMUM_STACK_SIZE + FTPD_DATASIZE /* Tasks stack size */
23};
24
25/* FTPD access control flags */
26enum
27{
28  FTPD_NO_WRITE = 0x1,
29  FTPD_NO_READ  = 0x2,
30  FTPD_NO_RW    = FTPD_NO_WRITE | FTPD_NO_READ
31};
32
33typedef int (*rtems_ftpd_hookfunction)(char *, size_t);
34
35#include <rtems/shell.h>
36
37struct rtems_ftpd_hook
38{
39   char                    *filename;
40   rtems_ftpd_hookfunction hook_function;
41};
42
43struct rtems_ftpd_configuration
44{
45   rtems_task_priority     priority;           /* FTPD task priority  */
46   unsigned long           max_hook_filesize;  /* Maximum buffersize  */
47                                               /*    for hooks        */
48   int                     port;               /* Well-known port     */
49   struct rtems_ftpd_hook  *hooks;             /* List of hooks       */
50   char const              *root;              /* Root for FTPD or 0 for / */
51   int                     tasks_count;        /* Max. connections    */
52   int                     idle;               /* Idle timeout in seoconds
53                                                  or 0 for no (inf) timeout */
54   int                     access;             /* 0 - r/w, 1 - read-only,
55                                                  2 - write-only,
56                                                  3 - browse-only */
57   rtems_shell_login_check_t login;            /* Login check or 0 to ignore
58                                                  user/passwd. */
59};
60
61/*
62 * Reply codes.
63 */
64#define PRELIM          1       /* positive preliminary */
65#define COMPLETE        2       /* positive completion */
66#define CONTINUE        3       /* positive intermediate */
67#define TRANSIENT       4       /* transient negative completion */
68#define ERROR           5       /* permanent negative completion */
69
70int rtems_initialize_ftpd(void);
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif  /* _RTEMS_FTPD_H */
Note: See TracBrowser for help on using the repository browser.