summaryrefslogtreecommitdiff
path: root/include/configreader.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-03 16:14:29 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-03 16:14:29 +0000
commit335a65f4188377a6d6a218fc225802ebbe1ec408 (patch)
treec9a7b3eeae7f31da3b574c5cd096842fdcadefb5 /include/configreader.h
parent85a79e990de2b1c05a161ea49857a9586567b8c2 (diff)
More anal config parsing, validates channel fields, ip address fields (with/without wildcard) hostname fields, fields which may not contain spaces
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8474 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/configreader.h')
-rw-r--r--include/configreader.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 1a14a2854..67fe2e2bf 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -44,7 +44,12 @@ enum ConfigDataType
DT_INTEGER = 1, /* Integer */
DT_CHARPTR = 2, /* Char pointer */
DT_BOOLEAN = 3, /* Boolean */
- DT_ALLOW_NEWLINE = 128 /* New line characters allowed */
+ DT_HOSTNAME = 4, /* Hostname syntax */
+ DT_NOSPACES = 5, /* No spaces */
+ 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 */
};
/** Holds a config value, either string, integer or boolean.
@@ -713,6 +718,12 @@ class CoreExport ServerConfig : public Extensible
/** Returns the numbers of vars inside the index'th 'tag in the config file
*/
int ConfVarEnum(ConfigDataHash &target, const std::string &tag, int index);
+
+ void ValidateHostname(const char* p, const std::string &tag, const std::string &val);
+
+ void ValidateIP(const char* p, const std::string &tag, const std::string &val, bool wild);
+
+ void ValidateNoSpaces(const char* p, const std::string &tag, const std::string &val);
/** Get a pointer to the module which has hooked the given port.
* @parameter port Port number