From fee368968890819f19ba6d29be9ea35fe45e881c Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Fri, 6 Dec 2024 15:37:00 +0100 Subject: [#3414] Added column types --- src/lib/dhcpsrv/database_backends.dox | 64 +++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 25 deletions(-) (limited to 'src/lib/dhcpsrv/database_backends.dox') diff --git a/src/lib/dhcpsrv/database_backends.dox b/src/lib/dhcpsrv/database_backends.dox index a5aef6046b..d5cb0deede 100644 --- a/src/lib/dhcpsrv/database_backends.dox +++ b/src/lib/dhcpsrv/database_backends.dox @@ -93,7 +93,7 @@ For details, see @ref isc::db::PgSqlConnection::openDatabase(). - @subsection infinite-valid-lifetime Infinite Valid Lifetime + @subsubsection infinite-valid-lifetime Infinite Valid Lifetime The @c isc::dhcp::Lease class uses cltt (client last transmission time) and valid lifetime, backend lease uses expire and valid lifetime. @@ -110,20 +110,34 @@ expire = cltt if valid_lifetime == 0xffffffff @endcode - @subsection lease4-csv DHCPv4 lease entry format in CSV files + @subsection memfile-description Memfile Lease Back-End + + The memfile backend does not use any database, but stores leases in + plain CSV file instead: kea-keases4.csv for DHCPv4 and kea-leases6.csv + for DHCPv6. These are effectively journal files, so changes are + appended at the end. For example, if a single device obtains a lease, + renews it 3 times and then it is released, there would be 5 + entries. Periodically, the lease file is cleaned by LFC (Lease File + Cleanup) process. That process does move the file to the side, then + creates a new file and writes cleaned entries there. Depending on the + situation, there may be other files, such as kea-leases4.csv.2 with .1 + (used during LFC taking place) or .2 extensions (left over after LFC + is complete as "backup", i.e. old file before clean-up). + + @subsubsection lease4-csv DHCPv4 lease entry format in CSV files - address - IPv4 address - hwaddr - hardware address (without the hardware type) - client_id - client identifier - - valid_lifetime - valid lifetime - - expire - expiration date (cltt + valid lifetime) - - subnet_id - DHCPv4 subnet identifier - - fqdn_fwd - FQDN forward DNS RR update flag - - fqdn_rev - FQDN reverse DNS RR update flag - - hostname - hostname - - state - lease state + - valid_lifetime - valid lifetime (uint32_t) + - expire - expiration date (uint64_t, cltt + valid lifetime) + - subnet_id - DHCPv4 subnet identifier (uint32_t) + - fqdn_fwd - FQDN forward DNS RR update flag (bool, 0 or 1) + - fqdn_rev - FQDN reverse DNS RR update flag (bool, 0 or 1) + - hostname - hostname (separators are escaped) + - state - lease state (uint32_t, 0 to 3) - user_context - user context (separators are escaped) - - pool_id - pool identifier + - pool_id - pool identifier (uint32_t) for instance: \verbatim @@ -136,22 +150,22 @@ - address - IPv6 address - DUID - client DUID - - valid_lifetime - valid lifetime - - expire - expiration date (cltt + valid lifetime) - - subnet_id - DHCPv6 subnet identifier - - pref_lifetime - preferred lifetime - - lease_type - lease type (0 for NA, 2 for PD) - - iaid - IA identifier - - prefix_len - prefix length - - fqdn_fwd - FQDN forward DNS RR update flag - - fqdn_rev - FQDN reverse DNS RR update flag - - hostname - hostname - - hwaddr - hardware address - - state - lease state + - valid_lifetime - valid lifetime (uint32_t) + - expire - expiration date (uint64_t, cltt + valid lifetime) + - subnet_id - DHCPv6 subnet identifier (uint32_t) + - pref_lifetime - preferred lifetime (uint32_t) + - lease_type - lease type (Lease::Type enum0 for NA, 2 for PD) + - iaid - IA identifier (uint32_t) + - prefix_len - prefix length (uint8_t, 0 to 128) + - fqdn_fwd - FQDN forward DNS RR update flag (bool, 0 or 1) + - fqdn_rev - FQDN reverse DNS RR update flag (bool, 0 or 1) + - hostname - hostname (separators are escaped) + - hwaddr - hardware address (hardware type is in hwtype column) + - state - lease state (uint32_t, 0 to 3) - user_context - user context (separators are escaped) - - hwtype - hardware type - - hwaddr_source - source of hardware address and type - - pool_id - pool identifier + - hwtype - hardware type (uint16_t) + - hwaddr_source - source of hardware address and type (uint32_t, 8 bit mask) + - pool_id - pool identifier (uint32_t) For instance: \verbatim -- cgit v1.2.3