]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/configreader.h
b561a40fdaa6d2c67bc141063ff28a5945705b98
[user/henk/code/inspircd.git] / include / configreader.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef INSPIRCD_CONFIGREADER
15 #define INSPIRCD_CONFIGREADER
16
17 /* handy defines */
18
19 /** Determines if a channel op is exempt from given mode m,
20  * in config of server instance s. 
21  */
22 #define CHANOPS_EXEMPT(s, m) (s->Config->ExemptChanOps[(unsigned char)m])
23
24 #include <sstream>
25 #include <string>
26 #include <vector>
27 #include <map>
28 #include "inspircd.h"
29 #include "globals.h"
30 #include "modules.h"
31 #include "socketengine.h"
32 #include "socket.h"
33
34 /* Required forward definitions */
35 class ServerConfig;
36 class InspIRCd;
37 class BufferedSocket;
38
39 /** Types of data in the core config
40  */
41 enum ConfigDataType
42 {
43         DT_NOTHING       = 0,           /* No data */
44         DT_INTEGER       = 1,           /* Integer */
45         DT_CHARPTR       = 2,           /* Char pointer */
46         DT_BOOLEAN       = 3,           /* Boolean */
47         DT_HOSTNAME      = 4,           /* Hostname syntax */
48         DT_NOSPACES      = 5,           /* No spaces */
49         DT_IPADDRESS     = 6,           /* IP address (v4, v6) */
50         DT_CHANNEL       = 7,           /* Channel name */
51         DT_ALLOW_WILD    = 64,          /* Allow wildcards/CIDR in DT_IPADDRESS */
52         DT_ALLOW_NEWLINE = 128          /* New line characters allowed in DT_CHARPTR */
53 };
54
55 /** Holds a config value, either string, integer or boolean.
56  * Callback functions receive one or more of these, either on
57  * their own as a reference, or in a reference to a deque of them.
58  * The callback function can then alter the values of the ValueItem
59  * classes to validate the settings.
60  */
61 class ValueItem
62 {
63         /** Actual data */
64         std::string v;
65  public:
66         /** Initialize with an int */
67         ValueItem(int value);
68         /** Initialize with a bool */
69         ValueItem(bool value);
70         /** Initialize with a char pointer */
71         ValueItem(char* value);
72         /** Change value to a char pointer */
73         void Set(char* value);
74         /** Change value to a const char pointer */
75         void Set(const char* val);
76         /** Change value to an int */
77         void Set(int value);
78         /** Get value as an int */
79         int GetInteger();
80         /** Get value as a string */
81         char* GetString();
82         /** Get value as a bool */
83         bool GetBool();
84 };
85
86 /** The base class of the container 'ValueContainer'
87  * used internally by the core to hold core values.
88  */
89 class ValueContainerBase
90 {
91  public:
92         /** Constructor */
93         ValueContainerBase() { }
94         /** Destructor */
95         virtual ~ValueContainerBase() { }
96 };
97
98 /** ValueContainer is used to contain pointers to different
99  * core values such as the server name, maximum number of
100  * clients etc.
101  * It is specialized to hold a data type, then pointed at
102  * a value in the ServerConfig class. When the value has been
103  * read and validated, the Set method is called to write the
104  * value safely in a type-safe manner.
105  */
106 template<typename T> class ValueContainer : public ValueContainerBase
107 {
108         /** Contained item */
109         T val;
110  public:
111
112         /** Initialize with nothing */
113         ValueContainer()
114         {
115                 val = NULL;
116         }
117
118         /** Initialize with a value of type T */
119         ValueContainer(T Val)
120         {
121                 val = Val;
122         }
123
124         /** Change value to type T of size s */
125         void Set(T newval, size_t s)
126         {
127                 memcpy(val, newval, s);
128         }
129 };
130
131 /** A specialization of ValueContainer to hold a pointer to a bool
132  */
133 typedef ValueContainer<bool*> ValueContainerBool;
134
135 /** A specialization of ValueContainer to hold a pointer to
136  * an unsigned int
137  */
138 typedef ValueContainer<unsigned int*> ValueContainerUInt;
139
140 /** A specialization of ValueContainer to hold a pointer to
141  * a char array.
142  */
143 typedef ValueContainer<char*> ValueContainerChar;
144
145 /** A specialization of ValueContainer to hold a pointer to
146  * an int
147  */
148 typedef ValueContainer<int*> ValueContainerInt;
149
150 /** A set of ValueItems used by multi-value validator functions
151  */
152 typedef std::deque<ValueItem> ValueList;
153
154 /** A callback for validating a single value
155  */
156 typedef bool (*Validator)(ServerConfig* conf, const char*, const char*, ValueItem&);
157 /** A callback for validating multiple value entries
158  */
159 typedef bool (*MultiValidator)(ServerConfig* conf, const char*, char**, ValueList&, int*);
160 /** A callback indicating the end of a group of entries
161  */
162 typedef bool (*MultiNotify)(ServerConfig* conf, const char*);
163
164 /** Holds a core configuration item and its callbacks
165  */
166 struct InitialConfig
167 {
168         /** Tag name */
169         char* tag;
170         /** Value name */
171         char* value;
172         /** Default, if not defined */
173         char* default_value;
174         /** Value containers */
175         ValueContainerBase* val;
176         /** Data types */
177         ConfigDataType datatype;
178         /** Validation function */
179         Validator validation_function;
180 };
181
182 /** Holds a core configuration item and its callbacks
183  * where there may be more than one item
184  */
185 struct MultiConfig
186 {
187         /** Tag name */
188         const char*     tag;
189         /** One or more items within tag */
190         char*           items[17];
191         /** One or more defaults for items within tags */
192         char*           items_default[17];
193         /** One or more data types */
194         int             datatype[17];
195         /** Initialization function */
196         MultiNotify     init_function;
197         /** Validation function */
198         MultiValidator  validation_function;
199         /** Completion function */
200         MultiNotify     finish_function;
201 };
202
203 /** A set of oper types
204  */
205 typedef std::map<irc::string,char*> opertype_t;
206
207 /** A Set of oper classes
208  */
209 typedef std::map<irc::string,char*> operclass_t;
210
211
212 /** This class holds the bulk of the runtime configuration for the ircd.
213  * It allows for reading new config values, accessing configuration files,
214  * and storage of the configuration data needed to run the ircd, such as
215  * the servername, connect classes, /ADMIN data, MOTDs and filenames etc.
216  */
217 class CoreExport ServerConfig : public Extensible
218 {
219   private:
220         /** Creator/owner pointer
221          */
222         InspIRCd* ServerInstance;
223
224         /** This variable holds the names of all
225          * files included from the main one. This
226          * is used to make sure that no files are
227          * recursively included.
228          */
229         std::vector<std::string> include_stack;
230
231         /** This private method processes one line of
232          * configutation, appending errors to errorstream
233          * and setting error if an error has occured.
234          */
235         bool ParseLine(ConfigDataHash &target, std::string &line, long &linenumber, std::ostringstream &errorstream, int pass, std::istream* scan_for_includes_only);
236   
237         /** Process an include directive
238          */
239         bool DoInclude(ConfigDataHash &target, const std::string &file, std::ostringstream &errorstream, int pass, std::istream* scan_for_includes_only);
240
241         /** Check that there is only one of each configuration item
242          */
243         bool CheckOnce(char* tag);
244
245  public:
246
247         std::ostringstream errstr;
248
249         ConfigDataHash newconfig;
250
251         std::map<std::string, std::istream*> IncludedFiles;
252
253         std::map<std::string, bool> CompletedFiles;
254
255         size_t TotalDownloaded;
256         size_t FileErrors;
257
258         /** Used to indicate who we announce invites to on a channel */
259         enum InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS, INVITE_ANNOUNCE_DYNAMIC };
260
261         /** Pointer to function that validates dns server addresses (can be changed depending on platform) */
262         Validator DNSServerValidator;
263
264         InspIRCd* GetInstance();
265
266         bool Downloading();
267
268         void StartDownloads();
269
270         void Complete(const std::string &filename, bool error);
271           
272         /** This holds all the information in the config file,
273          * it's indexed by tag name to a vector of key/values.
274          */
275         ConfigDataHash config_data;
276
277         /** Max number of WhoWas entries per user.
278          */
279         int WhoWasGroupSize;
280
281         /** Max number of cumulative user-entries in WhoWas.
282          *  When max reached and added to, push out oldest entry FIFO style.
283          */
284         int WhoWasMaxGroups;
285
286         /** Max seconds a user is kept in WhoWas before being pruned.
287          */
288         int WhoWasMaxKeep;
289
290         /** Holds the server name of the local server
291          * as defined by the administrator.
292          */
293         char ServerName[MAXBUF];
294
295         /** Notice to give to users when they are Xlined
296          */
297         char MoronBanner[MAXBUF];
298         
299         /* Holds the network name the local server
300          * belongs to. This is an arbitary field defined
301          * by the administrator.
302          */
303         char Network[MAXBUF];
304
305         /** Holds the description of the local server
306          * as defined by the administrator.
307          */
308         char ServerDesc[MAXBUF];
309
310         /** Holds the admin's name, for output in
311          * the /ADMIN command.
312          */
313         char AdminName[MAXBUF];
314
315         /** Holds the email address of the admin,
316          * for output in the /ADMIN command.
317          */
318         char AdminEmail[MAXBUF];
319
320         /** Holds the admin's nickname, for output
321          * in the /ADMIN command
322          */
323         char AdminNick[MAXBUF];
324
325         /** The admin-configured /DIE password
326          */
327         char diepass[MAXBUF];
328
329         /** The admin-configured /RESTART password
330          */
331         char restartpass[MAXBUF];
332
333         /** The pathname and filename of the message of the
334          * day file, as defined by the administrator.
335          */
336         char motd[MAXBUF];
337
338         /** The pathname and filename of the rules file,
339          * as defined by the administrator.
340          */
341         char rules[MAXBUF];
342
343         /** The quit prefix in use, or an empty string
344          */
345         char PrefixQuit[MAXBUF];
346
347         /** The quit suffix in use, or an empty string
348          */
349         char SuffixQuit[MAXBUF];
350
351         /** The fixed quit message in use, or an empty string
352          */
353         char FixedQuit[MAXBUF];
354
355         /** The last string found within a <die> tag, or
356          * an empty string.
357          */
358         char DieValue[MAXBUF];
359
360         /** The DNS server to use for DNS queries
361          */
362         char DNSServer[MAXBUF];
363
364         /** This variable contains a space-seperated list
365          * of commands which are disabled by the
366          * administrator of the server for non-opers.
367          */
368         char DisabledCommands[MAXBUF];
369
370         /** The full path to the modules directory.
371          * This is either set at compile time, or
372          * overridden in the configuration file via
373          * the <options> tag.
374          */
375         char ModPath[1024];
376
377         /** The full pathname to the executable, as
378          * given in argv[0] when the program starts.
379          */
380         char MyExecutable[1024];
381
382         /** The file handle of the logfile. If this
383          * value is NULL, the log file is not open,
384          * probably due to a permissions error on
385          * startup (this should not happen in normal
386          * operation!).
387          */
388         FILE *log_file;
389
390         /** If this value is true, the owner of the
391          * server specified -nofork on the command
392          * line, causing the daemon to stay in the
393          * foreground.
394          */
395         bool nofork;
396         
397         /** If this value if true then all log
398          * messages will be output, regardless of
399          * the level given in the config file.
400          * This is set with the -debug commandline
401          * option.
402          */
403         bool forcedebug;
404         
405         /** If this is true then log output will be
406          * written to the logfile. This is the default.
407          * If you put -nolog on the commandline then
408          * the logfile will not be written.
409          * This is meant to be used in conjunction with
410          * -debug for debugging without filling up the
411          * hard disk.
412          */
413         bool writelog;
414
415         /** If this value is true, halfops have been
416          * enabled in the configuration file.
417          */
418         bool AllowHalfop;
419
420         /** If this is set to true, then mode lists (e.g
421          * MODE #chan b) are hidden from unprivileged
422          * users.
423          */
424         bool HideModeLists[256];
425
426         /** If this is set to true, then channel operators
427          * are exempt from this channel mode. Used for +Sc etc.
428          */
429         bool ExemptChanOps[256];
430
431         /** The number of seconds the DNS subsystem
432          * will wait before timing out any request.
433          */
434         int dns_timeout;
435
436         /** The size of the read() buffer in the user
437          * handling code, used to read data into a user's
438          * recvQ.
439          */
440         int NetBufferSize;
441
442         /** The value to be used for listen() backlogs
443          * as default.
444          */
445         int MaxConn;
446
447         /** The soft limit value assigned to the irc server.
448          * The IRC server will not allow more than this
449          * number of local users.
450          */
451         unsigned int SoftLimit;
452
453         /** Maximum number of targets for a multi target command
454          * such as PRIVMSG or KICK
455          */
456         unsigned int MaxTargets;
457
458         /** The maximum number of /WHO results allowed
459          * in any single /WHO command.
460          */
461         int MaxWhoResults;
462
463         /** True if the DEBUG loglevel is selected.
464          */
465         int debugging;
466
467         /** The loglevel in use by the IRC server
468          */
469         int LogLevel;
470
471         /** How many seconds to wait before exiting
472          * the program when /DIE is correctly issued.
473          */
474         int DieDelay;
475
476         /** True if we're going to hide netsplits as *.net *.split for non-opers
477          */
478         bool HideSplits;
479
480         /** True if we're going to hide ban reasons for non-opers (e.g. G-Lines,
481          * K-Lines, Z-Lines)
482          */
483         bool HideBans;
484
485         /** Announce invites to the channel with a server notice
486          */
487         InviteAnnounceState AnnounceInvites;
488
489         /** If this is enabled then operators will
490          * see invisible (+i) channels in /whois.
491          */
492         bool OperSpyWhois;
493
494         /** Set to a non-empty string to obfuscate the server name of users in WHOIS
495          */
496         char HideWhoisServer[MAXBUF];
497
498         /** Set to a non empty string to obfuscate nicknames prepended to a KILL.
499          */
500         char HideKillsServer[MAXBUF];
501
502         /** The MOTD file, cached in a file_cache type.
503          */
504         file_cache MOTD;
505
506         /** The RULES file, cached in a file_cache type.
507          */
508         file_cache RULES;
509
510         /** The full pathname and filename of the PID
511          * file as defined in the configuration.
512          */
513         char PID[1024];
514
515         /** The connect classes in use by the IRC server.
516          */
517         ClassVector Classes;
518
519         /** A list of the classes for listening client ports
520          */
521         std::vector<ListenSocket*> ports;
522
523         /** A list of ports claimed by IO Modules
524          */
525         std::map<int,Module*> IOHookModule;
526
527         std::map<BufferedSocket*, Module*> SocketIOHookModule;
528
529         /** The 005 tokens of this server (ISUPPORT)
530          * populated/repopulated upon loading or unloading
531          * modules.
532          */
533         std::string data005;
534
535         /** isupport strings
536          */
537         std::vector<std::string> isupport;
538
539         /** STATS characters in this list are available
540          * only to operators.
541          */
542         char UserStats[MAXBUF];
543         
544         /** The path and filename of the ircd.log file
545          */
546         std::string logpath;
547
548         /** Default channel modes
549          */
550         char DefaultModes[MAXBUF];
551
552         /** Custom version string, which if defined can replace the system info in VERSION.
553          */
554         char CustomVersion[MAXBUF];
555
556         /** List of u-lined servers
557          */
558         std::map<irc::string, bool> ulines;
559
560         /** Max banlist sizes for channels (the std::string is a glob)
561          */
562         std::map<std::string, int> maxbans;
563
564         /** Directory where the inspircd binary resides
565          */
566         std::string MyDir;
567
568         /** If set to true, no user DNS lookups are to be performed
569          */
570         bool NoUserDns;
571
572         /** If set to true, provide syntax hints for unknown commands
573          */
574         bool SyntaxHints;
575
576         /** If set to true, users appear to quit then rejoin when their hosts change.
577          * This keeps clients synchronized properly.
578          */
579         bool CycleHosts;
580
581         /** If set to true, prefixed channel NOTICEs and PRIVMSGs will have the prefix
582          *  added to the outgoing text for undernet style msg prefixing.
583          */
584         bool UndernetMsgPrefix;
585
586         /** If set to true, the full nick!user@host will be shown in the TOPIC command
587          * for who set the topic last. If false, only the nick is shown.
588          */
589         bool FullHostInTopic;
590
591         /** All oper type definitions from the config file
592          */
593         opertype_t opertypes;
594
595         /** All oper class definitions from the config file
596          */
597         operclass_t operclass;
598
599         /** Saved argv from startup
600          */
601         char** argv;
602
603         /** Saved argc from startup
604          */
605         int argc;
606
607         /** Max channels per user
608          */
609         unsigned int MaxChans;
610
611         /** Oper max channels per user
612          */
613         unsigned int OperMaxChans;
614
615         /** TS6-like server ID.
616          * NOTE: 000...999 are usable for InspIRCd servers. This
617          * makes code simpler. 0AA, 1BB etc with letters are reserved
618          * for services use.
619          */
620         int sid;
621
622         /** Construct a new ServerConfig
623          */
624         ServerConfig(InspIRCd* Instance);
625
626         /** Clears the include stack in preperation for a Read() call.
627          */
628         void ClearStack();
629
630         /** Get server ID as string with required leading zeroes
631          */
632         std::string GetSID();
633
634         /** Update the 005 vector
635          */
636         void Update005();
637
638         /** Send the 005 numerics (ISUPPORT) to a user
639          */
640         void Send005(User* user);
641
642         /** Read the entire configuration into memory
643          * and initialize this class. All other methods
644          * should be used only by the core.
645          */
646         void Read(bool bail, User* user, int pass);
647
648         /** Read a file into a file_cache object
649          */
650         bool ReadFile(file_cache &F, const char* fname);
651
652         /** Report a configuration error given in errormessage.
653          * @param bail If this is set to true, the error is sent to the console, and the program exits
654          * @param user If this is set to a non-null value, and bail is false, the errors are spooled to
655          * this user as SNOTICEs.
656          * If the parameter is NULL, the messages are spooled to all users via WriteOpers as SNOTICEs.
657          */
658         void ReportConfigError(const std::string &errormessage, bool bail, User* user);
659
660         /** Load 'filename' into 'target', with the new config parser everything is parsed into
661          * tag/key/value at load-time rather than at read-value time.
662          */
663         bool LoadConf(ConfigDataHash &target, const char* filename, std::ostringstream &errorstream, int pass, std::istream* scan_for_includs_only);
664
665         /** Load 'filename' into 'target', with the new config parser everything is parsed into
666          * tag/key/value at load-time rather than at read-value time.
667          */
668         bool LoadConf(ConfigDataHash &target, const std::string &filename, std::ostringstream &errorstream, int pass, std::istream* scan_for_includs_only = NULL);
669         
670         /* Both these return true if the value existed or false otherwise */
671         
672         /** Writes 'length' chars into 'result' as a string
673          */
674         bool ConfValue(ConfigDataHash &target, const char* tag, const char* var, int index, char* result, int length, bool allow_linefeeds = false);
675         /** Writes 'length' chars into 'result' as a string
676          */
677         bool ConfValue(ConfigDataHash &target, const char* tag, const char* var, const char* default_value, int index, char* result, int length, bool allow_linefeeds = false);
678
679         /** Writes 'length' chars into 'result' as a string
680          */
681         bool ConfValue(ConfigDataHash &target, const std::string &tag, const std::string &var, int index, std::string &result, bool allow_linefeeds = false);
682         /** Writes 'length' chars into 'result' as a string
683          */
684         bool ConfValue(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index, std::string &result, bool allow_linefeeds = false);
685         
686         /** Tries to convert the value to an integer and write it to 'result'
687          */
688         bool ConfValueInteger(ConfigDataHash &target, const char* tag, const char* var, int index, int &result);
689         /** Tries to convert the value to an integer and write it to 'result'
690          */
691         bool ConfValueInteger(ConfigDataHash &target, const char* tag, const char* var, const char* default_value, int index, int &result);
692         /** Tries to convert the value to an integer and write it to 'result'
693          */
694         bool ConfValueInteger(ConfigDataHash &target, const std::string &tag, const std::string &var, int index, int &result);
695         /** Tries to convert the value to an integer and write it to 'result'
696          */
697         bool ConfValueInteger(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index, int &result);
698         
699         /** Returns true if the value exists and has a true value, false otherwise
700          */
701         bool ConfValueBool(ConfigDataHash &target, const char* tag, const char* var, int index);
702         /** Returns true if the value exists and has a true value, false otherwise
703          */
704         bool ConfValueBool(ConfigDataHash &target, const char* tag, const char* var, const char* default_value, int index);
705         /** Returns true if the value exists and has a true value, false otherwise
706          */
707         bool ConfValueBool(ConfigDataHash &target, const std::string &tag, const std::string &var, int index);
708         /** Returns true if the value exists and has a true value, false otherwise
709          */
710         bool ConfValueBool(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index);
711         
712         /** Returns the number of occurences of tag in the config file
713          */
714         int ConfValueEnum(ConfigDataHash &target, const char* tag);
715         /** Returns the number of occurences of tag in the config file
716          */
717         int ConfValueEnum(ConfigDataHash &target, const std::string &tag);
718         
719         /** Returns the numbers of vars inside the index'th 'tag in the config file
720          */
721         int ConfVarEnum(ConfigDataHash &target, const char* tag, int index);
722         /** Returns the numbers of vars inside the index'th 'tag in the config file
723          */
724         int ConfVarEnum(ConfigDataHash &target, const std::string &tag, int index);
725
726         void ValidateHostname(const char* p, const std::string &tag, const std::string &val);
727
728         void ValidateIP(const char* p, const std::string &tag, const std::string &val, bool wild);
729
730         void ValidateNoSpaces(const char* p, const std::string &tag, const std::string &val);
731         
732         /** Get a pointer to the module which has hooked the given port.
733          * @parameter port Port number
734          * @return Returns a pointer to the hooking module, or NULL
735          */
736         Module* GetIOHook(int port);
737
738         /** Hook a module to a client port, so that it can receive notifications
739          * of low-level port activity.
740          * @param port The port number
741          * @param Module the module to hook to the port
742          * @return True if the hook was successful.
743          */
744         bool AddIOHook(int port, Module* iomod);
745
746         /** Delete a module hook from a client port.
747          * @param port The port to detatch from
748          * @return True if successful
749          */
750         bool DelIOHook(int port);
751         
752         /** Get a pointer to the module which has hooked the given BufferedSocket class.
753          * @parameter port Port number
754          * @return Returns a pointer to the hooking module, or NULL
755          */
756         Module* GetIOHook(BufferedSocket* is);
757
758         /** Hook a module to an BufferedSocket class, so that it can receive notifications
759          * of low-level socket activity.
760          * @param iomod The module to hook to the socket
761          * @param is The BufferedSocket to attach to
762          * @return True if the hook was successful.
763          */
764         bool AddIOHook(Module* iomod, BufferedSocket* is);
765
766         /** Delete a module hook from an BufferedSocket.
767          * @param is The BufferedSocket to detatch from.
768          * @return True if the unhook was successful
769          */
770         bool DelIOHook(BufferedSocket* is);
771
772         /** Returns the fully qualified path to the inspircd directory
773          * @return The full program directory
774          */
775         std::string GetFullProgDir();
776
777         /** Returns true if a directory is valid (within the modules directory).
778          * @param dirandfile The directory and filename to check
779          * @return True if the directory is valid
780          */
781         static bool DirValid(const char* dirandfile);
782
783         /** Clean a filename, stripping the directories (and drives) from string.
784          * @param name Directory to tidy
785          * @return The cleaned filename
786          */
787         static char* CleanFilename(char* name);
788
789         /** Check if a file exists.
790          * @param file The full path to a file
791          * @return True if the file exists and is readable.
792          */
793         static bool FileExists(const char* file);
794         
795 };
796
797 /** Initialize the disabled commands list
798  */
799 CoreExport bool InitializeDisabledCommands(const char* data, InspIRCd* ServerInstance);
800
801 /** Initialize the oper types
802  */
803 bool InitTypes(ServerConfig* conf, const char* tag);
804
805 /** Initialize the oper classes
806  */
807 bool InitClasses(ServerConfig* conf, const char* tag);
808
809 /** Initialize an oper type 
810  */
811 bool DoType(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types);
812
813 /** Initialize an oper class
814  */
815 bool DoClass(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types);
816
817 /** Finish initializing the oper types and classes
818  */
819 bool DoneClassesAndTypes(ServerConfig* conf, const char* tag);
820
821
822
823 /** Initialize x line
824  */
825 bool InitXLine(ServerConfig* conf, const char* tag);
826  
827 /** Add a config-defined zline
828  */
829 bool DoZLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types);
830
831 /** Add a config-defined qline
832  */
833 bool DoQLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types);
834
835 /** Add a config-defined kline
836  */
837 bool DoKLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types);
838
839 /** Add a config-defined eline
840  */
841 bool DoELine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types);
842
843
844
845
846 #endif
847