D2Dhcid::fromHWAddr(const isc::dhcp::HWAddrPtr& hwaddr,
const std::vector<uint8_t>& wire_fqdn) {
if (!hwaddr) {
- isc_throw(isc::dhcp_ddns::DhcidComputeError,
+ isc_throw(isc::dhcp_ddns::DhcidRdataComputeError,
"unable to compute DHCID from the HW address, "
"NULL pointer has been specified");
}
// valid. It is caller's responsibility to make sure it is in
// the valid format. Here we just make sure it is not empty.
if (wire_fqdn.empty()) {
- isc_throw(isc::dhcp_ddns::DhcidComputeError,
+ isc_throw(isc::dhcp_ddns::DhcidRdataComputeError,
"empty FQDN used to create DHCID");
}
// But let's be on the safe side and at least check that it is not
// empty.
if (identifier_data.empty()) {
- isc_throw(isc::dhcp_ddns::DhcidComputeError,
+ isc_throw(isc::dhcp_ddns::DhcidRdataComputeError,
"empty DUID used to create DHCID");
}
secure = sha.process(static_cast<const Botan::byte*>(&data[0]),
data.size());
} catch (const std::exception& ex) {
- isc_throw(isc::dhcp_ddns::DhcidComputeError,
+ isc_throw(isc::dhcp_ddns::DhcidRdataComputeError,
"error while generating DHCID from DUID: "
<< ex.what());
}
/// @brief Exception thrown when there is an error occured during computation
/// of the DHCID.
-class DhcidComputeError : public isc::Exception {
+class DhcidRdataComputeError : public isc::Exception {
public:
- DhcidComputeError(const char* file, size_t line, const char* what) :
+ DhcidRdataComputeError(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) { };
};
// Make sure that the empty FQDN is not accepted.
std::vector<uint8_t> empty_wire_fqdn;
EXPECT_THROW(dhcid.fromClientId(clientid, empty_wire_fqdn),
- isc::dhcp_ddns::DhcidComputeError);
+ isc::dhcp_ddns::DhcidRdataComputeError);
// Make sure that the empty client identifier is not accepted.
clientid.clear();
EXPECT_THROW(dhcid.fromClientId(clientid, wire_fqdn_),
- isc::dhcp_ddns::DhcidComputeError);
+ isc::dhcp_ddns::DhcidRdataComputeError);
}
// Make sure that the empty FQDN is not accepted.
std::vector<uint8_t> empty_wire_fqdn;
EXPECT_THROW(dhcid.fromHWAddr(hwaddr, empty_wire_fqdn),
- isc::dhcp_ddns::DhcidComputeError);
+ isc::dhcp_ddns::DhcidRdataComputeError);
// Make sure that the NULL HW address is not accepted.
hwaddr.reset();
EXPECT_THROW(dhcid.fromHWAddr(hwaddr, wire_fqdn_),
- isc::dhcp_ddns::DhcidComputeError);
+ isc::dhcp_ddns::DhcidRdataComputeError);
}
} // end of anonymous namespace