void emitNSEC3(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const NSEC3PARAMRecordContent &ns3prc, const DNSName& name, const string& namehash, const string& nexthash, int mode);
int processUpdate(DNSPacket& p);
int forwardPacket(const string &msgPrefix, const DNSPacket& p, const DomainInfo& di);
- int checkUpdatePrescan(const DNSRecord *rr);
- int checkUpdatePrerequisites(const DNSRecord *rr, DomainInfo *di);
void makeNXDomain(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const DNSName& target, const DNSName& wildcard);
void makeNOError(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const DNSName& target, const DNSName& wildcard, int mode);
// Context data for RFC2136 operation
struct updateContext {
- const DomainInfo *di;
- bool isPresigned;
+ const DomainInfo *di{nullptr};
+ bool isPresigned{false};
// The following may be modified
- bool narrow;
- bool haveNSEC3;
- NSEC3PARAMRecordContent ns3pr;
- bool updatedSerial;
+ bool narrow{false};
+ bool haveNSEC3{false};
+ NSEC3PARAMRecordContent ns3pr{};
+ bool updatedSerial{false};
};
static void increaseSerial(const string& msgPrefix, const string& soaEditSetting, const updateContext& ctx);
// Implement section 3.2.1 and 3.2.2 of RFC2136
// NOLINTNEXTLINE(readability-identifier-length)
-int PacketHandler::checkUpdatePrerequisites(const DNSRecord* rr, DomainInfo* di)
+static int checkUpdatePrerequisites(const DNSRecord* rr, DomainInfo* di)
{
if (rr->d_ttl != 0) {
return RCode::FormErr;
// Method implements section 3.4.1 of RFC2136
// NOLINTNEXTLINE(readability-identifier-length)
-int PacketHandler::checkUpdatePrescan(const DNSRecord* rr)
+static int checkUpdatePrescan(const DNSRecord* rr)
{
// The RFC stats that d_class != ZCLASS, but we only support the IN class.
if (rr->d_class != QClass::IN && rr->d_class != QClass::NONE && rr->d_class != QClass::ANY) {
// Caller has checked that we are allowed to insert the record and has handled
// the NSEC3PARAM case already.
// ctx is not const, may update updateSerial
+// NOLINTNEXTLINE(readability-function-cognitive-complexity)
static uint performInsert(const string& msgPrefix, const DNSRecord* rr, updateContext& ctx, vector<DNSResourceRecord>& rrset, set<DNSName>& insnonterm, set<DNSName>& delnonterm) // NOLINT(readability-identifier-length)
{
uint changedRecords = 0;
// the code that calls this performUpdate().
// Caller has checked that we are allowed to delete the record and has handled
// the NSEC3PARAM case already.
+// NOLINTNEXTLINE(readability-function-cognitive-complexity)
static uint performDelete(const string& msgPrefix, const DNSRecord* rr, const updateContext& ctx, vector<DNSResourceRecord>& rrset, set<DNSName>& insnonterm, set<DNSName>& delnonterm) // NOLINT(readability-identifier-length)
{
vector<DNSResourceRecord> recordsToDelete;