Parcourir la source

Small changes resulting from jabber chat

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac408@3640 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner il y a 14 ans
Parent
commit
6b5cebef93

+ 9 - 0
src/lib/nsas/TODO

@@ -17,3 +17,12 @@ Zone entries:
 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).

+ 0 - 3
src/lib/nsas/nameserver_address_store.h

@@ -101,14 +101,11 @@ public:
     /// \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);
 

+ 8 - 15
src/lib/nsas/tests/zone_entry_unittest.cc

@@ -70,11 +70,9 @@ class InheritedZoneEntry : public ZoneEntry {
     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 @@ TEST_F(ZoneEntryTest, DefaultConstructor) {
 
 /// 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 @@ TEST_F(ZoneEntryTest, ReferralConstructor) {
 // 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 @@ TEST_F(ZoneEntryTest, CallbackZeroTTL) {
     // 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 @@ TEST_F(ZoneEntryTest, CallbackZeroTTL) {
 // 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 @@ TEST_F(ZoneEntryTest, CallbacksAnswered) {
 // 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 @@ TEST_F(ZoneEntryTest, CallbacksAOnly) {
 // 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

+ 1 - 4
src/lib/nsas/zone_entry.h

@@ -65,19 +65,16 @@ public:
 
     /// \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);