forked from unrealircd/unrealircd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynconf.h
403 lines (373 loc) · 12.5 KB
/
dynconf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
/************************************************************************
* Unreal Internet Relay Chat Daemon, include/dynconf.h
* Copyright (C) 1999 Carsten Munk
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
*/
#define DYNCONF_H
/* config level */
#define DYNCONF_CONF_VERSION "1.5"
#define DYNCONF_NETWORK_VERSION "2.2"
typedef struct zNetwork aNetwork;
struct zNetwork {
unsigned x_inah:1;
char *x_ircnetwork;
char *x_ircnet005;
char *x_defserv;
char *x_services_name;
char *x_oper_host;
char *x_admin_host;
char *x_locop_host;
char *x_sadmin_host;
char *x_netadmin_host;
char *x_coadmin_host;
char *x_hidden_host;
char *x_prefix_quit;
char *x_helpchan;
char *x_stats_server;
char *x_sasl_server;
};
enum UHAllowed { UHALLOW_ALWAYS, UHALLOW_NOCHANS, UHALLOW_REJOIN, UHALLOW_NEVER };
struct ChMode {
long mode;
long extmodes;
char *extparams[EXTCMODETABLESZ];
};
typedef struct _OperStat {
struct _OperStat *prev, *next;
char *flag;
} OperStat;
typedef struct zConfiguration aConfiguration;
struct zConfiguration {
unsigned som:1;
unsigned hide_ulines:1;
unsigned flat_map:1;
unsigned allow_chatops:1;
unsigned webtv_support:1;
unsigned ident_check:1;
unsigned fail_oper_warn:1;
unsigned show_connect_info:1;
unsigned dont_resolve:1;
unsigned use_ban_version:1;
unsigned mkpasswd_for_everyone:1;
unsigned allow_insane_bans;
unsigned allow_part_if_shunned:1;
unsigned disable_cap:1;
unsigned check_target_nick_bans:1;
unsigned use_egd : 1;
long host_timeout;
int host_retries;
char *name_server;
char *dns_bindip;
char *link_bindip;
long throttle_period;
char throttle_count;
char *kline_address;
char *gline_address;
long conn_modes;
long oper_modes;
char *oper_snomask;
char *user_snomask;
char *auto_join_chans;
char *oper_auto_join_chans;
char *oper_only_stats;
OperStat *oper_only_stats_ext;
int maxchannelsperuser;
int maxdccallow;
int anti_spam_quit_message_time;
char *egd_path;
char *static_quit;
char *static_part;
#ifdef USE_SSL
char *x_server_cert_pem;
char *x_server_key_pem;
char *x_server_cipher_list;
char *x_dh_pem;
char *trusted_ca_file;
long ssl_options;
int ssl_renegotiate_bytes;
int ssl_renegotiate_timeout;
#elif defined(_WIN32)
void *bogus1, *bogus2, *bogus3, *bogus4, *bogus5;
long bogus6;
int bogus7, bogus8;
#endif
enum UHAllowed userhost_allowed;
char *restrict_usermodes;
char *restrict_channelmodes;
char *restrict_extendedbans;
int new_linking_protocol;
char *channel_command_prefix;
long unknown_flood_bantime;
long unknown_flood_amount;
struct ChMode modes_on_join;
int level_on_join;
#ifdef NO_FLOOD_AWAY
unsigned char away_count;
long away_period;
#endif
unsigned char nick_count;
long nick_period;
int ident_connect_timeout;
int ident_read_timeout;
long default_bantime;
int who_limit;
int silence_limit;
unsigned char modef_default_unsettime;
unsigned char modef_max_unsettime;
long ban_version_tkl_time;
long spamfilter_ban_time;
char *spamfilter_ban_reason;
char *spamfilter_virus_help_channel;
char spamfilter_vchan_deny;
SpamExcept *spamexcept;
char *spamexcept_line;
long spamfilter_detectslow_warn;
long spamfilter_detectslow_fatal;
int spamfilter_stop_on_first_match;
int maxbans;
int maxbanlength;
int timesynch_enabled;
int timesynch_timeout;
char *timesynch_server;
int pingpong_warning;
int watch_away_notification;
int uhnames;
aNetwork network;
#ifdef INET6
unsigned short default_ipv6_clone_mask;
#endif /* INET6 */
int ping_cookie;
int nicklen;
};
#ifndef DYNCONF_C
extern MODVAR aConfiguration iConf;
#endif
#define KLINE_ADDRESS iConf.kline_address
#define GLINE_ADDRESS iConf.gline_address
#define CONN_MODES iConf.conn_modes
#define OPER_MODES iConf.oper_modes
#define OPER_SNOMASK iConf.oper_snomask
#define CONNECT_SNOMASK iConf.user_snomask
#define SHOWOPERMOTD iConf.som
#define HIDE_ULINES iConf.hide_ulines
#define FLAT_MAP iConf.flat_map
#define ALLOW_CHATOPS iConf.allow_chatops
#define MAXCHANNELSPERUSER iConf.maxchannelsperuser
#define MAXDCCALLOW iConf.maxdccallow
#define WEBTV_SUPPORT iConf.webtv_support
#define DONT_RESOLVE iConf.dont_resolve
#define AUTO_JOIN_CHANS iConf.auto_join_chans
#define OPER_AUTO_JOIN_CHANS iConf.oper_auto_join_chans
#define HOST_TIMEOUT iConf.host_timeout
#define HOST_RETRIES iConf.host_retries
#define NAME_SERVER iConf.name_server
#define DNS_BINDIP iConf.dns_bindip
#define LINK_BINDIP iConf.link_bindip
#define IDENT_CHECK iConf.ident_check
#define FAILOPER_WARN iConf.fail_oper_warn
#define SHOWCONNECTINFO iConf.show_connect_info
#define OPER_ONLY_STATS iConf.oper_only_stats
#define ANTI_SPAM_QUIT_MSG_TIME iConf.anti_spam_quit_message_time
#ifdef HAVE_RAND_EGD
#define USE_EGD iConf.use_egd
#else
#define USE_EGD 0
#endif
#define EGD_PATH iConf.egd_path
#define ircnetwork iConf.network.x_ircnetwork
#define ircnet005 iConf.network.x_ircnet005
#define defserv iConf.network.x_defserv
#define SERVICES_NAME iConf.network.x_services_name
#define oper_host iConf.network.x_oper_host
#define admin_host iConf.network.x_admin_host
#define locop_host iConf.network.x_locop_host
#define sadmin_host iConf.network.x_sadmin_host
#define netadmin_host iConf.network.x_netadmin_host
#define coadmin_host iConf.network.x_coadmin_host
#define hidden_host iConf.network.x_hidden_host
#define helpchan iConf.network.x_helpchan
#define STATS_SERVER iConf.network.x_stats_server
#define SASL_SERVER iConf.network.x_sasl_server
#define iNAH iConf.network.x_inah
#define prefix_quit iConf.network.x_prefix_quit
#define SSL_SERVER_CERT_PEM (iConf.x_server_cert_pem ? iConf.x_server_cert_pem : "server.cert.pem")
#define SSL_SERVER_KEY_PEM (iConf.x_server_key_pem ? iConf.x_server_key_pem : "server.key.pem")
#define STATIC_QUIT iConf.static_quit
#define STATIC_PART iConf.static_part
#define UHOST_ALLOWED iConf.userhost_allowed
#define RESTRICT_USERMODES iConf.restrict_usermodes
#define RESTRICT_CHANNELMODES iConf.restrict_channelmodes
#define RESTRICT_EXTENDEDBANS iConf.restrict_extendedbans
#define NEW_LINKING_PROTOCOL iConf.new_linking_protocol
#define THROTTLING_PERIOD iConf.throttle_period
#define THROTTLING_COUNT iConf.throttle_count
#define USE_BAN_VERSION iConf.use_ban_version
#define UNKNOWN_FLOOD_BANTIME iConf.unknown_flood_bantime
#define UNKNOWN_FLOOD_AMOUNT iConf.unknown_flood_amount
#define MODES_ON_JOIN iConf.modes_on_join.mode
#define LEVEL_ON_JOIN iConf.level_on_join
#ifdef NO_FLOOD_AWAY
#define AWAY_PERIOD iConf.away_period
#define AWAY_COUNT iConf.away_count
#endif
#define NICK_PERIOD iConf.nick_period
#define NICK_COUNT iConf.nick_count
#define IDENT_CONNECT_TIMEOUT iConf.ident_connect_timeout
#define IDENT_READ_TIMEOUT iConf.ident_read_timeout
#define MKPASSWD_FOR_EVERYONE iConf.mkpasswd_for_everyone
#define ALLOW_INSANE_BANS iConf.allow_insane_bans
#define CHANCMDPFX iConf.channel_command_prefix
#define DEFAULT_BANTIME iConf.default_bantime
#define WHOLIMIT iConf.who_limit
#define MODEF_DEFAULT_UNSETTIME iConf.modef_default_unsettime
#define MODEF_MAX_UNSETTIME iConf.modef_max_unsettime
#define ALLOW_PART_IF_SHUNNED iConf.allow_part_if_shunned
#define DISABLE_CAP iConf.disable_cap
#define BAN_VERSION_TKL_TIME iConf.ban_version_tkl_time
#define SILENCE_LIMIT (iConf.silence_limit ? iConf.silence_limit : 15)
#define SPAMFILTER_BAN_TIME iConf.spamfilter_ban_time
#define SPAMFILTER_BAN_REASON iConf.spamfilter_ban_reason
#define SPAMFILTER_VIRUSCHAN iConf.spamfilter_virus_help_channel
#define SPAMFILTER_VIRUSCHANDENY iConf.spamfilter_vchan_deny
#define SPAMFILTER_EXCEPT iConf.spamexcept_line
#define SPAMFILTER_DETECTSLOW_WARN iConf.spamfilter_detectslow_warn
#define SPAMFILTER_DETECTSLOW_FATAL iConf.spamfilter_detectslow_fatal
#define SPAMFILTER_STOP_ON_FIRST_MATCH iConf.spamfilter_stop_on_first_match
#define CHECK_TARGET_NICK_BANS iConf.check_target_nick_bans
#define MAXBANS iConf.maxbans
#define MAXBANLENGTH iConf.maxbanlength
#define TIMESYNCH iConf.timesynch_enabled
#define TIMESYNCH_TIMEOUT iConf.timesynch_timeout
#define TIMESYNCH_SERVER iConf.timesynch_server
#define PINGPONG_WARNING iConf.pingpong_warning
#define WATCH_AWAY_NOTIFICATION iConf.watch_away_notification
#define UHNAMES_ENABLED iConf.uhnames
/* Used for "is present?" and duplicate checking */
struct SetCheck {
unsigned has_show_opermotd:1;
unsigned has_hide_ulines:1;
unsigned has_flat_map:1;
unsigned has_allow_chatops:1;
unsigned has_webtv_support:1;
unsigned has_ident_check:1;
unsigned has_fail_oper_warn:1;
unsigned has_show_connect_info:1;
unsigned has_dont_resolve:1;
unsigned has_mkpasswd_for_everyone:1;
unsigned has_allow_part_if_shunned:1;
unsigned has_disable_cap:1;
unsigned has_ssl_egd:1;
unsigned has_ssl_server_cipher_list :1;
unsigned has_dns_timeout:1;
unsigned has_dns_retries:1;
unsigned has_dns_nameserver:1;
unsigned has_dns_bind_ip:1;
unsigned has_throttle_period:1;
unsigned has_throttle_connections:1;
unsigned has_kline_address:1;
unsigned has_gline_address:1;
unsigned has_modes_on_connect:1;
unsigned has_modes_on_oper:1;
unsigned has_snomask_on_connect:1;
unsigned has_snomask_on_oper:1;
unsigned has_auto_join:1;
unsigned has_oper_auto_join:1;
unsigned has_check_target_nick_bans:1;
unsigned has_pingpong_warning:1;
unsigned has_watch_away_notification:1;
unsigned has_uhnames:1;
unsigned has_oper_only_stats:1;
unsigned has_maxchannelsperuser:1;
unsigned has_maxdccallow:1;
unsigned has_anti_spam_quit_message_time:1;
unsigned has_egd_path:1;
unsigned has_static_quit:1;
unsigned has_static_part:1;
#ifdef USE_SSL
unsigned has_ssl_certificate:1;
unsigned has_ssl_key:1;
unsigned has_ssl_trusted_ca_file:1;
unsigned has_ssl_options:1;
unsigned has_ssl_dh:1;
unsigned has_renegotiate_timeout : 1;
unsigned has_renegotiate_bytes : 1;
#endif
unsigned has_allow_userhost_change:1;
unsigned has_restrict_usermodes:1;
unsigned has_restrict_channelmodes:1;
unsigned has_restrict_extendedbans:1;
unsigned has_new_linking_protocol:1;
unsigned has_channel_command_prefix:1;
unsigned has_anti_flood_unknown_flood_bantime:1;
unsigned has_anti_flood_unknown_flood_amount:1;
unsigned has_modes_on_join:1;
unsigned has_level_on_join:1;
#ifdef NO_FLOOD_AWAY
unsigned has_anti_flood_away_count:1;
unsigned has_anti_flood_away_period:1;
#endif
unsigned has_anti_flood_nick_flood:1;
unsigned has_ident_connect_timeout:1;
unsigned has_ident_read_timeout:1;
unsigned has_default_bantime:1;
unsigned has_who_limit:1;
unsigned has_maxbans:1;
unsigned has_maxbanlength:1;
unsigned has_silence_limit:1;
unsigned has_modef_default_unsettime:1;
unsigned has_modef_max_unsettime:1;
unsigned has_ban_version_tkl_time:1;
unsigned has_spamfilter_ban_time:1;
unsigned has_spamfilter_ban_reason:1;
unsigned has_spamfilter_virus_help_channel:1;
unsigned has_spamfilter_virus_help_channel_deny:1;
unsigned has_spamfilter_except:1;
unsigned has_hosts_host_on_oper_up:1;
unsigned has_network_name:1;
unsigned has_default_server:1;
unsigned has_services_server:1;
unsigned has_sasl_server:1;
unsigned has_hosts_global:1;
unsigned has_hosts_admin:1;
unsigned has_hosts_local:1;
unsigned has_hosts_servicesadmin:1;
unsigned has_hosts_netadmin:1;
unsigned has_hosts_coadmin:1;
unsigned has_hiddenhost_prefix:1;
unsigned has_prefix_quit:1;
unsigned has_help_channel:1;
unsigned has_stats_server:1;
unsigned has_cloak_keys:1;
unsigned has_options_webtv_support:1;
unsigned has_options_hide_ulines:1;
unsigned has_options_flat_map:1;
unsigned has_options_show_opermotd:1;
unsigned has_options_identd_check:1;
unsigned has_options_fail_oper_warn:1;
unsigned has_options_dont_resolve:1;
unsigned has_options_show_connect_info:1;
unsigned has_options_mkpasswd_for_everyone:1;
unsigned has_options_allow_insane_bans:1;
unsigned has_options_allow_part_if_shunned:1;
unsigned has_options_disable_cap:1;
int cgiirc_type; /* cheat :( */
unsigned has_cgiirc_hosts:1;
unsigned has_cgiirc_webpass:1;
unsigned has_ping_cookie:1;
unsigned has_nicklen:1;
};