]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules/dns.h
core_dns Don't store query class code in Question
[user/henk/code/inspircd.git] / include / modules / dns.h
index 400d2085d450d55b53f5772860b082e30e1d3283..f4071e399ce5c391845de31f37808e9156acfcbd 100644 (file)
@@ -68,6 +68,8 @@ namespace DNS
                ERROR_INVALIDTYPE
        };
 
+       typedef uint16_t RequestId;
+
        const int PORT = 53;
 
        /**
@@ -86,11 +88,10 @@ namespace DNS
        {
                std::string name;
                QueryType type;
-               unsigned short qclass;
 
-               Question() : type(QUERY_NONE), qclass(0) { }
-               Question(const std::string& n, QueryType t, unsigned short c = 1) : name(n), type(t), qclass(c) { }
-               inline bool operator==(const Question& other) const { return name == other.name && type == other.type && qclass == other.qclass; }
+               Question() : type(QUERY_NONE) { }
+               Question(const std::string& n, QueryType t) : name(n), type(t) { }
+               bool operator==(const Question& other) const { return ((name == other.name) && (type == other.type)); }
 
                struct hash
                {
@@ -107,7 +108,7 @@ namespace DNS
                std::string rdata;
                time_t created;
 
-               ResourceRecord(const std::string& n, QueryType t, unsigned short c = 1) : Question(n, t, c), ttl(0), created(ServerInstance->Time()) { }
+               ResourceRecord(const std::string& n, QueryType t) : Question(n, t), ttl(0), created(ServerInstance->Time()) { }
                ResourceRecord(const Question& question) : Question(question), ttl(0), created(ServerInstance->Time()) { }
        };
 
@@ -147,7 +148,7 @@ namespace DNS
                /* Use result cache if available */
                bool use_cache;
                /* Request id */
-               unsigned short id;
+               RequestId id;
                /* Creator of this request */
                Module* const creator;