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 */
235 class BanCacheManager;
237 /** The main class of the irc server.
238 * This class contains instances of all the other classes
239 * in this software, with the exception of the base class,
240 * classbase. Amongst other things, it contains a ModeParser,
241 * a DNS object, a CommandParser object, and a list of active
242 * Module objects, and facilities for Module objects to
243 * interact with the core system it implements. You should
244 * NEVER attempt to instantiate a class of type InspIRCd
245 * yourself. If you do, this is equivalent to spawning a second
246 * IRC server, and could have catastrophic consequences for the
247 * program in terms of ram usage (basically, you could create
248 * an obese forkbomb built from recursively spawning irc servers!)
250 class CoreExport InspIRCd : public classbase
253 /** Holds the current UID. Used to generate the next one.
255 char current_uid[UUID_LENGTH];
257 /** Set up the signal handlers
261 /** Daemonize the ircd and close standard input/output streams
262 * @return True if the program daemonized succesfully
266 /** Iterate the list of BufferedSocket objects, removing ones which have timed out
267 * @param TIME the current time
269 void DoSocketTimeouts(time_t TIME);
271 /** Sets up UID subsystem
273 void InitialiseUID();
275 /** Perform background user events such as PING checks
277 void DoBackgroundUserStuff();
279 /** Returns true when all modules have done pre-registration checks on a user
280 * @param user The user to verify
281 * @return True if all modules have finished checking this user
283 bool AllModulesReportReady(User* user);
285 /** Logfile pathname specified on the commandline, or empty string
287 char LogFileName[MAXBUF];
289 /** The current time, updated in the mainloop
293 /** The time that was recorded last time around the mainloop
297 /** A 64k buffer used to read client lines into
299 char ReadBuffer[65535];
301 /** Used when connecting clients
303 insp_sockaddr client, server;
305 /** Used when connecting clients
309 /** Nonblocking file writer
313 /** Time offset in seconds
314 * This offset is added to all calls to Time(). Use SetTimeDelta() to update
324 /** Global cull list, will be processed on next iteration
326 CullList GlobalCulls;
330 ProcessUserHandler HandleProcessUser;
331 IsNickHandler HandleIsNick;
332 IsIdentHandler HandleIsIdent;
333 FindDescriptorHandler HandleFindDescriptor;
334 FloodQuitUserHandler HandleFloodQuitUser;
336 /** BufferedSocket classes pending deletion after being closed.
337 * We don't delete these immediately as this may cause a segmentation fault.
339 std::map<BufferedSocket*,BufferedSocket*> SocketCull;
341 /** 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
344 * SendMode expects a User* to send the numeric replies
345 * back to, so we create it a fake user that isnt in the user
346 * hash and set its descriptor to FD_MAGIC_NUMBER so the data
347 * falls into the abyss :p
351 /** Returns the next available UID for this server.
353 std::string GetUID();
355 /** Find a user in the UUID hash
356 * @param nick The nickname to find
357 * @return A pointer to the user, or NULL if the user does not exist
359 User *FindUUID(const std::string &);
361 /** Find a user in the UUID hash
362 * @param nick The nickname to find
363 * @return A pointer to the user, or NULL if the user does not exist
365 User *FindUUID(const char *);
367 /** Build the ISUPPORT string by triggering all modules On005Numeric events
369 void BuildISupport();
371 /** Number of unregistered users online right now.
372 * (Unregistered means before USER/NICK/dns)
374 int unregistered_count;
376 /** List of server names we've seen.
378 servernamelist servernames;
380 /** Time this ircd was booted
384 /** Config file pathname specified on the commandline or via ./configure
386 char ConfigFileName[MAXBUF];
388 /** Mode handler, handles mode setting and removal
392 /** Command parser, handles client to server commands
394 CommandParser* Parser;
396 /** Socket engine, handles socket activity events
400 /** ModuleManager contains everything related to loading/unloading
403 ModuleManager* Modules;
405 /** BanCacheManager is used to speed up checking of restrictions on connection
408 BanCacheManager *BanCache;
410 /** Stats class, holds miscellaneous stats counters
414 /** Server Config class, holds configuration file data
416 ServerConfig* Config;
418 /** Snomask manager - handles routing of snomask messages
423 /** Client list, a hash_map containing all clients, local and remote
425 user_hash* clientlist;
427 /** Client list stored by UUID. Contains all clients, and is updated
428 * automatically by the constructor and destructor of User.
432 /** Channel list, a hash_map containing all channels
436 /** Local client list, a vector containing only local clients
438 std::vector<User*> local_users;
440 /** Oper list, a vector containing all local and remote opered users
442 std::list<User*> all_opers;
444 /** Map of local ip addresses for clone counting
446 clonemap local_clones;
448 /** Map of global ip addresses for clone counting
450 clonemap global_clones;
452 /** DNS class, provides resolver facilities to the core and modules
456 /** Timer manager class, triggers Timer timer events
458 TimerManager* Timers;
460 /** X-Line manager. Handles G/K/Q/E line setting, removal and matching
462 XLineManager* XLines;
464 /** Set to the current signal recieved
468 /** Get the current time
469 * Because this only calls time() once every time around the mainloop,
470 * it is much faster than calling time() directly.
471 * @param delta True to use the delta as an offset, false otherwise
472 * @return The current time as an epoch value (time_t)
474 time_t Time(bool delta = false);
476 /** Set the time offset in seconds
477 * This offset is added to Time() to offset the system time by the specified
479 * @param delta The number of seconds to offset
480 * @return The old time delta
482 int SetTimeDelta(int delta);
484 /** Add a user to the local clone map
485 * @param user The user to add
487 void AddLocalClone(User* user);
489 /** Add a user to the global clone map
490 * @param user The user to add
492 void AddGlobalClone(User* user);
494 /** Number of users with a certain mode set on them
496 int ModeCount(const char mode);
498 /** Get the time offset in seconds
499 * @return The current time delta (in seconds)
503 /** Process a user whos socket has been flagged as active
504 * @param cu The user to process
505 * @return There is no actual return value, however upon exit, the user 'cu' may have been
506 * marked for deletion in the global CullList.
508 caller1<void, User*> ProcessUser;
510 /** Bind all ports specified in the configuration file.
511 * @param bail True if the function should bail back to the shell on failure
512 * @param found_ports The actual number of ports found in the config, as opposed to the number actually bound
513 * @return The number of ports actually bound without error
515 int BindPorts(bool bail, int &found_ports, FailedPortList &failed_ports);
517 /** Binds a socket on an already open file descriptor
518 * @param sockfd A valid file descriptor of an open socket
519 * @param port The port number to bind to
520 * @param addr The address to bind to (IP only)
521 * @return True if the port was bound successfully
523 bool BindSocket(int sockfd, int port, char* addr, bool dolisten = true);
525 /** Adds a server name to the list of servers we've seen
526 * @param The servername to add
528 void AddServerName(const std::string &servername);
530 /** Finds a cached char* pointer of a server name,
531 * This is used to optimize User by storing only the pointer to the name
532 * @param The servername to find
533 * @return A pointer to this name, gauranteed to never become invalid
535 const char* FindServerNamePtr(const std::string &servername);
537 /** Returns true if we've seen the given server name before
538 * @param The servername to find
539 * @return True if we've seen this server name before
541 bool FindServerName(const std::string &servername);
543 /** Gets the GECOS (description) field of the given server.
544 * If the servername is not that of the local server, the name
545 * is passed to handling modules which will attempt to determine
546 * the GECOS that bleongs to the given servername.
547 * @param servername The servername to find the description of
548 * @return The description of this server, or of the local server
550 std::string GetServerDescription(const char* servername);
552 /** Write text to all opers connected to this server
553 * @param text The text format string
554 * @param ... Format args
556 void WriteOpers(const char* text, ...);
558 /** Write text to all opers connected to this server
559 * @param text The text to send
561 void WriteOpers(const std::string &text);
563 /** Find a user in the nick hash.
564 * If the user cant be found in the nick hash check the uuid hash
565 * @param nick The nickname to find
566 * @return A pointer to the user, or NULL if the user does not exist
568 User* FindNick(const std::string &nick);
570 /** Find a user in the nick hash.
571 * If the user cant be found in the nick hash check the uuid hash
572 * @param nick The nickname to find
573 * @return A pointer to the user, or NULL if the user does not exist
575 User* FindNick(const char* nick);
577 /** Find a user in the nick hash ONLY
579 User* FindNickOnly(const char* nick);
581 /** Find a user in the nick hash ONLY
583 User* FindNickOnly(const std::string &nick);
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 std::string &chan);
591 /** Find a channel in the channels hash
592 * @param chan The channel to find
593 * @return A pointer to the channel, or NULL if the channel does not exist
595 Channel* FindChan(const char* chan);
597 /** Check for a 'die' tag in the config file, and abort if found
598 * @return Depending on the configuration, this function may never return
602 /** Check we aren't running as root, and exit if we are
603 * @return Depending on the configuration, this function may never return
607 /** Determine the right path for, and open, the logfile
608 * @param argv The argv passed to main() initially, used to calculate program path
609 * @param argc The argc passed to main() initially, used to calculate program path
610 * @return True if the log could be opened, false if otherwise
612 bool OpenLog(char** argv, int argc);
614 /** Close the currently open log file
618 /** Send a server notice to all local users
619 * @param text The text format string to send
620 * @param ... The format arguments
622 void ServerNoticeAll(char* text, ...);
624 /** Send a server message (PRIVMSG) to all local users
625 * @param text The text format string to send
626 * @param ... The format arguments
628 void ServerPrivmsgAll(char* text, ...);
630 /** Send text to all users with a specific set of modes
631 * @param modes The modes to check against, without a +, e.g. 'og'
632 * @param flags one of WM_OR or WM_AND. If you specify WM_OR, any one of the
633 * mode characters in the first parameter causes receipt of the message, and
634 * if you specify WM_OR, all the modes must be present.
635 * @param text The text format string to send
636 * @param ... The format arguments
638 void WriteMode(const char* modes, int flags, const char* text, ...);
640 /** Return true if a channel name is valid
641 * @param chname A channel name to verify
642 * @return True if the name is valid
644 bool IsChannel(const char *chname);
646 /** Rehash the local server
650 /** Handles incoming signals after being set
651 * @param signal the signal recieved
653 void SignalHandler(int signal);
655 /** Sets the signal recieved
656 * @param signal the signal recieved
658 static void SetSignal(int signal);
660 /** Causes the server to exit after unloading modules and
661 * closing all open file descriptors.
663 * @param The exit code to give to the operating system
664 * (See the ExitStatus enum for valid values)
666 void Exit(int status);
668 /** Causes the server to exit immediately with exit code 0.
669 * The status code is required for signal handlers, and ignored.
671 static void QuickExit(int status);
673 /** Return a count of users, unknown and known connections
674 * @return The number of users
678 /** Return a count of fully registered connections only
679 * @return The number of registered users
681 int RegisteredUserCount();
683 /** Return a count of opered (umode +o) users only
684 * @return The number of opers
688 /** Return a count of unregistered (before NICK/USER) users only
689 * @return The number of unregistered (unknown) connections
691 int UnregisteredUserCount();
693 /** Return a count of channels on the network
694 * @return The number of channels
698 /** Return a count of local users on this server only
699 * @return The number of local users
701 long LocalUserCount();
703 /** Send an error notice to all local users, opered and unopered
704 * @param s The error string to send
706 void SendError(const std::string &s);
708 /** Return true if a nickname is valid
709 * @param n A nickname to verify
710 * @return True if the nick is valid
712 caller1<bool, const char*> IsNick;
714 /** Return true if an ident is valid
715 * @param An ident to verify
716 * @return True if the ident is valid
718 caller1<bool, const char*> IsIdent;
720 /** Find a username by their file descriptor.
721 * It is preferred to use this over directly accessing the fd_ref_table array.
722 * @param socket The file descriptor of a user
723 * @return A pointer to the user if the user exists locally on this descriptor
725 caller1<User*, int> FindDescriptor;
727 /** Add a new mode to this server's mode parser
728 * @param mh The modehandler to add
729 * @return True if the mode handler was added
731 bool AddMode(ModeHandler* mh);
733 /** Add a new mode watcher to this server's mode parser
734 * @param mw The modewatcher to add
735 * @return True if the modewatcher was added
737 bool AddModeWatcher(ModeWatcher* mw);
739 /** Delete a mode watcher from this server's mode parser
740 * @param mw The modewatcher to delete
741 * @return True if the modewatcher was deleted
743 bool DelModeWatcher(ModeWatcher* mw);
745 /** Add a dns Resolver class to this server's active set
746 * @param r The resolver to add
747 * @param cached If this value is true, then the cache will
748 * be searched for the DNS result, immediately. If the value is
749 * false, then a request will be sent to the nameserver, and the
750 * result will not be immediately available. You should usually
751 * use the boolean value which you passed to the Resolver
752 * constructor, which Resolver will set appropriately depending
753 * on if cached results are available and haven't expired. It is
754 * however safe to force this value to false, forcing a remote DNS
755 * lookup, but not an update of the cache.
756 * @return True if the operation completed successfully. Note that
757 * if this method returns true, you should not attempt to access
758 * the resolver class you pass it after this call, as depending upon
759 * the request given, the object may be deleted!
761 bool AddResolver(Resolver* r, bool cached);
763 /** Add a command to this server's command parser
764 * @param f A Command command handler object to add
765 * @throw ModuleException Will throw ModuleExcption if the command already exists
767 void AddCommand(Command *f);
769 /** Send a modechange.
770 * The parameters provided are identical to that sent to the
771 * handler for class cmd_mode.
772 * @param parameters The mode parameters
773 * @param pcnt The number of items you have given in the first parameter
774 * @param user The user to send error messages to
776 void SendMode(const char **parameters, int pcnt, User *user);
778 /** Match two strings using pattern matching.
779 * This operates identically to the global function match(),
780 * except for that it takes std::string arguments rather than
782 * @param sliteral The literal string to match against
783 * @param spattern The pattern to match against. CIDR and globs are supported.
785 bool MatchText(const std::string &sliteral, const std::string &spattern);
787 /** Call the handler for a given command.
788 * @param commandname The command whos handler you wish to call
789 * @param parameters The mode parameters
790 * @param pcnt The number of items you have given in the first parameter
791 * @param user The user to execute the command as
792 * @return True if the command handler was called successfully
794 CmdResult CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, User* user);
796 /** Return true if the command is a module-implemented command and the given parameters are valid for it
797 * @param parameters The mode parameters
798 * @param pcnt The number of items you have given in the first parameter
799 * @param user The user to test-execute the command as
800 * @return True if the command handler is a module command, and there are enough parameters and the user has permission to the command
802 bool IsValidModuleCommand(const std::string &commandname, int pcnt, User* user);
804 /** Return true if the given parameter is a valid nick!user\@host mask
805 * @param mask A nick!user\@host masak to match against
806 * @return True i the mask is valid
808 bool IsValidMask(const std::string &mask);
810 /** Rehash the local server
814 /** Return the channel whos index number matches that provided
815 * @param The index number of the channel to fetch
816 * @return A channel record, or NUll if index < 0 or index >= InspIRCd::ChannelCount()
818 Channel* GetChannelIndex(long index);
820 /** Dump text to a user target, splitting it appropriately to fit
821 * @param User the user to dump the text to
822 * @param LinePrefix text to prefix each complete line with
823 * @param TextStream the text to send to the user
825 void DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream);
827 /** Check if the given nickmask matches too many users, send errors to the given user
828 * @param nick A nickmask to match against
829 * @param user A user to send error text to
830 * @return True if the nick matches too many users
832 bool NickMatchesEveryone(const std::string &nick, User* user);
834 /** Check if the given IP mask matches too many users, send errors to the given user
835 * @param ip An ipmask to match against
836 * @param user A user to send error text to
837 * @return True if the ip matches too many users
839 bool IPMatchesEveryone(const std::string &ip, User* user);
841 /** Check if the given hostmask matches too many users, send errors to the given user
842 * @param mask A hostmask to match against
843 * @param user A user to send error text to
844 * @return True if the host matches too many users
846 bool HostMatchesEveryone(const std::string &mask, User* user);
848 /** Calculate a duration in seconds from a string in the form 1y2w3d4h6m5s
849 * @param str A string containing a time in the form 1y2w3d4h6m5s
850 * (one year, two weeks, three days, four hours, six minutes and five seconds)
851 * @return The total number of seconds
853 long Duration(const std::string &str);
855 /** Attempt to compare an oper password to a string from the config file.
856 * This will be passed to handling modules which will compare the data
857 * against possible hashed equivalents in the input string.
858 * @param data The data from the config file
859 * @param input The data input by the oper
860 * @param tagnum the tag number of the oper's tag in the config file
861 * @return 0 if the strings match, 1 or -1 if they do not
863 int OperPassCompare(const char* data,const char* input, int tagnum);
865 /** Check if a given server is a uline.
866 * An empty string returns true, this is by design.
867 * @param server The server to check for uline status
868 * @return True if the server is a uline OR the string is empty
870 bool ULine(const char* server);
872 /** Returns true if the uline is 'silent' (doesnt generate
873 * remote connect notices etc).
875 bool SilentULine(const char* server);
877 /** Returns the subversion revision ID of this ircd
878 * @return The revision ID or an empty string
880 std::string GetRevision();
882 /** Returns the full version string of this ircd
883 * @return The version string
885 std::string GetVersionString();
887 /** Attempt to write the process id to a given file
888 * @param filename The PID file to attempt to write to
889 * @return This function may bail if the file cannot be written
891 void WritePID(const std::string &filename);
893 /** This constructor initialises all the subsystems and reads the config file.
894 * @param argc The argument count passed to main()
895 * @param argv The argument list passed to main()
896 * @throw <anything> If anything is thrown from here and makes it to
897 * you, you should probably just give up and go home. Yes, really.
898 * It's that bad. Higher level classes should catch any non-fatal exceptions.
900 InspIRCd(int argc, char** argv);
902 /** Output a log message to the ircd.log file
903 * The text will only be output if the current loglevel
904 * is less than or equal to the level you provide
905 * @param level A log level from the DebugLevel enum
906 * @param text Format string of to write to the log
907 * @param ... Format arguments of text to write to the log
909 void Log(int level, const char* text, ...);
911 /** Output a log message to the ircd.log file
912 * The text will only be output if the current loglevel
913 * is less than or equal to the level you provide
914 * @param level A log level from the DebugLevel enum
915 * @param text Text to write to the log
917 void Log(int level, const std::string &text);
919 /** Send a line of WHOIS data to a user.
920 * @param user user to send the line to
921 * @param dest user being WHOISed
922 * @param numeric Numeric to send
923 * @param text Text of the numeric
925 void SendWhoisLine(User* user, User* dest, int numeric, const std::string &text);
927 /** Send a line of WHOIS data to a user.
928 * @param user user to send the line to
929 * @param dest user being WHOISed
930 * @param numeric Numeric to send
931 * @param format Format string for the numeric
932 * @param ... Parameters for the format string
934 void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...);
936 /** Quit a user for excess flood, and if they are not
937 * fully registered yet, temporarily zline their IP.
938 * @param current user to quit
940 caller1<void, User*> FloodQuitUser;
942 /** Restart the server.
943 * This function will not return. If an error occurs,
944 * it will throw an instance of CoreException.
945 * @param reason The restart reason to show to all clients
946 * @throw CoreException An instance of CoreException indicating the error from execv().
948 void Restart(const std::string &reason);
950 /** Prepare the ircd for restart or shutdown.
951 * This function unloads all modules which can be unloaded,
952 * closes all open sockets, and closes the logfile.
956 /** This copies the user and channel hash_maps into new hash maps.
957 * This frees memory used by the hash_map allocator (which it neglects
958 * to free, most of the time, using tons of ram)
960 void RehashUsersAndChans();
962 /** Resets the cached max bans value on all channels.
967 /** Return a time_t as a human-readable string.
969 std::string TimeString(time_t curtime);
971 /** Begin execution of the server.
972 * NOTE: this function NEVER returns. Internally,
973 * it will repeatedly loop.
974 * @return The return value for this function is undefined.
978 /** Force all BufferedSockets to be removed which are due to
981 void BufferedSocketCull();
983 char* GetReadBuffer()
985 return this->ReadBuffer;