[svn] commit: r3640 - in /branches/trac408/src/lib/nsas: TODO nameserver_address_store.h tests/zone_entry_unittest.cc zone_entry.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Nov 26 18:05:29 UTC 2010
Author: vorner
Date: Fri Nov 26 18:05:29 2010
New Revision: 3640
Log:
Small changes resulting from jabber chat
Modified:
branches/trac408/src/lib/nsas/TODO
branches/trac408/src/lib/nsas/nameserver_address_store.h
branches/trac408/src/lib/nsas/tests/zone_entry_unittest.cc
branches/trac408/src/lib/nsas/zone_entry.h
Modified: branches/trac408/src/lib/nsas/TODO
==============================================================================
--- branches/trac408/src/lib/nsas/TODO (original)
+++ branches/trac408/src/lib/nsas/TODO Fri Nov 26 18:05:29 2010
@@ -17,3 +17,12 @@
The NSAS itself:
* If the zone rejects the callback, remove it and call recursively the same
one. As it will accept at last one, it should not become a loop.
+* Do not pass referral info by lookup, it should be fetched on-demand from recursor/cache
+
+Long term:
+* Make a mechanism the cache (which does not exist at the time of writing this
+ note) will be able to notify the NSAS that something has changed (address,
+ new nameserver, etc). Because the cache will have access to the data and
+ knows when it changes (it updates its structures), it is the best place. It
+ will be caching even data like authority and additional sections. It will
+ notify us somehow (we will need to tell it when).
Modified: branches/trac408/src/lib/nsas/nameserver_address_store.h
==============================================================================
--- branches/trac408/src/lib/nsas/nameserver_address_store.h (original)
+++ branches/trac408/src/lib/nsas/nameserver_address_store.h Fri Nov 26 18:05:29 2010
@@ -101,14 +101,11 @@
/// \param class_code Class of the zone.
/// \param authority Authority RRset from the referral containing the
/// nameservers that serve the zone.
- /// \param additional Additional RRset(s) for authority information. These
- /// are taken from the referral.
/// \param callback Callback object used to pass the result back to the
/// caller.
/// \param request Which address is requested.
void lookup(const std::string& zone, uint16_t class_code,
const isc::dns::AbstractRRset& authority,
- const std::vector<const isc::dns::AbstractRRset*>& additional,
boost::shared_ptr<AddressRequestCallback> callback, AddressRequest
request = ANY_OK);
Modified: branches/trac408/src/lib/nsas/tests/zone_entry_unittest.cc
==============================================================================
--- branches/trac408/src/lib/nsas/tests/zone_entry_unittest.cc (original)
+++ branches/trac408/src/lib/nsas/tests/zone_entry_unittest.cc Fri Nov 26 18:05:29 2010
@@ -70,11 +70,9 @@
public:
InheritedZoneEntry(shared_ptr<ResolverInterface> resolver,
const isc::dns::AbstractRRset& authority,
- const std::vector<const isc::dns::AbstractRRset*>& additional,
HashTable<NameserverEntry>& nameservers,
LruList<NameserverEntry>& nameserver_lru) :
- ZoneEntry(resolver, authority, additional, nameservers,
- nameserver_lru)
+ ZoneEntry(resolver, authority, nameservers, nameserver_lru)
{ }
InheritedZoneEntry(shared_ptr<ResolverInterface> resolver,
const std::string& name, uint16_t class_code) :
@@ -96,8 +94,8 @@
/// Tests of constructor from referral data
TEST_F(ZoneEntryTest, ReferralConstructor) {
- InheritedZoneEntry alpha(resolver_, rr_single_,
- vector<const AbstractRRset*>(), nameservers_hash_, nameservers_lru_);
+ InheritedZoneEntry alpha(resolver_, rr_single_, nameservers_hash_,
+ nameservers_lru_);
// It should load the name and class from the referral info
EXPECT_EQ(EXAMPLE_CO_UK, alpha.getName());
EXPECT_EQ(RRClass::IN().getCode(), alpha.getClass());
@@ -109,8 +107,7 @@
// It should answer negatively right away if there are no nameservers
TEST_F(ZoneEntryTest, CallbackNoNS) {
shared_ptr<InheritedZoneEntry> zone(new InheritedZoneEntry(resolver_,
- rr_empty_, vector<const AbstractRRset*>(), nameservers_hash_,
- nameservers_lru_));
+ rr_empty_, nameservers_hash_, nameservers_lru_));
// It should accept the callback
EXPECT_TRUE(zone->addCallback(callback_, ANY_OK, zone));
// And tell imediatelly that it is unreachable (when it has no nameservers)
@@ -123,8 +120,7 @@
// Make it zero TTL, so it expires right away
rr_single_.setTTL(RRTTL(0));
shared_ptr<InheritedZoneEntry> zone(new InheritedZoneEntry(resolver_,
- rr_single_, vector<const AbstractRRset*>(), nameservers_hash_,
- nameservers_lru_));
+ rr_single_, nameservers_hash_, nameservers_lru_));
// It should accept the callback
EXPECT_TRUE(zone->addCallback(callback_, ANY_OK, zone));
// It should not be answered yet, it should ask for the IP addresses
@@ -138,8 +134,7 @@
// Check it answers callbacks when we give it addresses
TEST_F(ZoneEntryTest, CallbacksAnswered) {
shared_ptr<InheritedZoneEntry> zone(new InheritedZoneEntry(resolver_,
- rr_single_, vector<const AbstractRRset*>(), nameservers_hash_,
- nameservers_lru_));
+ rr_single_, nameservers_hash_, nameservers_lru_));
// It should be in NOT_ASKED state
EXPECT_EQ(Fetchable::NOT_ASKED, zone->getState());
// It should accept the callback
@@ -183,8 +178,7 @@
// Pretend the server can be reached only by IPv4
TEST_F(ZoneEntryTest, CallbacksAOnly) {
shared_ptr<InheritedZoneEntry> zone(new InheritedZoneEntry(resolver_,
- rr_single_, vector<const AbstractRRset*>(), nameservers_hash_,
- nameservers_lru_));
+ rr_single_, nameservers_hash_, nameservers_lru_));
// It should be in NOT_ASKED state
EXPECT_EQ(Fetchable::NOT_ASKED, zone->getState());
// It should accept the callback
@@ -227,8 +221,7 @@
// See it tries hard enough to get address and tries both nameservers
TEST_F(ZoneEntryTest, CallbackTwoNS) {
shared_ptr<InheritedZoneEntry> zone(new InheritedZoneEntry(resolver_,
- rrns_, vector<const AbstractRRset*>(), nameservers_hash_,
- nameservers_lru_));
+ rrns_, nameservers_hash_, nameservers_lru_));
// It should be in NOT_ASKED state
EXPECT_EQ(Fetchable::NOT_ASKED, zone->getState());
// It should accept the callback
Modified: branches/trac408/src/lib/nsas/zone_entry.h
==============================================================================
--- branches/trac408/src/lib/nsas/zone_entry.h (original)
+++ branches/trac408/src/lib/nsas/zone_entry.h Fri Nov 26 18:05:29 2010
@@ -65,19 +65,16 @@
/// \brief Constructor
///
- /// Creates a zone entry object with an RRset representing the nameservers,
- /// plus possibly additional RRsets holding address information.
+ /// Creates a zone entry object with an RRset representing the nameservers.
///
/// \param resolver The resolver used to ask for IP addresses
/// \param authority Specifies the name, code and nameservers of this zone.
- /// \param additional The additional section to feed to nameservers.
/// \param nameservers Hash table of existing nameserves and a place where
/// new ones will be put.
/// \param nameserver_lru The lru where the nameservers will be added or
/// touched.
ZoneEntry(boost::shared_ptr<ResolverInterface> resolver,
const isc::dns::AbstractRRset& authority,
- const std::vector<const isc::dns::AbstractRRset*>& additional,
HashTable<NameserverEntry>& nameservers,
LruList<NameserverEntry>& nameserver_lru);
More information about the bind10-changes
mailing list