From: Peter van Dijk Date: Tue, 12 May 2015 18:54:12 +0000 (+0200) Subject: s/xfrLabel/xfrName/ X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~28^2~49^2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2525%2Fhead;p=thirdparty%2Fpdns.git s/xfrLabel/xfrName/ --- diff --git a/pdns/dnsparser.hh b/pdns/dnsparser.hh index 5f0de674b2..4a09c75f09 100644 --- a/pdns/dnsparser.hh +++ b/pdns/dnsparser.hh @@ -119,7 +119,7 @@ public: } - void xfrLabel(string &label, bool compress=false) + void xfrName(string &label, bool compress=false) { label=getLabel(); } diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index 402ded4095..9f77397d7a 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -106,20 +106,20 @@ void ARecordContent::doRecordCheck(const DNSRecord& dr) boilerplate_conv(AAAA, QType::AAAA, conv.xfrIP6(d_ip6); ); -boilerplate_conv(NS, QType::NS, conv.xfrLabel(d_content, true)); -boilerplate_conv(PTR, QType::PTR, conv.xfrLabel(d_content, true)); -boilerplate_conv(CNAME, QType::CNAME, conv.xfrLabel(d_content, true)); -boilerplate_conv(ALIAS, QType::ALIAS, conv.xfrLabel(d_content, true)); -boilerplate_conv(DNAME, QType::DNAME, conv.xfrLabel(d_content)); -boilerplate_conv(MR, QType::MR, conv.xfrLabel(d_alias, true)); -boilerplate_conv(MINFO, QType::MINFO, conv.xfrLabel(d_rmailbx, true); conv.xfrLabel(d_emailbx, true)); +boilerplate_conv(NS, QType::NS, conv.xfrName(d_content, true)); +boilerplate_conv(PTR, QType::PTR, conv.xfrName(d_content, true)); +boilerplate_conv(CNAME, QType::CNAME, conv.xfrName(d_content, true)); +boilerplate_conv(ALIAS, QType::ALIAS, conv.xfrName(d_content, true)); +boilerplate_conv(DNAME, QType::DNAME, conv.xfrName(d_content)); +boilerplate_conv(MR, QType::MR, conv.xfrName(d_alias, true)); +boilerplate_conv(MINFO, QType::MINFO, conv.xfrName(d_rmailbx, true); conv.xfrName(d_emailbx, true)); boilerplate_conv(TXT, QType::TXT, conv.xfrText(d_text, true)); boilerplate_conv(SPF, 99, conv.xfrText(d_text, true)); boilerplate_conv(HINFO, QType::HINFO, conv.xfrText(d_cpu); conv.xfrText(d_host)); boilerplate_conv(RP, QType::RP, - conv.xfrLabel(d_mbox); - conv.xfrLabel(d_info) + conv.xfrName(d_mbox); + conv.xfrName(d_info) ); @@ -146,7 +146,7 @@ void OPTRecordContent::getData(vector >& options) } boilerplate_conv(TSIG, QType::TSIG, - conv.xfrLabel(d_algoName); + conv.xfrName(d_algoName); conv.xfr48BitInt(d_time); conv.xfr16BitInt(d_fudge); uint16_t size=d_mac.size(); @@ -165,12 +165,12 @@ MXRecordContent::MXRecordContent(uint16_t preference, const string& mxname) : DN boilerplate_conv(MX, QType::MX, conv.xfr16BitInt(d_preference); - conv.xfrLabel(d_mxname, true); + conv.xfrName(d_mxname, true); ) boilerplate_conv(KX, QType::KX, conv.xfr16BitInt(d_preference); - conv.xfrLabel(d_exchanger, false); + conv.xfrName(d_exchanger, false); ) boilerplate_conv(IPSECKEY, QType::IPSECKEY, @@ -189,7 +189,7 @@ boilerplate_conv(IPSECKEY, QType::IPSECKEY, conv.xfrIP6(d_ip6); break; case 3: // DNS label - conv.xfrLabel(d_gateway, false); + conv.xfrName(d_gateway, false); break; default: throw MOADNSException("Parsing record content: invalid gateway type"); @@ -214,14 +214,14 @@ boilerplate_conv(DHCID, 49, boilerplate_conv(AFSDB, QType::AFSDB, conv.xfr16BitInt(d_subtype); - conv.xfrLabel(d_hostname); + conv.xfrName(d_hostname); ) boilerplate_conv(NAPTR, QType::NAPTR, conv.xfr16BitInt(d_order); conv.xfr16BitInt(d_preference); conv.xfrText(d_flags); conv.xfrText(d_services); conv.xfrText(d_regexp); - conv.xfrLabel(d_replacement); + conv.xfrName(d_replacement); ) @@ -231,7 +231,7 @@ SRVRecordContent::SRVRecordContent(uint16_t preference, uint16_t weight, uint16_ boilerplate_conv(SRV, QType::SRV, conv.xfr16BitInt(d_preference); conv.xfr16BitInt(d_weight); conv.xfr16BitInt(d_port); - conv.xfrLabel(d_target); + conv.xfrName(d_target); ) SOARecordContent::SOARecordContent(const string& mname, const string& rname, const struct soatimes& st) @@ -241,8 +241,8 @@ SOARecordContent::SOARecordContent(const string& mname, const string& rname, con } boilerplate_conv(SOA, QType::SOA, - conv.xfrLabel(d_mname, true); - conv.xfrLabel(d_rname, true); + conv.xfrName(d_mname, true); + conv.xfrName(d_rname, true); conv.xfr32BitInt(d_st.serial); conv.xfr32BitInt(d_st.refresh); conv.xfr32BitInt(d_st.retry); @@ -305,7 +305,7 @@ boilerplate_conv(RRSIG, 46, conv.xfrTime(d_sigexpire); conv.xfrTime(d_siginception); conv.xfr16BitInt(d_tag); - conv.xfrLabel(d_signer); + conv.xfrName(d_signer); conv.xfrBlob(d_signature); ) @@ -414,7 +414,7 @@ string EUI64RecordContent::getZoneRepresentation() const /* EUI64 end */ boilerplate_conv(TKEY, QType::TKEY, - conv.xfrLabel(d_algo); + conv.xfrName(d_algo); conv.xfr32BitInt(d_inception); conv.xfr32BitInt(d_expiration); conv.xfr16BitInt(d_mode); diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index 82d69733fc..078159a68f 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -561,10 +561,10 @@ string makeTSIGMessageFromTSIGPacket(const string& opacket, unsigned int tsigOff vector signVect; DNSPacketWriter dw(signVect, "", 0); if(!timersonly) { - dw.xfrLabel(keyname, false); + dw.xfrName(keyname, false); dw.xfr16BitInt(QClass::ANY); // class dw.xfr32BitInt(0); // TTL - dw.xfrLabel(toLower(trc.d_algoName), false); + dw.xfrName(toLower(trc.d_algoName), false); } uint32_t now = trc.d_time; @@ -625,10 +625,10 @@ void addTSIG(DNSPacketWriter& pw, TSIGRecordContent* trc, const string& tsigkeyn vector signVect; DNSPacketWriter dw(signVect, "", 0); if(!timersonly) { - dw.xfrLabel(tsigkeyname, false); + dw.xfrName(tsigkeyname, false); dw.xfr16BitInt(QClass::ANY); // class dw.xfr32BitInt(0); // TTL - dw.xfrLabel(trc->d_algoName, false); + dw.xfrName(trc->d_algoName, false); } uint32_t now = trc->d_time; dw.xfr48BitInt(now); diff --git a/pdns/dnswriter.cc b/pdns/dnswriter.cc index d94d963f78..5286439a25 100644 --- a/pdns/dnswriter.cc +++ b/pdns/dnswriter.cc @@ -26,7 +26,7 @@ DNSPacketWriter::DNSPacketWriter(vector& content, const string& qname, memcpy(dptr, ptr, sizeof(dnsheader)); d_stuff=0; - xfrLabel(qname, false); + xfrName(qname, false); len=d_content.size(); d_content.resize(len + d_record.size() + 4); @@ -76,7 +76,7 @@ void DNSPacketWriter::startRecord(const string& name, uint16_t qtype, uint32_t t d_content.insert(d_content.end(), (const char *) &marker[0], (const char *) &marker[2]); } else { - xfrLabel(d_recordqname, compress); + xfrName(d_recordqname, compress); d_content.insert(d_content.end(), d_record.begin(), d_record.end()); d_record.clear(); } @@ -196,7 +196,7 @@ bool labeltokUnescape(labelparts_t& parts, const string& label) } // this is the absolute hottest function in the pdns recursor -void DNSPacketWriter::xfrLabel(const string& Label, bool compress) +void DNSPacketWriter::xfrName(const string& Label, bool compress) { string label = d_lowerCase ? toLower(Label) : Label; labelparts_t parts; @@ -231,7 +231,7 @@ void DNSPacketWriter::xfrLabel(const string& Label, bool compress) if(compress && (li=find(d_labelmap, chopped))!=d_labelmap.end()) { // cerr<<"\tFound a compression pointer to '"<second< 253) // chopped does not include a length octet for the first label and the root label - throw MOADNSException("DNSPacketWriter::xfrLabel() found overly large (compressed) name"); + throw MOADNSException("DNSPacketWriter::xfrName() found overly large (compressed) name"); uint16_t offset=li->second; offset|=0xc000; d_record.push_back((char)(offset >> 8)); @@ -270,14 +270,14 @@ void DNSPacketWriter::xfrLabel(const string& Label, bool compress) } if(pos - startPos == 1) - throw MOADNSException("DNSPacketWriter::xfrLabel() found empty label in the middle of name"); + throw MOADNSException("DNSPacketWriter::xfrName() found empty label in the middle of name"); if(pos - startPos > 64) - throw MOADNSException("DNSPacketWriter::xfrLabel() found overly large label in name"); + throw MOADNSException("DNSPacketWriter::xfrName() found overly large label in name"); } d_record.push_back(0); // insert root label if (d_record.size() - startRecordSize > 255) - throw MOADNSException("DNSPacketWriter::xfrLabel() found overly large name"); + throw MOADNSException("DNSPacketWriter::xfrName() found overly large name"); out:; } diff --git a/pdns/dnswriter.hh b/pdns/dnswriter.hh index d5ef4b75d0..579a23c768 100644 --- a/pdns/dnswriter.hh +++ b/pdns/dnswriter.hh @@ -86,7 +86,7 @@ public: void xfr8BitInt(uint8_t val); - void xfrLabel(const string& label, bool compress=false); + void xfrName(const string& label, bool compress=false); void xfrText(const string& text, bool multi=false); void xfrBlob(const string& blob, int len=-1); void xfrBlobNoSpaces(const string& blob, int len=-1); diff --git a/pdns/nsecrecords.cc b/pdns/nsecrecords.cc index 9dc4994e32..119b05f85e 100644 --- a/pdns/nsecrecords.cc +++ b/pdns/nsecrecords.cc @@ -16,7 +16,7 @@ DNSRecordContent* NSECRecordContent::make(const string& content) NSECRecordContent::NSECRecordContent(const string& content, const string& zone) : DNSRecordContent(47) { RecordTextReader rtr(content, zone); - rtr.xfrLabel(d_next); + rtr.xfrName(d_next); while(!rtr.eof()) { uint16_t type; @@ -27,7 +27,7 @@ NSECRecordContent::NSECRecordContent(const string& content, const string& zone) void NSECRecordContent::toPacket(DNSPacketWriter& pw) { - pw.xfrLabel(d_next); + pw.xfrName(d_next); uint8_t res[34]; set::const_iterator i; @@ -63,7 +63,7 @@ void NSECRecordContent::toPacket(DNSPacketWriter& pw) NSECRecordContent::DNSRecordContent* NSECRecordContent::make(const DNSRecord &dr, PacketReader& pr) { NSECRecordContent* ret=new NSECRecordContent(); - pr.xfrLabel(ret->d_next); + pr.xfrName(ret->d_next); string bitmap; pr.xfrBlob(bitmap); @@ -98,7 +98,7 @@ string NSECRecordContent::getZoneRepresentation() const { string ret; RecordTextWriter rtw(ret); - rtw.xfrLabel(d_next); + rtw.xfrName(d_next); for(set::const_iterator i=d_set.begin(); i!=d_set.end(); ++i) { ret+=" "; diff --git a/pdns/rcpgenerator.cc b/pdns/rcpgenerator.cc index f3fda6a745..447d2d0448 100644 --- a/pdns/rcpgenerator.cc +++ b/pdns/rcpgenerator.cc @@ -79,7 +79,7 @@ void RecordTextReader::xfrTime(uint32_t &val) memset(&tm, 0, sizeof(tm)); string tmp; - xfrLabel(tmp); // ends on number, so this works + xfrName(tmp); // ends on number, so this works sscanf(tmp.c_str(), "%04d%02d%02d" "%02d%02d%02d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, @@ -184,7 +184,7 @@ void RecordTextReader::xfr8BitInt(uint8_t &val) } // this code should leave all the escapes around -void RecordTextReader::xfrLabel(string& val, bool) +void RecordTextReader::xfrName(string& val, bool) { skipSpaces(); val.clear(); @@ -498,7 +498,7 @@ void RecordTextWriter::xfr8BitInt(const uint8_t& val) } // should not mess with the escapes -void RecordTextWriter::xfrLabel(const string& val, bool) +void RecordTextWriter::xfrName(const string& val, bool) { if(!d_string.empty()) d_string.append(1,' '); @@ -562,7 +562,7 @@ try rtr.xfrText(flags); rtr.xfrText(services); rtr.xfrText(regexp); - rtr.xfrLabel(replacement); + rtr.xfrName(replacement); cout<<"order: "<