Browse Source

Update interface of Recursor

The forward address will be from configuration.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/vorner-recursor-config@3333 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner 14 years ago
parent
commit
894e61966d
1 changed files with 24 additions and 6 deletions
  1. 24 6
      src/bin/recurse/recursor.h

+ 24 - 6
src/bin/recurse/recursor.h

@@ -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 @@ private:
     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 @@ public:
     /// \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_;