4 * main Citadel/UX header file
5 * see copyright.txt for copyright information
8 /* system customizations are in sysconfig.h */
14 #include "sysconfig.h"
17 #define CITADEL "Citadel/UX 5.80" /* Text description of this software */
20 * REV_LEVEL is the current version number (multiplied by 100 to avoid having
21 * to fiddle with the decimal). REV_MIN is the oldest version of Citadel
22 * whose data files are compatible with the current version. If the data files
23 * are older than REV_MIN, none of the programs will work until the setup
24 * program is run again to bring things up to date.
26 #define REV_LEVEL 580 /* This version */
27 #define REV_MIN 570 /* Oldest compatible version */
29 #define SERVER_TYPE 0 /* zero for stock Citadel/UX; other developers please
30 obtain SERVER_TYPE codes for your implementations */
33 #define tolower(x) ( ((x>='A')&&(x<='Z')) ? (x+'a'-'A') : x )
37 * The only typedef we do is an 8-bit unsigned, for screen dimensions.
38 * All other defs are done using standard C types. The code assumes that
39 * 'int' 'unsigned' and 'short' are at least 16 bits, and that 'long' is at
40 * least 32 bits. There are no endian dependencies in any of the Citadel
43 typedef unsigned char CIT_UBYTE;
45 /* Various length constants */
47 #define ROOMNAMELEN 128 /* The size of the roomname structure */
48 #define NONCE_SIZE 128 /* Added by <bc> to allow for APOP auth
49 * it is BIG becuase there is a hostname
50 * in the nonce, as per the APOP RFC.
53 #define USERNAME_SIZE 32 /* The size of a username string */
56 * Message expiration policy stuff
63 #define EXPIRE_NEXTLEVEL 0 /* Inherit expiration policy */
64 #define EXPIRE_MANUAL 1 /* Don't expire messages at all */
65 #define EXPIRE_NUMMSGS 2 /* Keep only latest n messages */
66 #define EXPIRE_AGE 3 /* Expire messages after n days */
70 * Global system configuration
73 char c_nodename[16]; /* Unqualified "short" nodename */
74 char c_fqdn[64]; /* Fully Qualified Domain Name */
75 char c_humannode[21]; /* Long name of system */
76 char c_phonenum[16]; /* Dialup number of system */
77 uid_t c_bbsuid; /* UID of the bbs-only user */
78 char c_creataide; /* room creator = room aide flag */
79 int c_sleeping; /* watchdog timer setting */
80 char c_initax; /* initial access level */
81 char c_regiscall; /* call number to register on */
82 char c_twitdetect; /* twit detect flag */
83 char c_twitroom[ROOMNAMELEN]; /* twit detect msg move to room */
84 char c_moreprompt[80]; /* paginator prompt */
85 char c_restrict; /* restrict Internet mail flag */
86 long c_msgbase; /* size of message base */
87 char c_bbs_city[32]; /* physical location of server */
88 char c_sysadm[26]; /* name of system administrator */
89 char c_bucket_dir[15]; /* bit bucket for files... */
90 int c_setup_level; /* what rev level we've setup to */
91 int c_maxsessions; /* maximum concurrent sessions */
92 char c_net_password[20]; /* system net password */
93 int c_port_number; /* Cit listener port (usually 504) */
94 int c_ipgm_secret; /* Internal program authentication */
95 struct ExpirePolicy c_ep; /* System default msg expire policy */
96 int c_userpurge; /* System default user purge (days) */
97 int c_roompurge; /* System default room purge (days) */
98 char c_logpages[ROOMNAMELEN]; /* Room to log pages to (or not) */
99 char c_createax; /* Axlevel required to create rooms */
100 long c_maxmsglen; /* Maximum message length */
101 int c_min_workers; /* Lower limit on number of threads */
102 int c_max_workers; /* Upper limit on number of threads */
103 int c_pop3_port; /* POP3 listener port (usually 110) */
104 int c_smtp_port; /* SMTP listener port (usually 25) */
105 int c_default_filter; /* Default moderation filter level */
106 int c_aide_zap; /* Are Aides allowed to zap rooms? */
107 int c_imap_port; /* IMAP listener port (usually 143) */
110 #define NODENAME config.c_nodename
111 #define FQDN config.c_fqdn
112 #define HUMANNODE config.c_humannode
113 #define PHONENUM config.c_phonenum
114 #define BBSUID config.c_bbsuid
115 #define CREATAIDE config.c_creataide
116 #define REGISCALL config.c_regiscall
117 #define TWITDETECT config.c_twitdetect
118 #define TWITROOM config.c_twitroom
119 #define RESTRICT_INTERNET config.c_restrict
121 /* Defines the actual user record */
123 struct usersupp { /* User record */
124 int version; /* Cit vers. which created this rec */
125 uid_t uid; /* Associate with a unix account? */
126 char password[32]; /* password (for BBS-only users) */
127 unsigned flags; /* See US_ flags below */
128 long timescalled; /* Total number of logins */
129 long posted; /* Number of messages posted (ever) */
130 CIT_UBYTE axlevel; /* Access level */
131 long usernum; /* User number (never recycled) */
132 time_t lastcall; /* Last time the user called */
133 int USuserpurge; /* Purge time (in days) for user */
134 char fullname[64]; /* Name for Citadel messages & mail */
135 CIT_UBYTE USscreenwidth; /* Screen width (for textmode users)*/
136 CIT_UBYTE USscreenheight; /* Screen height(for textmode users)*/
137 char moderation_filter; /* Moderation filter level */
142 * This is the control record for the message base...
145 long MMhighest; /* highest message number in file */
146 unsigned MMflags; /* Global system flags */
147 long MMnextuser; /* highest user number on system */
148 long MMnextroom; /* highest room number on system */
149 int version; /* Server-hosted upgrade level */
152 /* Bits which may appear in CitControl.MMflags. Note that these don't
153 * necessarily pertain to the message base -- it's just a good place to
154 * store any global flags.
156 #define MM_VALID 4 /* New users need validating */
162 char QRname[ROOMNAMELEN]; /* Name of room */
163 char QRpasswd[10]; /* Only valid if it's a private rm */
164 long QRroomaide; /* User number of room aide */
165 long QRhighest; /* Highest message NUMBER in room */
166 time_t QRgen; /* Generation number of room */
167 unsigned QRflags; /* See flag values below */
168 char QRdirname[15]; /* Directory name, if applicable */
169 long QRinfo; /* Info file update relative to msgs*/
170 char QRfloor; /* Which floor this room is on */
171 time_t QRmtime; /* Date/time of last post */
172 struct ExpirePolicy QRep; /* Message expiration policy */
173 long QRnumber; /* Globally unique room number */
174 char QRorder; /* Sort key for room listing order */
177 /* Private rooms are always flagged with QR_PRIVATE. If neither QR_PASSWORDED
178 * or QR_GUESSNAME is set, then it is invitation-only. Passworded rooms are
179 * flagged with both QR_PRIVATE and QR_PASSWORDED while guess-name rooms are
180 * flagged with both QR_PRIVATE and QR_GUESSNAME. NEVER set all three flags.
184 * Events which might show up in the Citadel Log
186 #define CL_CONNECT 8 /* Connect to server */
187 #define CL_LOGIN 16 /* CLfullname logged in */
188 #define CL_NEWUSER 32 /* CLfullname is a new user */
189 #define CL_BADPW 64 /* Bad attempt at CLfullname's pw */
190 #define CL_TERMINATE 128 /* Logout - proper termination */
191 #define CL_DROPCARR 256 /* Logout - dropped carrier */
192 #define CL_SLEEPING 512 /* Logout - sleeping */
193 #define CL_PWCHANGE 1024 /* CLfullname changed passwords */
197 #define MES_NORMAL 65 /* Normal message */
198 #define MES_ANON 66 /* "****" header */
199 #define MES_AN2 67 /* "Anonymous" header */
201 #define MES_ERROR (-1) /* Can't send message due to bad address */
202 #define MES_LOCAL 0 /* Local message, do no network processing */
203 #define MES_INTERNET 1 /* Convert msg and send as Internet mail */
204 #define MES_BINARY 2 /* Process recipient and send via Cit net */
206 /****************************************************************************/
209 * Floor record. The floor number is implicit in its location in the file.
212 unsigned short f_flags; /* flags */
213 char f_name[256]; /* name of floor */
214 int f_ref_count; /* reference count */
215 struct ExpirePolicy f_ep; /* default expiration policy */
218 #define F_INUSE 1 /* floor is in use */
222 * Values used internally for function call returns, etc.
225 #define NEWREGISTER 0 /* new user to register */
226 #define REREGISTER 1 /* existing user reregistering */
228 #define READ_HEADER 2
229 #define READ_MSGBODY 3
231 /* commands we can send to the sttybbs() routine */
232 #define SB_NO_INTR 0 /* set to bbs mode, i/q disabled */
233 #define SB_YES_INTR 1 /* set to bbs mode, i/q enabled */
234 #define SB_SAVE 2 /* save settings */
235 #define SB_RESTORE 3 /* restore settings */
236 #define SB_LAST 4 /* redo the last command sent */
241 /* server exit codes */
242 #define EXIT_NORMAL 0 /* server terminated normally */
243 /* 1 through 63 reserved for signals */
244 #define EXIT_NULL 64 /* EOF on server command input */
246 /* citadel.rc stuff */
247 #define RC_NO 0 /* always no */
248 #define RC_YES 1 /* always yes */
249 #define RC_DEFAULT 2 /* setting depends on user config */
252 #define KA_NO 0 /* no keepalives */
253 #define KA_YES 1 /* full keepalives */
255 /* for <;G>oto and <;S>kip commands */
256 #define GF_GOTO 0 /* <;G>oto floor mode */
257 #define GF_SKIP 1 /* <;S>kip floor mode */
258 #define GF_ZAP 2 /* <;Z>ap floor mode */
261 * MIME types used in Citadel for configuration stuff
263 #define SPOOLMIME "application/x-citadel-delivery-list"
264 #define INTERNETCFG "application/x-citadel-internet-config"
265 #define IGNETCFG "application/x-citadel-ignet-config"
266 #define IGNETMAP "application/x-citadel-ignet-map"
267 #define USETABLE "application/x-citadel-usetable"
269 #define TRACE lprintf(9, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
272 #define LONG_MAX 2147483647L
275 #endif /* CITADEL_H */