bool TinyDNSBackend::list(const DNSName &target, int domain_id, bool include_disabled) {
d_isAxfr=true;
- string key = target.toDNSString(); // FIXME bug: no lowercase here? or promise that from core?
+ string key = target.toDNSString(); // FIXME400 bug: no lowercase here? or promise that from core?
d_cdbReader=new CDB(getArg("dbfile"));
return d_cdbReader->searchSuffix(key);
}
bind("qtype",r.qtype.getName())->
bind("domain_id",r.domain_id)->
bind("disabled",r.disabled)->
- bind("qname",stripDot(r.qname.toString())); // FIXME lowercase?
+ bind("qname",stripDot(r.qname.toString())); // FIXME400 lowercase?
if (ordername == NULL)
d_InsertRecordOrderQuery_stmt->bindNull("ordername");
else
virtual SSqlStatement* bind(const string& name, unsigned long long value)=0;
virtual SSqlStatement* bind(const string& name, const std::string& value)=0;
SSqlStatement* bind(const string& name, const DNSName& value) {
- return bind(name, toLower(value.toStringNoDot())); // FIXME toLower()?
+ return bind(name, toLower(value.toStringNoDot())); // FIXME400 toLower()?
}
virtual SSqlStatement* bindNull(const string& name)=0;
virtual SSqlStatement* execute()=0;;
#include <time.h>
#include <sys/types.h>
class DNSBackend;
-class DNSName; // FIXME
+class DNSName; // FIXME400
struct SOAData
{
if(!sd.hostmaster.countLabels()) {
if (!arg().isEmpty("default-soa-mail")) {
sd.hostmaster=arg()["default-soa-mail"];
- // attodot(sd.hostmaster); FIXME
+ // attodot(sd.hostmaster); FIXME400
}
else
sd.hostmaster=DNSName("hostmaster")+domain;
bool DNSBackend::getBeforeAndAfterNames(uint32_t id, const DNSName& zonename, const DNSName& qname, DNSName& before, DNSName& after)
{
- // FIXME FIXME FIXME
- // string lcqname=toLower(qname); FIXME tolower?
- // string lczonename=toLower(zonename); FIXME tolower?
+ // FIXME400 FIXME400 FIXME400
+ // string lcqname=toLower(qname); FIXME400 tolower?
+ // string lczonename=toLower(zonename); FIXME400 tolower?
// lcqname=makeRelative(lcqname, lczonename);
DNSName lczonename = DNSName(toLower(zonename.toString()));
// lcqname=labelReverse(lcqname);
before = DNSName(labelReverse(sbefore)) + lczonename;
after = DNSName(labelReverse(safter)) + lczonename;
- // before=dotConcat(labelReverse(before), lczonename); FIXME
- // after=dotConcat(labelReverse(after), lczonename); FIXME
+ // before=dotConcat(labelReverse(before), lczonename); FIXME400
+ // after=dotConcat(labelReverse(after), lczonename); FIXME400
return ret;
}
string realinput;
if(input.empty() || input == ".") return ret;
- if(input[input.size()-1]!='.') realinput=input+"."; // FIXME YOLO
+ if(input[input.size()-1]!='.') realinput=input+"."; // FIXME400 YOLO
else realinput=input;
const char *p = realinput.c_str(), *pe = realinput.c_str() + realinput.length();
size_t hash_value(DNSName const& d)
{
boost::hash<string> hasher;
- return hasher(toLower(d.toString())); // FIXME HACK
+ return hasher(toLower(d.toString())); // FIXME400 HACK
}
string DNSName::escapeLabel(const std::string& label)
DNSName labelReverse() const;
bool isWildcard() const;
unsigned int countLabels() const;
- size_t length() const; // FIXME remove me?
+ size_t length() const; // FIXME400 remove me?
bool empty() const { return d_empty; }
bool isRoot() const { return !d_empty && d_storage.empty(); }
void clear() { d_storage.clear(); d_empty=true; }
return false;
}
- DNSName algoName = trc->d_algoName; // FIXME
+ DNSName algoName = trc->d_algoName; // FIXME400
if (algoName == "hmac-md5.sig-alg.reg.int")
algoName = "hmac-md5";
vector<uint8_t> d_record;
};
-//FIXME lots of overlap with DNSPacketWriter::xfrName
+//FIXME400 lots of overlap with DNSPacketWriter::xfrName
static const string EncodeDNSLabel(const DNSName& input)
{
if(!input.countLabels()) // otherwise we encode .. (long story)
xfrBlob(blob);
}
-//FIXME remove this method completely
+//FIXME400 remove this method completely
string simpleCompress(const string& elabel, const string& root)
{
string label=elabel;
- // FIXME: this relies on the semi-canonical escaped output from getName
+ // FIXME400: this relies on the semi-canonical escaped output from getName
if(strchr(label.c_str(), '\\')) {
boost::replace_all(label, "\\.", ".");
boost::replace_all(label, "\\032", " ");
}
-// FIXME this function needs to go
+// FIXME400 this function needs to go
void simpleExpandTo(const string& label, unsigned int frompos, string& ret)
{
unsigned int labellen=0;
void doRecordCheck(const struct DNSRecord&){}
- DNSName label; // FIXME rename
+ DNSName label; // FIXME400 rename
struct dnsrecordheader header;
typedef DNSRecordContent* makerfunc_t(const struct DNSRecord& dr, PacketReader& pr);
struct DNSRecord
{
- DNSName d_label; //FIXME rename
+ DNSName d_label; //FIXME400 rename
std::shared_ptr<DNSRecordContent> d_content;
uint16_t d_type;
uint16_t d_class;
if(rhs.d_content)
rzrp=toLower(rhs.d_content->getZoneRepresentation());
- string llabel=toLower(d_label.toString()); //FIXME
- string rlabel=toLower(rhs.d_label.toString()); //FIXME
+ string llabel=toLower(d_label.toString()); //FIXME400
+ string rlabel=toLower(rhs.d_label.toString()); //FIXME400
return
tie(llabel, d_type, d_class, lzrp) <
if(rhs.d_content)
rzrp=toLower(rhs.d_content->getZoneRepresentation());
- string llabel=toLower(d_label.toString()); //FIXME
- string rlabel=toLower(rhs.d_label.toString()); //FIXME
+ string llabel=toLower(d_label.toString()); //FIXME400
+ string rlabel=toLower(rhs.d_label.toString()); //FIXME400
return
tie(llabel, d_type, d_class, lzrp) ==
static void report(void);
NSECRecordContent() : DNSRecordContent(47)
{}
- NSECRecordContent(const string& content, const string& zone=""); //DNSNameFIXME: DNSName& zone?
+ NSECRecordContent(const string& content, const string& zone=""); //FIXME400: DNSName& zone?
static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
static DNSRecordContent* make(const string& content);
static void report(void);
NSEC3RecordContent() : DNSRecordContent(50)
{}
- NSEC3RecordContent(const string& content, const string& zone=""); //DNSNameFIXME: DNSName& zone?
+ NSEC3RecordContent(const string& content, const string& zone=""); //FIXME400: DNSName& zone?
static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
static DNSRecordContent* make(const string& content);
static void report(void);
NSEC3PARAMRecordContent() : DNSRecordContent(51)
{}
- NSEC3PARAMRecordContent(const string& content, const string& zone=""); // DNSNameFIXME: DNSName& zone?
+ NSEC3PARAMRecordContent(const string& content, const string& zone=""); // FIXME400: DNSName& zone?
static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
static DNSRecordContent* make(const string& content);
static void report(void);
WKSRecordContent() : DNSRecordContent(QType::WKS)
{}
- WKSRecordContent(const string& content, const string& zone=""); // FIXMEDNSName: DNSName& zone?
+ WKSRecordContent(const string& content, const string& zone=""); // FIXME400: DNSName& zone?
static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
static DNSRecordContent* make(const string& content);
EUI48RecordContent() : DNSRecordContent(QType::EUI48) {};
static void report(void);
static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
- static DNSRecordContent* make(const string& zone); // FIXMEDNSName: DNSName& zone?
+ static DNSRecordContent* make(const string& zone); // FIXME400: DNSName& zone?
void toPacket(DNSPacketWriter& pw);
string getZoneRepresentation() const;
private:
EUI64RecordContent() : DNSRecordContent(QType::EUI64) {};
static void report(void);
static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
- static DNSRecordContent* make(const string& zone); // FIXMEDNSName: DNSName& zone?
+ static DNSRecordContent* make(const string& zone); // FIXME400: DNSName& zone?
void toPacket(DNSPacketWriter& pw);
string getZoneRepresentation() const;
private:
toHash.resize(toHash.size() - rrc.d_signature.length()); // chop off the end, don't sign the signature!
BOOST_FOREACH(shared_ptr<DNSRecordContent>& add, signRecords) {
- toHash.append(qname.toDNSString()); // FIXME tolower?
+ toHash.append(qname.toDNSString()); // FIXME400 tolower?
uint16_t tmp=htons(rrc.d_type);
toHash.append((char*)&tmp, 2);
tmp=htons(1); // class
DSRecordContent makeDSFromDNSKey(const DNSName& qname, const DNSKEYRecordContent& drc, int digest)
{
string toHash;
- toHash.assign(qname.toDNSString()); // FIXME tolower?
+ toHash.assign(qname.toDNSString()); // FIXME400 tolower?
toHash.append(const_cast<DNSKEYRecordContent&>(drc).serialize("", true, true));
DSRecordContent dsrc;
dw.xfrName(keyname, false);
dw.xfr16BitInt(QClass::ANY); // class
dw.xfr32BitInt(0); // TTL
- // dw.xfrName(toLower(trc.d_algoName), false); //FIXME
+ // dw.xfrName(toLower(trc.d_algoName), false); //FIXME400
dw.xfrName(trc.d_algoName, false);
}
{
//cerr<<"xfrName: name=["<<name.toString()<<"] compress="<<compress<<endl;
// string label = d_lowerCase ? toLower(Label) : Label;
- // FIXME: we ignore d_lowerCase for now
+ // FIXME400: we ignore d_lowerCase for now
// cerr<<"xfrName writing ["<<name.toString()<<"]"<<endl;
std::vector<std::string> parts = name.getRawLabels();
// labelparts_t parts;
d_record.push_back(labelsize);
unsigned int len=d_record.size();
d_record.resize(len + labelsize);
- memcpy(((&*d_record.begin()) + len), label.c_str(), labelsize); // FIXME do not want memcpy
+ memcpy(((&*d_record.begin()) + len), label.c_str(), labelsize); // FIXME400 do not want memcpy
pos+=labelsize+1;
if(pos - startPos == 1)
}
lua_pushstring(d_lua, remote.toString().c_str() );
- lua_pushstring(d_lua, zone.toString().c_str() ); // FIXME expose DNSName to Lua?
+ lua_pushstring(d_lua, zone.toString().c_str() ); // FIXME400 expose DNSName to Lua?
lua_pushstring(d_lua, in.qname.toString().c_str() );
lua_pushnumber(d_lua, in.qtype.getCode() );
lua_pushnumber(d_lua, in.ttl );
bool getTSIGHashEnum(const DNSName& algoName, TSIGHashEnum& algoEnum)
{
- if (algoName == "hmac-md5.sig-alg.reg.int." || algoName == "hmac-md5.") // FIXME
+ if (algoName == "hmac-md5.sig-alg.reg.int." || algoName == "hmac-md5.") // FIXME400
algoEnum = TSIG_MD5;
else if (algoName == "hmac-sha1.")
algoEnum = TSIG_SHA1;
return true;
}
-// FIXME remove this, it's just here to move faster while we DNSName the things
+// FIXME400 remove this, it's just here to move faster while we DNSName the things
inline bool pdns_iequals(const DNSName& a, const DNSName& b) __attribute__((pure));
inline bool pdns_iequals(const DNSName& a, const DNSName& b)
{
#endif
};
-// FIXME this should probably go?
+// FIXME400 this should probably go?
struct CIStringCompare: public std::binary_function<string, string, bool>
{
bool operator()(const string& a, const string& b) const
// cerr<<toBase32Hex(r.d_nexthash)<<endl;
vector<string> parts;
string sname=i->first.d_label.toString();
- boost::split(parts, sname /* FIXME */, boost::is_any_of("."));
+ boost::split(parts, sname /* FIXME400 */, boost::is_any_of("."));
nsec3s.insert(make_pair(toLower(parts[0]), toBase32Hex(r.d_nexthash)));
nsec3salt = r.d_salt;
nsec3iters = r.d_iterations;
r->addRecord(rr);
}
-void PacketHandler::emitNSEC3(const NSEC3PARAMRecordContent& ns3prc, const SOAData& sd, const DNSName& unhashed, const string& begin, const string& end, /* FIXME unused */ const DNSName& toNSEC3, DNSPacket *r, int mode)
+void PacketHandler::emitNSEC3(const NSEC3PARAMRecordContent& ns3prc, const SOAData& sd, const DNSName& unhashed, const string& begin, const string& end, /* FIXME400 unused */ const DNSName& toNSEC3, DNSPacket *r, int mode)
{
::emitNSEC3(B, ns3prc, sd, unhashed, begin, end, toNSEC3, r, mode);
void addNSEC(DNSPacket *p, DNSPacket* r, const DNSName &target, const DNSName &wildcard, const DNSName& auth, int mode);
void addNSEC3(DNSPacket *p, DNSPacket* r, const DNSName &target, const DNSName &wildcard, const DNSName& auth, const NSEC3PARAMRecordContent& nsec3param, bool narrow, int mode);
void emitNSEC(const DNSName& before, const DNSName& after, const DNSName& toNSEC, const SOAData& sd, DNSPacket *r, int mode);
- void emitNSEC3(const NSEC3PARAMRecordContent &ns3rc, const SOAData& sd, const DNSName& unhashed, /* FIXME should this be DNSName? */ const string& begin, const string& end, const DNSName& toNSEC3, DNSPacket *r, int mode);
+ void emitNSEC3(const NSEC3PARAMRecordContent &ns3rc, const SOAData& sd, const DNSName& unhashed, /* FIXME400 should this be DNSName? */ const string& begin, const string& end, const DNSName& toNSEC3, DNSPacket *r, int mode);
int processUpdate(DNSPacket *p);
int forwardPacket(const string &msgPrefix, DNSPacket *p, DomainInfo *di);
uint performUpdate(const string &msgPrefix, const DNSRecord *rr, DomainInfo *di, bool isPresigned, bool* narrow, bool* haveNSEC3, NSEC3PARAMRecordContent *ns3pr, bool *updatedSerial);
if (rrType == QType::NSEC3PARAM) {
L<<Logger::Notice<<msgPrefix<<"Adding/updating NSEC3PARAM for zone, resetting ordernames."<<endl;
- NSEC3PARAMRecordContent nsec3param(rr->d_content->getZoneRepresentation(), di->zone.toString() /* FIXME huh */);
+ NSEC3PARAMRecordContent nsec3param(rr->d_content->getZoneRepresentation(), di->zone.toString() /* FIXME400 huh */);
*narrow = false; // adding a NSEC3 will cause narrow mode to be dropped, as you cannot specify that in a NSEC3PARAM record
d_dk.setNSEC3PARAM(di->zone, nsec3param, (*narrow));
} else {
di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, qname, DNSName(), (ddepth == 0));
}
- if (ddepth == 1 || dssets.count(qname)) // FIXME && ?
+ if (ddepth == 1 || dssets.count(qname)) // FIXME400 && ?
di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, qname, ordername, false, QType::DS);
}
return 1;
ordername=DNSName(toBase32Hex(hashQNameWithSalt(ns3pr->d_iterations, ns3pr->d_salt, *qname)))+di->zone;
if (*narrow)
- di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), auth); // FIXME no *qname here?
+ di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), auth); // FIXME400 no *qname here?
else
di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, *qname, ordername, auth);
if (rr->d_class == QClass::ANY)
d_dk.unsetNSEC3PARAM(rr->d_label);
else if (rr->d_class == QClass::NONE) {
- NSEC3PARAMRecordContent nsec3rr(rr->d_content->getZoneRepresentation(), di->zone.toString() /* FIXME huh */);
+ NSEC3PARAMRecordContent nsec3rr(rr->d_content->getZoneRepresentation(), di->zone.toString() /* FIXME400 huh */);
if (ns3pr->getZoneRepresentation() == nsec3rr.getZoneRepresentation())
d_dk.unsetNSEC3PARAM(rr->d_label);
else
}
for(auto &record: records) {
- DNSName label /* FIXME rename */=record.first;
+ DNSName label /* FIXME400 rename */=record.first;
if (isNSEC3 && unhash)
{
auto i = hashes.find(label.makeRelative(argv[3]).toStringNoDot());
return false;
}
-// FIXME use DNSName.isPartOf
+// FIXME400 use DNSName.isPartOf
bool SyncRes::moreSpecificThan(const DNSName& a, const DNSName &b)
{
return a.countLabels() > b.countLabels();
struct GetBestNSAnswer
{
DNSName qname;
- set<pair<DNSName,string> > bestns; // FIXME right side really should be DNSName too
+ set<pair<DNSName,string> > bestns; // FIXME400 right side really should be DNSName too
uint8_t qtype; // only A and AAAA anyhow
bool operator<(const GetBestNSAnswer &b) const
{
if( tie(a.remote, ourSock, a.type) > tie(b.remote, bSock, b.type))
return false;
- return pdns_ilexicographical_compare(a.domain.toString(), b.domain.toString()); // FIXME
+ return pdns_ilexicographical_compare(a.domain.toString(), b.domain.toString()); // FIXME400
}
};
extern __thread MemRecursorCache* t_RC;
if(!tsigkeyname.empty()) {
string tsig64;
- DNSName algorithm=trc.d_algoName; // FIXME: check
+ DNSName algorithm=trc.d_algoName; // FIXME400: check
if (algorithm == "hmac-md5.sig-alg.reg.int")
algorithm = "hmac-md5";
if (algorithm != "gss-tsig") {
if(!tsigkeyname.empty()) {
string tsig64;
- DNSName algorithm=trc.d_algoName; // FIXME: was toLowerCanonic, compare output
+ DNSName algorithm=trc.d_algoName; // FIXME400: was toLowerCanonic, compare output
if (algorithm == "hmac-md5.sig-alg.reg.int")
algorithm = "hmac-md5";
Lock l(&s_plock);
BOOST_CHECK_EQUAL(rr.ttl, ttl);
BOOST_CHECK_EQUAL(rr.qtype.getName(), type);
if (rr.qtype == QType::SOA)
- continue; // FIXME remove trailing dots from data
+ continue; // FIXME400 remove trailing dots from data
if (*(rr.content.rbegin()) != '.' && *(data.rbegin()) == '.')
BOOST_CHECK_EQUAL(rr.content, std::string(data.begin(),data.end()-1));
else
for(vector<DNSBackend *>::const_iterator i=backends.begin(); i!=backends.end();++i)
if((*i)->getAuth(p, sd, target, best_match_len)) {
- best_match_len = sd->qname.countLabels(); // FIXME
+ best_match_len = sd->qname.countLabels(); // FIXME400
from_cache = false;
// Shortcut for the case that we got a direct hit - no need to go
sd.nameserver = arg()["default-soa-name"];
if (!arg().isEmpty("default-soa-mail")) {
sd.hostmaster = arg()["default-soa-mail"];
- // attodot(sd.hostmaster); FIXME
+ // attodot(sd.hostmaster); FIXME400
} else {
sd.hostmaster = "hostmaster." + zonename;
}