|
|
1.1.1.2 ! root 1: /* ftpsrvr.h */ 1.1 root 2: 3: /* Synchronet FTP server */ 4: 1.1.1.2 ! root 5: /* $Id: ftpsrvr.h,v 1.41 2004/11/06 02:13:07 rswindell Exp $ */ 1.1 root 6: 7: /**************************************************************************** 8: * @format.tab-size 4 (Plain Text/Source Code File Header) * 9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * 10: * * 1.1.1.2 ! root 11: * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * 1.1 root 12: * * 13: * This program is free software; you can redistribute it and/or * 14: * modify it under the terms of the GNU General Public License * 15: * as published by the Free Software Foundation; either version 2 * 16: * of the License, or (at your option) any later version. * 17: * See the GNU General Public License for more details: gpl.txt or * 18: * http://www.fsf.org/copyleft/gpl.html * 19: * * 20: * Anonymous FTP access to the most recent released source is available at * 21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * 22: * * 23: * Anonymous CVS access to the development source and modification history * 24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: * 25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login * 26: * (just hit return, no password is necessary) * 27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src * 28: * * 29: * For Synchronet coding style and modification guidelines, see * 30: * http://www.synchro.net/source.html * 31: * * 32: * You are encouraged to submit any modifications (preferably in Unix diff * 33: * format) via e-mail to [email protected] * 34: * * 35: * Note: If this box doesn't appear square, then you need to fix your tabs. * 36: ****************************************************************************/ 37: 1.1.1.2 ! root 38: #ifndef _FTPSRVR_H_ ! 39: #define _FTPSRVR_H_ ! 40: ! 41: #include "startup.h" 1.1 root 42: 43: typedef struct { 44: 45: DWORD size; /* sizeof(ftp_startup_t) */ 46: WORD port; 47: WORD max_clients; 48: WORD max_inactivity; 1.1.1.2 ! root 49: WORD qwk_timeout; ! 50: WORD sem_chk_freq; /* semaphore file checking frequency (in seconds) */ 1.1 root 51: DWORD interface_addr; 52: DWORD options; /* See FTP_OPT definitions */ 1.1.1.2 ! root 53: DWORD js_max_bytes; ! 54: DWORD js_cx_stack; ! 55: ! 56: void* cbdata; /* Private data passed to callbacks */ ! 57: ! 58: /* Callbacks (NULL if unused) */ ! 59: int (*lputs)(void*, int, char*); ! 60: void (*status)(void*, char*); ! 61: void (*started)(void*); ! 62: void (*recycle)(void*); ! 63: void (*terminated)(void*, int code); ! 64: void (*clients)(void*, int active); ! 65: void (*thread_up)(void*, BOOL up, BOOL setuid); ! 66: void (*socket_open)(void*, BOOL open); ! 67: void (*client_on)(void*, BOOL on, int sock, client_t*, BOOL update); ! 68: BOOL (*seteuid)(BOOL user); ! 69: BOOL (*setuid)(BOOL force); ! 70: ! 71: /* Paths */ 1.1 root 72: char ctrl_dir[128]; 1.1.1.2 ! root 73: char index_file_name[64]; ! 74: char html_index_file[64]; ! 75: char html_index_script[64]; ! 76: char temp_dir[128]; 1.1 root 77: char answer_sound[128]; 78: char hangup_sound[128]; 1.1.1.2 ! root 79: char hack_sound[128]; ! 80: ! 81: /* Misc */ ! 82: char host_name[128]; ! 83: BOOL recycle_now; ! 84: BOOL shutdown_now; ! 85: DWORD log_mask; ! 86: uint bind_retry_count; /* Number of times to retry bind() calls */ ! 87: uint bind_retry_delay; /* Time to wait between each bind() retry */ 1.1 root 88: 89: } ftp_startup_t; 90: 1.1.1.2 ! root 91: /* startup options that requires re-initialization/recycle when changed */ ! 92: #if defined(STARTUP_INIT_FIELD_TABLES) ! 93: static struct init_field ftp_init_fields[] = { ! 94: OFFSET_AND_SIZE(ftp_startup_t,port) ! 95: ,OFFSET_AND_SIZE(ftp_startup_t,interface_addr) ! 96: ,OFFSET_AND_SIZE(ftp_startup_t,ctrl_dir) ! 97: ,OFFSET_AND_SIZE(ftp_startup_t,temp_dir) ! 98: ,{ 0,0 } /* terminator */ ! 99: }; ! 100: #endif ! 101: 1.1 root 102: #define FTP_OPT_DEBUG_RX (1<<0) 103: #define FTP_OPT_DEBUG_DATA (1<<1) 1.1.1.2 ! root 104: #define FTP_OPT_INDEX_FILE (1<<2) /* Auto-generate ASCII Index files */ 1.1 root 105: #define FTP_OPT_DEBUG_TX (1<<3) 106: #define FTP_OPT_ALLOW_QWK (1<<4) 107: #define FTP_OPT_NO_LOCAL_FSYS (1<<5) 108: #define FTP_OPT_DIR_FILES (1<<6) /* Allow access to files in dir but not in database */ 109: #define FTP_OPT_KEEP_TEMP_FILES (1<<7) /* Don't delete temp files (for debugging) */ 1.1.1.2 ! root 110: #define FTP_OPT_HTML_INDEX_FILE (1<<8) /* Auto-generate HTML index files */ 1.1 root 111: #define FTP_OPT_NO_HOST_LOOKUP (1<<11) 1.1.1.2 ! root 112: #define FTP_OPT_NO_RECYCLE (1<<27) /* Disable recycling of server */ ! 113: #define FTP_OPT_NO_JAVASCRIPT (1<<29) /* JavaScript disabled */ ! 114: #define FTP_OPT_LOCAL_TIMEZONE (1<<30) /* Don't force UTC/GMT */ 1.1 root 115: #define FTP_OPT_MUTE (1<<31) 116: 1.1.1.2 ! root 117: /* ftp_startup_t.options bits that require re-init/recycle when changed */ ! 118: #define FTP_INIT_OPTS (FTP_OPT_LOCAL_TIMEZONE) ! 119: ! 120: #if defined(STARTUP_INI_BITDESC_TABLES) ! 121: static ini_bitdesc_t ftp_options[] = { ! 122: ! 123: { FTP_OPT_DEBUG_RX ,"DEBUG_RX" }, ! 124: { FTP_OPT_DEBUG_DATA ,"DEBUG_DATA" }, ! 125: { FTP_OPT_INDEX_FILE ,"INDEX_FILE" }, ! 126: { FTP_OPT_DEBUG_TX ,"DEBUG_TX" }, ! 127: { FTP_OPT_ALLOW_QWK ,"ALLOW_QWK" }, ! 128: { FTP_OPT_NO_LOCAL_FSYS ,"NO_LOCAL_FSYS" }, ! 129: { FTP_OPT_DIR_FILES ,"DIR_FILES" }, ! 130: { FTP_OPT_KEEP_TEMP_FILES ,"KEEP_TEMP_FILES" }, ! 131: { FTP_OPT_HTML_INDEX_FILE ,"HTML_INDEX_FILE" }, ! 132: { FTP_OPT_NO_HOST_LOOKUP ,"NO_HOST_LOOKUP" }, ! 133: { FTP_OPT_NO_RECYCLE ,"NO_RECYCLE" }, ! 134: { FTP_OPT_NO_JAVASCRIPT ,"NO_JAVASCRIPT" }, ! 135: { FTP_OPT_LOCAL_TIMEZONE ,"LOCAL_TIMEZONE" }, ! 136: { FTP_OPT_MUTE ,"MUTE" }, ! 137: /* terminator */ ! 138: { 0 ,NULL } ! 139: }; ! 140: #endif ! 141: 1.1 root 142: #ifdef DLLEXPORT 143: #undef DLLEXPORT 144: #endif 145: #ifdef DLLCALL 146: #undef DLLCALL 147: #endif 148: 149: #ifdef _WIN32 150: #ifdef FTPSRVR_EXPORTS 151: #define DLLEXPORT __declspec(dllexport) 152: #else 153: #define DLLEXPORT __declspec(dllimport) 154: #endif 155: #ifdef __BORLANDC__ 156: #define DLLCALL __stdcall 157: #else 158: #define DLLCALL 159: #endif 160: #else 161: #define DLLEXPORT 162: #define DLLCALL 163: #endif 164: 165: #ifdef __cplusplus 166: extern "C" { 167: #endif 168: /* arg is pointer to static ftp_startup_t */ 1.1.1.2 ! root 169: DLLEXPORT void DLLCALL ftp_server(void* arg); ! 170: DLLEXPORT void DLLCALL ftp_terminate(void); ! 171: DLLEXPORT const char* DLLCALL ftp_ver(void); 1.1 root 172: #ifdef __cplusplus 173: } 1.1.1.2 ! root 174: #endif ! 175: ! 176: #endif /* Don't add anything after this line */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.