config.h 6.42 KB
Newer Older
Linus Tolke's avatar
Linus Tolke committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * $Id: config.h,v 0.3 1991/09/15 10:13:11 linus Exp $
 * Copyright (C) 1991  Lysator Academic Computer Association.
 *
 * This file is part of the LysKOM server.
 * 
 * LysKOM is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 1, or (at your option) 
 * any later version.
 * 
 * LysKOM is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with LysKOM; see the file COPYING.  If not, write to
 * Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
 * or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
 * MA 02139, USA.
 *
 * Please mail bug reports to bug-lyskom@lysator.liu.se. 
 */
Per Cederqvist's avatar
.    
Per Cederqvist committed
25
26
27
28
29
30
31
32
33
/*
 *  config.h
 *
 *  Configuration parameters for compiling.  Contains among other
 *  things all the stupid limits you really want to be without, all the
 *  smart limits that has to be there to make it impossible to crash
 *  the server, and lots of constants and configuration options.
 */

34
#include <m-config.h>
Per Cederqvist's avatar
.    
Per Cederqvist committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

#define DEBUG			/* We're still debugging and want traces. */

/*
 * Add some checks that really shouldn't be necessary.
 */
#define DEFENSIVE_CHECKS


/* Collating sequence used. */
#define DEFAULT_COLLAT_TAB	swedish_collate_tab



/* The file kom_perror prints to.  */
/* Yes! This should be stdout. At least during testing and debugging! /ceder */

#define kom_errout	stdout

/*
 * Security options (these must be #defines since they are used inside a
 *		     'const' definition in kom-types.c).
 */
#define ANYONE_CAN_CREATE_NEW_PERSONS TRUE /* Can a created person */
					   /* create other persons? */
#define CREATE_PERSON_BEFORE_LOGIN  TRUE /* Can a person create himself? */
#define ANYONE_CAN_CREATE_NEW_CONFS TRUE
#define DEFAULT_CHANGE_NAME	    TRUE /* Everyone is normally allowed */
					 /* to change their own name. */

/*
 * The following are constants which can not be changed without rewriting
 * some of the code.
 */
#define PROTOCOL_NUMBER_BASE 10	/* The number base used in all communication
				 * between server and clients. */


/* Where to save things. These are used by ramkomd. */

extern const char *DEFAULT_DBASE_DIR;
extern const char *DATAFILE_NAME;
extern const char *BACKUPFILE_NAME;
extern const char *TEXTFILE_NAME;
extern const char *STATISTIC_NAME;
extern const char *PID_NAME;
extern const char *MEMUSE_NAME;

/* Communications */

extern const char * DEFAULT_CLIENT_SERVICE;
extern const char * DEFAULT_MUX_SERVICE;

#if 0
extern const int IN_CLIENT_PORT;	/* Which port does LysKOM listen to? */
extern const int IN_MUX_PORT;	        /* Which port does LysKOM listen to? */
#endif

/*
 * The following should always be true:
 * SYNCTIMEOUT <= GARBTIMEOUT <= TIMEOUT
 * Times in milliseconds.
 */
extern const int TIMEOUT;	/* Timeout to select() when totally idle. */
extern const int GARBTIMEOUT;	/* Timeout to select() when garbing texts
				   but not syncing. */
extern const int SYNCTIMEOUT;	/* Timeout to select() when syncing. */

extern const int GARB_INTERVAL;	/* In minutes. */
extern const int SYNC_INTERVAL;	/* In minutes. */
extern const int SYNC_RETRY_INTERVAL;	/* In minutes. */

/* Size of the cache. (only applies to diskomd). */

extern const int CACHE_CONFERENCES;
extern const int CACHE_PERSONS;
extern const int CACHE_TEXT_STATS;

/* String limits */

extern const int CONF_NAME_LEN;	/* Conference (and Person) name */
extern const int PWD_LEN;	/* Password. It is not guaranteed that all
				   chars are significant. */
extern const int WHAT_DO_LEN;	/* what_am_i_doing */
extern const int USERNAME_LEN;	/* Max login-id from clients */
extern const int TEXT_LEN;	/* Max len of a text. */
extern const int BROADCAST_LEN;	/* Max len of a broadcast message */

/* Text_stat limits */

extern const int MAX_MARKS_PERSON; /* Max marks per person */
extern const int MAX_MARKS_TEXT;  /* Max marks per text */
extern const int MAX_RECIPIENTS;  /* Max recipients/cc_recipients per text */
extern const int MAX_COMM;	  /* Max number of comments to a text */
extern const int MAX_FOOT;	  /* Max number of footnotes to a text */
extern const int MAX_CREA_MISC;   /* Sum of recipients, cc_recipients, comm_to
				   * and footn_to must not exceed MAX_CREA_MISC
				   * when the text is created. */

/*
 * Some other limits
 */
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174


/*
 * MAX_NO_OF_CONNECTIONS must be small enough. Each connection takes one
 * file descriptor, and it is important that there are a few descriptors
 * left so that it is possible to save the data base. lyskomd might crash
 * if this number is too big and that many connectionattempts are made
 * simultaneously.
 *
 * The following descriptors are open by LysKOM:
 *   stdin, stdout, stderr   (stdin and stdout could probably be closed.
 *			      The log() function prints to stderr.)
 *   TEXTFILE_NAME	     (always open)
 *   DATAFILE_NAME	     (often open)
 *   STATISTIC_NAME	     (open after a SIGUSR1)
 * Thus, the max number of connections is the number of available file
 * descriptors minus six. This has not been fully tested for a long
 * while, so we subtract eight just to be on the safe side. That still
 * gives 56 simultaneous users on a sun4, and that is enough for the
 * time beeing. (If you need more connections you can ran a mux. Send
 * mail to kom@lysator.liu.se for more info.)
 */

#define PROTECTED_FDS 8

/*
 * An upper limit of how many connections to LysKOM that can be opened
 * simultaneously. If we HAVE_GETDTABLESIZE this is set once and for
 * all at the beginning of main(). Otherwise it is determined at
 * compile-time.
 */
#ifdef HAVE_GETDTABLESIZE
extern int MAX_NO_OF_CONNECTIONS;
#else
extern const int MAX_NO_OF_CONNECTIONS;
#endif


Per Cederqvist's avatar
.    
Per Cederqvist committed
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
extern const int MARK_AS_READ_CHUNK;	/* You can't mark more than this many
					 * texts as read in one call. */

/*
 * Max number of nested super_confs a message will be forwarded before
 * the server gives up.
 */
extern const int MAX_SUPER_CONF_LOOP;


extern const int DEFAULT_NICE;	/* Number of days a text normally lives. */

/* Max entries in the per-client transmit queue */
extern const int MAXQUEUEDSIZE;

/* Max entries in the per-client transmit queue to send at any one time */
extern const int MAXDEQUEUELEN;

/* What is whitespace? */
extern const unsigned char *WHITESPACE;