|
@@ -336,9 +336,26 @@ RadiusHostDataSource::get4(const SubnetID& subnet_id,
|
|
ConstHostPtr
|
|
ConstHostPtr
|
|
RadiusHostDataSource::get6(const SubnetID& subnet_id, const DuidPtr& duid,
|
|
RadiusHostDataSource::get6(const SubnetID& subnet_id, const DuidPtr& duid,
|
|
const HWAddrPtr& hwaddr) const {
|
|
const HWAddrPtr& hwaddr) const {
|
|
- // TODO: libradcli call
|
|
|
|
- ConstHostPtr result = NULL;
|
|
|
|
- return (result);
|
|
|
|
|
|
+ if (hwaddr && duid) {
|
|
|
|
+ isc_throw(BadValue, "Radius host data source get6() called with both"
|
|
|
|
+ " hwaddr and duid, only one of them is allowed");
|
|
|
|
+ }
|
|
|
|
+ if (!hwaddr && !duid) {
|
|
|
|
+ isc_throw(BadValue, "Radius host data source get6() called with "
|
|
|
|
+ "neither hwaddr or duid specified, one of them is required");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Choosing one of the identifiers
|
|
|
|
+ if (hwaddr) {
|
|
|
|
+ return (get6(subnet_id, Host::IDENT_HWADDR, &hwaddr->hwaddr_[0],
|
|
|
|
+ hwaddr->hwaddr_.size()));
|
|
|
|
+
|
|
|
|
+ } else if (duid) {
|
|
|
|
+ return (get6(subnet_id, Host::IDENT_DUID, &duid->getDuid()[0],
|
|
|
|
+ duid->getDuid().size()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return (ConstHostPtr());
|
|
}
|
|
}
|
|
|
|
|
|
ConstHostPtr
|
|
ConstHostPtr
|
|
@@ -346,25 +363,27 @@ RadiusHostDataSource::get6(const SubnetID& subnet_id,
|
|
const Host::IdentifierType& identifier_type,
|
|
const Host::IdentifierType& identifier_type,
|
|
const uint8_t* identifier_begin,
|
|
const uint8_t* identifier_begin,
|
|
const size_t identifier_len) const {
|
|
const size_t identifier_len) const {
|
|
- // TODO: libradcli call
|
|
|
|
- ConstHostPtr result = NULL;
|
|
|
|
|
|
+ ConstHostCollection collection = getAll(identifier_type, identifier_begin, identifier_len);
|
|
|
|
+ ConstHostPtr result;
|
|
|
|
+ if (!collection.empty())
|
|
|
|
+ result = *collection.begin();
|
|
return (result);
|
|
return (result);
|
|
}
|
|
}
|
|
|
|
|
|
ConstHostPtr
|
|
ConstHostPtr
|
|
RadiusHostDataSource::get6(const asiolink::IOAddress& prefix,
|
|
RadiusHostDataSource::get6(const asiolink::IOAddress& prefix,
|
|
const uint8_t prefix_len) const {
|
|
const uint8_t prefix_len) const {
|
|
- // TODO: libradcli call
|
|
|
|
- ConstHostPtr result = NULL;
|
|
|
|
- return (result);
|
|
|
|
|
|
+ // We always assume that there is no conflict between reserved
|
|
|
|
+ // prefixes and dynamic prefixes, so just return nothing here.
|
|
|
|
+ return (ConstHostPtr());
|
|
}
|
|
}
|
|
|
|
|
|
ConstHostPtr
|
|
ConstHostPtr
|
|
RadiusHostDataSource::get6(const SubnetID& subnet_id,
|
|
RadiusHostDataSource::get6(const SubnetID& subnet_id,
|
|
const asiolink::IOAddress& address) const {
|
|
const asiolink::IOAddress& address) const {
|
|
- // TODO: libradcli call
|
|
|
|
- ConstHostPtr result = NULL;
|
|
|
|
- return (result);
|
|
|
|
|
|
+ // We always assume that there is no conflict between reserved
|
|
|
|
+ // addresses and dynamic addresses, so just return nothing here.
|
|
|
|
+ return (ConstHostPtr());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|