[svn] commit: r3333 - /branches/vorner-recursor-config/src/bin/recurse/recursor.h

BIND 10 source code commits bind10-changes at lists.isc.org
Sat Oct 23 12:16:32 UTC 2010


Author: vorner
Date: Sat Oct 23 12:16:31 2010
New Revision: 3333

Log:
Update interface of Recursor

The forward address will be from configuration.

Modified:
    branches/vorner-recursor-config/src/bin/recurse/recursor.h

Modified: branches/vorner-recursor-config/src/bin/recurse/recursor.h
==============================================================================
--- branches/vorner-recursor-config/src/bin/recurse/recursor.h (original)
+++ branches/vorner-recursor-config/src/bin/recurse/recursor.h Sat Oct 23 12:16:31 2010
@@ -18,6 +18,8 @@
 #define __RECURSOR_H 1
 
 #include <string>
+#include <vector>
+#include <utility>
 
 #include <cc/data.h>
 #include <config/ccsession.h>
@@ -38,12 +40,7 @@
     Recursor& operator=(const Recursor& source);
 public:
     /// The constructor.
-    ///
-    /// \param forward The address of the name server to which requests
-    /// should be forwarded.  (In the future, when the server is running
-    /// in forwarding mode, the forward nameserver addresses will be set
-    /// via the config channel instaed.)
-    Recursor(const char& forward);
+    Recursor();
     ~Recursor();
     //@}
 
@@ -93,6 +90,27 @@
     /// \brief Return pointer to the Checkin callback function
     asiolink::SimpleCallback* getCheckinProvider() { return (checkin_); }
 
+    /**
+     * \brief Specify the list of upstream servers.
+     *
+     * Specify the list off addresses of upstream servers to forward queries
+     * to. If the list is empty, this server is set to full recursive mode.
+     * If it is non-empty, it switches to forwarder.
+     *
+     * @param addresses The list of addresses to use (each one is the address
+     * and port pair).
+     */
+    void setForwardAddresses(const std::vector<std::pair<std::string,
+        uint16_t> >& addresses);
+    /**
+     * \short Get list of upstream addresses.
+     *
+     * \see setForwardAddresses.
+     */
+    std::vector<std::pair<std::string, uint16_t> > getForwardAddresses() const;
+    /// Return if we are in forwarding mode (if not, we are in fully recursive)
+    bool isForwarding() const;
+
 private:
     RecursorImpl* impl_;
     asiolink::IOService* io_;




More information about the bind10-changes mailing list