2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-28 20:47:48 +00:00

474 Commits

Author SHA1 Message Date
Thomas Markwalder
8d1c66ada6 Revert "[#1409] Correct DNS handling when reusing expired leases"
These changes overlook the fact that if a lease has expired, then
it's DNS entries have also expired and may or may not still be
in DNS. In any event, they need to be made anew.
2020-09-09 20:15:01 +00:00
Thomas Markwalder
d6b1297831 [#1409] Correct DNS handling when reusing expired leases
src/bin/dhcp6/dhcp6_srv.cc
    Dhcpv6Srv::createNameChangeRequests() - added logic to queue
    CHG_REMOVES for changed leases when new lease has no FQDN

src/lib/dhcpsrv/alloc_engine.cc
    AllocEngine::allocateUnreservedLeases6() - return the old lease
    as a changed lease, when reusing an expired lease

    AllocEngine::reclaimExpiredLease() - moved queue CHG_REMOVE to
    only occur when the DB is flagged for change.

    AllocEngine::reclaimLeaseInDatabase() - removed logic to
    clear lease FQDN data

src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc
    TEST_F(AllocEngine6Test, requestReuseExpiredLease6) - verifies
    changed_leases instead of old_leases
2020-09-09 20:15:01 +00:00
Razvan Becheriu
28396543a8 [#1333] rebased and fixed comments 2020-08-28 14:35:01 +03:00
Francis Dupont
8de716d33f [#1333] Removed useless getLease calls in createLeaseX 2020-08-28 14:15:22 +03:00
Francis Dupont
03cef674c6 [#1308] Less _1 ambiguities 2020-08-13 13:54:14 +00:00
Francis Dupont
2035f64c1c [#1308] Got rid of boost function/bind 2020-08-13 13:54:14 +00:00
Razvan Becheriu
a794d7bd4d [#1065] update stats according to current lease state 2020-08-12 09:56:43 +03:00
Razvan Becheriu
f8b20eaf25 [#1065] lease commands update statistics 2020-08-12 09:56:43 +03:00
Francis Dupont
4325528cfa [#1147] Addressed some comments 2020-05-26 11:53:11 +02:00
Francis Dupont
ee5c75639a [#1147] Checkpoint: todo lease commands 2020-05-26 11:51:57 +02:00
Francis Dupont
8a69ac46be [#1147] Checkpoint: cleaned up alloc code 2020-05-26 11:51:57 +02:00
Razvan Becheriu
c9324da4d4 [#1227] addressed review 2020-05-15 21:21:41 +03:00
Francis Dupont
e8a9e44faa [#816] Addressed some (other) comments 2020-04-23 23:24:53 +02:00
Francis Dupont
8ad94924f5 [#816] Added global cumulative assigned stats 2020-04-23 23:23:18 +02:00
Francis Dupont
3f43d49e1c [#816] Added per subnet cumulative assigned stats 2020-04-23 23:23:18 +02:00
Thomas Markwalder
4d3cb9ab14 [#1010] Modified AllocateEngine and parsers to store extended v6 lease info
src/lib/dhcpsrv/alloc_engine.*
    AllocEngine::reuseExpiredLease()
    AllocEngine::createLease6()
    AllocEngine::extendLease6() - added call to AllocEngine::updateLase6ExtendedInfo()

    AllocEngine::updateLease4ExtendedInfo() - create Elements directly

    AllocEngine::updateLease6ExtendedInfo() - new method

src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc
    TEST_F(AllocEngine6ExtendedInfoTest, updateExtendedInfo6)
    TEST_F(AllocEngine6ExtendedInfoTest, storeExtendedInfoEnabled6)
    TEST_F(AllocEngine6ExtendedInfoTest, storeExtendedInfoDisabled6)
    TEST_F(AllocEngine6ExtendedInfoTest, reuseExpiredLease6)
    - new tests

src/lib/dhcpsrv/parsers/dhcp_parsers.cc
src/lib/dhcpsrv/parsers/shared_network_parser.cc
src/lib/dhcpsrv/parsers/base_network_parser.*
    Renamed BaseNetworkParser::parseCommonTimer() to parseCommon() and
    added handling of store-extended-info.

src/lib/dhcpsrv/parsers/simple_parser6.cc
    Added store-extended-info

src/lib/dhcpsrv/tests/cfg_shared_networks6_unittest.cc
src/lib/dhcpsrv/tests/cfg_subnets6_unittest.cc
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
src/lib/dhcpsrv/tests/network_unittest.cc
src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc
    updated tests
2020-04-02 21:08:09 +02:00
Thomas Markwalder
fb3e48e595 [#1010] Added v4 support of store-extended-info to lib dhcpsrv
src/lib/dhcpsrv/alloc_engine.cc
    AllocEngine::updateLease4ExtendedInfo()
    - added check of store-extended-info

src/lib/dhcpsrv/network.*
src/lib/dhcpsrv/parsers/simple_parser4.cc
    added parameter for store-extended-info

src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
src/lib/dhcpsrv/tests/cfg_shared_networks4_unittest.cc
src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc
src/lib/dhcpsrv/tests/network_unittest.cc
src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc

    Updated tests to include store-extended-info
2020-04-02 21:06:01 +02:00
Thomas Markwalder
3b75ebf271 [#1010] Modified AllocateEngine to store extended lease4 info
src/lib/dhcpsrv/alloc_engine.*
    AllocEngine::updateLease4ExtendedInfo() - new function

    AllocEngine::createLease4()
    AllocEngine::updateLease4Info()
    - added call to updateLease4ExtendedInfo(lease, ctx);

src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
    TEST_F(AllocEngine4Test, updateExtendedInfo4)
    TEST_F(AllocEngine4Test, storeExtendedInfoEnabled4)
    TEST_F(AllocEngine4Test, storeExtendedInfoDisabled4)

src/lib/dhcpsrv/tests/alloc_engine_utils.h
    NakeAllocEngine::callUpdateLease4ExtendedInfo4()
2020-04-02 21:06:01 +02:00
Marcin Siodelski
e5c189505e [#1139] Added globalHost() convenience method
This function was added to the ClientContext4 for the DHCPv4 server to be
able to quickly check if there are any global host reservations present
and if the reservations contain client classes which could be possibly
used for leases allocation.
2020-03-19 12:14:51 +00:00
Thomas Markwalder
d955b3dda2 [#1124] Reversed order for v6 also
modified:
    alloc_engine.cc
2020-03-04 14:54:50 -05:00
Thomas Markwalder
a47839d801 [#1124] Addressed v4 code review
Minor cleanup in alloc_engine.cc.
2020-03-04 14:54:49 -05:00
Thomas Markwalder
49b540a01c [#1124] Change the order of HR vs lease lookup during v4 lease allocation
src/lib/dhcpsrv/alloc_engine.cc
    AllocEngine::allocateUnreservedLease4() - rather than first testing for a
    host reservation and then looking for an existing lease, we reverse the
    order, thus worrying about HRs only if there is no existing lease.
2020-03-04 14:54:49 -05:00
Razvan Becheriu
ac82b269d5 [#957] refactored hooks manager classes to be unsed in multi-threading 2020-02-07 12:57:51 +02:00
Razvan Becheriu
07954313dd [#890] make allocation engine thread safe 2020-01-28 17:06:21 +02:00
Michal Nowikowski
78233068df [#1098] adjusted code for release
- update copyright dates
- prepare messages files
- added release entry in ChangeLog file
2020-01-27 19:50:37 +01:00
Thomas Markwalder
a65be143ec [#981] Reworked DdnsParams to allow on-demand value fetching
src/lib/dhcpsrv/d2_client_cfg.*
    Moved DdnsParams to srv_config.*

src/lib/dhcpsrv/network.h
    respaced

src/lib/dhcpsrv/srv_config.*
    DdnsParams relocated here from d2_client_cfg.*.
    Added SubnetPtr member.
    Added constructors from Subnet4Ptr and Subnet6Ptr
    Replaced individual members with getters.

src/lib/dhcpsrv/tests/d2_client_unittest.cc
src/lib/dhcpsrv/tests/srv_config_unittest.cc
    Retrofitted tests accordingly.

src/lib/dhcpsrv/alloc_engine.*
src/lib/dhcpsrv/d2_client_mgr.*
    Updated DdnsParams references

src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/tests/fqdn_unittest.cc
    Updated DdnsParams references

src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/tests/fqdn_unittest.cc
    Updated DdnsParams references
2020-01-27 12:55:24 -05:00
Razvan Becheriu
f3cc85ce2e [#1040] address review 2020-01-24 12:27:09 +00:00
Razvan Becheriu
d5e45c7863 [#1040] address review 2020-01-24 12:27:09 +00:00
Razvan Becheriu
c41e32f709 [#1040] handle update and delete 2020-01-24 12:27:09 +00:00
Razvan Becheriu
364bbbf3d4 [#1040] handle update and delete 2020-01-24 12:27:09 +00:00
Razvan Becheriu
b852520424 [#1040] delete lease only if expire time has not changed 2020-01-17 15:08:16 +02:00
Razvan Becheriu
01eba32f6a [1040] separated delete functions 2020-01-10 17:41:35 +02:00
Francis Dupont
b1fb6811ff [#897] Addressed comments 2019-12-10 21:05:02 +01:00
Francis Dupont
e219cc9d27 [897-add-infinite-valid-lifetime-for-bootp] Added BOOTP client class 2019-12-10 21:05:02 +01:00
Kristoffer Larsen
7bbddc50a1 Add log message containing classes during allocation failure 2019-10-27 21:04:57 -04:00
Thomas Markwalder
211786337f [#754,!558] Update v6 lease data for dynamic leases with HRs
src/lib/dhcpsrv/alloc_engine.cc
    AllocEngine::allocateLeases6(ClientContext6& ctx) - add call to
    updateLeaseData() to case 3.

src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc
    TEST_F(AllocEngine6Test, hostDynamicAddress)
    TEST_F(AllocEngine6Test, globalHostDynamicAddress) - revamped to
    verify assignment and update for REQUESTs
2019-10-18 08:49:36 -04:00
Thomas Markwalder
7cfc5d3fd3 [#35,!517] Addressed review comments
Addressed a myriad of minor typos and wording issues.

modified:
ChangeLog
doc/examples/kea4/all-keys.json
doc/examples/kea6/all-keys.json
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp4/tests/fqdn_unittest.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/d2_unittest.cc
src/bin/dhcp6/tests/fqdn_unittest.cc
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine.h
src/lib/dhcpsrv/d2_client_cfg.h
src/lib/dhcpsrv/parsers/base_network_parser.cc
src/lib/dhcpsrv/srv_config.h
2019-10-10 08:36:39 -04:00
Thomas Markwalder
ce14110bf2 [#35,!517] Rework kea-dhcp6 parsing and server
src/bin/dhcp6/ctrl_dhcp6_srv.cc
    Removed setting D2ClientCfg fetch function

src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_parser.yy
    ddns-send-updates
    ddns-override-no-update
    ddns-override-client-update
    ddns-replace-client-name
    ddns-generated-prefix
    ddns-qualifying-suffix
    - added to DHCP4,SHARED_NETWORK,SUBNET4

    hostname-char-set
    hostname-char-replacement
    - added to SHARED_NETWORK,SUBNET4

src/bin/dhcp6/dhcp6_srv.cc
    Dhcpv6Srv::processClientFqdn()
    Dhcpv6Srv::createNameChangeRequests()
    Dhcpv6Srv::updateReservedFqdn()
    - use cxt.getDdnsParams()

src/bin/dhcp6/json_config_parser.cc
    configureDhcp6Server()
    - use SrvConfig::moveDdnsParams() to move dhcp-ddns parameters
    - handle new "ddns-" globals

src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/fqdn_unittest.cc
src/bin/dhcp6/tests/get_config_unittest.cc
    Updated tests
2019-10-10 08:34:39 -04:00
Thomas Markwalder
77cfe4bc79 [#35,!517] Added getDdnsParams() to AllocEngine::ClientContext4/6
src/lib/dhcpsrv/alloc_engine.*
    AllocEngine::ClientContext6::getDdnsParams()
    AllocEngine::ClientContext4::getDdnsParams() - new
    methods which return a DdnsParams instance scoped by
    currently selected subnet

    Replaced direct references to context::ddns_params_ with
    new getter methods.

src/lib/dhcpsrv/parsers/simple_parser4.cc
src/lib/dhcpsrv/parsers/simple_parser6.cc
    Removed global defaults for hostname-char-set/replacement
2019-10-10 08:32:44 -04:00
Thomas Markwalder
b767f9446e [#35,!517] Modify D2ClientMgr functions to accept DdnsParams parameter
D2ClientMgr functions now get behavior parameters from a passed in
structure instead of D2ClientMgr::d2_client_config_.

src/lib/dhcpsrv/d2_client_cfg.h
    struct DdnsParams  - new structure to convey request specific
    (i.e.scopable) Ddns params

src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine.h
    Added ddns_params_ to ClientContext4/6

src/lib/dhcpsrv/d2_client_mgr.*
    D2ClientMgr::adjustFqdnFlags()
    D2ClientMgr::adjustDomainName()
    D2ClientMgr::analyzeFqdn()
    D2ClientMgr::generateFqdn()
    D2ClientMgr::qualifyName() - now accept DdnsParams instance as
    parameter

src/lib/dhcpsrv/tests/d2_client_unittest.cc
    Reworked tests to use DdnsParams
2019-10-10 08:32:44 -04:00
Thomas Markwalder
4b9b0514cb [#750,!440] Added unit tests to allocation engine
src/lib/dhcpsrv/alloc_engine.cc
     AllocEngine::removeNonreservedLeases6() -
     exits with no action if the existing list of leases contains
     one or less

added ChangeLog entry
2019-08-07 09:34:04 -04:00
Francis Dupont
495cd829eb [295-min-max-lease-time-configuration-options] Addressed easy comments 2019-06-22 10:05:23 -04:00
Francis Dupont
9ef628e779 [295-min-max-lease-time-configuration-options] Removed default- keywords 2019-06-22 10:05:23 -04:00
Francis Dupont
ba9b894b6a [295-min-max-lease-time-configuration-options] checkpoint: code done, need unit tests and doc 2019-06-22 10:05:23 -04:00
Francis Dupont
80985ac8a7 [295-min-max-lease-time-configuration-options] checkpoint 2019-06-22 10:05:23 -04:00
Francis Dupont
da42fc316e [295-min-max-lease-time-configuration-options] checkpoint 2019-06-22 10:05:23 -04:00
Francis Dupont
7088f78b02 [567-remove-lease-t1_-and-t2_-members] Removed t1/t2 from leases 2019-06-19 02:43:03 -04:00
Thomas Markwalder
66fc02e105 [#557,!310] Fixed kea-dhcp6 DNS updates on renewals with generated FQDNs
Moved logic for detecting FQDN changes from the alloc engine to the
kea-dhcp6 server proper.  This allows the change detection to be done after
FQDN generation.

src/bin/dhcp6/dhcp6_srv.*
    Dhcpv6Srv::createNameChangeRequests() - modified to detect when changes
    to a valid lease require a DNS remove

    Dhcpv6Srv::generateFqdn() - updated to store the generated name in
    the current context

src/lib/dhcpsrv/alloc_engine.cc
    AllocEngine::extendLease6()
    AllocEngine::updateLeaseData() - removed logic that checks for FQDN changes

src/bin/dhcp6/dhcp6_messages.*
    Revamped a message
2019-05-15 11:21:56 -04:00
Francis Dupont
e463f7dd81 [509-improve-disabling-client-id] [509-improve-disabling-client-id-] Factored subnetsIncludeMatchClientId and subnetsAllHRGlobal 2019-05-10 13:11:45 +02:00
Francis Dupont
8529b3181d [509-improve-disabling-client-id] [509-improve-disabling-client-id-] typo 2019-05-10 13:11:45 +02:00