mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 21:45:37 +00:00
use NS::getNSName() to retrieve NS name from an NS RDATA entry.
the use of dynamic_cast is intientional, assuming such specialization is rare. git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@546 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
@@ -43,8 +43,9 @@
|
||||
using namespace std;
|
||||
|
||||
using namespace isc::dns;
|
||||
using namespace isc::dns::rdata::in;
|
||||
using namespace isc::dns::rdata::generic;
|
||||
using namespace isc::dns::rdata;
|
||||
//using namespace isc::dns::rdata::in;
|
||||
//using namespace isc::dns::rdata::generic;
|
||||
using namespace isc::data;
|
||||
|
||||
ParkingLot::ParkingLot(int port) {
|
||||
@@ -145,15 +146,15 @@ ParkingLot::processMessage() {
|
||||
for (rrsetit->first();
|
||||
!rrsetit->isLast();
|
||||
rrsetit->next()) {
|
||||
const rdata::Rdata& rdata = rrsetit->getCurrent();
|
||||
/* no direct way to get the Name from the rdata fields? */
|
||||
Name ns_name = Name(rdata.toText());
|
||||
const generic::NS& nsrdata =
|
||||
dynamic_cast<const generic::NS&>(
|
||||
rrsetit->getCurrent());
|
||||
data_source.addToMessage(msg, Section::ADDITIONAL(),
|
||||
zname, ns_name, qclass,
|
||||
RRType::A());
|
||||
zname, nsrdata.getNSName(),
|
||||
qclass, RRType::A());
|
||||
data_source.addToMessage(msg, Section::ADDITIONAL(),
|
||||
zname, ns_name, qclass,
|
||||
RRType::AAAA());
|
||||
zname, nsrdata.getNSName(),
|
||||
qclass, RRType::AAAA());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,15 +167,16 @@ ParkingLot::processMessage() {
|
||||
for (rrsetit->first();
|
||||
!rrsetit->isLast();
|
||||
rrsetit->next()) {
|
||||
const rdata::Rdata& rdata = rrsetit->getCurrent();
|
||||
/* no direct way to get the Name from the rdata fields? */
|
||||
Name ns_name = Name(rdata.toText());
|
||||
const generic::NS& nsrdata =
|
||||
dynamic_cast<const generic::NS&>(
|
||||
rrsetit->getCurrent());
|
||||
data_source.addToMessage(msg, Section::ADDITIONAL(),
|
||||
zname, ns_name, qclass,
|
||||
RRType::A());
|
||||
zname, nsrdata.getNSName(),
|
||||
qclass, RRType::A());
|
||||
data_source.addToMessage(msg, Section::ADDITIONAL(),
|
||||
zname, ns_name, qclass,
|
||||
RRType::AAAA());
|
||||
zname,
|
||||
nsrdata.getNSName(),
|
||||
qclass, RRType::AAAA());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user