]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/configreader.h
Add fixes to stop people changing the SID of a live server - certain configuration...
[user/henk/code/inspircd.git] / include / configreader.h
index d8fa3b418075c7d2977167aa958a18074998e582..3120d3d59b69fb5267b9f3fc7eb5ef7a90b8ce50 100644 (file)
@@ -49,7 +49,8 @@ enum ConfigDataType
        DT_IPADDRESS     = 6,           /* IP address (v4, v6) */
        DT_CHANNEL       = 7,           /* Channel name */
        DT_ALLOW_WILD    = 64,          /* Allow wildcards/CIDR in DT_IPADDRESS */
-       DT_ALLOW_NEWLINE = 128          /* New line characters allowed in DT_CHARPTR */
+       DT_ALLOW_NEWLINE = 128,         /* New line characters allowed in DT_CHARPTR */
+       DT_BOOTONLY      = 256          /* Can only be set on startup, not on rehash */
 };
 
 /** Holds a config value, either string, integer or boolean.
@@ -172,7 +173,7 @@ struct InitialConfig
        /** Value containers */
        ValueContainerBase* val;
        /** Data types */
-       ConfigDataType datatype;
+       int datatype;
        /** Validation function */
        Validator validation_function;
 };
@@ -230,11 +231,7 @@ class CoreExport ServerConfig : public Extensible
         * configutation, appending errors to errorstream
         * and setting error if an error has occured.
         */
-       bool ParseLine(ConfigDataHash &target, std::string &line, long &linenumber, std::ostringstream &errorstream, int pass, std::istream* scan_for_includes_only);
-  
-       /** Process an include directive
-        */
-       bool DoInclude(ConfigDataHash &target, const std::string &file, std::ostringstream &errorstream, int pass, std::istream* scan_for_includes_only);
+       bool ParseLine(ConfigDataHash &target, std::string &line, long &linenumber, std::ostringstream &errorstream);
 
        /** Check that there is only one of each configuration item
         */
@@ -242,6 +239,18 @@ class CoreExport ServerConfig : public Extensible
 
  public:
 
+       /** Process an include executable directive
+        */
+       bool DoPipe(ConfigDataHash &target, const std::string &file, std::ostringstream &errorstream);
+
+       /** Process an include file directive
+        */
+       bool DoInclude(ConfigDataHash &target, const std::string &file, std::ostringstream &errorstream);
+
+       User* RehashUser;
+
+       std::string RehashParameter;
+
        std::ostringstream errstr;
 
        ConfigDataHash newconfig;
@@ -658,7 +667,7 @@ class CoreExport ServerConfig : public Extensible
         * and initialize this class. All other methods
         * should be used only by the core.
         */
-       void Read(bool bail, User* user, int pass);
+       void Read(bool bail, User* user);
 
        /** Read a file into a file_cache object
         */
@@ -675,12 +684,12 @@ class CoreExport ServerConfig : public Extensible
        /** Load 'filename' into 'target', with the new config parser everything is parsed into
         * tag/key/value at load-time rather than at read-value time.
         */
-       bool LoadConf(ConfigDataHash &target, const char* filename, std::ostringstream &errorstream, int pass, std::istream* scan_for_includs_only);
+       bool LoadConf(ConfigDataHash &target, FILE* &conf, const char* filename, std::ostringstream &errorstream);
 
        /** Load 'filename' into 'target', with the new config parser everything is parsed into
         * tag/key/value at load-time rather than at read-value time.
         */
-       bool LoadConf(ConfigDataHash &target, const std::string &filename, std::ostringstream &errorstream, int pass, std::istream* scan_for_includs_only = NULL);
+       bool LoadConf(ConfigDataHash &target, FILE* &conf, const std::string &filename, std::ostringstream &errorstream);
        
        /* Both these return true if the value existed or false otherwise */