diff options
Diffstat (limited to 'dnsdist-cache.hh')
-rw-r--r-- | dnsdist-cache.hh | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/dnsdist-cache.hh b/dnsdist-cache.hh index d8837be..95667bd 100644 --- a/dnsdist-cache.hh +++ b/dnsdist-cache.hh @@ -45,15 +45,15 @@ public: bool isFull(); string toString(); uint64_t getSize(); - uint64_t getHits() const { return d_hits; } - uint64_t getMisses() const { return d_misses; } - uint64_t getDeferredLookups() const { return d_deferredLookups; } - uint64_t getDeferredInserts() const { return d_deferredInserts; } - uint64_t getLookupCollisions() const { return d_lookupCollisions; } - uint64_t getInsertCollisions() const { return d_insertCollisions; } + uint64_t getHits() const { return d_hits.load(); } + uint64_t getMisses() const { return d_misses.load(); } + uint64_t getDeferredLookups() const { return d_deferredLookups.load(); } + uint64_t getDeferredInserts() const { return d_deferredInserts.load(); } + uint64_t getLookupCollisions() const { return d_lookupCollisions.load(); } + uint64_t getInsertCollisions() const { return d_insertCollisions.load(); } uint64_t getMaxEntries() const { return d_maxEntries; } - uint64_t getTTLTooShorts() const { return d_ttlTooShorts; } - uint64_t getCleanupCount() const { return d_cleanupCount; } + uint64_t getTTLTooShorts() const { return d_ttlTooShorts.load(); } + uint64_t getCleanupCount() const { return d_cleanupCount.load(); } uint64_t getEntriesCount(); uint64_t dump(int fd); @@ -75,12 +75,14 @@ public: d_keepStaleData = keep; } - void setECSParsingEnabled(bool enabled) { d_parseECS = enabled; } + void setMaximumEntrySize(size_t maxSize); + size_t getMaximumEntrySize() const { return d_maximumEntrySize; } + uint32_t getKey(const DNSName::string_t& qname, size_t qnameWireLength, const PacketBuffer& packet, bool receivedOverUDP); static uint32_t getMinTTL(const char* packet, uint16_t length, bool* seenNoDataSOA); @@ -139,15 +141,16 @@ private: pdns::stat_t d_ttlTooShorts{0}; pdns::stat_t d_cleanupCount{0}; - size_t d_maxEntries; - uint32_t d_shardCount; - uint32_t d_maxTTL; - uint32_t d_tempFailureTTL; - uint32_t d_maxNegativeTTL; - uint32_t d_minTTL; - uint32_t d_staleTTL; - bool d_dontAge; - bool d_deferrableInsertLock; + const size_t d_maxEntries; + size_t d_maximumEntrySize{4096}; + const uint32_t d_shardCount; + const uint32_t d_maxTTL; + const uint32_t d_tempFailureTTL; + const uint32_t d_maxNegativeTTL; + const uint32_t d_minTTL; + const uint32_t d_staleTTL; + const bool d_dontAge; + const bool d_deferrableInsertLock; bool d_parseECS; bool d_keepStaleData{false}; }; |