return std::make_shared<UnknownRecordContent>(dr, pr);
}
- return std::shared_ptr<DNSRecordContent>(i->second(dr, pr));
+ return i->second(dr, pr);
}
std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(uint16_t qtype, uint16_t qclass,
return std::make_shared<UnknownRecordContent>(content);
}
- return std::shared_ptr<DNSRecordContent>(i->second(content));
+ return i->second(content);
}
-std::unique_ptr<DNSRecordContent> DNSRecordContent::makeunique(uint16_t qtype, uint16_t qclass,
- const string& content)
-{
- zmakermap_t::const_iterator i=getZmakermap().find(make_pair(qclass, qtype));
- if(i==getZmakermap().end()) {
- return std::unique_ptr<DNSRecordContent>(new UnknownRecordContent(content));
- }
-
- return std::unique_ptr<DNSRecordContent>(i->second(content));
-}
-
-
std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(const DNSRecord &dr, PacketReader& pr, uint16_t oc) {
// For opcode UPDATE and where the DNSRecord is an answer record, we don't care about content, because this is
// not used within the prerequisite section of RFC2136, so - we can simply use unknownrecordcontent.
return std::make_shared<UnknownRecordContent>(dr, pr);
}
- return std::shared_ptr<DNSRecordContent>(i->second(dr, pr));
+ return i->second(dr, pr);
}
static std::shared_ptr<DNSRecordContent> mastermake(const DNSRecord &dr, PacketReader& pr);
static std::shared_ptr<DNSRecordContent> mastermake(const DNSRecord &dr, PacketReader& pr, uint16_t opcode);
static std::shared_ptr<DNSRecordContent> mastermake(uint16_t qtype, uint16_t qclass, const string& zone);
- static std::unique_ptr<DNSRecordContent> makeunique(uint16_t qtype, uint16_t qclass, const string& content);
virtual std::string getZoneRepresentation(bool noDot=false) const = 0;
virtual ~DNSRecordContent() {}
void doRecordCheck(const struct DNSRecord&){}
- typedef DNSRecordContent* makerfunc_t(const struct DNSRecord& dr, PacketReader& pr);
- typedef DNSRecordContent* zmakerfunc_t(const string& str);
+ typedef std::shared_ptr<DNSRecordContent> makerfunc_t(const struct DNSRecord& dr, PacketReader& pr);
+ typedef std::shared_ptr<DNSRecordContent> zmakerfunc_t(const string& str);
static void regist(uint16_t cl, uint16_t ty, makerfunc_t* f, zmakerfunc_t* z, const char* name)
{
{
regist(1, QType::EUI48, &make, &make, "EUI48");
}
-DNSRecordContent* EUI48RecordContent::make(const DNSRecord &dr, PacketReader& pr)
+std::shared_ptr<DNSRecordContent> EUI48RecordContent::make(const DNSRecord &dr, PacketReader& pr)
{
if(dr.d_clen!=6)
throw MOADNSException("Wrong size for EUI48 record");
- EUI48RecordContent* ret=new EUI48RecordContent();
+ auto ret=std::make_shared<EUI48RecordContent>();
pr.copyRecord((uint8_t*) &ret->d_eui48, 6);
return ret;
}
-DNSRecordContent* EUI48RecordContent::make(const string& zone)
+std::shared_ptr<DNSRecordContent> EUI48RecordContent::make(const string& zone)
{
// try to parse
- EUI48RecordContent *ret=new EUI48RecordContent();
+ auto ret=std::make_shared<EUI48RecordContent>();
// format is 6 hex bytes and dashes
if (sscanf(zone.c_str(), "%2hhx-%2hhx-%2hhx-%2hhx-%2hhx-%2hhx",
ret->d_eui48, ret->d_eui48+1, ret->d_eui48+2,
{
regist(1, QType::EUI64, &make, &make, "EUI64");
}
-DNSRecordContent* EUI64RecordContent::make(const DNSRecord &dr, PacketReader& pr)
+std::shared_ptr<DNSRecordContent> EUI64RecordContent::make(const DNSRecord &dr, PacketReader& pr)
{
if(dr.d_clen!=8)
throw MOADNSException("Wrong size for EUI64 record");
- EUI64RecordContent* ret=new EUI64RecordContent();
+ auto ret=std::make_shared<EUI64RecordContent>();
pr.copyRecord((uint8_t*) &ret->d_eui64, 8);
return ret;
}
-DNSRecordContent* EUI64RecordContent::make(const string& zone)
+std::shared_ptr<DNSRecordContent> EUI64RecordContent::make(const string& zone)
{
// try to parse
- EUI64RecordContent *ret=new EUI64RecordContent();
+ auto ret=std::make_shared<EUI64RecordContent>();
// format is 8 hex bytes and dashes
if (sscanf(zone.c_str(), "%2hhx-%2hhx-%2hhx-%2hhx-%2hhx-%2hhx-%2hhx-%2hhx",
ret->d_eui64, ret->d_eui64+1, ret->d_eui64+2,
RNAME##RecordContent(const string& zoneData); \
static void report(void); \
static void unreport(void); \
- static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr); \
- static DNSRecordContent* make(const string& zonedata); \
+ static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr); \
+ static std::shared_ptr<DNSRecordContent> make(const string& zonedata); \
string getZoneRepresentation(bool noDot=false) const override; \
void toPacket(DNSPacketWriter& pw) override; \
uint16_t getType() const override { return QType::RNAME; } \
{}
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 std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
+ static std::shared_ptr<DNSRecordContent> make(const string& content);
string getZoneRepresentation(bool noDot=false) const override;
void toPacket(DNSPacketWriter& pw) override;
uint16_t getType() const override
{}
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 std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
+ static std::shared_ptr<DNSRecordContent> make(const string& content);
string getZoneRepresentation(bool noDot=false) const override;
void toPacket(DNSPacketWriter& pw) override;
{}
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 std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
+ static std::shared_ptr<DNSRecordContent> make(const string& content);
string getZoneRepresentation(bool noDot=false) const override;
void toPacket(DNSPacketWriter& pw) override;
{}
LOCRecordContent(const string& content, const string& zone="");
- static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
- static DNSRecordContent* make(const string& content);
+ static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
+ static std::shared_ptr<DNSRecordContent> make(const string& content);
string getZoneRepresentation(bool noDot=false) const override;
void toPacket(DNSPacketWriter& pw) override;
{}
WKSRecordContent(const string& content, const string& zone=""); // FIXME400: DNSName& zone?
- static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
- static DNSRecordContent* make(const string& content);
+ static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
+ static std::shared_ptr<DNSRecordContent> make(const string& content);
string getZoneRepresentation(bool noDot=false) const override;
void toPacket(DNSPacketWriter& pw) override;
public:
EUI48RecordContent() {};
static void report(void);
- static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
- static DNSRecordContent* make(const string& zone); // FIXME400: DNSName& zone?
+ static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
+ static std::shared_ptr<DNSRecordContent> make(const string& zone); // FIXME400: DNSName& zone?
string getZoneRepresentation(bool noDot=false) const override;
void toPacket(DNSPacketWriter& pw) override;
uint16_t getType() const override { return QType::EUI48; }
public:
EUI64RecordContent() {};
static void report(void);
- static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
- static DNSRecordContent* make(const string& zone); // FIXME400: DNSName& zone?
+ static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
+ static std::shared_ptr<DNSRecordContent> make(const string& zone); // FIXME400: DNSName& zone?
string getZoneRepresentation(bool noDot=false) const override;
void toPacket(DNSPacketWriter& pw) override;
uint16_t getType() const override { return QType::EUI64; }
};
#define boilerplate(RNAME, RTYPE) \
-RNAME##RecordContent::DNSRecordContent* RNAME##RecordContent::make(const DNSRecord& dr, PacketReader& pr) \
+std::shared_ptr<RNAME##RecordContent::DNSRecordContent> RNAME##RecordContent::make(const DNSRecord& dr, PacketReader& pr) \
{ \
- return new RNAME##RecordContent(dr, pr); \
+ return std::make_shared<RNAME##RecordContent>(dr, pr); \
} \
\
RNAME##RecordContent::RNAME##RecordContent(const DNSRecord& dr, PacketReader& pr) \
xfrPacket(pr); \
} \
\
-RNAME##RecordContent::DNSRecordContent* RNAME##RecordContent::make(const string& zonedata) \
+std::shared_ptr<RNAME##RecordContent::DNSRecordContent> RNAME##RecordContent::make(const string& zonedata) \
{ \
- return new RNAME##RecordContent(zonedata); \
+ return std::make_shared<RNAME##RecordContent>(zonedata); \
} \
\
void RNAME##RecordContent::toPacket(DNSPacketWriter& pw) \
regist(1, 47, &make, &make, "NSEC");
}
-DNSRecordContent* NSECRecordContent::make(const string& content)
+std::shared_ptr<DNSRecordContent> NSECRecordContent::make(const string& content)
{
- return new NSECRecordContent(content);
+ return std::make_shared<NSECRecordContent>(content);
}
NSECRecordContent::NSECRecordContent(const string& content, const string& zone)
pw.xfrBlob(tmp);
}
-NSECRecordContent::DNSRecordContent* NSECRecordContent::make(const DNSRecord &dr, PacketReader& pr)
+std::shared_ptr<NSECRecordContent::DNSRecordContent> NSECRecordContent::make(const DNSRecord &dr, PacketReader& pr)
{
- NSECRecordContent* ret=new NSECRecordContent();
+ auto ret=std::make_shared<NSECRecordContent>();
pr.xfrName(ret->d_next);
string bitmap;
pr.xfrBlob(bitmap);
regist(1, 50, &make, &make, "NSEC3");
}
-DNSRecordContent* NSEC3RecordContent::make(const string& content)
+std::shared_ptr<DNSRecordContent> NSEC3RecordContent::make(const string& content)
{
- return new NSEC3RecordContent(content);
+ return std::make_shared<NSEC3RecordContent>(content);
}
NSEC3RecordContent::NSEC3RecordContent(const string& content, const string& zone)
}
}
-NSEC3RecordContent::DNSRecordContent* NSEC3RecordContent::make(const DNSRecord &dr, PacketReader& pr)
+std::shared_ptr<NSEC3RecordContent::DNSRecordContent> NSEC3RecordContent::make(const DNSRecord &dr, PacketReader& pr)
{
- NSEC3RecordContent* ret=new NSEC3RecordContent();
+ auto ret=std::make_shared<NSEC3RecordContent>();
pr.xfr8BitInt(ret->d_algorithm);
pr.xfr8BitInt(ret->d_flags);
pr.xfr16BitInt(ret->d_iterations);
regist(254, 51, &make, &make, "NSEC3PARAM");
}
-DNSRecordContent* NSEC3PARAMRecordContent::make(const string& content)
+std::shared_ptr<DNSRecordContent> NSEC3PARAMRecordContent::make(const string& content)
{
- return new NSEC3PARAMRecordContent(content);
+ return std::make_shared<NSEC3PARAMRecordContent>(content);
}
NSEC3PARAMRecordContent::NSEC3PARAMRecordContent(const string& content, const string& zone)
pw.xfrBlob(d_salt);
}
-NSEC3PARAMRecordContent::DNSRecordContent* NSEC3PARAMRecordContent::make(const DNSRecord &dr, PacketReader& pr)
+std::shared_ptr<NSEC3PARAMRecordContent::DNSRecordContent> NSEC3PARAMRecordContent::make(const DNSRecord &dr, PacketReader& pr)
{
- NSEC3PARAMRecordContent* ret=new NSEC3PARAMRecordContent();
+ auto ret=std::make_shared<NSEC3PARAMRecordContent>();
pr.xfr8BitInt(ret->d_algorithm);
pr.xfr8BitInt(ret->d_flags);
pr.xfr16BitInt(ret->d_iterations);
{
DNSName root("."); // don't use g_rootdnsname here, it might not exist yet
for (const auto &dsRecord : rootDSs) {
- auto ds=unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(dsRecord)));
+ auto ds=std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(dsRecord));
dsAnchors[root].insert(*ds);
}
}
Lua.writeFunction("addTA", [&lci](const std::string& who, const std::string& what) {
warnIfDNSSECDisabled("Warning: adding Trust Anchor for DNSSEC (addTA), but dnssec is set to 'off'!");
DNSName zone(who);
- auto ds = unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(what)));
+ auto ds = std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(what));
lci.dsAnchors[zone].insert(*ds);
});
warnIfDNSSECDisabled("Warning: adding Trust Anchor for DNSSEC (addDS), but dnssec is set to 'off'!");
g_log<<Logger::Warning<<"addDS is deprecated and will be removed in the future, switch to addTA"<<endl;
DNSName zone(who);
- auto ds = unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(what)));
+ auto ds = std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(what));
lci.dsAnchors[zone].insert(*ds);
});
try {
g_log<<Logger::Warning<<"Adding Trust Anchor for "<<who<<" with data '"<<what<<"', requested via control channel";
g_luaconfs.modify([who, what](LuaConfigItems& lci) {
- auto ds = unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(what)));
+ auto ds=std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(what));
lci.dsAnchors[who].insert(*ds);
});
broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, who, true));
LuaConfigItems::LuaConfigItems()
{
for (const auto &dsRecord : rootDSs) {
- auto ds=unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(dsRecord)));
+ auto ds=std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(dsRecord));
dsAnchors[g_rootdnsname].insert(*ds);
}
}
luaconfsCopy.dfe.clear();
luaconfsCopy.dsAnchors.clear();
for (const auto &dsRecord : rootDSs) {
- auto ds=unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(dsRecord)));
+ auto ds=std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(dsRecord));
luaconfsCopy.dsAnchors[g_rootdnsname].insert(*ds);
}
luaconfsCopy.negAnchors.clear();
regist(254, QType::LOC, &make, &make, "LOC");
}
-DNSRecordContent* LOCRecordContent::make(const string& content)
+std::shared_ptr<DNSRecordContent> LOCRecordContent::make(const string& content)
{
- return new LOCRecordContent(content);
+ return std::make_shared<LOCRecordContent>(content);
}
pw.xfr32BitInt(d_altitude);
}
-LOCRecordContent::DNSRecordContent* LOCRecordContent::make(const DNSRecord &dr, PacketReader& pr)
+std::shared_ptr<LOCRecordContent::DNSRecordContent> LOCRecordContent::make(const DNSRecord &dr, PacketReader& pr)
{
- LOCRecordContent* ret=new LOCRecordContent();
+ auto ret=std::make_shared<LOCRecordContent>();
pr.xfr8BitInt(ret->d_version);
pr.xfr8BitInt(ret->d_size);
pr.xfr8BitInt(ret->d_horizpre);
for(char c='a'; c<= 'm';++c) {
pw.startRecord(DNSName("com"), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY);
gtld[0]=c;
- auto drc = DNSRecordContent::makeunique(QType::NS, 1, gtld);
+ auto drc = DNSRecordContent::mastermake(QType::NS, 1, gtld);
drc->toPacket(pw);
}
for(char c='a'; c<= 'k';++c) {
gtld[0]=c;
pw.startRecord(DNSName(gtld), QType::A, 3600, 1, DNSResourceRecord::ADDITIONAL);
- auto drc = DNSRecordContent::makeunique(QType::A, 1, "1.2.3.4");
+ auto drc = DNSRecordContent::mastermake(QType::A, 1, "1.2.3.4");
drc->toPacket(pw);
}
pw.startRecord(DNSName("a.gtld-servers.net"), QType::AAAA, 3600, 1, DNSResourceRecord::ADDITIONAL);
- auto aaaarc = DNSRecordContent::makeunique(QType::AAAA, 1, "2001:503:a83e::2:30");
+ auto aaaarc = DNSRecordContent::mastermake(QType::AAAA, 1, "2001:503:a83e::2:30");
aaaarc->toPacket(pw);
pw.startRecord(DNSName("b.gtld-servers.net"), QType::AAAA, 3600, 1, DNSResourceRecord::ADDITIONAL);
- aaaarc = DNSRecordContent::makeunique(QType::AAAA, 1, "2001:503:231d::2:30");
+ aaaarc = DNSRecordContent::mastermake(QType::AAAA, 1, "2001:503:231d::2:30");
aaaarc->toPacket(pw);
// shuffle(records);
for(const auto& rec : records) {
pw.startRecord(rec.qname, rec.qtype.getCode(), rec.ttl, 1, DNSResourceRecord::ADDITIONAL);
- auto drc = DNSRecordContent::makeunique(rec.qtype.getCode(), 1, rec.content);
+ auto drc = DNSRecordContent::mastermake(rec.qtype.getCode(), 1, rec.content);
drc->toPacket(pw);
}
void operator()() const
{
- auto drc = DNSRecordContent::makeunique(QType::A, 1,
+ auto drc = DNSRecordContent::mastermake(QType::A, 1,
"1.2.3.4");
}
};
DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), d_type);
for(int records = 0; records < d_records; records++) {
pw.startRecord(DNSName("outpost.ds9a.nl"), d_type);
- auto drc = DNSRecordContent::makeunique(d_type, 1,
+ auto drc = DNSRecordContent::mastermake(d_type, 1,
d_content);
drc->toPacket(pw);
}
DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::AAAA);
for(int records = 0; records < d_records; records++) {
pw.startRecord(DNSName("outpost.ds9a.nl"), QType::AAAA);
- auto drc = DNSRecordContent::makeunique(QType::AAAA, 1, "fe80::21d:92ff:fe6d:8441");
+ auto drc = DNSRecordContent::mastermake(QType::AAAA, 1, "fe80::21d:92ff:fe6d:8441");
drc->toPacket(pw);
}
pw.commit();
for(int records = 0; records < d_records; records++) {
pw.startRecord(DNSName("outpost.ds9a.nl"), QType::SOA);
- auto drc = DNSRecordContent::makeunique(QType::SOA, 1, "a0.org.afilias-nst.info. noc.afilias-nst.info. 2008758137 1800 900 604800 86400");
+ auto drc = DNSRecordContent::mastermake(QType::SOA, 1, "a0.org.afilias-nst.info. noc.afilias-nst.info. 2008758137 1800 900 604800 86400");
drc->toPacket(pw);
}
pw.commit();
DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::A);
pw.startRecord(DNSName("ds9a.nl"), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY);
- auto drc = DNSRecordContent::makeunique(QType::NS, 1, "ns1.ds9a.nl");
+ auto drc = DNSRecordContent::mastermake(QType::NS, 1, "ns1.ds9a.nl");
drc->toPacket(pw);
pw.startRecord(DNSName("ds9a.nl"), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY);
- drc = DNSRecordContent::makeunique(QType::NS, 1, "ns2.ds9a.nl");
+ drc = DNSRecordContent::mastermake(QType::NS, 1, "ns2.ds9a.nl");
drc->toPacket(pw);
pw.startRecord(DNSName("ns1.ds9a.nl"), QType::A, 3600, 1, DNSResourceRecord::ADDITIONAL);
- drc = DNSRecordContent::makeunique(QType::A, 1, "1.2.3.4");
+ drc = DNSRecordContent::mastermake(QType::A, 1, "1.2.3.4");
drc->toPacket(pw);
pw.startRecord(DNSName("ns2.ds9a.nl"), QType::A, 3600, 1, DNSResourceRecord::ADDITIONAL);
- drc = DNSRecordContent::makeunique(QType::A, 1, "4.3.2.1");
+ drc = DNSRecordContent::mastermake(QType::A, 1, "4.3.2.1");
drc->toPacket(pw);
pw.commit();
BOOST_CHECK(aaaa == aaaa1);
- auto rec1=DNSRecordContent::makeunique(QType::A, 1, "192.168.0.1");
- auto rec2=DNSRecordContent::makeunique(QType::A, 1, "192.168.222.222");
- auto rec3=DNSRecordContent::makeunique(QType::AAAA, 1, "::1");
- auto recMX=DNSRecordContent::makeunique(QType::MX, 1, "25 smtp.powerdns.com");
- auto recMX2=DNSRecordContent::makeunique(QType::MX, 1, "26 smtp.powerdns.com");
- auto recMX3=DNSRecordContent::makeunique(QType::MX, 1, "26 SMTP.powerdns.com");
+ auto rec1=DNSRecordContent::mastermake(QType::A, 1, "192.168.0.1");
+ auto rec2=DNSRecordContent::mastermake(QType::A, 1, "192.168.222.222");
+ auto rec3=DNSRecordContent::mastermake(QType::AAAA, 1, "::1");
+ auto recMX=DNSRecordContent::mastermake(QType::MX, 1, "25 smtp.powerdns.com");
+ auto recMX2=DNSRecordContent::mastermake(QType::MX, 1, "26 smtp.powerdns.com");
+ auto recMX3=DNSRecordContent::mastermake(QType::MX, 1, "26 SMTP.powerdns.com");
BOOST_CHECK(!(*rec1==*rec2));
BOOST_CHECK(*rec1==*rec1);
BOOST_CHECK(*rec3==*rec3);
rrc.d_signer = DNSName("example.net.");
inception = 946684800;
expire = 1893456000;
- rrs.push_back(DNSRecordContent::makeunique(QType::A, QClass::IN, "192.0.2.1"));
+ rrs.push_back(DNSRecordContent::mastermake(QType::A, QClass::IN, "192.0.2.1"));
}
else {
rrc.d_signer = qname;
- rrs.push_back(DNSRecordContent::makeunique(QType::MX, QClass::IN, "10 mail.example.com."));
+ rrs.push_back(DNSRecordContent::mastermake(QType::MX, QClass::IN, "10 mail.example.com."));
}
rrc.d_originalttl = 3600;
reportBasicTypes();
- rrs.push_back(DNSRecordContent::makeunique(QType::MX, 1, "10 mail.example.com."));
+ rrs.push_back(DNSRecordContent::mastermake(QType::MX, 1, "10 mail.example.com."));
RRSIGRecordContent rrc;
rrc.d_originalttl = 3600;
LuaConfigItems::LuaConfigItems()
{
for (const auto &dsRecord : rootDSs) {
- auto ds=unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(dsRecord)));
+ auto ds=std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(dsRecord));
dsAnchors[g_rootdnsname].insert(*ds);
}
}
/** Helper to build a record content as needed. */
static inline string makeRecordContent(const QType& qtype, const string& content, bool noDot) {
// noDot: for backend storage, pass true. for API users, pass false.
- auto drc = DNSRecordContent::makeunique(qtype.getCode(), QClass::IN, content);
+ auto drc = DNSRecordContent::mastermake(qtype.getCode(), QClass::IN, content);
return drc->getZoneRepresentation(noDot);
}