2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-28 12:37:55 +00:00

474 Commits

Author SHA1 Message Date
Francis Dupont
3776e08a16 [#226] Finished v6 code 2025-08-20 17:39:16 +02:00
Francis Dupont
45799e22bf [#226] Checkpoint v6 code 2025-08-20 17:39:16 +02:00
Francis Dupont
069c6ec34e [#226] Finished v4 code 2025-08-20 17:39:16 +02:00
Francis Dupont
beec9ae4e6 [#226] Checkpoint v4 code 2025-08-20 17:39:15 +02:00
Francis Dupont
233e393735 [#226] Added getMin*Lft* 2025-08-20 17:39:15 +02:00
Francis Dupont
eea3d8af2e [#226] Added getRemaining 2025-08-20 17:39:15 +02:00
Razvan Becheriu
a5a8da3c11 [#3911] fixed error handling 2025-06-12 22:08:39 +03:00
Francis Dupont
9958bfd122 [#3413] Fixed some coverity complains 2025-06-05 18:57:57 +02:00
Francis Dupont
d24ca2ae8b [#3555] Double semicolon 2025-03-26 16:47:14 +00:00
Thomas Markwalder
cf371a2d2d [#3555] Cleanups and Changelog
Added Changelog entry
/src/lib/dhcpsrv/alloc_engine.cc
/src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
    Minor cleanups
2025-03-26 16:47:14 +00:00
Thomas Markwalder
e83c4f59c0 [#3555] Handle conflicts when offer-liftime > 0
/src/bin/dhcp4/tests/dora_unittest.cc
    DORATest::reservationsWithConflicts() - added parameter
    for offer-lifetime

    TEST_F(DORATest, reservationsWithConflictsOfferLft)
    TEST_F(DORATest, reservationsWithConflictsOfferLftMultiThreading)
    - new tests

/src/lib/dhcpsrv/alloc_engine.*
    deleteAssignedLease() - new convenience function

    AllocEngine::requestLease4() - added logic to handle conflicting
    lease when offer-lifetime > 0

    AllocEngine::getOfferLft() - added flag to disable DISCOVER
    only check

/src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
    TEST_F(AllocEngine4Test, existingLeasePlusTemporary) - new test
2025-03-26 16:47:14 +00:00
Razvan Becheriu
01728b22b2 [#1336] addressed review comments 2025-03-14 20:47:22 +02:00
Razvan Becheriu
6e1c34157a [#1336] addressed review comments 2025-03-14 19:49:22 +02:00
Razvan Becheriu
d353006a1d [#1336] fixed reclaim counters for pools 2025-03-14 19:42:34 +02:00
Razvan Becheriu
12d89b6130 [#3648] addressed review comments 2025-03-14 16:46:13 +02:00
Razvan Becheriu
ae7cddb5d8 [#3648] drop packet on db race 2025-03-14 13:09:26 +02:00
Razvan Becheriu
f44b0ba95c [#1336] fixed decrement on both reclaim and release 2025-03-13 09:52:59 +02:00
Francis Dupont
6861ed9c2a [#3683] Addressed more comments 2025-03-04 22:49:13 +01:00
Francis Dupont
7a90a14a1b [#3683] Checkpoint: UTs to do 2025-03-04 22:49:12 +01:00
Thomas Markwalder
89f08dd667 [#3463] Add BindingVariableMgr::evaluateVariables
/src/hooks/dhcp/lease_cmds/binding_variables.*
    BindingVariableMgr::evaluateVariables() - initial implementation

/src/lib/dhcpsrv/alloc_engine.cc
    AllocEngine::updateLease4ExtendedInfo()
    AllocEngine::updateLease6ExtendedInfo()
    - use Lease::updateUserContextISC()

/src/lib/dhcpsrv/lease.*
    bool Lease::updateUserContextISC() - new function that
    adds/updates an element in the "ISC" map in the lease's
    user-context.
2025-02-18 18:54:19 +00:00
Thomas Markwalder
3862bab83f [#3257] Suppress NCRs when reusing leases
/src/bin/dhcp4/dhcp4_srv.cc
    Dhcpv4Srv::createNameChangeRequests() - modified to check for
    reused lease

/src/bin/dhcp4/tests/dora_unittest.cc
    DORATest::leaseCaching() - modified to verify suppression of NCRs

/src/bin/dhcp6/dhcp6_srv.cc
    Dhcpv6Srv::createNameChangeRequests() - modified to iteralte over
    IA contexts rather than IA options in response and to check for
    reused leases

/src/bin/dhcp6/tests/fqdn_unittest.cc
    Updated tests to populate IAContexts

/src/bin/dhcp6/tests/sarr_unittest.cc
    SARRTest::leaseCaching()- modified to verify suppression of NCRs

/src/lib/dhcpsrv/alloc_engine.*
    AllocEngine::ClientContext6::IAContext - added reused_leases_ container
    AllocEngine::ClientContext6::getIAContexts() - new function
2024-11-19 05:19:15 -05:00
Francis Dupont
6b9061456b [#3268] Moved to ConstSubnet*Ptr 2024-11-06 09:43:56 +01:00
Marcin Siodelski
a52bf68db9 [#3246] Do not delete soft released leases 2024-06-19 12:34:18 +02:00
Francis Dupont
e3bf7f6ce4 [#2976] Disabled stashed RAI in updateLease4ExtendedInfo 2024-04-26 18:25:06 +03:00
Piotrek Zadroga
4546eb3944 [#2820] small fixes 2024-04-26 14:42:46 +02:00
Piotrek Zadroga
45e6ea1ed8 [#2820] add tid in some alloc-engine logs 2024-04-26 14:42:46 +02:00
Francis Dupont
b99d71bdfd [#3289] New fix 2024-04-05 18:10:46 +02:00
Francis Dupont
baa1aa46e5 [#3211] Almost done 2024-03-20 00:18:24 +01:00
Thomas Markwalder
b75e0f4c50 [#3209] Initial commit
Rewrote encoding/decoding.

src/lib/util/Makefile.am
    Removed old files, added encode.cc, encode.h

src/lib/util/encode/encode.*
    New implemenentation encoding and decoding not based
    on boost.
2024-02-07 13:58:47 +00:00
Wlodek Wencel
416a072394 [#3237] release changes 2024-01-29 10:17:26 +01:00
Razvan Becheriu
1b4d7b0293 [#3119] use range based for loop or BOOST_FOREACH 2024-01-22 17:49:59 +02:00
Razvan Becheriu
72f330320b [#3119] replace const auto with auto const 2024-01-22 17:33:26 +02:00
Razvan Becheriu
54dd674d0d [#3119] use auto const& whenever possible 2024-01-22 17:33:26 +02:00
Razvan Becheriu
59c45ecb13 [#3108] added warning message to disable "ip-reservations-unique"
- suggest disabling "ip-reservations-unique" flag if multiple reservations
   for the same IP address are found
2023-12-18 18:48:26 +02:00
Razvan Becheriu
3f56d3de07 [#2881] only check for OPT_EMPTY_TYPE 2023-10-14 02:49:45 +03:00
Piotrek Zadroga
c9fd11c085 [#3063] set new_lease_ in client ctx on OFFER 2023-09-18 19:19:45 +02:00
Marcin Siodelski
132ef88b47 [#2826] Options in db are not encapsulated
Returned options from db are not encapsulated and have to be encapsulated
before the server returns them to a client. Parsers, depending on the use
case, may or may not encapsulate options. When they are used for parsing
a config file, the options are encapsulated. When they are used by the
host_cmds or cb_cmds, they are not.
2023-06-29 21:00:51 +02:00
Razvan Becheriu
21ff30b112 [#2898] added unittests for pool-id 2023-06-22 14:52:48 +00:00
Razvan Becheriu
bd079a7d35 [#2886] fix schema order for pool_id and binaddr 2023-05-29 19:21:51 +00:00
Razvan Becheriu
a9e717aaca [#145] addressed review comments 2023-05-26 18:40:53 +03:00
Razvan Becheriu
ac229425d1 [#145] backend support for pool counters 2023-05-26 18:40:52 +03:00
Razvan Becheriu
630732e486 [#145] create stats per pool 2023-05-26 18:40:52 +03:00
Thomas Markwalder
0482115cf8 [#2835] Replace preferred-lifetime as needed
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/get_config_unittest.cc
src/bin/dhcp6/tests/simple_parser6_unittest.cc
    Updated tests

src/lib/dhcpsrv/alloc_engine.cc
    AllocEngine::getLifetimes6() - modified to replace preferred
    lifetime with  valid-lifetime * .625 it's unspecified or
    greater than valid-lifetime

src/lib/dhcpsrv/alloc_engine_messages.mes
    ALLOC_ENGINE_V6_CALCULATED_PREFERRED_LIFETIME - new message

src/lib/dhcpsrv/parsers/simple_parser6.cc
    SimpleParser6::GLOBAL6_DEFAULTS - removed preferred-lifetime

src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc
    Updated tests
2023-05-22 15:29:33 -04:00
Andrei Pavel
4a06d2baf0
[#2658] add big integer support to statistics
Pool capacities have been promoted in code from uint64_t to uint128_t.

Bigint is modelled as an int128_t in statistics, following the precedent of
signed integer of int64_t from statistics.

- "total-nas" is extended to 128 bits as requested in the issue.
- "total-pds" has the same risk of overflowing so it has been extended
  as well.
- "total-addresses" always fits in 64 bits, but certain code forces a
  128 bit value on it. See Pool::getCapacity(), Subnet::getPoolCapacity(),
  Subnet::sumPoolCapacity(). It could have been truncated to a 64 bit value,
  but that seems like an unnecessary complication.

Because of the disparity in signedness there is some truncation that can
happen when pool capacity values are passed on to statistics. That only happens
for the last half of the value range, so for prefix ranges larger than /1.
2023-05-17 19:09:38 +03:00
Marcin Siodelski
01ded4bedb [#2843] Addressed review comment
Used IPV6_ZERO_ADDRESS() instead of :: in the candidate addresss
initialization.
2023-05-12 13:02:03 +02:00
Marcin Siodelski
9d8d99a980 [#2843] Use different allocators in shared net
Fixed a bug in the allocation engine which could result in a failure to
allocate available addresses from a subnet that used an FLQ allocator, or
returning a zero lease.
2023-05-12 13:02:03 +02:00
Thomas Markwalder
52df77064c [#2719] Do not shorten exiting leases
Augmented UTs to issue DHCPREQUESTS
Altered alloc engine to skip temp allocation when
there is an existing lease is longer than offer_lft
2023-03-23 07:18:26 -04:00
Thomas Markwalder
ef3281460d [#2719] Renamed parameter and added it to classes
Renamed offer-lft to offer-lifetime to match other
lifetime parameters.
2023-03-23 07:17:48 -04:00
Thomas Markwalder
d74021c60b [#2719] kea-dhcp4 offer-lft is now functional
kea-dhcp4 supports offer-lft for global, shared-network,
and subnets.  Not yet supported in classes.

src/bin/dhcp4/dhcp4_srv.cc
    Dhcpv4Srv::assignLease() - adjust outbound lease time option

    Dhcpv4Srv::postAllocateNameUpdate() - allow reuse check on allocated
    discover

src/lib/dhcpsrv/alloc_engine.*
    AllocEngine::ClientContext4 - add offer_lft_ member
    AllocEngine::discoverLease4() -set contexts offer_lft_
    AllocEngine::getOfferLft() - new, get context appropriate value for offer_lft
    AllocEngine::createLease4() - use offer_lft on DISCOVER, pass offer_lft
    into hook, set lease fqdn flags to false
    AllocEngine::reuseExpiredLease4() - reclaim on discover allocation
    AllocEngine::updateLease4Information() - use offer_lft if appropriate

src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
    TEST_F(AllocEngine4Test, discoverOfferLft) - enabled
    TEST_F(AllocEngine4Test, discoverOfferLftReuseExpiredLease4) - new test
2023-03-23 07:17:48 -04:00
Francis Dupont
262057546d [#2766] Fixed advertise with zero lifetimes 2023-03-15 16:01:35 +01:00