1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #ifndef __INSPIRCD_H__
15 #define __INSPIRCD_H__
20 #define printf_c printf
22 #include "inspircd_win32wrapper.h"
23 /** Windows defines these already */
32 #include "inspircd_config.h"
38 #include "socketengine.h"
39 #include "command_parse.h"
41 #include "cull_list.h"
42 #include "filelogger.h"
46 * Used to define the maximum number of parameters a command may have.
48 #define MAXPARAMETERS 127
50 /** Returned by some functions to indicate failure.
54 /** Support for librodent -
55 * see http://www.chatspike.net/index.php?z=64
57 #define ETIREDHAMSTERS EAGAIN
59 /** Delete a pointer, and NULL its value
61 template<typename T> inline void DELETE(T* x)
67 /** Template function to convert any input type to std::string
69 template<typename T> inline std::string ConvNumeric(const T &in)
71 if (in == 0) return "0";
76 *out = "0123456789"[ std::abs( (long)quotient % 10 ) ];
83 std::reverse(res,out);
87 /** Template function to convert any input type to std::string
89 inline std::string ConvToStr(const int in)
91 return ConvNumeric(in);
94 /** Template function to convert any input type to std::string
96 inline std::string ConvToStr(const long in)
98 return ConvNumeric(in);
101 /** Template function to convert any input type to std::string
103 inline std::string ConvToStr(const char* in)
108 /** Template function to convert any input type to std::string
110 inline std::string ConvToStr(const bool in)
112 return (in ? "1" : "0");
115 /** Template function to convert any input type to std::string
117 inline std::string ConvToStr(char in)
119 return std::string(in,1);
122 /** Template function to convert any input type to std::string
124 template <class T> inline std::string ConvToStr(const T &in)
126 std::stringstream tmp;
127 if (!(tmp << in)) return std::string();
131 /** Template function to convert any input type to any other type
132 * (usually an integer or numeric type)
134 template<typename T> inline long ConvToInt(const T &in)
136 std::stringstream tmp;
137 if (!(tmp << in)) return 0;
138 return atoi(tmp.str().c_str());
141 /** Template function to convert integer to char, storing result in *res and
142 * also returning the pointer to res. Based on Stuart Lowe's C/C++ Pages.
143 * @param T input value
144 * @param V result value
145 * @param R base to convert to
147 template<typename T, typename V, typename R> inline char* itoa(const T &in, V *res, R base)
149 if (base < 2 || base > 16) { *res = 0; return res; }
153 *out = "0123456789abcdef"[ std::abs( quotient % base ) ];
157 if ( in < 0 && base == 10) *out++ = '-';
158 std::reverse( res, out );
163 /** This class contains various STATS counters
164 * It is used by the InspIRCd class, which internally
165 * has an instance of it.
167 class serverstats : public classbase
170 /** Number of accepted connections
172 unsigned long statsAccept;
173 /** Number of failed accepts
175 unsigned long statsRefused;
176 /** Number of unknown commands seen
178 unsigned long statsUnknown;
179 /** Number of nickname collisions handled
181 unsigned long statsCollisions;
182 /** Number of DNS queries sent out
184 unsigned long statsDns;
185 /** Number of good DNS replies received
186 * NOTE: This may not tally to the number sent out,
187 * due to timeouts and other latency issues.
189 unsigned long statsDnsGood;
190 /** Number of bad (negative) DNS replies received
191 * NOTE: This may not tally to the number sent out,
192 * due to timeouts and other latency issues.
194 unsigned long statsDnsBad;
195 /** Number of inbound connections seen
197 unsigned long statsConnects;
198 /** Total bytes of data transmitted
201 /** Total bytes of data received
204 /** Cpu usage at last sample
207 /** Time last sample was read
210 /** The constructor initializes all the counts to zero
213 : statsAccept(0), statsRefused(0), statsUnknown(0), statsCollisions(0), statsDns(0),
214 statsDnsGood(0), statsDnsBad(0), statsConnects(0), statsSent(0.0), statsRecv(0.0)
219 /** A list of failed port bindings, used for informational purposes on startup */
220 typedef std::vector<std::pair<std::string, long> > FailedPortList;
222 /** A list of ip addresses cross referenced against clone counts */
223 typedef std::map<irc::string, unsigned int> clonemap;
227 DEFINE_HANDLER1(ProcessUserHandler, void, User*);
228 DEFINE_HANDLER1(IsNickHandler, bool, const char*);
229 DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
230 DEFINE_HANDLER1(FindDescriptorHandler, User*, int);
231 DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
233 /* Forward declaration - required */
236 /** The main class of the irc server.
237 * This class contains instances of all the other classes
238 * in this software, with the exception of the base class,
239 * classbase. Amongst other things, it contains a ModeParser,
240 * a DNS object, a CommandParser object, and a list of active
241 * Module objects, and facilities for Module objects to
242 * interact with the core system it implements. You should
243 * NEVER attempt to instantiate a class of type InspIRCd
244 * yourself. If you do, this is equivalent to spawning a second
245 * IRC server, and could have catastrophic consequences for the
246 * program in terms of ram usage (basically, you could create
247 * an obese forkbomb built from recursively spawning irc servers!)
249 class CoreExport InspIRCd : public classbase
252 /** Holds the current UID. Used to generate the next one.
254 char current_uid[UUID_LENGTH];
256 /** Set up the signal handlers
260 /** Daemonize the ircd and close standard input/output streams
261 * @return True if the program daemonized succesfully
265 /** Iterate the list of BufferedSocket objects, removing ones which have timed out
266 * @param TIME the current time
268 void DoSocketTimeouts(time_t TIME);
270 /** Sets up UID subsystem
272 void InitialiseUID();
274 /** Perform background user events such as PING checks
276 void DoBackgroundUserStuff();
278 /** Returns true when all modules have done pre-registration checks on a user
279 * @param user The user to verify
280 * @return True if all modules have finished checking this user
282 bool AllModulesReportReady(User* user);
284 /** Logfile pathname specified on the commandline, or empty string
286 char LogFileName[MAXBUF];
288 /** The current time, updated in the mainloop
292 /** The time that was recorded last time around the mainloop
296 /** A 64k buffer used to read client lines into
298 char ReadBuffer[65535];
300 /** Used when connecting clients
302 insp_sockaddr client, server;
304 /** Used when connecting clients
308 /** Nonblocking file writer
312 /** Time offset in seconds
313 * This offset is added to all calls to Time(). Use SetTimeDelta() to update
323 /** Global cull list, will be processed on next iteration
325 CullList GlobalCulls;
329 ProcessUserHandler HandleProcessUser;
330 IsNickHandler HandleIsNick;
331 IsIdentHandler HandleIsIdent;
332 FindDescriptorHandler HandleFindDescriptor;
333 FloodQuitUserHandler HandleFloodQuitUser;
335 /** BufferedSocket classes pending deletion after being closed.
336 * We don't delete these immediately as this may cause a segmentation fault.
338 std::map<BufferedSocket*,BufferedSocket*> SocketCull;
340 /** Globally accessible fake user record. This is used to force mode changes etc across s2s, etc.. bit ugly, but.. better than how this was done in 1.1
343 * SendMode expects a User* to send the numeric replies
344 * back to, so we create it a fake user that isnt in the user
345 * hash and set its descriptor to FD_MAGIC_NUMBER so the data
346 * falls into the abyss :p
350 /** Returns the next available UID for this server.
352 std::string GetUID();
354 /** Find a user in the UUID hash
355 * @param nick The nickname to find
356 * @return A pointer to the user, or NULL if the user does not exist
358 User *FindUUID(const std::string &);
360 /** Find a user in the UUID hash
361 * @param nick The nickname to find
362 * @return A pointer to the user, or NULL if the user does not exist
364 User *FindUUID(const char *);
366 /** Build the ISUPPORT string by triggering all modules On005Numeric events
368 void BuildISupport();
370 /** Number of unregistered users online right now.
371 * (Unregistered means before USER/NICK/dns)
373 int unregistered_count;
375 /** List of server names we've seen.
377 servernamelist servernames;
379 /** Time this ircd was booted
383 /** Config file pathname specified on the commandline or via ./configure
385 char ConfigFileName[MAXBUF];
387 /** Mode handler, handles mode setting and removal
391 /** Command parser, handles client to server commands
393 CommandParser* Parser;
395 /** Socket engine, handles socket activity events
399 /** ModuleManager contains everything related to loading/unloading
402 ModuleManager* Modules;
404 /** Stats class, holds miscellaneous stats counters
408 /** Server Config class, holds configuration file data
410 ServerConfig* Config;
412 /** Snomask manager - handles routing of snomask messages
417 /** Client list, a hash_map containing all clients, local and remote
419 user_hash* clientlist;
421 /** Client list stored by UUID. Contains all clients, and is updated
422 * automatically by the constructor and destructor of User.
426 /** Channel list, a hash_map containing all channels
430 /** Local client list, a vector containing only local clients
432 std::vector<User*> local_users;
434 /** Oper list, a vector containing all local and remote opered users
436 std::list<User*> all_opers;
438 /** Map of local ip addresses for clone counting
440 clonemap local_clones;
442 /** Map of global ip addresses for clone counting
444 clonemap global_clones;
446 /** DNS class, provides resolver facilities to the core and modules
450 /** Timer manager class, triggers Timer timer events
452 TimerManager* Timers;
454 /** X-Line manager. Handles G/K/Q/E line setting, removal and matching
456 XLineManager* XLines;
458 /** Set to the current signal recieved
462 /** Get the current time
463 * Because this only calls time() once every time around the mainloop,
464 * it is much faster than calling time() directly.
465 * @param delta True to use the delta as an offset, false otherwise
466 * @return The current time as an epoch value (time_t)
468 time_t Time(bool delta = false);
470 /** Set the time offset in seconds
471 * This offset is added to Time() to offset the system time by the specified
473 * @param delta The number of seconds to offset
474 * @return The old time delta
476 int SetTimeDelta(int delta);
478 /** Add a user to the local clone map
479 * @param user The user to add
481 void AddLocalClone(User* user);
483 /** Add a user to the global clone map
484 * @param user The user to add
486 void AddGlobalClone(User* user);
488 /** Number of users with a certain mode set on them
490 int ModeCount(const char mode);
492 /** Get the time offset in seconds
493 * @return The current time delta (in seconds)
497 /** Process a user whos socket has been flagged as active
498 * @param cu The user to process
499 * @return There is no actual return value, however upon exit, the user 'cu' may have been
500 * marked for deletion in the global CullList.
502 caller1<void, User*> ProcessUser;
504 /** Bind all ports specified in the configuration file.
505 * @param bail True if the function should bail back to the shell on failure
506 * @param found_ports The actual number of ports found in the config, as opposed to the number actually bound
507 * @return The number of ports actually bound without error
509 int BindPorts(bool bail, int &found_ports, FailedPortList &failed_ports);
511 /** Binds a socket on an already open file descriptor
512 * @param sockfd A valid file descriptor of an open socket
513 * @param port The port number to bind to
514 * @param addr The address to bind to (IP only)
515 * @return True if the port was bound successfully
517 bool BindSocket(int sockfd, int port, char* addr, bool dolisten = true);
519 /** Adds a server name to the list of servers we've seen
520 * @param The servername to add
522 void AddServerName(const std::string &servername);
524 /** Finds a cached char* pointer of a server name,
525 * This is used to optimize User by storing only the pointer to the name
526 * @param The servername to find
527 * @return A pointer to this name, gauranteed to never become invalid
529 const char* FindServerNamePtr(const std::string &servername);
531 /** Returns true if we've seen the given server name before
532 * @param The servername to find
533 * @return True if we've seen this server name before
535 bool FindServerName(const std::string &servername);
537 /** Gets the GECOS (description) field of the given server.
538 * If the servername is not that of the local server, the name
539 * is passed to handling modules which will attempt to determine
540 * the GECOS that bleongs to the given servername.
541 * @param servername The servername to find the description of
542 * @return The description of this server, or of the local server
544 std::string GetServerDescription(const char* servername);
546 /** Write text to all opers connected to this server
547 * @param text The text format string
548 * @param ... Format args
550 void WriteOpers(const char* text, ...);
552 /** Write text to all opers connected to this server
553 * @param text The text to send
555 void WriteOpers(const std::string &text);
557 /** Find a user in the nick hash.
558 * If the user cant be found in the nick hash check the uuid hash
559 * @param nick The nickname to find
560 * @return A pointer to the user, or NULL if the user does not exist
562 User* FindNick(const std::string &nick);
564 /** Find a user in the nick hash.
565 * If the user cant be found in the nick hash check the uuid hash
566 * @param nick The nickname to find
567 * @return A pointer to the user, or NULL if the user does not exist
569 User* FindNick(const char* nick);
571 /** Find a user in the nick hash ONLY
573 User* FindNickOnly(const char* nick);
575 /** Find a user in the nick hash ONLY
577 User* FindNickOnly(const std::string &nick);
579 /** Find a channel in the channels hash
580 * @param chan The channel to find
581 * @return A pointer to the channel, or NULL if the channel does not exist
583 Channel* FindChan(const std::string &chan);
585 /** Find a channel in the channels hash
586 * @param chan The channel to find
587 * @return A pointer to the channel, or NULL if the channel does not exist
589 Channel* FindChan(const char* chan);
591 /** Check for a 'die' tag in the config file, and abort if found
592 * @return Depending on the configuration, this function may never return
596 /** Check we aren't running as root, and exit if we are
597 * @return Depending on the configuration, this function may never return
601 /** Determine the right path for, and open, the logfile
602 * @param argv The argv passed to main() initially, used to calculate program path
603 * @param argc The argc passed to main() initially, used to calculate program path
604 * @return True if the log could be opened, false if otherwise
606 bool OpenLog(char** argv, int argc);
608 /** Close the currently open log file
612 /** Send a server notice to all local users
613 * @param text The text format string to send
614 * @param ... The format arguments
616 void ServerNoticeAll(char* text, ...);
618 /** Send a server message (PRIVMSG) to all local users
619 * @param text The text format string to send
620 * @param ... The format arguments
622 void ServerPrivmsgAll(char* text, ...);
624 /** Send text to all users with a specific set of modes
625 * @param modes The modes to check against, without a +, e.g. 'og'
626 * @param flags one of WM_OR or WM_AND. If you specify WM_OR, any one of the
627 * mode characters in the first parameter causes receipt of the message, and
628 * if you specify WM_OR, all the modes must be present.
629 * @param text The text format string to send
630 * @param ... The format arguments
632 void WriteMode(const char* modes, int flags, const char* text, ...);
634 /** Return true if a channel name is valid
635 * @param chname A channel name to verify
636 * @return True if the name is valid
638 bool IsChannel(const char *chname);
640 /** Rehash the local server
644 /** Handles incoming signals after being set
645 * @param signal the signal recieved
647 void SignalHandler(int signal);
649 /** Sets the signal recieved
650 * @param signal the signal recieved
652 static void SetSignal(int signal);
654 /** Causes the server to exit after unloading modules and
655 * closing all open file descriptors.
657 * @param The exit code to give to the operating system
658 * (See the ExitStatus enum for valid values)
660 void Exit(int status);
662 /** Causes the server to exit immediately with exit code 0.
663 * The status code is required for signal handlers, and ignored.
665 static void QuickExit(int status);
667 /** Return a count of users, unknown and known connections
668 * @return The number of users
672 /** Return a count of fully registered connections only
673 * @return The number of registered users
675 int RegisteredUserCount();
677 /** Return a count of opered (umode +o) users only
678 * @return The number of opers
682 /** Return a count of unregistered (before NICK/USER) users only
683 * @return The number of unregistered (unknown) connections
685 int UnregisteredUserCount();
687 /** Return a count of channels on the network
688 * @return The number of channels
692 /** Return a count of local users on this server only
693 * @return The number of local users
695 long LocalUserCount();
697 /** Send an error notice to all local users, opered and unopered
698 * @param s The error string to send
700 void SendError(const std::string &s);
702 /** Return true if a nickname is valid
703 * @param n A nickname to verify
704 * @return True if the nick is valid
706 caller1<bool, const char*> IsNick;
708 /** Return true if an ident is valid
709 * @param An ident to verify
710 * @return True if the ident is valid
712 caller1<bool, const char*> IsIdent;
714 /** Find a username by their file descriptor.
715 * It is preferred to use this over directly accessing the fd_ref_table array.
716 * @param socket The file descriptor of a user
717 * @return A pointer to the user if the user exists locally on this descriptor
719 caller1<User*, int> FindDescriptor;
721 /** Add a new mode to this server's mode parser
722 * @param mh The modehandler to add
723 * @return True if the mode handler was added
725 bool AddMode(ModeHandler* mh);
727 /** Add a new mode watcher to this server's mode parser
728 * @param mw The modewatcher to add
729 * @return True if the modewatcher was added
731 bool AddModeWatcher(ModeWatcher* mw);
733 /** Delete a mode watcher from this server's mode parser
734 * @param mw The modewatcher to delete
735 * @return True if the modewatcher was deleted
737 bool DelModeWatcher(ModeWatcher* mw);
739 /** Add a dns Resolver class to this server's active set
740 * @param r The resolver to add
741 * @param cached If this value is true, then the cache will
742 * be searched for the DNS result, immediately. If the value is
743 * false, then a request will be sent to the nameserver, and the
744 * result will not be immediately available. You should usually
745 * use the boolean value which you passed to the Resolver
746 * constructor, which Resolver will set appropriately depending
747 * on if cached results are available and haven't expired. It is
748 * however safe to force this value to false, forcing a remote DNS
749 * lookup, but not an update of the cache.
750 * @return True if the operation completed successfully. Note that
751 * if this method returns true, you should not attempt to access
752 * the resolver class you pass it after this call, as depending upon
753 * the request given, the object may be deleted!
755 bool AddResolver(Resolver* r, bool cached);
757 /** Add a command to this server's command parser
758 * @param f A Command command handler object to add
759 * @throw ModuleException Will throw ModuleExcption if the command already exists
761 void AddCommand(Command *f);
763 /** Send a modechange.
764 * The parameters provided are identical to that sent to the
765 * handler for class cmd_mode.
766 * @param parameters The mode parameters
767 * @param pcnt The number of items you have given in the first parameter
768 * @param user The user to send error messages to
770 void SendMode(const char **parameters, int pcnt, User *user);
772 /** Match two strings using pattern matching.
773 * This operates identically to the global function match(),
774 * except for that it takes std::string arguments rather than
776 * @param sliteral The literal string to match against
777 * @param spattern The pattern to match against. CIDR and globs are supported.
779 bool MatchText(const std::string &sliteral, const std::string &spattern);
781 /** Call the handler for a given command.
782 * @param commandname The command whos handler you wish to call
783 * @param parameters The mode parameters
784 * @param pcnt The number of items you have given in the first parameter
785 * @param user The user to execute the command as
786 * @return True if the command handler was called successfully
788 CmdResult CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, User* user);
790 /** Return true if the command is a module-implemented command and the given parameters are valid for it
791 * @param parameters The mode parameters
792 * @param pcnt The number of items you have given in the first parameter
793 * @param user The user to test-execute the command as
794 * @return True if the command handler is a module command, and there are enough parameters and the user has permission to the command
796 bool IsValidModuleCommand(const std::string &commandname, int pcnt, User* user);
798 /** Return true if the given parameter is a valid nick!user\@host mask
799 * @param mask A nick!user\@host masak to match against
800 * @return True i the mask is valid
802 bool IsValidMask(const std::string &mask);
804 /** Rehash the local server
808 /** Return the channel whos index number matches that provided
809 * @param The index number of the channel to fetch
810 * @return A channel record, or NUll if index < 0 or index >= InspIRCd::ChannelCount()
812 Channel* GetChannelIndex(long index);
814 /** Dump text to a user target, splitting it appropriately to fit
815 * @param User the user to dump the text to
816 * @param LinePrefix text to prefix each complete line with
817 * @param TextStream the text to send to the user
819 void DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream);
821 /** Check if the given nickmask matches too many users, send errors to the given user
822 * @param nick A nickmask to match against
823 * @param user A user to send error text to
824 * @return True if the nick matches too many users
826 bool NickMatchesEveryone(const std::string &nick, User* user);
828 /** Check if the given IP mask matches too many users, send errors to the given user
829 * @param ip An ipmask to match against
830 * @param user A user to send error text to
831 * @return True if the ip matches too many users
833 bool IPMatchesEveryone(const std::string &ip, User* user);
835 /** Check if the given hostmask matches too many users, send errors to the given user
836 * @param mask A hostmask to match against
837 * @param user A user to send error text to
838 * @return True if the host matches too many users
840 bool HostMatchesEveryone(const std::string &mask, User* user);
842 /** Calculate a duration in seconds from a string in the form 1y2w3d4h6m5s
843 * @param str A string containing a time in the form 1y2w3d4h6m5s
844 * (one year, two weeks, three days, four hours, six minutes and five seconds)
845 * @return The total number of seconds
847 long Duration(const std::string &str);
849 /** Attempt to compare an oper password to a string from the config file.
850 * This will be passed to handling modules which will compare the data
851 * against possible hashed equivalents in the input string.
852 * @param data The data from the config file
853 * @param input The data input by the oper
854 * @param tagnum the tag number of the oper's tag in the config file
855 * @return 0 if the strings match, 1 or -1 if they do not
857 int OperPassCompare(const char* data,const char* input, int tagnum);
859 /** Check if a given server is a uline.
860 * An empty string returns true, this is by design.
861 * @param server The server to check for uline status
862 * @return True if the server is a uline OR the string is empty
864 bool ULine(const char* server);
866 /** Returns true if the uline is 'silent' (doesnt generate
867 * remote connect notices etc).
869 bool SilentULine(const char* server);
871 /** Returns the subversion revision ID of this ircd
872 * @return The revision ID or an empty string
874 std::string GetRevision();
876 /** Returns the full version string of this ircd
877 * @return The version string
879 std::string GetVersionString();
881 /** Attempt to write the process id to a given file
882 * @param filename The PID file to attempt to write to
883 * @return This function may bail if the file cannot be written
885 void WritePID(const std::string &filename);
887 /** This constructor initialises all the subsystems and reads the config file.
888 * @param argc The argument count passed to main()
889 * @param argv The argument list passed to main()
890 * @throw <anything> If anything is thrown from here and makes it to
891 * you, you should probably just give up and go home. Yes, really.
892 * It's that bad. Higher level classes should catch any non-fatal exceptions.
894 InspIRCd(int argc, char** argv);
896 /** Output a log message to the ircd.log file
897 * The text will only be output if the current loglevel
898 * is less than or equal to the level you provide
899 * @param level A log level from the DebugLevel enum
900 * @param text Format string of to write to the log
901 * @param ... Format arguments of text to write to the log
903 void Log(int level, const char* text, ...);
905 /** Output a log message to the ircd.log file
906 * The text will only be output if the current loglevel
907 * is less than or equal to the level you provide
908 * @param level A log level from the DebugLevel enum
909 * @param text Text to write to the log
911 void Log(int level, const std::string &text);
913 /** Send a line of WHOIS data to a user.
914 * @param user user to send the line to
915 * @param dest user being WHOISed
916 * @param numeric Numeric to send
917 * @param text Text of the numeric
919 void SendWhoisLine(User* user, User* dest, int numeric, const std::string &text);
921 /** Send a line of WHOIS data to a user.
922 * @param user user to send the line to
923 * @param dest user being WHOISed
924 * @param numeric Numeric to send
925 * @param format Format string for the numeric
926 * @param ... Parameters for the format string
928 void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...);
930 /** Quit a user for excess flood, and if they are not
931 * fully registered yet, temporarily zline their IP.
932 * @param current user to quit
934 caller1<void, User*> FloodQuitUser;
936 /** Restart the server.
937 * This function will not return. If an error occurs,
938 * it will throw an instance of CoreException.
939 * @param reason The restart reason to show to all clients
940 * @throw CoreException An instance of CoreException indicating the error from execv().
942 void Restart(const std::string &reason);
944 /** Prepare the ircd for restart or shutdown.
945 * This function unloads all modules which can be unloaded,
946 * closes all open sockets, and closes the logfile.
950 /** This copies the user and channel hash_maps into new hash maps.
951 * This frees memory used by the hash_map allocator (which it neglects
952 * to free, most of the time, using tons of ram)
954 void RehashUsersAndChans();
956 /** Resets the cached max bans value on all channels.
961 /** Return a time_t as a human-readable string.
963 std::string TimeString(time_t curtime);
965 /** Begin execution of the server.
966 * NOTE: this function NEVER returns. Internally,
967 * it will repeatedly loop.
968 * @return The return value for this function is undefined.
972 /** Force all BufferedSockets to be removed which are due to
975 void BufferedSocketCull();
977 char* GetReadBuffer()
979 return this->ReadBuffer;