aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-13 07:44:32 +0000
committerGravatar Sadie Powell2023-01-13 07:46:47 +0000
commit713b57749674beb77f1bedbec984776ad4d5a8ca (patch)
treedf7315487d8c8f36855d24f8cf2cf01510e9b870 /include
parentAdd a new cloak system that cloaks using HMAC-SHA256. (diff)
parentFix core_dns rejecting simple hostnames. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'include')
-rw-r--r--include/inspircd.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 38de778de..80db54b01 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -327,9 +327,16 @@ public:
/** Determines whether a hostname is valid according to RFC 5891 rules.
* @param host The hostname to validate.
+ * @param allowsimple Whether to allow simple hostnames (e.g. localhost).
* @return True if the hostname is valid; otherwise, false.
*/
- static bool IsHost(const std::string& host);
+ static bool IsHost(const std::string& host, bool allowsimple);
+
+ /** Determines whether a fully qualified hostname is valid according to RFC 5891 rules.
+ * @param host The hostname to validate.
+ * @return True if the hostname is valid; otherwise, false.
+ */
+ inline static bool IsFQDN(const std::string& host) { return IsHost(host, false); }
/** Return true if str looks like a server ID
* @param sid string to check against