diff options
| author | Adam <Adam@anope.org> | 2013-05-05 01:57:24 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-05-05 01:57:24 -0400 |
| commit | 2044b4d3ad9dbdfd5c6c6573261a7c4bfd9e2878 (patch) | |
| tree | 8693321490f29c3ba588bb0778a9f28b4cc292b2 /modules/dns.h | |
| parent | 1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b (diff) | |
Cleanup of dns stuff based on stuff found making inspircd's module
Diffstat (limited to 'modules/dns.h')
| -rw-r--r-- | modules/dns.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/modules/dns.h b/modules/dns.h index 469bb0e82..99b84098f 100644 --- a/modules/dns.h +++ b/modules/dns.h @@ -76,9 +76,18 @@ namespace DNS Question() : type(QUERY_NONE), qclass(0) { } Question(const Anope::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; } + + struct hash + { + size_t operator()(const Question &q) const + { + return Anope::hash_ci()(q.name); + } + }; }; - struct ResourceRecord : public Question + struct ResourceRecord : Question { unsigned int ttl; Anope::string rdata; @@ -98,16 +107,6 @@ namespace DNS Query(const Question &q) : error(ERROR_NONE) { questions.push_back(q); } }; - class Packet : public Query - { - public: - static const int POINTER = 0xC0; - static const int LABEL = 0x3F; - static const int HEADER_LENGTH = 12; - - virtual ~Packet() { } - }; - class ReplySocket; class Request; |
