static constexpr StatementTag GET_LEASE4_LIMIT = "GET_LEASE4_LIMIT";
// Get range of lease4 from address with limit (paging)
static constexpr StatementTag GET_LEASE4_PAGE = "GET_LEASE4_PAGE";
- // Get range of lease4 between two addresses
- static constexpr StatementTag GET_LEASE4_RANGE = "GET_LEASE4_RANGE";
// Get lease4 by subnet ID
static constexpr StatementTag GET_LEASE4_SUBID = "GET_LEASE4_SUBID";
/// @}
constexpr StatementTag CqlLease4Exchange::GET_LEASE4_HWADDR_SUBID;
constexpr StatementTag CqlLease4Exchange::GET_LEASE4_LIMIT;
constexpr StatementTag CqlLease4Exchange::GET_LEASE4_PAGE;
-constexpr StatementTag CqlLease4Exchange::GET_LEASE4_RANGE;
constexpr StatementTag CqlLease4Exchange::GET_LEASE4_SUBID;
StatementMap CqlLease4Exchange::tagged_statements_{
"LIMIT ? "
"ALLOW FILTERING "}},
- // Get range of lease4 between two addresses
- {GET_LEASE4_RANGE,
- {GET_LEASE4_RANGE,
- "SELECT "
- "address, hwaddr, client_id, valid_lifetime, expire, subnet_id, "
- "fqdn_fwd, fqdn_rev, hostname, state "
- "FROM lease4 "
- "WHERE address >= ? "
- "AND address <= ? "
- "ALLOW FILTERING "}},
-
// Gets an IPv4 lease(s) with specified subnet-id
{GET_LEASE4_SUBID,
{GET_LEASE4_SUBID,
"WHERE address > ? "
"ORDER BY address "
"LIMIT ?"},
- {MySqlLeaseMgr::GET_LEASE4_RANGE,
- "SELECT address, hwaddr, client_id, "
- "valid_lifetime, expire, subnet_id, "
- "fqdn_fwd, fqdn_rev, hostname, "
- "state "
- "FROM lease4 "
- "WHERE address >= ? AND address <= ?"},
{MySqlLeaseMgr::GET_LEASE4_SUBID,
"SELECT address, hwaddr, client_id, "
"valid_lifetime, expire, subnet_id, "
"WHERE address > ? "
"ORDER BY address "
"LIMIT ?"},
- {MySqlLeaseMgr::GET_LEASE6_RANGE,
- "SELECT address, duid, valid_lifetime, "
- "expire, subnet_id, pref_lifetime, "
- "lease_type, iaid, prefix_len, "
- "fqdn_fwd, fqdn_rev, hostname, "
- "hwaddr, hwtype, hwaddr_source, "
- "state "
- "FROM lease6 "
- "WHERE INET6_ATON(address) >= INET6_ATON(?) "
- "AND INET6_ATON(address) <= INET6_ATON(?)"},
{MySqlLeaseMgr::GET_LEASE6_SUBID,
"SELECT address, duid, valid_lifetime, "
"expire, subnet_id, pref_lifetime, "
GET_LEASE4_HWADDR, // Get lease4 by HW address
GET_LEASE4_HWADDR_SUBID, // Get lease4 by HW address & subnet ID
GET_LEASE4_PAGE, // Get page of leases beginning with an address
- GET_LEASE4_RANGE, // Get range of leases between addresses
GET_LEASE4_SUBID, // Get IPv4 leases by subnet ID
GET_LEASE4_EXPIRE, // Get lease4 by expiration.
GET_LEASE6, // Get all IPv6 leases
GET_LEASE6_DUID_IAID, // Get lease6 by DUID and IAID
GET_LEASE6_DUID_IAID_SUBID, // Get lease6 by DUID, IAID and subnet ID
GET_LEASE6_PAGE, // Get page of leases beginning with an address
- GET_LEASE6_RANGE, // Get range of leases between addresses
GET_LEASE6_SUBID, // Get IPv6 leases by subnet ID
GET_LEASE6_EXPIRE, // Get lease6 by expiration.
INSERT_LEASE4, // Add entry to lease4 table
"ORDER BY address "
"LIMIT $2"},
- // GET_LEASE4_RANGE
- { 2, { OID_INT8, OID_INT8 },
- "get_lease4_range",
- "SELECT address, hwaddr, client_id, "
- "valid_lifetime, extract(epoch from expire)::bigint, subnet_id, "
- "fqdn_fwd, fqdn_rev, hostname, "
- "state "
- "FROM lease4 "
- "WHERE address >= $1 AND address <= $2"},
-
// GET_LEASE4_SUBID
{ 1, { OID_INT8 },
"get_lease4_subid",
"ORDER BY address "
"LIMIT $2"},
- // GET_LEASE6_RANGE
- { 2, { OID_VARCHAR, OID_VARCHAR },
- "get_lease6_range",
- "SELECT address, duid, valid_lifetime, "
- "extract(epoch from expire)::bigint, subnet_id, pref_lifetime, "
- "lease_type, iaid, prefix_len, fqdn_fwd, fqdn_rev, hostname, "
- "hwaddr, hwtype, hwaddr_source, "
- "state "
- "FROM lease6 "
- "WHERE INET(address) >= INET($1) AND INET(address) <= INET($2)"},
-
// GET_LEASE6_SUBID
{ 1, { OID_INT8 },
"get_lease6_subid",
GET_LEASE4_HWADDR, // Get lease4 by HW address
GET_LEASE4_HWADDR_SUBID, // Get lease4 by HW address & subnet ID
GET_LEASE4_PAGE, // Get page of leases beginning with an address
- GET_LEASE4_RANGE, // Get range of leases between addresses
GET_LEASE4_SUBID, // Get IPv4 leases by subnet ID
GET_LEASE4_EXPIRE, // Get expired lease4
GET_LEASE6, // Get all IPv6 leases
GET_LEASE6_DUID_IAID, // Get lease6 by DUID and IAID
GET_LEASE6_DUID_IAID_SUBID, // Get lease6 by DUID, IAID and subnet ID
GET_LEASE6_PAGE, // Get page of IPv6 leases beginning with an address
- GET_LEASE6_RANGE, // Get range of IPv6 leases between addresses
GET_LEASE6_SUBID, // Get IPv6 leases by subnet ID
GET_LEASE6_EXPIRE, // Get expired lease6
INSERT_LEASE4, // Add entry to lease4 table