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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
|
.TH "ServerConfig" 3 "15 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ServerConfig \- This class holds the bulk of the runtime configuration for the ircd.
.PP
.SH SYNOPSIS
.br
.PP
\fC#include <inspircd_io.h>\fP
.PP
Inherits \fBclassbase\fP.
.PP
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBServerConfig\fP ()"
.br
.ti -1c
.RI "void \fBClearStack\fP ()"
.br
.RI "\fIClears the include stack in preperation for a \fBRead()\fP call. \fP"
.ti -1c
.RI "void \fBRead\fP (bool bail, \fBuserrec\fP *user)"
.br
.RI "\fIRead the entire configuration into memory and initialize this class. \fP"
.ti -1c
.RI "bool \fBLoadConf\fP (const char *filename, std::stringstream *target, std::stringstream *errorstream)"
.br
.ti -1c
.RI "int \fBConfValue\fP (char *tag, char *var, int index, char *result, std::stringstream *config)"
.br
.ti -1c
.RI "int \fBReadConf\fP (std::stringstream *\fBconfig_f\fP, const char *tag, const char *var, int index, char *result)"
.br
.ti -1c
.RI "int \fBConfValueEnum\fP (char *tag, std::stringstream *config)"
.br
.ti -1c
.RI "int \fBEnumConf\fP (std::stringstream *\fBconfig_f\fP, const char *tag)"
.br
.ti -1c
.RI "int \fBEnumValues\fP (std::stringstream *config, const char *tag, int index)"
.br
.in -1c
.SS "Public Attributes"
.in +1c
.ti -1c
.RI "char \fBServerName\fP [MAXBUF]"
.br
.RI "\fIHolds the server name of the local server as defined by the administrator. \fP"
.ti -1c
.RI "char \fBNetwork\fP [MAXBUF]"
.br
.ti -1c
.RI "char \fBServerDesc\fP [MAXBUF]"
.br
.RI "\fIHolds the description of the local server as defined by the administrator. \fP"
.ti -1c
.RI "char \fBAdminName\fP [MAXBUF]"
.br
.RI "\fIHolds the admin's name, for output in the /ADMIN command. \fP"
.ti -1c
.RI "char \fBAdminEmail\fP [MAXBUF]"
.br
.RI "\fIHolds the email address of the admin, for output in the /ADMIN command. \fP"
.ti -1c
.RI "char \fBAdminNick\fP [MAXBUF]"
.br
.RI "\fIHolds the admin's nickname, for output in the /ADMIN command. \fP"
.ti -1c
.RI "char \fBdiepass\fP [MAXBUF]"
.br
.RI "\fIThe admin-configured /DIE password. \fP"
.ti -1c
.RI "char \fBrestartpass\fP [MAXBUF]"
.br
.RI "\fIThe admin-configured /RESTART password. \fP"
.ti -1c
.RI "char \fBmotd\fP [MAXBUF]"
.br
.RI "\fIThe pathname and filename of the message of the day file, as defined by the administrator. \fP"
.ti -1c
.RI "char \fBrules\fP [MAXBUF]"
.br
.RI "\fIThe pathname and filename of the rules file, as defined by the administrator. \fP"
.ti -1c
.RI "char \fBPrefixQuit\fP [MAXBUF]"
.br
.RI "\fIThe quit prefix in use, or an empty string. \fP"
.ti -1c
.RI "char \fBDieValue\fP [MAXBUF]"
.br
.RI "\fIThe last string found within a <die> tag, or an empty string. \fP"
.ti -1c
.RI "char \fBDNSServer\fP [MAXBUF]"
.br
.RI "\fIThe \fBDNS\fP server to use for \fBDNS\fP queries. \fP"
.ti -1c
.RI "char \fBDisabledCommands\fP [MAXBUF]"
.br
.RI "\fIThis variable contains a space-seperated list of commands which are disabled by the administrator of the server for non-opers. \fP"
.ti -1c
.RI "char \fBModPath\fP [1024]"
.br
.RI "\fIThe full path to the modules directory. \fP"
.ti -1c
.RI "char \fBMyExecutable\fP [1024]"
.br
.RI "\fIThe full pathname to the executable, as given in argv[0] when the program starts. \fP"
.ti -1c
.RI "FILE * \fBlog_file\fP"
.br
.RI "\fIThe file handle of the logfile. \fP"
.ti -1c
.RI "bool \fBnofork\fP"
.br
.RI "\fIIf this value is true, the owner of the server specified -nofork on the command line, causing the daemon to stay in the foreground. \fP"
.ti -1c
.RI "bool \fBunlimitcore\fP"
.br
.RI "\fIIf this value is true, the owner of the server has chosen to unlimit the coredump size to as large a value as his account settings will allow. \fP"
.ti -1c
.RI "bool \fBAllowHalfop\fP"
.br
.RI "\fIIf this value is true, halfops have been enabled in the configuration file. \fP"
.ti -1c
.RI "int \fBdns_timeout\fP"
.br
.RI "\fIThe number of seconds the \fBDNS\fP subsystem will wait before timing out any request. \fP"
.ti -1c
.RI "int \fBNetBufferSize\fP"
.br
.RI "\fIThe size of the read() buffer in the user handling code, used to read data into a user's recvQ. \fP"
.ti -1c
.RI "int \fBMaxConn\fP"
.br
.RI "\fIThe value to be used for listen() backlogs as default. \fP"
.ti -1c
.RI "unsigned int \fBSoftLimit\fP"
.br
.RI "\fIThe soft limit value assigned to the irc server. \fP"
.ti -1c
.RI "int \fBMaxWhoResults\fP"
.br
.RI "\fIThe maximum number of /WHO results allowed in any single /WHO command. \fP"
.ti -1c
.RI "int \fBdebugging\fP"
.br
.RI "\fITrue if the DEBUG loglevel is selected. \fP"
.ti -1c
.RI "int \fBLogLevel\fP"
.br
.RI "\fIThe loglevel in use by the IRC server. \fP"
.ti -1c
.RI "int \fBDieDelay\fP"
.br
.RI "\fIHow many seconds to wait before exiting the program when /DIE is correctly issued. \fP"
.ti -1c
.RI "char \fBaddrs\fP [MAXBUF][255]"
.br
.RI "\fIA list of IP addresses the server is listening on. \fP"
.ti -1c
.RI "\fBfile_cache\fP \fBMOTD\fP"
.br
.RI "\fIThe MOTD file, cached in a file_cache type. \fP"
.ti -1c
.RI "\fBfile_cache\fP \fBRULES\fP"
.br
.RI "\fIThe RULES file, cached in a file_cache type. \fP"
.ti -1c
.RI "char \fBPID\fP [1024]"
.br
.RI "\fIThe full pathname and filename of the PID file as defined in the configuration. \fP"
.ti -1c
.RI "std::stringstream \fBconfig_f\fP"
.br
.RI "\fIThe parsed configuration file as a stringstream. \fP"
.ti -1c
.RI "\fBClassVector\fP \fBClasses\fP"
.br
.RI "\fIThe connect classes in use by the IRC server. \fP"
.ti -1c
.RI "std::vector< \fBstd::string\fP > \fBmodule_names\fP"
.br
.RI "\fIA list of module names (names only, no paths) which are currently loaded by the server. \fP"
.ti -1c
.RI "int \fBports\fP [255]"
.br
.RI "\fIA list of ports which the server is listening on. \fP"
.in -1c
.SS "Private Member Functions"
.in +1c
.ti -1c
.RI "int \fBfgets_safe\fP (char *buffer, size_t maxsize, FILE *&file)"
.br
.RI "\fIUsed by the config file subsystem to safely read a C-style string without dependency upon any certain style of linefeed, e.g. \fP"
.ti -1c
.RI "\fBstd::string\fP \fBConfProcess\fP (char *buffer, long linenumber, std::stringstream *errorstream, bool &error, \fBstd::string\fP filename)"
.br
.RI "\fIThis private method processes one line of configutation, appending errors to errorstream and setting error if an error has occured. \fP"
.in -1c
.SS "Private Attributes"
.in +1c
.ti -1c
.RI "std::vector< \fBstd::string\fP > \fBinclude_stack\fP"
.br
.RI "\fIThis variable holds the names of all files included from the main one. \fP"
.in -1c
.SH "Detailed Description"
.PP
This class holds the bulk of the runtime configuration for the ircd.
It allows for reading new config values, accessing configuration files, and storage of the configuration data needed to run the ircd, such as the servername, connect classes, /ADMIN data, MOTDs and filenames etc.
.PP
Definition at line 39 of file inspircd_io.h.
.SH "Constructor & Destructor Documentation"
.PP
.SS "ServerConfig::ServerConfig ()"
.PP
.SH "Member Function Documentation"
.PP
.SS "void ServerConfig::ClearStack ()"
.PP
Clears the include stack in preperation for a \fBRead()\fP call.
.PP
Referenced by ConfigReader::ConfigReader().
.SS "\fBstd::string\fP ServerConfig::ConfProcess (char * buffer, long linenumber, std::stringstream * errorstream, bool & error, \fBstd::string\fP filename)\fC [private]\fP"
.PP
This private method processes one line of configutation, appending errors to errorstream and setting error if an error has occured.
.PP
.SS "int ServerConfig::ConfValue (char * tag, char * var, int index, char * result, std::stringstream * config)"
.PP
Referenced by userrec::HasPermission().
.SS "int ServerConfig::ConfValueEnum (char * tag, std::stringstream * config)"
.PP
.SS "int ServerConfig::EnumConf (std::stringstream * config_f, const char * tag)"
.PP
Referenced by ConfigReader::Enumerate().
.SS "int ServerConfig::EnumValues (std::stringstream * config, const char * tag, int index)"
.PP
Referenced by ConfigReader::EnumerateValues().
.SS "int ServerConfig::fgets_safe (char * buffer, size_t maxsize, FILE *& file)\fC [private]\fP"
.PP
Used by the config file subsystem to safely read a C-style string without dependency upon any certain style of linefeed, e.g.
.PP
it can read both windows and UNIX style linefeeds transparently.
.SS "bool ServerConfig::LoadConf (const char * filename, std::stringstream * target, std::stringstream * errorstream)"
.PP
Referenced by ConfigReader::ConfigReader().
.SS "void ServerConfig::Read (bool bail, \fBuserrec\fP * user)"
.PP
Read the entire configuration into memory and initialize this class.
.PP
All other methods should be used only by the core.
.PP
Referenced by Server::RehashServer().
.SS "int ServerConfig::ReadConf (std::stringstream * config_f, const char * tag, const char * var, int index, char * result)"
.PP
Referenced by ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue().
.SH "Member Data Documentation"
.PP
.SS "char \fBServerConfig::addrs\fP[MAXBUF][255]"
.PP
A list of IP addresses the server is listening on.
.PP
Definition at line 216 of file inspircd_io.h.
.SS "char \fBServerConfig::AdminEmail\fP[MAXBUF]"
.PP
Holds the email address of the admin, for output in the /ADMIN command.
.PP
Definition at line 89 of file inspircd_io.h.
.PP
Referenced by Server::GetAdmin().
.SS "char \fBServerConfig::AdminName\fP[MAXBUF]"
.PP
Holds the admin's name, for output in the /ADMIN command.
.PP
Definition at line 84 of file inspircd_io.h.
.PP
Referenced by Server::GetAdmin().
.SS "char \fBServerConfig::AdminNick\fP[MAXBUF]"
.PP
Holds the admin's nickname, for output in the /ADMIN command.
.PP
Definition at line 94 of file inspircd_io.h.
.PP
Referenced by Server::GetAdmin().
.SS "bool \fBServerConfig::AllowHalfop\fP"
.PP
If this value is true, halfops have been enabled in the configuration file.
.PP
Definition at line 171 of file inspircd_io.h.
.SS "\fBClassVector\fP \fBServerConfig::Classes\fP"
.PP
The connect classes in use by the IRC server.
.PP
Definition at line 242 of file inspircd_io.h.
.SS "std::stringstream \fBServerConfig::config_f\fP"
.PP
The parsed configuration file as a stringstream.
.PP
You should pass this to any configuration methods of this class, and not access it directly. It is recommended that modules use \fBConfigReader\fP instead which provides a simpler abstraction of configuration files.
.PP
Definition at line 238 of file inspircd_io.h.
.PP
Referenced by userrec::HasPermission().
.SS "int \fBServerConfig::debugging\fP"
.PP
True if the DEBUG loglevel is selected.
.PP
Definition at line 202 of file inspircd_io.h.
.SS "int \fBServerConfig::DieDelay\fP"
.PP
How many seconds to wait before exiting the program when /DIE is correctly issued.
.PP
Definition at line 211 of file inspircd_io.h.
.SS "char \fBServerConfig::diepass\fP[MAXBUF]"
.PP
The admin-configured /DIE password.
.PP
Definition at line 98 of file inspircd_io.h.
.SS "char \fBServerConfig::DieValue\fP[MAXBUF]"
.PP
The last string found within a <die> tag, or an empty string.
.PP
Definition at line 121 of file inspircd_io.h.
.SS "char \fBServerConfig::DisabledCommands\fP[MAXBUF]"
.PP
This variable contains a space-seperated list of commands which are disabled by the administrator of the server for non-opers.
.PP
Definition at line 131 of file inspircd_io.h.
.SS "int \fBServerConfig::dns_timeout\fP"
.PP
The number of seconds the \fBDNS\fP subsystem will wait before timing out any request.
.PP
Definition at line 176 of file inspircd_io.h.
.SS "char \fBServerConfig::DNSServer\fP[MAXBUF]"
.PP
The \fBDNS\fP server to use for \fBDNS\fP queries.
.PP
Definition at line 125 of file inspircd_io.h.
.SS "std::vector<\fBstd::string\fP> \fBServerConfig::include_stack\fP\fC [private]\fP"
.PP
This variable holds the names of all files included from the main one.
.PP
This is used to make sure that no files are recursively included.
.PP
Definition at line 47 of file inspircd_io.h.
.SS "FILE* \fBServerConfig::log_file\fP"
.PP
The file handle of the logfile.
.PP
If this value is NULL, the log file is not open, probably due to a permissions error on startup (this should not happen in normal operation!).
.PP
Definition at line 151 of file inspircd_io.h.
.SS "int \fBServerConfig::LogLevel\fP"
.PP
The loglevel in use by the IRC server.
.PP
Definition at line 206 of file inspircd_io.h.
.SS "int \fBServerConfig::MaxConn\fP"
.PP
The value to be used for listen() backlogs as default.
.PP
Definition at line 187 of file inspircd_io.h.
.SS "int \fBServerConfig::MaxWhoResults\fP"
.PP
The maximum number of /WHO results allowed in any single /WHO command.
.PP
Definition at line 198 of file inspircd_io.h.
.SS "char \fBServerConfig::ModPath\fP[1024]"
.PP
The full path to the modules directory.
.PP
This is either set at compile time, or overridden in the configuration file via the <options> tag.
.PP
Definition at line 138 of file inspircd_io.h.
.SS "std::vector<\fBstd::string\fP> \fBServerConfig::module_names\fP"
.PP
A list of module names (names only, no paths) which are currently loaded by the server.
.PP
Definition at line 247 of file inspircd_io.h.
.PP
Referenced by Server::FindModule().
.SS "\fBfile_cache\fP \fBServerConfig::MOTD\fP"
.PP
The MOTD file, cached in a file_cache type.
.PP
Definition at line 220 of file inspircd_io.h.
.SS "char \fBServerConfig::motd\fP[MAXBUF]"
.PP
The pathname and filename of the message of the day file, as defined by the administrator.
.PP
Definition at line 107 of file inspircd_io.h.
.SS "char \fBServerConfig::MyExecutable\fP[1024]"
.PP
The full pathname to the executable, as given in argv[0] when the program starts.
.PP
Definition at line 143 of file inspircd_io.h.
.SS "int \fBServerConfig::NetBufferSize\fP"
.PP
The size of the read() buffer in the user handling code, used to read data into a user's recvQ.
.PP
Definition at line 182 of file inspircd_io.h.
.SS "char \fBServerConfig::Network\fP[MAXBUF]"
.PP
Definition at line 74 of file inspircd_io.h.
.PP
Referenced by Server::GetNetworkName().
.SS "bool \fBServerConfig::nofork\fP"
.PP
If this value is true, the owner of the server specified -nofork on the command line, causing the daemon to stay in the foreground.
.PP
Definition at line 158 of file inspircd_io.h.
.SS "char \fBServerConfig::PID\fP[1024]"
.PP
The full pathname and filename of the PID file as defined in the configuration.
.PP
Definition at line 229 of file inspircd_io.h.
.SS "int \fBServerConfig::ports\fP[255]"
.PP
A list of ports which the server is listening on.
.PP
Definition at line 251 of file inspircd_io.h.
.SS "char \fBServerConfig::PrefixQuit\fP[MAXBUF]"
.PP
The quit prefix in use, or an empty string.
.PP
Definition at line 116 of file inspircd_io.h.
.SS "char \fBServerConfig::restartpass\fP[MAXBUF]"
.PP
The admin-configured /RESTART password.
.PP
Definition at line 102 of file inspircd_io.h.
.SS "\fBfile_cache\fP \fBServerConfig::RULES\fP"
.PP
The RULES file, cached in a file_cache type.
.PP
Definition at line 224 of file inspircd_io.h.
.SS "char \fBServerConfig::rules\fP[MAXBUF]"
.PP
The pathname and filename of the rules file, as defined by the administrator.
.PP
Definition at line 112 of file inspircd_io.h.
.SS "char \fBServerConfig::ServerDesc\fP[MAXBUF]"
.PP
Holds the description of the local server as defined by the administrator.
.PP
Definition at line 79 of file inspircd_io.h.
.PP
Referenced by Server::GetServerDescription().
.SS "char \fBServerConfig::ServerName\fP[MAXBUF]"
.PP
Holds the server name of the local server as defined by the administrator.
.PP
Definition at line 68 of file inspircd_io.h.
.PP
Referenced by Server::GetServerName(), and userrec::userrec().
.SS "unsigned int \fBServerConfig::SoftLimit\fP"
.PP
The soft limit value assigned to the irc server.
.PP
The IRC server will not allow more than this number of local users.
.PP
Definition at line 193 of file inspircd_io.h.
.SS "bool \fBServerConfig::unlimitcore\fP"
.PP
If this value is true, the owner of the server has chosen to unlimit the coredump size to as large a value as his account settings will allow.
.PP
This is often used when debugging.
.PP
Definition at line 166 of file inspircd_io.h.
.SH "Author"
.PP
Generated automatically by Doxygen for InspIRCd from the source code.
|