]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Reduce size of max number of bytes in a bitfield from a 4 or 8 byte field to a 1...
[user/henk/code/inspircd.git] / include / inspircd.h
index 568c6a6a52af8c0bd4b1f3a22696665ed5836f6c..7fecf22ae9fd7f5dae85ca533f01d814d2433cae 100644 (file)
@@ -190,6 +190,9 @@ class FileLogger : public EventHandler
        virtual ~FileLogger();
 };
 
+/** A list of failed port bindings, used for informational purposes on startup */
+typedef std::vector<std::pair<std::string, long> > FailedPortList;
+
 class XLineManager;
 
 /** The main class of the irc server.
@@ -339,6 +342,11 @@ class InspIRCd : public classbase
         */
        FileLogger* Logger;
 
+       /** Time offset in seconds
+        * This offset is added to all calls to Time(). Use SetTimeDelta() to update
+        */
+       int time_delta;
+
  public:
         /** List of server names we've seen.
         */
@@ -393,6 +401,10 @@ class InspIRCd : public classbase
         */
        irc::whowas::whowas_users whowas;
 
+       /** Whowas container, contains a map of time_t to users tracked by WHOWAS
+        */
+       irc::whowas::whowas_users_fifo whowas_fifo;
+
        /** DNS class, provides resolver facilities to the core and modules
         */
        DNS* Res;
@@ -424,9 +436,18 @@ class InspIRCd : public classbase
        /** Get the current time
         * Because this only calls time() once every time around the mainloop,
         * it is much faster than calling time() directly.
+        * @param delta True to use the delta as an offset, false otherwise
         * @return The current time as an epoch value (time_t)
         */
-       time_t Time();
+       time_t Time(bool delta = false);
+
+       /** Set the time offset in seconds
+        * This offset is added to Time() to offset the system time by the specified
+        * number of seconds.
+        * @param delta The number of seconds to offset
+        * @return The old time delta
+        */
+       int SetTimeDelta(int delta);
 
        /** Process a user whos socket has been flagged as active
         * @param cu The user to process
@@ -451,7 +472,7 @@ class InspIRCd : public classbase
         * @param found_ports The actual number of ports found in the config, as opposed to the number actually bound
         * @return The number of ports actually bound without error
         */
-       int BindPorts(bool bail, int &found_ports);
+       int BindPorts(bool bail, int &found_ports, FailedPortList &failed_ports);
 
        /** Returns true if this server has the given port bound to the given address
         * @param port The port number