]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/ServerConfig.3
445d8b09726efe94afca2299fdcced28dbfec218
[user/henk/code/inspircd.git] / docs / man / man3 / ServerConfig.3
1 .TH "ServerConfig" 3 "15 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 ServerConfig \- This class holds the bulk of the runtime configuration for the ircd.  
6
7 .PP
8 .SH SYNOPSIS
9 .br
10 .PP
11 \fC#include <inspircd_io.h>\fP
12 .PP
13 Inherits \fBclassbase\fP.
14 .PP
15 .SS "Public Member Functions"
16
17 .in +1c
18 .ti -1c
19 .RI "\fBServerConfig\fP ()"
20 .br
21 .ti -1c
22 .RI "void \fBClearStack\fP ()"
23 .br
24 .RI "\fIClears the include stack in preperation for a \fBRead()\fP call. \fP"
25 .ti -1c
26 .RI "void \fBRead\fP (bool bail, \fBuserrec\fP *user)"
27 .br
28 .RI "\fIRead the entire configuration into memory and initialize this class. \fP"
29 .ti -1c
30 .RI "bool \fBLoadConf\fP (const char *filename, std::stringstream *target, std::stringstream *errorstream)"
31 .br
32 .ti -1c
33 .RI "int \fBConfValue\fP (char *tag, char *var, int index, char *result, std::stringstream *config)"
34 .br
35 .ti -1c
36 .RI "int \fBReadConf\fP (std::stringstream *\fBconfig_f\fP, const char *tag, const char *var, int index, char *result)"
37 .br
38 .ti -1c
39 .RI "int \fBConfValueEnum\fP (char *tag, std::stringstream *config)"
40 .br
41 .ti -1c
42 .RI "int \fBEnumConf\fP (std::stringstream *\fBconfig_f\fP, const char *tag)"
43 .br
44 .ti -1c
45 .RI "int \fBEnumValues\fP (std::stringstream *config, const char *tag, int index)"
46 .br
47 .in -1c
48 .SS "Public Attributes"
49
50 .in +1c
51 .ti -1c
52 .RI "char \fBServerName\fP [MAXBUF]"
53 .br
54 .RI "\fIHolds the server name of the local server as defined by the administrator. \fP"
55 .ti -1c
56 .RI "char \fBNetwork\fP [MAXBUF]"
57 .br
58 .ti -1c
59 .RI "char \fBServerDesc\fP [MAXBUF]"
60 .br
61 .RI "\fIHolds the description of the local server as defined by the administrator. \fP"
62 .ti -1c
63 .RI "char \fBAdminName\fP [MAXBUF]"
64 .br
65 .RI "\fIHolds the admin's name, for output in the /ADMIN command. \fP"
66 .ti -1c
67 .RI "char \fBAdminEmail\fP [MAXBUF]"
68 .br
69 .RI "\fIHolds the email address of the admin, for output in the /ADMIN command. \fP"
70 .ti -1c
71 .RI "char \fBAdminNick\fP [MAXBUF]"
72 .br
73 .RI "\fIHolds the admin's nickname, for output in the /ADMIN command. \fP"
74 .ti -1c
75 .RI "char \fBdiepass\fP [MAXBUF]"
76 .br
77 .RI "\fIThe admin-configured /DIE password. \fP"
78 .ti -1c
79 .RI "char \fBrestartpass\fP [MAXBUF]"
80 .br
81 .RI "\fIThe admin-configured /RESTART password. \fP"
82 .ti -1c
83 .RI "char \fBmotd\fP [MAXBUF]"
84 .br
85 .RI "\fIThe pathname and filename of the message of the day file, as defined by the administrator. \fP"
86 .ti -1c
87 .RI "char \fBrules\fP [MAXBUF]"
88 .br
89 .RI "\fIThe pathname and filename of the rules file, as defined by the administrator. \fP"
90 .ti -1c
91 .RI "char \fBPrefixQuit\fP [MAXBUF]"
92 .br
93 .RI "\fIThe quit prefix in use, or an empty string. \fP"
94 .ti -1c
95 .RI "char \fBDieValue\fP [MAXBUF]"
96 .br
97 .RI "\fIThe last string found within a <die> tag, or an empty string. \fP"
98 .ti -1c
99 .RI "char \fBDNSServer\fP [MAXBUF]"
100 .br
101 .RI "\fIThe \fBDNS\fP server to use for \fBDNS\fP queries. \fP"
102 .ti -1c
103 .RI "char \fBDisabledCommands\fP [MAXBUF]"
104 .br
105 .RI "\fIThis variable contains a space-seperated list of commands which are disabled by the administrator of the server for non-opers. \fP"
106 .ti -1c
107 .RI "char \fBModPath\fP [1024]"
108 .br
109 .RI "\fIThe full path to the modules directory. \fP"
110 .ti -1c
111 .RI "char \fBMyExecutable\fP [1024]"
112 .br
113 .RI "\fIThe full pathname to the executable, as given in argv[0] when the program starts. \fP"
114 .ti -1c
115 .RI "FILE * \fBlog_file\fP"
116 .br
117 .RI "\fIThe file handle of the logfile. \fP"
118 .ti -1c
119 .RI "bool \fBnofork\fP"
120 .br
121 .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"
122 .ti -1c
123 .RI "bool \fBunlimitcore\fP"
124 .br
125 .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"
126 .ti -1c
127 .RI "bool \fBAllowHalfop\fP"
128 .br
129 .RI "\fIIf this value is true, halfops have been enabled in the configuration file. \fP"
130 .ti -1c
131 .RI "int \fBdns_timeout\fP"
132 .br
133 .RI "\fIThe number of seconds the \fBDNS\fP subsystem will wait before timing out any request. \fP"
134 .ti -1c
135 .RI "int \fBNetBufferSize\fP"
136 .br
137 .RI "\fIThe size of the read() buffer in the user handling code, used to read data into a user's recvQ. \fP"
138 .ti -1c
139 .RI "int \fBMaxConn\fP"
140 .br
141 .RI "\fIThe value to be used for listen() backlogs as default. \fP"
142 .ti -1c
143 .RI "unsigned int \fBSoftLimit\fP"
144 .br
145 .RI "\fIThe soft limit value assigned to the irc server. \fP"
146 .ti -1c
147 .RI "int \fBMaxWhoResults\fP"
148 .br
149 .RI "\fIThe maximum number of /WHO results allowed in any single /WHO command. \fP"
150 .ti -1c
151 .RI "int \fBdebugging\fP"
152 .br
153 .RI "\fITrue if the DEBUG loglevel is selected. \fP"
154 .ti -1c
155 .RI "int \fBLogLevel\fP"
156 .br
157 .RI "\fIThe loglevel in use by the IRC server. \fP"
158 .ti -1c
159 .RI "int \fBDieDelay\fP"
160 .br
161 .RI "\fIHow many seconds to wait before exiting the program when /DIE is correctly issued. \fP"
162 .ti -1c
163 .RI "char \fBaddrs\fP [MAXBUF][255]"
164 .br
165 .RI "\fIA list of IP addresses the server is listening on. \fP"
166 .ti -1c
167 .RI "\fBfile_cache\fP \fBMOTD\fP"
168 .br
169 .RI "\fIThe MOTD file, cached in a file_cache type. \fP"
170 .ti -1c
171 .RI "\fBfile_cache\fP \fBRULES\fP"
172 .br
173 .RI "\fIThe RULES file, cached in a file_cache type. \fP"
174 .ti -1c
175 .RI "char \fBPID\fP [1024]"
176 .br
177 .RI "\fIThe full pathname and filename of the PID file as defined in the configuration. \fP"
178 .ti -1c
179 .RI "std::stringstream \fBconfig_f\fP"
180 .br
181 .RI "\fIThe parsed configuration file as a stringstream. \fP"
182 .ti -1c
183 .RI "\fBClassVector\fP \fBClasses\fP"
184 .br
185 .RI "\fIThe connect classes in use by the IRC server. \fP"
186 .ti -1c
187 .RI "std::vector< \fBstd::string\fP > \fBmodule_names\fP"
188 .br
189 .RI "\fIA list of module names (names only, no paths) which are currently loaded by the server. \fP"
190 .ti -1c
191 .RI "int \fBports\fP [255]"
192 .br
193 .RI "\fIA list of ports which the server is listening on. \fP"
194 .in -1c
195 .SS "Private Member Functions"
196
197 .in +1c
198 .ti -1c
199 .RI "int \fBfgets_safe\fP (char *buffer, size_t maxsize, FILE *&file)"
200 .br
201 .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"
202 .ti -1c
203 .RI "\fBstd::string\fP \fBConfProcess\fP (char *buffer, long linenumber, std::stringstream *errorstream, bool &error, \fBstd::string\fP filename)"
204 .br
205 .RI "\fIThis private method processes one line of configutation, appending errors to errorstream and setting error if an error has occured. \fP"
206 .in -1c
207 .SS "Private Attributes"
208
209 .in +1c
210 .ti -1c
211 .RI "std::vector< \fBstd::string\fP > \fBinclude_stack\fP"
212 .br
213 .RI "\fIThis variable holds the names of all files included from the main one. \fP"
214 .in -1c
215 .SH "Detailed Description"
216 .PP 
217 This class holds the bulk of the runtime configuration for the ircd. 
218
219 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.
220 .PP
221 Definition at line 39 of file inspircd_io.h.
222 .SH "Constructor & Destructor Documentation"
223 .PP 
224 .SS "ServerConfig::ServerConfig ()"
225 .PP
226 .SH "Member Function Documentation"
227 .PP 
228 .SS "void ServerConfig::ClearStack ()"
229 .PP
230 Clears the include stack in preperation for a \fBRead()\fP call. 
231 .PP
232 Referenced by ConfigReader::ConfigReader().
233 .SS "\fBstd::string\fP ServerConfig::ConfProcess (char * buffer, long linenumber, std::stringstream * errorstream, bool & error, \fBstd::string\fP filename)\fC [private]\fP"
234 .PP
235 This private method processes one line of configutation, appending errors to errorstream and setting error if an error has occured. 
236 .PP
237 .SS "int ServerConfig::ConfValue (char * tag, char * var, int index, char * result, std::stringstream * config)"
238 .PP
239 Referenced by userrec::HasPermission().
240 .SS "int ServerConfig::ConfValueEnum (char * tag, std::stringstream * config)"
241 .PP
242 .SS "int ServerConfig::EnumConf (std::stringstream * config_f, const char * tag)"
243 .PP
244 Referenced by ConfigReader::Enumerate().
245 .SS "int ServerConfig::EnumValues (std::stringstream * config, const char * tag, int index)"
246 .PP
247 Referenced by ConfigReader::EnumerateValues().
248 .SS "int ServerConfig::fgets_safe (char * buffer, size_t maxsize, FILE *& file)\fC [private]\fP"
249 .PP
250 Used by the config file subsystem to safely read a C-style string without dependency upon any certain style of linefeed, e.g. 
251 .PP
252 it can read both windows and UNIX style linefeeds transparently.
253 .SS "bool ServerConfig::LoadConf (const char * filename, std::stringstream * target, std::stringstream * errorstream)"
254 .PP
255 Referenced by ConfigReader::ConfigReader().
256 .SS "void ServerConfig::Read (bool bail, \fBuserrec\fP * user)"
257 .PP
258 Read the entire configuration into memory and initialize this class. 
259 .PP
260 All other methods should be used only by the core.
261 .PP
262 Referenced by Server::RehashServer().
263 .SS "int ServerConfig::ReadConf (std::stringstream * config_f, const char * tag, const char * var, int index, char * result)"
264 .PP
265 Referenced by ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue().
266 .SH "Member Data Documentation"
267 .PP 
268 .SS "char \fBServerConfig::addrs\fP[MAXBUF][255]"
269 .PP
270 A list of IP addresses the server is listening on. 
271 .PP
272 Definition at line 216 of file inspircd_io.h.
273 .SS "char \fBServerConfig::AdminEmail\fP[MAXBUF]"
274 .PP
275 Holds the email address of the admin, for output in the /ADMIN command. 
276 .PP
277 Definition at line 89 of file inspircd_io.h.
278 .PP
279 Referenced by Server::GetAdmin().
280 .SS "char \fBServerConfig::AdminName\fP[MAXBUF]"
281 .PP
282 Holds the admin's name, for output in the /ADMIN command. 
283 .PP
284 Definition at line 84 of file inspircd_io.h.
285 .PP
286 Referenced by Server::GetAdmin().
287 .SS "char \fBServerConfig::AdminNick\fP[MAXBUF]"
288 .PP
289 Holds the admin's nickname, for output in the /ADMIN command. 
290 .PP
291 Definition at line 94 of file inspircd_io.h.
292 .PP
293 Referenced by Server::GetAdmin().
294 .SS "bool \fBServerConfig::AllowHalfop\fP"
295 .PP
296 If this value is true, halfops have been enabled in the configuration file. 
297 .PP
298 Definition at line 171 of file inspircd_io.h.
299 .SS "\fBClassVector\fP \fBServerConfig::Classes\fP"
300 .PP
301 The connect classes in use by the IRC server. 
302 .PP
303 Definition at line 242 of file inspircd_io.h.
304 .SS "std::stringstream \fBServerConfig::config_f\fP"
305 .PP
306 The parsed configuration file as a stringstream. 
307 .PP
308 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.
309 .PP
310 Definition at line 238 of file inspircd_io.h.
311 .PP
312 Referenced by userrec::HasPermission().
313 .SS "int \fBServerConfig::debugging\fP"
314 .PP
315 True if the DEBUG loglevel is selected. 
316 .PP
317 Definition at line 202 of file inspircd_io.h.
318 .SS "int \fBServerConfig::DieDelay\fP"
319 .PP
320 How many seconds to wait before exiting the program when /DIE is correctly issued. 
321 .PP
322 Definition at line 211 of file inspircd_io.h.
323 .SS "char \fBServerConfig::diepass\fP[MAXBUF]"
324 .PP
325 The admin-configured /DIE password. 
326 .PP
327 Definition at line 98 of file inspircd_io.h.
328 .SS "char \fBServerConfig::DieValue\fP[MAXBUF]"
329 .PP
330 The last string found within a <die> tag, or an empty string. 
331 .PP
332 Definition at line 121 of file inspircd_io.h.
333 .SS "char \fBServerConfig::DisabledCommands\fP[MAXBUF]"
334 .PP
335 This variable contains a space-seperated list of commands which are disabled by the administrator of the server for non-opers. 
336 .PP
337 Definition at line 131 of file inspircd_io.h.
338 .SS "int \fBServerConfig::dns_timeout\fP"
339 .PP
340 The number of seconds the \fBDNS\fP subsystem will wait before timing out any request. 
341 .PP
342 Definition at line 176 of file inspircd_io.h.
343 .SS "char \fBServerConfig::DNSServer\fP[MAXBUF]"
344 .PP
345 The \fBDNS\fP server to use for \fBDNS\fP queries. 
346 .PP
347 Definition at line 125 of file inspircd_io.h.
348 .SS "std::vector<\fBstd::string\fP> \fBServerConfig::include_stack\fP\fC [private]\fP"
349 .PP
350 This variable holds the names of all files included from the main one. 
351 .PP
352 This is used to make sure that no files are recursively included.
353 .PP
354 Definition at line 47 of file inspircd_io.h.
355 .SS "FILE* \fBServerConfig::log_file\fP"
356 .PP
357 The file handle of the logfile. 
358 .PP
359 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!).
360 .PP
361 Definition at line 151 of file inspircd_io.h.
362 .SS "int \fBServerConfig::LogLevel\fP"
363 .PP
364 The loglevel in use by the IRC server. 
365 .PP
366 Definition at line 206 of file inspircd_io.h.
367 .SS "int \fBServerConfig::MaxConn\fP"
368 .PP
369 The value to be used for listen() backlogs as default. 
370 .PP
371 Definition at line 187 of file inspircd_io.h.
372 .SS "int \fBServerConfig::MaxWhoResults\fP"
373 .PP
374 The maximum number of /WHO results allowed in any single /WHO command. 
375 .PP
376 Definition at line 198 of file inspircd_io.h.
377 .SS "char \fBServerConfig::ModPath\fP[1024]"
378 .PP
379 The full path to the modules directory. 
380 .PP
381 This is either set at compile time, or overridden in the configuration file via the <options> tag.
382 .PP
383 Definition at line 138 of file inspircd_io.h.
384 .SS "std::vector<\fBstd::string\fP> \fBServerConfig::module_names\fP"
385 .PP
386 A list of module names (names only, no paths) which are currently loaded by the server. 
387 .PP
388 Definition at line 247 of file inspircd_io.h.
389 .PP
390 Referenced by Server::FindModule().
391 .SS "\fBfile_cache\fP \fBServerConfig::MOTD\fP"
392 .PP
393 The MOTD file, cached in a file_cache type. 
394 .PP
395 Definition at line 220 of file inspircd_io.h.
396 .SS "char \fBServerConfig::motd\fP[MAXBUF]"
397 .PP
398 The pathname and filename of the message of the day file, as defined by the administrator. 
399 .PP
400 Definition at line 107 of file inspircd_io.h.
401 .SS "char \fBServerConfig::MyExecutable\fP[1024]"
402 .PP
403 The full pathname to the executable, as given in argv[0] when the program starts. 
404 .PP
405 Definition at line 143 of file inspircd_io.h.
406 .SS "int \fBServerConfig::NetBufferSize\fP"
407 .PP
408 The size of the read() buffer in the user handling code, used to read data into a user's recvQ. 
409 .PP
410 Definition at line 182 of file inspircd_io.h.
411 .SS "char \fBServerConfig::Network\fP[MAXBUF]"
412 .PP
413 Definition at line 74 of file inspircd_io.h.
414 .PP
415 Referenced by Server::GetNetworkName().
416 .SS "bool \fBServerConfig::nofork\fP"
417 .PP
418 If this value is true, the owner of the server specified -nofork on the command line, causing the daemon to stay in the foreground. 
419 .PP
420 Definition at line 158 of file inspircd_io.h.
421 .SS "char \fBServerConfig::PID\fP[1024]"
422 .PP
423 The full pathname and filename of the PID file as defined in the configuration. 
424 .PP
425 Definition at line 229 of file inspircd_io.h.
426 .SS "int \fBServerConfig::ports\fP[255]"
427 .PP
428 A list of ports which the server is listening on. 
429 .PP
430 Definition at line 251 of file inspircd_io.h.
431 .SS "char \fBServerConfig::PrefixQuit\fP[MAXBUF]"
432 .PP
433 The quit prefix in use, or an empty string. 
434 .PP
435 Definition at line 116 of file inspircd_io.h.
436 .SS "char \fBServerConfig::restartpass\fP[MAXBUF]"
437 .PP
438 The admin-configured /RESTART password. 
439 .PP
440 Definition at line 102 of file inspircd_io.h.
441 .SS "\fBfile_cache\fP \fBServerConfig::RULES\fP"
442 .PP
443 The RULES file, cached in a file_cache type. 
444 .PP
445 Definition at line 224 of file inspircd_io.h.
446 .SS "char \fBServerConfig::rules\fP[MAXBUF]"
447 .PP
448 The pathname and filename of the rules file, as defined by the administrator. 
449 .PP
450 Definition at line 112 of file inspircd_io.h.
451 .SS "char \fBServerConfig::ServerDesc\fP[MAXBUF]"
452 .PP
453 Holds the description of the local server as defined by the administrator. 
454 .PP
455 Definition at line 79 of file inspircd_io.h.
456 .PP
457 Referenced by Server::GetServerDescription().
458 .SS "char \fBServerConfig::ServerName\fP[MAXBUF]"
459 .PP
460 Holds the server name of the local server as defined by the administrator. 
461 .PP
462 Definition at line 68 of file inspircd_io.h.
463 .PP
464 Referenced by Server::GetServerName(), and userrec::userrec().
465 .SS "unsigned int \fBServerConfig::SoftLimit\fP"
466 .PP
467 The soft limit value assigned to the irc server. 
468 .PP
469 The IRC server will not allow more than this number of local users.
470 .PP
471 Definition at line 193 of file inspircd_io.h.
472 .SS "bool \fBServerConfig::unlimitcore\fP"
473 .PP
474 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. 
475 .PP
476 This is often used when debugging.
477 .PP
478 Definition at line 166 of file inspircd_io.h.
479
480 .SH "Author"
481 .PP 
482 Generated automatically by Doxygen for InspIRCd from the source code.