-----------------------------------------------------------
:isccmd:`sflq-pool4-get-all` and :isccmd:`sflq-pool6-get-all` can be used
-to fetch a list of all IPv4 or IPv6 SFLQ pools. It takes no arguments.
+to fetch a list of all IPv4 or IPv6 SFLQ pools. They take no arguments.
An example :isccmd:`sflq-pool4-get-all` command for fetching IPv4 SFLQ
pools:
---------------------------------------------------
:isccmd:`sflq-pool4-del` and :isccmd:`sflq-pool6-del` can be used to delete
-an IPv4 or IPv6 SFLQ pool. It requires two arguments, ``start-address`` and
+an IPv4 or IPv6 SFLQ pool. They require two arguments, ``start-address`` and
and ``end-address``. Only a pool whose range matches these values will be
deleted and only if no other SFLQ pools overlap the range described by these
values. If any overlapping pools are detected the delete will fail with an
"bogus" : "fluff"
)",
"spurious 'bogus' parameter"
+ },
+ {
+ __LINE__,
+ R"(
+ "subnet-id": -1
+ )",
+ "'subnet-id' -1 is invalid, must be greater than zero"
+ " and less than 4294967295"
}
};
"bogus" : "fluff"
)",
"spurious 'bogus' parameter"
+ },
+ {
+ __LINE__,
+ R"(
+ "subnet-id": -1
+ )",
+ "'subnet-id' -1 is invalid, must be greater than zero"
+ " and less than 4294967295"
}
};
SimpleParser::checkRequired(required_keywords, cmd_args_);
SimpleParser::checkKeywords(keywords, cmd_args_);
- SubnetID subnet_id = SimpleParser::getInteger(cmd_args_, "subnet-id");
+
+ // Extract subnet-id.
+ int64_t subnet_id = SimpleParser::getInteger(cmd_args_, "subnet-id");
+ if ((subnet_id < 1) || (subnet_id >= SUBNET_ID_UNUSED)) {
+ isc_throw(isc::BadValue, "'subnet-id' " << subnet_id << " is invalid,"
+ " must be greater than zero and less than "
+ << SUBNET_ID_UNUSED);
+ }
// Invoke the pool get by subnet function.
auto pools = (family == AF_INET ? LeaseMgrFactory::instance().sflqPool4Get(subnet_id)
/// @return an uint32_t value
/// @throw isc::dhcp::DhcpConfigError when it is not an uint32_t
uint32_t getUint32(isc::data::ConstElementPtr scope,
- const std::string& name) {
+ const std::string& name) {
return (getIntType<uint32_t>(scope, name));
}
/// @brief Defines a pointer to a LeaseStatsRow.
typedef boost::shared_ptr<LeaseStatsRow> LeaseStatsRowPtr;
-// Forward declaration.
-class SflqPoolInfo;
-/// @brief A pointer to a SFLQPoolInfo instance.
-typedef boost::shared_ptr<SflqPoolInfo> SflqPoolInfoPtr;
-
/// @brief Describes a SFLQ pool.
class SflqPoolInfo {
public:
data::ElementPtr toElement() const;
};
+/// @brief A pointer to a SFLQPoolInfo instance.
+typedef boost::shared_ptr<SflqPoolInfo> SflqPoolInfoPtr;
+
/// @brief A collection of SFLQPoolInfo structures.
typedef std::vector<SflqPoolInfoPtr> SflqPoolInfoCollection;
typedef boost::shared_ptr<SflqPoolInfoCollection> SflqPoolInfoCollectionPtr;