4 * main Citadel/UX header file
5 * see copyright.txt for copyright information
8 /* system customizations are in sysconfig.h */
15 #include "sysconfig.h"
19 * Text description of this software
21 #define CITADEL "Citadel/UX 5.91"
24 * REV_LEVEL is the current version number (multiplied by 100 to avoid having
25 * to fiddle with the decimal). REV_MIN is the oldest version of Citadel
26 * whose data files are compatible with the current version. If the data files
27 * are older than REV_MIN, none of the programs will work until the setup
28 * program is run again to bring things up to date.
30 #define REV_LEVEL 591 /* This version */
31 #define REV_MIN 591 /* Oldest compatible version */
33 #define SERVER_TYPE 0 /* zero for stock Citadel/UX; other developers please
34 obtain SERVER_TYPE codes for your implementations */
37 * This is a better implementation of tolower() than that found on some
38 * systems (there are operating systems out there on which tolower() will
39 * screw up if you give it a character that is already lower case).
44 #define tolower(x) ( ((x>='A')&&(x<='Z')) ? (x+'a'-'A') : x )
48 * The only typedef we do is an 8-bit unsigned, for screen dimensions.
49 * All other defs are done using standard C types. The code assumes that
50 * 'int' 'unsigned' and 'short' are at least 16 bits, and that 'long' is at
51 * least 32 bits. There are no endian dependencies in any of the Citadel
54 typedef unsigned char CIT_UBYTE;
56 /* Various length constants */
58 #define UGLISTLEN 100 /* you get a ungoto list of this size */
59 #define ROOMNAMELEN 128 /* The size of a roomname string */
60 #define NONCE_SIZE 128 /* Added by <bc> to allow for APOP auth
61 * it is BIG becuase there is a hostname
62 * in the nonce, as per the APOP RFC.
65 #define USERNAME_SIZE 32 /* The size of a username string */
68 * Message expiration policy stuff
75 #define EXPIRE_NEXTLEVEL 0 /* Inherit expiration policy */
76 #define EXPIRE_MANUAL 1 /* Don't expire messages at all */
77 #define EXPIRE_NUMMSGS 2 /* Keep only latest n messages */
78 #define EXPIRE_AGE 3 /* Expire messages after n days */
82 * Global system configuration
85 char c_nodename[16]; /* Unqualified "short" nodename */
86 char c_fqdn[64]; /* Fully Qualified Domain Name */
87 char c_humannode[21]; /* Long name of system */
88 char c_phonenum[16]; /* Dialup number of system */
89 uid_t c_bbsuid; /* UID of the bbs-only user */
90 char c_creataide; /* room creator = room aide flag */
91 int c_sleeping; /* watchdog timer setting */
92 char c_initax; /* initial access level */
93 char c_regiscall; /* call number to register on */
94 char c_twitdetect; /* twit detect flag */
95 char c_twitroom[ROOMNAMELEN]; /* twit detect msg move to room */
96 char c_moreprompt[80]; /* paginator prompt */
97 char c_restrict; /* restrict Internet mail flag */
98 long c_msgbase; /* size of message base (obsolete) */
99 char c_bbs_city[32]; /* physical location of server */
100 char c_sysadm[26]; /* name of system administrator */
101 char c_bucket_dir[15]; /* bit bucket for files... */
102 int c_setup_level; /* what rev level we've setup to */
103 int c_maxsessions; /* maximum concurrent sessions */
104 char c_net_password[20]; /* system net password (obsolete) */
105 int c_port_number; /* Cit listener port (usually 504) */
106 int c_ipgm_secret; /* Internal program authentication */
107 struct ExpirePolicy c_ep; /* System default msg expire policy */
108 int c_userpurge; /* System default user purge (days) */
109 int c_roompurge; /* System default room purge (days) */
110 char c_logpages[ROOMNAMELEN]; /* Room to log pages to (or not) */
111 char c_createax; /* Axlevel required to create rooms */
112 long c_maxmsglen; /* Maximum message length */
113 int c_min_workers; /* Lower limit on number of threads */
114 int c_max_workers; /* Upper limit on number of threads */
115 int c_pop3_port; /* POP3 listener port (usually 110) */
116 int c_smtp_port; /* SMTP listener port (usually 25) */
117 int c_unused_1; /* Nothin' here anymore... */
118 int c_aide_zap; /* Are Aides allowed to zap rooms? */
119 int c_imap_port; /* IMAP listener port (usually 143) */
120 time_t c_net_freq; /* how often to run the networker */
121 char c_disable_newu; /* disable NEWU command */
122 char c_aide_mailboxes; /* give Aides access to mailboxes */
123 char c_baseroom[ROOMNAMELEN]; /* Name of baseroom (Lobby) */
124 char c_aideroom[ROOMNAMELEN]; /* Name of aideroom (Aide) */
127 #define NODENAME config.c_nodename
128 #define FQDN config.c_fqdn
129 #define HUMANNODE config.c_humannode
130 #define PHONENUM config.c_phonenum
131 #define BBSUID config.c_bbsuid
132 #define CREATAIDE config.c_creataide
133 #define REGISCALL config.c_regiscall
134 #define TWITDETECT config.c_twitdetect
135 #define TWITROOM config.c_twitroom
136 #define RESTRICT_INTERNET config.c_restrict
138 /* Defines the actual user record */
140 struct usersupp { /* User record */
141 int version; /* Cit vers. which created this rec */
142 uid_t uid; /* Associate with a unix account? */
143 char password[32]; /* password (for BBS-only users) */
144 unsigned flags; /* See US_ flags below */
145 long timescalled; /* Total number of logins */
146 long posted; /* Number of messages posted (ever) */
147 CIT_UBYTE axlevel; /* Access level */
148 long usernum; /* User number (never recycled) */
149 time_t lastcall; /* Last time the user called */
150 int USuserpurge; /* Purge time (in days) for user */
151 char fullname[64]; /* Name for Citadel messages & mail */
152 CIT_UBYTE USscreenwidth; /* Screen width (for textmode users)*/
153 CIT_UBYTE USscreenheight; /* Screen height(for textmode users)*/
158 * This is the control record for the message base...
161 long MMhighest; /* highest message number in file */
162 unsigned MMflags; /* Global system flags */
163 long MMnextuser; /* highest user number on system */
164 long MMnextroom; /* highest room number on system */
165 int version; /* Server-hosted upgrade level */
168 /* Bits which may appear in CitControl.MMflags. Note that these don't
169 * necessarily pertain to the message base -- it's just a good place to
170 * store any global flags.
172 #define MM_VALID 4 /* New users need validating */
178 char QRname[ROOMNAMELEN]; /* Name of room */
179 char QRpasswd[10]; /* Only valid if it's a private rm */
180 long QRroomaide; /* User number of room aide */
181 long QRhighest; /* Highest message NUMBER in room */
182 time_t QRgen; /* Generation number of room */
183 unsigned QRflags; /* See flag values below */
184 char QRdirname[15]; /* Directory name, if applicable */
185 long QRinfo; /* Info file update relative to msgs*/
186 char QRfloor; /* Which floor this room is on */
187 time_t QRmtime; /* Date/time of last post */
188 struct ExpirePolicy QRep; /* Message expiration policy */
189 long QRnumber; /* Globally unique room number */
190 char QRorder; /* Sort key for room listing order */
191 unsigned QRflags2; /* Additional flags */
192 int QRdefaultview; /* How to display the contents */
195 /* Private rooms are always flagged with QR_PRIVATE. If neither QR_PASSWORDED
196 * or QR_GUESSNAME is set, then it is invitation-only. Passworded rooms are
197 * flagged with both QR_PRIVATE and QR_PASSWORDED while guess-name rooms are
198 * flagged with both QR_PRIVATE and QR_GUESSNAME. NEVER set all three flags.
202 * Events which might show up in the Citadel Log
204 #define CL_CONNECT 8 /* Connect to server */
205 #define CL_LOGIN 16 /* CLfullname logged in */
206 #define CL_NEWUSER 32 /* CLfullname is a new user */
207 #define CL_BADPW 64 /* Bad attempt at CLfullname's pw */
208 #define CL_TERMINATE 128 /* Logout - proper termination */
209 #define CL_DROPCARR 256 /* Logout - dropped carrier */
210 #define CL_SLEEPING 512 /* Logout - sleeping */
211 #define CL_PWCHANGE 1024 /* CLfullname changed passwords */
215 #define MES_NORMAL 65 /* Normal message */
216 #define MES_ANONONLY 66 /* "****" header */
217 #define MES_ANONOPT 67 /* "Anonymous" header */
219 #define MES_ERROR (-1) /* Can't send message due to bad address */
220 #define MES_LOCAL 0 /* Local message, do no network processing */
221 #define MES_INTERNET 1 /* Convert msg and send as Internet mail */
222 #define MES_IGNET 2 /* Process recipient and send via Cit net */
224 /****************************************************************************/
227 * Floor record. The floor number is implicit in its location in the file.
230 unsigned short f_flags; /* flags */
231 char f_name[256]; /* name of floor */
232 int f_ref_count; /* reference count */
233 struct ExpirePolicy f_ep; /* default expiration policy */
236 #define F_INUSE 1 /* floor is in use */
240 * Values used internally for function call returns, etc.
243 #define NEWREGISTER 0 /* new user to register */
244 #define REREGISTER 1 /* existing user reregistering */
246 #define READ_HEADER 2
247 #define READ_MSGBODY 3
249 /* commands we can send to the sttybbs() routine */
250 #define SB_NO_INTR 0 /* set to bbs mode, i/q disabled */
251 #define SB_YES_INTR 1 /* set to bbs mode, i/q enabled */
252 #define SB_SAVE 2 /* save settings */
253 #define SB_RESTORE 3 /* restore settings */
254 #define SB_LAST 4 /* redo the last command sent */
259 /* server exit codes */
260 #define EXIT_NORMAL 0 /* server terminated normally */
261 /* 1 through 63 reserved for signals */
262 #define EXIT_NULL 64 /* EOF on server command input */
264 /* citadel.rc stuff */
265 #define RC_NO 0 /* always no */
266 #define RC_YES 1 /* always yes */
267 #define RC_DEFAULT 2 /* setting depends on user config */
271 KA_NO, /* no keepalives */
272 KA_YES, /* full keepalives */
273 KA_HALF /* half keepalives */
276 /* for <;G>oto and <;S>kip commands */
277 #define GF_GOTO 0 /* <;G>oto floor mode */
278 #define GF_SKIP 1 /* <;S>kip floor mode */
279 #define GF_ZAP 2 /* <;Z>ap floor mode */
282 * MIME types used in Citadel for configuration stuff
284 #define SPOOLMIME "application/x-citadel-delivery-list"
285 #define INTERNETCFG "application/x-citadel-internet-config"
286 #define IGNETCFG "application/x-citadel-ignet-config"
287 #define IGNETMAP "application/x-citadel-ignet-map"
288 #define FILTERLIST "application/x-citadel-filter-list"
289 #define SPAMSTRINGS "application/x-citadel-spam-strings"
291 #define TRACE lprintf(9, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
294 #define LONG_MAX 2147483647L
297 #endif /* CITADEL_H */
303 #define VIEW_BBS 0 /* Traditional Citadel BBS view */
304 #define VIEW_MAILBOX 1 /* Mailbox summary */
305 #define VIEW_ADDRESSBOOK 2 /* Address book view */