.. warning::
- Added in Kea 3.2.0, Shared Free Lease Queue Allocator is considered
+ Added in Kea 3.1.9, Shared Free Lease Queue Allocator is considered
experimental and is not supported for production use.
The Shared Free Lease Queue (SFLQ) Allocator is intended for use sites with
.. warning::
- Added in Kea 3.2.0, Shared Free Lease Queue Allocator is considered
+ Added in Kea 3.1.9, Shared Free Lease Queue Allocator is considered
experimental and is not supported for production use.
.. note::
- :isccmd:`lease6-write` - writes the IPv6 memfile lease database into a file.
-- :isccmd::`sflq-pool4-create` - creates an IPv4 SFLQ pool in the lease back end.
+- :iscmd:`sflq-pool4-create` - creates an IPv4 SFLQ pool in the lease back end.
-- :isccmd::`sflq-pool6-create` - creates an IPv6 SFLQ pool in the lease back end.
+- :iscmd:`sflq-pool6-create` - creates an IPv6 SFLQ pool in the lease back end.
-- :isccmd::`sflq-pool4-get-all` - fetches all IPv4 SFLQ pools from the lease back end.
+- :iscmd:`sflq-pool4-get-all` - fetches all IPv4 SFLQ pools from the lease back end.
-- :isccmd::`sflq-pool6-get-all` - fetches all IPv6 SFLQ pools from the lease back end.
+- :iscmd:`sflq-pool6-get-all` - fetches all IPv6 SFLQ pools from the lease back end.
-- :isccmd::`sflq-pool4-get-by-subnet` - fetches all IPv4 SFLQ pools that belong to
+- :iscmd:`sflq-pool4-get-by-subnet` - fetches all IPv4 SFLQ pools that belong to
a subnet from the lease back end.
-- :isccmd::`sflq-pool6-get-by-subnet` - fetches all IPv6 SFLQ pools that belong to
+- :iscmd:`sflq-pool6-get-by-subnet` - fetches all IPv6 SFLQ pools that belong to
a subnet from the lease back end.
-- :isccmd::`sflq-pool4-get-by-range` - fetches all IPv4 SFLQ pools that overlap an
+- :iscmd:`sflq-pool4-get-by-range` - fetches all IPv4 SFLQ pools that overlap an
address range from the lease back end.
-- :isccmd::`sflq-pool6-get-by-range` - fetches all IPv6 SFLQ pools that overlap an
+- :iscmd:`sflq-pool6-get-by-range` - fetches all IPv6 SFLQ pools that overlap an
address range from the lease back end.
-- :isccmd::`sflq-pool4-del` - deletes an IPv4 SFLQ pool that matches an address
+- :iscmd:`sflq-pool4-del` - deletes an IPv4 SFLQ pool that matches an address
range from the lease back end.
-- :isccmd::`sflq-pool6-del` - deletes an IPv6 SFLQ pool that matches an address
+- :iscmd:`sflq-pool6-del` - deletes an IPv6 SFLQ pool that matches an address
range from the lease back end.
All commands use JSON syntax and can be issued either using the control
For large pools (e.g. >= 1 million address/prefixes), this command can take
twenty seconds or more. During this time the server will not process
client queries. Make sure the tool with which you send the commands
- is confgured for long time outs. Once submitted to the lease back
+ is configured for long time outs. Once submitted to the lease back
end the query will continue to run, even if the API client disconnects.
The command returns a status that indicates either success (result 0)
"SFLQ_POOL4_CREATE_FAILED", "sflq-pool4-create command failed, (parameters: %1, reason: %2)",
"SFLQ_POOL4_DEL", "sflq-pool4-del command succeeded, (parameters: %1) pools deleted: %2",
"SFLQ_POOL4_DEL_FAILED", "sflq-pool4-del command failed, (parameters: %1, reason: %2)",
- "SFLQ_POOL4_GET_ALL", "sflq-pool4-get-all command succeeded, (parameters: %1) pools found: %2",
+ "SFLQ_POOL4_GET_ALL", "sflq-pool4-get-all command succeeded, pools found: %1",
"SFLQ_POOL4_GET_ALL_FAILED", "sflq-pool4-get-all command failed, (parameters: %1, reason: %2)",
"SFLQ_POOL4_GET_BY_RANGE", "sflq-pool4-get-by-range command succeeded, (parameters: %1) pools found: %2",
"SFLQ_POOL4_GET_BY_RANGE_FAILED", "sflq-pool4-get-by-range command failed, (parameters: %1, reason: %2)",
"SFLQ_POOL6_CREATE_FAILED", "sflq-pool6-create command failed, (parameters: %1, reason: %2)",
"SFLQ_POOL6_DEL", "sflq-pool4-del command succeeded, (parameters: %1) pools deleted: %2",
"SFLQ_POOL6_DEL_FAILED", "sflq-pool4-del command failed, (parameters: %1, reason: %2)",
- "SFLQ_POOL6_GET_ALL", "sflq-pool6-get-all command succeeded, (parameters: %1) pools found: %2",
+ "SFLQ_POOL6_GET_ALL", "sflq-pool6-get-all command succeeded, pools found: %1",
"SFLQ_POOL6_GET_ALL_FAILED", "sflq-pool6-get-all command failed, (parameters: %1, reason: %2)",
"SFLQ_POOL6_GET_BY_RANGE", "sflq-pool6-get-by-range command succeeded, (parameters: %1) pools found: %2",
"SFLQ_POOL6_GET_BY_RANGE_FAILED", "sflq-pool6-get-by-range command failed, (parameters: %1, reason: %2)",
/// equal to their rhs counterparts. Asserts if they are not "equal".
///
/// @param lhs left-side instance to compare
- /// @param rhs reft-side instance to compare
+ /// @param rhs left-side instance to compare
/// @param lineno source line of invocation (pass in __LINE__)
void checkPoolInfos(const SflqPoolInfo& lhs, const SflqPoolInfo& rhs, int lineno) {
ASSERT_TRUE(lhs.lease_type_ == rhs.lease_type_ &&
auto family = isc::dhcp::CfgMgr::instance().getFamily();
SflqPoolInfoCollectionPtr pool_infos(new SflqPoolInfoCollection());
- for (int i = 0; i < pools_elem->size(); ++i) {
+ for (size_t i = 0; i < pools_elem->size(); ++i) {
auto pool_elem = pools_elem->get(i);
SflqPoolInfoPtr pi(new SflqPoolInfo());
pi->start_address_ = SimpleParser::getAddress(pool_elem, "start-address");
return (pool_infos);
}
- /// @brief Extracts the value of "lease-type" from commnd parameters
+ /// @brief Extracts the value of "lease-type" from command parameters
///
/// This function is used both for command parameters and unparsing
/// JSON pool infos.
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool4-create", "arguments": {)"
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool4-get-all", "arguments": {)"
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool4-get-by-subnet", "arguments": {)"
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool4-get-by-range", "arguments": {)"
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool4-del", "arguments": {)"
auto pool_infos = extractPools(cmd_rsp);
// Should get them back in order they were created. Dummy back end doesn't sort.
- for (int i = 0; i < test_pools.size(); ++i) {
+ for (size_t i = 0; i < test_pools.size(); ++i) {
checkPoolInfos(*(*pool_infos)[i], *test_pools[i], __LINE__);
}
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool6-create", "arguments": {)"
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool6-get-all", "arguments": {)"
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool6-get-by-subnet", "arguments": {)"
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool6-get-by-range", "arguments": {)"
for ( auto const& scenario : scenarios) {
std::ostringstream oss;
- oss << "Scenerio at line: " << scenario.line_;
+ oss << "Scenario at line: " << scenario.line_;
SCOPED_TRACE(oss.str());
std::ostringstream command;
command << R"({ "command": "sflq-pool6-del", "arguments": {)"
pool_infos = extractPools(cmd_rsp);
// Should get them back in order they were created. Dummy back end doesn't sort.
- for (int i = 0; i < test_pools.size(); ++i) {
+ for (size_t i = 0; i < test_pools.size(); ++i) {
checkPoolInfos(*(*pool_infos)[i], *test_pools[i], __LINE__);
}
<< ", it must be >= 1 and =< 128");
}
- if (lease_type == Lease::TYPE_NA) {
+ if (lease_type == Lease::TYPE_NA && val != 128) {
isc_throw(BadValue, "'delegated-len' must only be 128 for IA_NA pools");
}
/// SFLQ pools and data.
class SflqCmdsImpl : private config::CmdsImpl {
public:
- /// @brief Consstructor.
+ /// @brief Constructor.
SflqCmdsImpl() {};
/// @brief Destructor.
/// @brief Extracts an ip address range from given parameters map
///
- /// Expects the map to contain valid addressess of the the given
+ /// Expects the map to contain valid addresses of the the given
/// family (AF_INET or AF_INET6), specified as 'start-address' and
/// 'end-address' and where the former is less than or equal to the
/// latter.
///
- /// @param params Element map containging the command arguments.
+ /// @param params Element map containing the command arguments.
/// @param family protocol family (AF_INET or AF_INET6).
/// @param[out] start_address IOAddress reference which receives the
/// extracted start-address value
/// value. If the parameter is not found in the map, the function will
/// the function will return the default value.
///
- /// @param params Element map containging the command arguments.
+ /// @param params Element map containing the command arguments.
/// @param name name of the desired parameter.
/// @param default_value value to return if the parameter is optional and
/// not specified.
/// if it is present and is >= 1 and <= 128. If it is not present
/// it returns a value of 128.
///
- /// @param params Element map containging the command arguments.
+ /// @param params Element map containing the command arguments.
/// @param lease_type Lease::Type supplied with the arguments (IA_NA
/// or IA_PD)
///
/// For v4 it can be either "V4" or "3", for V6 it can be "IA_NA"
/// "0", "IA_PD", or "2".
///
- /// @param params Element map containging the command arguments.
+ /// @param params Element map containing the command arguments.
/// @param family protocol family (AF_INET or AF_INET6).
///
/// @throw BadValue if the parameter is not valid for the protocol
/// @brief Wrapper class around SFLQ pool commands.
///
-/// This provides the interfacew through which callouts
+/// This provides the interface through which callouts
/// execute the commands.
class SflqCmds {
public:
ASSERT_TRUE(iface);
EXPECT_EQ("lo", iface->getName());
- // Attemt to get an undefined interface.
+ // Attempt to get an undefined interface.
iface = ifacemgr.getIface(3);
EXPECT_FALSE(iface);
/// @brief Creates an SflqPoolInfo instance from this pool.
///
- /// SflqPoolInfo is the pool representaion returned by SFLQ API
+ /// SflqPoolInfo is the pool representation returned by SFLQ API
/// "get" functions. The SflqPoolInfo timestamp members are set
/// to the current time.
///
{
"access": "write",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command instructs the lease back end to create a v4 SFLQ pool and its free lease data."
],
"{",
" \"command\": \"sflq-pool4-create\",",
" \"arguments\": {",
- " \"start-address\": \"1.2.3.4\",",
- " \"end-address\": \"1.2.3.4\",",
- " \"subnet-id\": 123",
+ " \"start-address\": \"1.2.3.4\",",
+ " \"end-address\": \"1.2.3.4\",",
+ " \"subnet-id\": 123,",
" \"recreate\" : false",
- " } ]",
" }",
"}"
],
{
"access": "write",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command deletes a pool that exactly matches an address range from the lease back end."
],
"cmd-syntax": [
"{",
- " \"command\": \"sflq-pool4-del\"",
+ " \"command\": \"sflq-pool4-del\",",
" \"arguments\": {",
- " \"end-address\": \"192.0.2.255\",",
" \"start-address\": \"192.0.2.0\",",
+ " \"end-address\": \"192.0.2.255\",",
" \"force\": true",
" }",
"}"
{
"access": "read",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command fetches a list of all v4 SFLQ pools from the lease back end."
],
" \"start-address\": \"192.0.2.0\",",
" \"subnet-id\": 6",
" }",
- "]]",
+ " ]",
+ "},",
"\"result\": 0,",
"\"text\": \"1 pool(s) found.\"",
"}"
{
"access": "read",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command fetches a list of all v4 SFLQ pools that overlap an address range from the lease back end."
],
"cmd-syntax": [
"{",
- " \"command\": \"sflq-pool4-get-get-by-range\"",
+ " \"command\": \"sflq-pool4-get-by-range\",",
" \"arguments\": {",
- " \"end-address\": \"192.0.2.255\",",
- " \"start-address\": \"192.0.2.0\"",
+ " \"start-address\": \"192.0.2.0\",",
+ " \"end-address\": \"192.0.2.255\"",
" }",
"}"
],
" \"start-address\": \"192.0.2.0\",",
" \"subnet-id\": 123",
" }",
- "]]",
+ " ]",
+ "},",
"\"result\": 0,",
"\"text\": \"1 pool(s) found.\"",
"}"
{
"access": "read",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command fetches a list of all v4 SFLQ pools that belong to a subnet from the lease back end."
],
"cmd-syntax": [
"{",
- " \"command\": \"sflq-pool4-get-get-by-subnet\"",
+ " \"command\": \"sflq-pool4-get-by-subnet\",",
" \"arguments\": {",
" \"subnet-id\": 123",
" }",
" \"start-address\": \"192.0.2.0\",",
" \"subnet-id\": 123",
" }",
- "]]",
+ " ]",
+ "},",
"\"result\": 0,",
"\"text\": \"1 pool(s) found.\"",
"}"
{
"access": "write",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command instructs the lease back end to create a v6 SFLQ pool and its free lease data."
],
"{",
" \"command\": \"sflq-pool6-create\",",
" \"arguments\": {",
- " \"start-address\": \"2001:db8:1::\",",
- " \"end-address\": \"2001:db8:1::FFFF\",",
+ " \"start-address\": \"2001:db8:1::\",",
+ " \"end-address\": \"2001:db8:1::ffff\",",
" \"lease-type\": \"IA_PD\"," ,
" \"delegated-len\": 120,",
" \"recreate\" : false",
- " } ]",
" }",
"}"
],
{
"access": "write",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command deletes a pool that exactly matches an address range from the lease back end."
],
"cmd-syntax": [
"{",
- " \"command\": \"sflq-pool6-get-get-by-range\"",
+ " \"command\": \"sflq-pool6-del\",",
" \"arguments\": {",
+ " \"start-address\": \"3001::ffff\",",
" \"end-address\": \"3001::10\",",
- " \"start-address\": \"3001::FFFF\",",
" \"force\": true",
" }",
"}"
{
"access": "read",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command fetches a list of all v6 SFLQ pools from the lease back end."
],
{
"access": "read",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command fetches a list of all v6 SFLQ pools that overlap an address range from the lease back end."
],
"cmd-syntax": [
"{",
- " \"command\": \"sflq-pool6-get-get-by-range\"",
+ " \"command\": \"sflq-pool6-get-by-range\",",
" \"arguments\": {",
- " \"end-address\": \"3001::FFFF\",",
- " \"start-address\": \"3001::10\"",
+ " \"start-address\": \"3001::10\",",
+ " \"end-address\": \"3001::ffff\"",
" }",
"}"
],
{
"access": "read",
- "avail": "3.2.0",
+ "avail": "3.1.9",
"brief": [
"This command fetches a list of all v6 SFLQ pools that belong to a subnet from the lease back end."
],
"cmd-syntax": [
"{",
- " \"command\": \"sflq-pool6-get-get-by-subnet\"",
+ " \"command\": \"sflq-pool6-get-by-subnet\",",
" \"arguments\": {",
" \"subnet-id\": 100",
" }",