]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
s/xfrLabel/xfrName/ 2525/head
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Tue, 12 May 2015 18:54:12 +0000 (20:54 +0200)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Tue, 12 May 2015 18:54:57 +0000 (20:54 +0200)
pdns/dnsparser.hh
pdns/dnsrecords.cc
pdns/dnssecinfra.cc
pdns/dnswriter.cc
pdns/dnswriter.hh
pdns/nsecrecords.cc
pdns/rcpgenerator.cc
pdns/rcpgenerator.hh

index 5f0de674b2afe511214153ee3a2169d218282aea..4a09c75f09010cb904fe5ef08bbe11694041030e 100644 (file)
@@ -119,7 +119,7 @@ public:
   }
 
 
-  void xfrLabel(string &label, bool compress=false)
+  void xfrName(string &label, bool compress=false)
   {
     label=getLabel();
   }
index 402ded409589655066c751c7f570ff0bbb4dbff9..9f77397d7a7eba3e4fd4e38ae46e45fa6ee7affe 100644 (file)
@@ -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<pair<uint16_t, string> >& 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);
index 82d69733fc94b73e8390d477e28830fe5c0c6ef8..078159a68fa8345ce035b129cc488eec4eea59b1 100644 (file)
@@ -561,10 +561,10 @@ string makeTSIGMessageFromTSIGPacket(const string& opacket, unsigned int tsigOff
   vector<uint8_t> 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<uint8_t> 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);
index d94d963f78e3c0c7c30fcc3ab678dc4d98f0fcb3..5286439a25890c4233abe92179efc02cd7b1fb99 100644 (file)
@@ -26,7 +26,7 @@ DNSPacketWriter::DNSPacketWriter(vector<uint8_t>& 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 '"<<chopped<<"': "<<li->second<<endl;
       if (d_record.size() - startRecordSize + chopped.size() > 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:;
 }
index d5ef4b75d0a63132e741e5fd7d6e312f0abe897e..579a23c7688f0e35a4b41c9fc1eec3c6e412f6e4 100644 (file)
@@ -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);
index 9dc4994e32d14365575068bb9ad2e7299d723844..119b05f85e984db1d688552d38c4286f35a4f759 100644 (file)
@@ -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<uint16_t>::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<uint16_t>::const_iterator i=d_set.begin(); i!=d_set.end(); ++i) {
     ret+=" ";
index f3fda6a745eabd161677b232d1d3f50482ec7690..447d2d04487fe7b8f50c11477d288a0a79d746ba 100644 (file)
@@ -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: "<<order<<", pref: "<<pref<<"\n";
   cout<<"flags: \""<<flags<<"\", services: \""<<services<<"\", regexp: \""<<regexp<<"\", replacement: "<<replacement<<"\n";
@@ -575,7 +575,7 @@ try
   rtw.xfrText(flags);
   rtw.xfrText(services);
   rtw.xfrText(regexp);
-  rtw.xfrLabel(replacement);
+  rtw.xfrName(replacement);
 
   cout<<"Regenerated: '"<<out<<"'\n";
   
index fb9aac9415413ee25a2ac3384b74b6a949de9a12..bd61b061c9f5cc7fd359a4c55ef5837381b5390e 100644 (file)
@@ -51,7 +51,7 @@ public:
   void xfrIP6(std::string& val);
   void xfrTime(uint32_t& val);
 
-  void xfrLabel(string& val, bool compress=false);
+  void xfrName(string& val, bool compress=false);
   void xfrText(string& val, bool multi=false);
   void xfrHexBlob(string& val, bool keepReading=false);
   void xfrBase32HexBlob(string& val);
@@ -82,7 +82,7 @@ public:
   void xfrBase32HexBlob(const string& val);
 
   void xfrType(const uint16_t& val);
-  void xfrLabel(const string& val, bool compress=false);
+  void xfrName(const string& val, bool compress=false);
   void xfrText(const string& val, bool multi=false);
   void xfrBlobNoSpaces(const string& val, int len=-1);
   void xfrBlob(const string& val, int len=-1);