using namespace isc;
using namespace isc::util;
using namespace isc::acl;
+using isc::acl::dns::RequestACL;
using namespace isc::dns;
using namespace isc::data;
using namespace isc::config;
OutputBufferPtr buffer,
DNSServer* server);
- const Resolver::QueryACL& getQueryACL() const {
+ const RequestACL& getQueryACL() const {
return (*query_acl_);
}
- void setQueryACL(shared_ptr<const Resolver::QueryACL> new_acl) {
+ void setQueryACL(shared_ptr<const RequestACL> new_acl) {
query_acl_ = new_acl;
}
private:
/// ACL on incoming queries
- shared_ptr<const Resolver::QueryACL> query_acl_;
+ shared_ptr<const RequestACL> query_acl_;
/// Object to handle upstream queries
RecursiveQuery* rec_query_;
AddressList listenAddresses(parseAddresses(listenAddressesE,
"listen_on"));
const ConstElementPtr query_acl_cfg(config->get("query_acl"));
- const shared_ptr<const QueryACL> query_acl =
+ const shared_ptr<const RequestACL> query_acl =
query_acl_cfg ? acl::dns::getLoader().load(query_acl_cfg) :
- shared_ptr<const QueryACL>();
+ shared_ptr<const RequestACL>();
bool set_timeouts(false);
int qtimeout = impl_->query_timeout_;
int ctimeout = impl_->client_timeout_;
return (impl_->listen_);
}
-const Resolver::QueryACL&
+const RequestACL&
Resolver::getQueryACL() const {
return (impl_->getQueryACL());
}
void
-Resolver::setQueryACL(shared_ptr<const QueryACL> new_acl) {
+Resolver::setQueryACL(shared_ptr<const RequestACL> new_acl) {
if (!new_acl) {
isc_throw(InvalidParameter, "NULL pointer is passed to setQueryACL");
}
*/
int getRetries() const;
- // Shortcut typedef used for query ACL.
- typedef isc::acl::ACL<isc::acl::dns::RequestContext> QueryACL;
-
/// Get the query ACL.
///
/// \exception None
- const QueryACL& getQueryACL() const;
+ const isc::acl::dns::RequestACL& getQueryACL() const;
/// Set the new query ACL.
///
/// \exception InvalidParameter The given pointer is NULL
///
/// \param new_acl The new ACL to replace the existing one.
- void setQueryACL(boost::shared_ptr<const QueryACL> new_acl);
+ void setQueryACL(boost::shared_ptr<const isc::acl::dns::RequestACL>
+ new_acl);
private:
ResolverImpl* impl_;
using namespace std;
using namespace isc::dns;
using namespace isc::data;
+using isc::acl::dns::RequestACL;
using namespace isc::testutils;
using isc::UnitTestUtil;
TEST_F(ResolverTest, setQueryACL) {
// valid cases are tested through other tests. We only explicitly check
// an invalid case: passing a NULL shared pointer.
- EXPECT_THROW(server.setQueryACL(
- boost::shared_ptr<const Resolver::QueryACL>()),
+ EXPECT_THROW(server.setQueryACL(boost::shared_ptr<const RequestACL>()),
isc::InvalidParameter);
}