1 #ifndef TWO_FTPD__H__ 2 #define TWO_FTPD__H__ 3 4 #include <sys/stat.h> 5 #include <sys/types.h> 6 7 #define SPACE ((char)040) 8 9 #define TELNET_SE ((char)240) /* End subnegotiation parameters */ 10 #define TELNET_NOP ((char)241) /* No operation */ 11 #define TELNET_MARK ((char)242) /* Data Mark */ 12 #define TELNET_BRK ((char)243) /* NVT character BRK */ 13 #define TELNET_IP ((char)244) /* Interrupt Process */ 14 #define TELNET_AO ((char)245) /* Abort output */ 15 #define TELNET_AYT ((char)246) /* Are You There */ 16 #define TELNET_EC ((char)247) /* Erase character */ 17 #define TELNET_EL ((char)248) /* Erase line */ 18 #define TELNET_GA ((char)249) /* Go ahead */ 19 #define TELNET_SB ((char)250) /* Start subnegotiation parameters */ 20 #define TELNET_WILL ((char)251) 21 #define TELNET_WONT ((char)252) 22 #define TELNET_DO ((char)253) 23 #define TELNET_DONT ((char)254) 24 #define TELNET_IAC ((char)255) /* Interpret as Command (escape) */ 25 26 #ifndef BUFSIZE 27 #define BUFSIZE 4096 28 #endif 29 30 struct command 31 { 32 const char* name; 33 int hideparam; 34 int (*fn0)(void); 35 int (*fn1)(void); 36 }; 37 typedef struct command command; 38 39 extern const char* req_param; 40 extern unsigned req_param_len; 41 extern unsigned timeout; 42 43 /* In banner.c */ 44 extern void show_banner(unsigned code, const char* banner); 45 46 /* In respond.c */ 47 extern int log_responses; 48 extern int respond_start(unsigned code, int final); 49 extern int respond_str(const char* msg); 50 extern int respond_uint(unsigned long num); 51 extern int respond_end(void); 52 extern int respond_syserr(unsigned code, const char *msg); 53 extern int respond(unsigned code, int final, const char* msg); 54 extern void respond_start_xfer(void); 55 extern int respond_xferresult(unsigned result, unsigned long bytes, int sent); 56 57 /* In responses.c */ 58 extern int respond_internal_error(void); 59 extern int respond_ok(void); 60 extern int respond_permission_denied(void); 61 62 /* In strtou.c */ 63 extern unsigned long strtou(const char* s, const char** end); 64 65 /* Used by main.c */ 66 extern const command verbs[]; 67 extern const command site_commands[]; 68 extern int startup(int argc, char* argv[]); 69 70 #endif 71