.includes(CommandOptions::LeaseType::ADDRESS)) {
OptionPtr option = pkt_from->getOption(D6O_IA_NA);
if (!option) {
- isc_throw(OptionNotFound, "IA_NA option not found in the"
+ isc_throw(NotFound, "IA_NA option not found in the"
" server's response");
}
pkt_to->addOption(option);
.includes(CommandOptions::LeaseType::PREFIX)) {
OptionPtr option = pkt_from->getOption(D6O_IA_PD);
if (!option) {
- isc_throw(OptionNotFound, "IA_PD option not found in the"
+ isc_throw(NotFound, "IA_PD option not found in the"
" server's response");
}
pkt_to->addOption(option);
/// Default DHCPV6 IA_NA offset in the packet template.
static const size_t DHCPV6_IA_NA_OFFSET = 40;
-/// @brief Exception thrown when the required option is not found in a packet.
-class OptionNotFound : public Exception {
-public:
- OptionNotFound(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) { };
-};
-
-
/// \brief Test Control class.
///
/// This class is used to run the performance test with
/// \param [in] pkt_from A packet from which options should be copied.
/// \param [out] pkt_to A packet to which options should be copied.
///
- /// \throw isc::perfdhcp::OptionNotFound if a required option is not
- /// found in the packet from which options should be copied.
+ /// \throw isc::NotFound if a required option is not found in the
+ /// packet from which options should be copied.
/// \throw isc::BadValue if any of the specified pointers to packets
/// is NULL.
void copyIaOptions(const dhcp::Pkt6Ptr& pkt_from, dhcp::Pkt6Ptr& pkt_to);
auto& index = subnets_.template get<SubnetSubnetIdIndexTag>();
auto subnet_it = index.find(subnet_id);
if (subnet_it == index.end()) {
- isc_throw(BadValue, "ID of the IPv4 subnet '" << subnet_id
- << "' is not in use");
+ isc_throw(BadValue, "There is no IPv4 subnet with ID " <<subnet_id);
}
Subnet4Ptr old = *subnet_it;
bool ret = index.replace(subnet_it, subnet);
auto& index = subnets_.template get<SubnetSubnetIdIndexTag>();
auto subnet_it = index.find(subnet_id);
if (subnet_it == index.end()) {
- isc_throw(BadValue, "ID of the IPv6 subnet '" << subnet_id
- << "' is not in use");
+ isc_throw(BadValue, "There is no IPv6 subnet with ID " << subnet_id);
}
Subnet6Ptr old = *subnet_it;
bool ret = index.replace(subnet_it, subnet);
-# Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2012-2019 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
% DHCPSRV_CFGMGR_UPDATE_SUBNET4 updating subnet %1 (result %2)
A debug message reported when the DHCP configuration manager is updating the
-specified IPv4 subnet to its database. Subnet ID and result (expected to
-be true) are displayed.
+specified IPv4 subnet in its current configuration. Subnet ID and result
+(expected to be true) are displayed.
% DHCPSRV_CFGMGR_UPDATE_SUBNET6 updating subnet %1 (result %2)
A debug message reported when the DHCP configuration manager is replacing the
-specified IPv6 subnet to its database. Subnet ID and result (expected to
-be true) are displayed.
+specified IPv6 subnet in its current configuration. Subnet ID and result
+(expected to be true) are displayed.
% DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED use of raw sockets is unsupported on this OS, UDP sockets will be used
This warning message is logged when the user specified that the
static bool replace(SubnetCollectionType& subnets,
const SubnetPtrType& subnet) {
- // Check if the subnet is already associated with some network.
+ // Check if the new subnet is already associated with some network.
NetworkPtr network;
subnet->getSharedNetwork(network);
if (network) {
ASSERT_TRUE(returned);
EXPECT_TRUE(returned == subnet);
- // Rollback.
+ // Restore.
replaced = cfg.replace(replaced);
ASSERT_TRUE(replaced);
EXPECT_TRUE(replaced == subnet);
ASSERT_TRUE(returned);
EXPECT_TRUE(returned == subnet);
- // Rollback.
+ // Restore.
replaced = cfg.replace(replaced);
ASSERT_TRUE(replaced);
EXPECT_TRUE(replaced == subnet);
isc::Exception(file, line, what) {}
};
+///
+/// \brief A generic exception that is thrown when an object can
+/// not be found.
+class NotFound : public Exception {
+public:
+ NotFound(const char* file, size_t line, const char* what) :
+ isc::Exception(file, line, what) {}
+};
+
///
/// A shortcut macro to insert known values into exception arguments.
///