mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 23:45:27 +00:00
[2204] changed internal representation of auth_srv's "client_lists_" to ptrs.
this will be necessary later in this branch. also renamed the member variable "datasrc_client_lists_" as the mere "client" can be ambiguous.
This commit is contained in:
@@ -69,6 +69,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
using boost::shared_ptr;
|
||||||
|
|
||||||
using namespace isc;
|
using namespace isc;
|
||||||
using namespace isc::cc;
|
using namespace isc::cc;
|
||||||
using namespace isc::datasrc;
|
using namespace isc::datasrc;
|
||||||
@@ -264,23 +266,21 @@ public:
|
|||||||
AddressList listen_addresses_;
|
AddressList listen_addresses_;
|
||||||
|
|
||||||
/// The TSIG keyring
|
/// The TSIG keyring
|
||||||
const boost::shared_ptr<TSIGKeyRing>* keyring_;
|
const shared_ptr<TSIGKeyRing>* keyring_;
|
||||||
|
|
||||||
/// The client list
|
/// The data source client list
|
||||||
std::map<RRClass, boost::shared_ptr<ConfigurableClientList> >
|
shared_ptr<std::map<RRClass, shared_ptr<ConfigurableClientList> > >
|
||||||
client_lists_;
|
datasrc_client_lists_;
|
||||||
|
|
||||||
boost::shared_ptr<ConfigurableClientList> getClientList(const RRClass&
|
shared_ptr<ConfigurableClientList> getClientList(const RRClass& rrclass) {
|
||||||
rrclass)
|
|
||||||
{
|
|
||||||
// TODO: Debug-build only check
|
// TODO: Debug-build only check
|
||||||
if (!mutex_.locked()) {
|
if (!mutex_.locked()) {
|
||||||
isc_throw(isc::Unexpected, "Not locked!");
|
isc_throw(isc::Unexpected, "Not locked!");
|
||||||
}
|
}
|
||||||
const std::map<RRClass, boost::shared_ptr<ConfigurableClientList> >::
|
const std::map<RRClass, shared_ptr<ConfigurableClientList> >::
|
||||||
const_iterator it(client_lists_.find(rrclass));
|
const_iterator it(datasrc_client_lists_->find(rrclass));
|
||||||
if (it == client_lists_.end()) {
|
if (it == datasrc_client_lists_->end()) {
|
||||||
return (boost::shared_ptr<ConfigurableClientList>());
|
return (shared_ptr<ConfigurableClientList>());
|
||||||
} else {
|
} else {
|
||||||
return (it->second);
|
return (it->second);
|
||||||
}
|
}
|
||||||
@@ -335,6 +335,8 @@ AuthSrvImpl::AuthSrvImpl(AbstractXfroutClient& xfrout_client,
|
|||||||
xfrin_session_(NULL),
|
xfrin_session_(NULL),
|
||||||
counters_(),
|
counters_(),
|
||||||
keyring_(NULL),
|
keyring_(NULL),
|
||||||
|
datasrc_client_lists_(new std::map<RRClass,
|
||||||
|
shared_ptr<ConfigurableClientList> >()),
|
||||||
ddns_base_forwarder_(ddns_forwarder),
|
ddns_base_forwarder_(ddns_forwarder),
|
||||||
ddns_forwarder_(NULL),
|
ddns_forwarder_(NULL),
|
||||||
xfrout_connected_(false),
|
xfrout_connected_(false),
|
||||||
@@ -650,7 +652,7 @@ AuthSrvImpl::processNormalQuery(const IOMessage& io_message, Message& message,
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const ConstQuestionPtr question = *message.beginQuestion();
|
const ConstQuestionPtr question = *message.beginQuestion();
|
||||||
const boost::shared_ptr<datasrc::ClientList>
|
const shared_ptr<datasrc::ClientList>
|
||||||
list(getClientList(question->getClass()));
|
list(getClientList(question->getClass()));
|
||||||
if (list) {
|
if (list) {
|
||||||
const RRType& qtype = question->getType();
|
const RRType& qtype = question->getType();
|
||||||
@@ -911,7 +913,7 @@ AuthSrv::setDNSService(isc::asiodns::DNSServiceBase& dnss) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AuthSrv::setTSIGKeyRing(const boost::shared_ptr<TSIGKeyRing>* keyring) {
|
AuthSrv::setTSIGKeyRing(const shared_ptr<TSIGKeyRing>* keyring) {
|
||||||
impl_->keyring_ = keyring;
|
impl_->keyring_ = keyring;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -932,19 +934,21 @@ AuthSrv::destroyDDNSForwarder() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
AuthSrv::setClientList(const RRClass& rrclass,
|
AuthSrv::setClientList(const RRClass& rrclass,
|
||||||
const boost::shared_ptr<ConfigurableClientList>& list) {
|
const shared_ptr<ConfigurableClientList>& list)
|
||||||
|
{
|
||||||
// TODO: Debug-build only check
|
// TODO: Debug-build only check
|
||||||
if (!impl_->mutex_.locked()) {
|
if (!impl_->mutex_.locked()) {
|
||||||
isc_throw(isc::Unexpected, "Not locked");
|
isc_throw(isc::Unexpected, "Not locked");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list) {
|
if (list) {
|
||||||
impl_->client_lists_[rrclass] = list;
|
(*impl_->datasrc_client_lists_)[rrclass] = list;
|
||||||
} else {
|
} else {
|
||||||
impl_->client_lists_.erase(rrclass);
|
impl_->datasrc_client_lists_->erase(rrclass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boost::shared_ptr<ConfigurableClientList>
|
|
||||||
|
shared_ptr<ConfigurableClientList>
|
||||||
AuthSrv::getClientList(const RRClass& rrclass) {
|
AuthSrv::getClientList(const RRClass& rrclass) {
|
||||||
return (impl_->getClientList(rrclass));
|
return (impl_->getClientList(rrclass));
|
||||||
}
|
}
|
||||||
@@ -957,9 +961,9 @@ AuthSrv::getClientListClasses() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vector<RRClass> result;
|
vector<RRClass> result;
|
||||||
for (std::map<RRClass, boost::shared_ptr<ConfigurableClientList> >::
|
for (std::map<RRClass, shared_ptr<ConfigurableClientList> >::
|
||||||
const_iterator it(impl_->client_lists_.begin());
|
const_iterator it(impl_->datasrc_client_lists_->begin());
|
||||||
it != impl_->client_lists_.end(); ++it) {
|
it != impl_->datasrc_client_lists_->end(); ++it) {
|
||||||
result.push_back(it->first);
|
result.push_back(it->first);
|
||||||
}
|
}
|
||||||
return (result);
|
return (result);
|
||||||
|
Reference in New Issue
Block a user