2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-29 04:57:52 +00:00

82 Commits

Author SHA1 Message Date
Francis Dupont
3e930eb348 [master] regen all bison files 2019-03-11 13:07:38 +00:00
Francis Dupont
0f58269410 [#365,!194] regen bison 2019-01-10 14:47:23 +00:00
Thomas Markwalder
9a7cd6e027 [#365,!194] kea-dhcp4 can be configured to calculate T1 and T2
doc/guide/dhcp4-srv.xml
    Updated user guide with new parameters and details on rules

src/lib/cc/data.cc
    DoubleElement::toJSON(std::ostream& ss) - modified to ensure whole number
     values are suffixed with ".0"

src/lib/utils/doubles.h - new file
   provides a function for equating doubles within a given tolerance

src/lib/cc/simple_parser.*
    SimpleParser::getDouble() - new method for fetching real number
    parameters as DoulbeElements

src/lib/dhcpsrv/network.*
    Added members and support for new paramters to Network4:
        calculate_tee_times_, t1_percent_, t2_percent_

src/lib/dhcpsrv/parsers/dhcp_parsers.cc
src/lib/dhcpsrv/parsers/simple_parser4.cc
    Added support for new parameters to Subnet4ConfigParser

src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/json_config_parser.cc
    Added parser support for calculate-tee-times, t1-percent, and t2-percent

src/bin/dhcp4/dhcp4_srv.*
    Dhcpv4Srv::setTeeTimes(lease, subnet, resp) - new method for
    determining T1 adn T2 values
2019-01-09 11:14:01 -05:00
Francis Dupont
9a427e9e3d [master] Regen flex/bison (with bison 3.2.2) 2018-11-27 13:45:23 +00:00
Francis Dupont
c14a4b48f3 [#275, !130] Regen flex/bison 2018-11-27 08:39:22 -05:00
Francis Dupont
196a77b3d3 [master] Regen flex/bison 2018-11-20 22:58:30 +00:00
Thomas Markwalder
33c86243dc [#260,!120] Packet queueing is now optional
src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc
    ControlledDhcpv<4/6>Srv::processConfig() - now calls
        IfaceMgr::configureDHCPPacketQueue

src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy
    dhpc-queue-control parsing updated to enforce
    enable-queue/queue-type rules

src/bin/dhcp<4/6>/tests/config_parser_unittest.cc
    TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl)
    TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid)

src/lib/dhcp/iface_mgr.*
    IfaceMgr
    - closeSockets()  - now calls stopDHCPReceiver

    - openSockets<4/6>() -  now calls startDHCPReceiver

    - receive<4/6>Indirect() - new function which monitors receiver
    thread watch sockets, reads DHCP packets from queue

    - receive<4/6>Direct() - new function which monitors and reads DHCP
    packets from interface sockets directly

    - receive<4/6>() - rewritten to call receive<4/6>Indirect
    if receiver thread is running, otherwise it calls receive<4/6>Direct

    - configureDHCPPacketQueue() - new function which either enables queuing
    by creating a new packet queue, or disables it by destroying the
    existing queue

src/lib/dhcp/packet_queue_mgr.h
    PacketQueue::destroyPacketQueue() - new function

src/lib/dhcp/packet_queue_mgr<4/6>.cc
    PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a
    default packet queue

src/lib/dhcpsrv/cfg_iface.cc
    CfgIface::closeSockets() - removed call to stopDHCPReceiver
    CfgIface::openSockets() - removed call to startDHCPReceiver

src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.*
    DHCPQueueControlParser
    - removed unused family_ member
    - parse() - added support for enable-queue

src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc
    - new file
2018-11-20 13:22:59 -05:00
Francis Dupont
478b523060 [#268,!125] Regen flex/bison 2018-11-20 19:00:41 +01:00
Francis Dupont
cafeba167e [#182, !128] Regen flex/bison 2018-11-20 13:51:15 +00:00
Francis Dupont
e1def12420 [#270, !129] regen bison with 3.2.1 2018-11-17 21:55:25 +00:00
Francis Dupont
2ce409a598 [master] Regen bison 3.0.5 (>= 3.1 bugged) 2018-11-15 14:08:33 +00:00
Francis Dupont
b0b1d2e765 [master] Regen bison with 3.2.1 (last) version 2018-11-15 13:38:22 +00:00
Thomas Markwalder
09d5ffebc8 [master] Adds initial congestion handling
Merge branch '42-congestion-handler-exp-1'
2018-11-08 09:06:49 -05:00
Thomas Markwalder
464ea71b2b [#42,!103] Addressed majority of review comments
Most notable change is "queue-control" is now "dhcp-queue-control"
2018-11-07 18:07:34 -05:00
Francis Dupont
b8d67806bb [#66,!115] regen flex/bison 2018-11-07 23:19:27 +07:00
Sebastian Schrader
1ac65d772f [5184] Generate lexer and parser files
This change is a separate commit to reduce noise.
2018-11-07 23:17:45 +07:00
Thomas Markwalder
eddf6e3dfb [#42] kea-dhcp4 parsing simplified
kea-dhcp4 parsing now matches kea-dhpc6 in parsing queue-control
as simply a map that must contain "queue-type".
2018-11-06 09:42:59 -05:00
Thomas Markwalder
90fd7ebfaa [#42] Implemented PacketQueueMgr class
New files:
    src/lib/dhcp/packet_queue_mgr.h
    src/lib/dhcp/packet_queue_mgr4.cc
    src/lib/dhcp/packet_queue_mgr4.h
    src/lib/dhcp/packet_queue_mgr6.cc
    src/lib/dhcp/packet_queue_mgr6.h
    src/lib/dhcp/tests/packet_queue_mgr4_unittest.cc
    src/lib/dhcp/tests/packet_queue_mgr6_unittest.cc
    src/lib/dhcp/tests/packet_queue_testutils.h

src/bin/dhcp4/ctrl_dhcp4_srv.cc
    Cleaned up packet queue config block

src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/tests/config_parser_unittest.cc
    added queue-type

src/bin/dhcp4/dhcp4_messages.mes
    added DHCP4_CONFIG_PACKET_QUEUE message

src/lib/dhcp/Makefile.am
    packet_queue_mgr.h
    packet_queue_mgr4.cc packet_queue_mgr4.h
    packet_queue_mgr6.cc packet_queue_mgr6.h

src/lib/dhcp/iface_mgr.*
    Replaced packet queue members with PQM members
    Added PQM instantion to IfaceMgr ctor

src/lib/dhcp/packet_queue.h
    added getInfo,getInfoStr

src/lib/dhcp/tests/Makefile.am
    packet_queue_mgr4_unittest.cc
    packet_queue_mgr6_unittest.cc

src/lib/dhcpsrv/parsers/queue_control_parser.cc
    added queue-type
2018-11-05 11:21:29 -05:00
Thomas Markwalder
036d249fd1 [#42, !103] Interrim commit, kea-dhcp4 supports "queue-control"
kea-dhcp4 will parse and use "queue-control" to configure ring
    buffer size:

    "Dhcp4":
    {
        "queue-control": {
            # max number of packets the ring will hold
            "capacity" : 100
        },
    :

    This is an interrim commit for testing purposes.
    Expect a fair amount of refactoring in subsequent commits.

New files:
	src/lib/dhcp/queue_control.cc
	src/lib/dhcp/queue_control.h
	src/lib/dhcp/tests/queue_control_unittest.cc
	src/lib/dhcpsrv/parsers/queue_control_parser.cc
	src/lib/dhcpsrv/parsers/queue_control_parser.h

src/bin/dhcp4/ctrl_dhcp4_srv.cc
    ControlledDhcpv4Srv::processConfig() -
        added logic to set packet queue controller

src/bin/dhcp4/dhcp4_lexer.ll b/src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/parser_context.*
    Added queue-control parsing

src/bin/dhcp4/json_config_parser.cc
    configureDhcp4Server() - recognize and parse "queue-control"

src/bin/dhcp4/tests/config_parser_unittest.cc
    TEST_F(Dhcp4ParserTest, queueControl)
    TEST_F(Dhcp4ParserTest, queueControlInvalid)
    - new tests

src/lib/dhcp/iface_mgr.*
    IfaceMgr::getPacketQueueControl4()
    IfaceMgr::setPacketQueueControl4()
    IfaceMgr::getPacketQueueControl6()
    IfaceMgr::setPacketQueueControl6()

src/lib/dhcp/packet_queue.*
    Use QueueControl class

src/lib/dhcpsrv/srv_config.*
    Added QueueControl member, getter/setter
    SrvConfig::toElement() - now emits queue-control if not null
2018-11-01 11:19:55 -04:00
Thomas Markwalder
7fd4a5c044 [#32,!23] - Added server-tag global to SrvConfig and kea-dhcp4/6
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/json_config_parser.cc
    added server-tag

src/bin/dhcp4/tests/config_parser_unittest.cc
    TEST_F(Dhcp4ParserTest, serverTag) - new test

src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_parser.yy
src/bin/dhcp6/json_config_parser.cc
    added server-tag

src/bin/dhcp6/tests/config_parser_unittest.cc
    TEST_F(Dhcp6ParserTest, serverTag)

src/lib/dhcpsrv/parsers/simple_parser4.cc
src/lib/dhcpsrv/parsers/simple_parser6.cc
    Added server-tag to global defaults

src/lib/dhcpsrv/srv_config.cc
    Added server_tag_ memger to SrvConfig

src/lib/dhcpsrv/tests/srv_config_unittest.cc
    TEST_F(SrvConfigTest, serverTag)
    TEST_F(SrvConfigTest, unparseConfigControlInfo6) - new tests
2018-10-05 09:19:44 -04:00
Thomas Markwalder
8c5e6ce814 [#32,!23] dhcp4 now parses "config-control" element
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
    Added parsing support for config-control and config-databases

src/bin/dhcp4/json_config_parser.cc
    configureDhcp4Server() - added handler for config-control element

src/bin/dhcp4/parser_context.*
    added CONFIG_CONTROL and CONFIG_DATABASE

src/bin/dhcp4/tests/config_parser_unittest.cc
   TEST_F(Dhcp4ParserTest, configControlInfo) - new test
2018-10-05 09:17:50 -04:00
Francis Dupont
d87859fb9a [116-interface-id-dhcpv4] regen flex/bison 2018-09-14 07:50:36 +00:00
Francis Dupont
e2205466bf [116-interface-id-dhcpv4] regen flex/bison 2018-09-12 18:54:47 +00:00
Francis Dupont
762e88096c [master] regen flex/bison 2018-08-16 11:37:55 +00:00
Thomas Markwalder
4f8db6c61e [5705] kea-dhcp4 now fully supports globl HRs
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
    Added support for HR_GLOBAL mode

src/bin/dhcp4/tests/dhcp4_test_utils.cc
    Minor modifications to output exception and config text
    when parsing fails.

src/bin/dhcp4/tests/host_unittest.cc
    New tests to make sure reservation matching behaves
    according to reservation modes

src/lib/dhcpsrv/network.cc
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
    Adding missed bits needed to parse HR_GLOBAL mode
2018-08-14 09:43:04 -04:00
Thomas Markwalder
f1b3b3c76d [5704] host backends and kea-dhcp4/6 support global HR storage
- Added constants for special SubnetIDs:
    SUBNET_ID_GLOBAL, SUBNET_ID_MAX, SUBNET_ID_UNUSED

- Modified code throughout to use these constants, rather than hard-coded
  values.   Note, MySQL and PostgreSQL host backends convert from NULL to
  UNUSED and back.

- kea-dhcp4/6 servers will now parse a "reservations" element at the global
  level.

src/lib/dhcpsrv/subnet_id.h
    Added constants SubnetID SUBNET_ID_GLOBAL, SUBNET_ID_MAX, SUBNET_ID_UNUSED

src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/json_config_parser.cc
    kea-dhcp4 parsing now handles reservations as a global element

src/bin/dhcp4/tests/config_parser_unittest.cc
    TEST_F(Dhcp4ParserTest, globalReservations) - new test to
    verify global HR parsing

src/bin/dhcp4/tests/dora_unittest.cc
src/lib/dhcpsrv/cfg_hosts.cc
src/lib/dhcpsrv/host.cc
src/lib/dhcpsrv/host_mgr.cc
src/lib/dhcpsrv/mysql_host_data_source.cc
src/lib/dhcpsrv/parsers/host_reservation_parser.cc
src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
src/lib/dhcpsrv/tests/alloc_engine_utils.cc
src/lib/dhcpsrv/tests/host_mgr_unittest.cc
src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc
src/lib/dhcpsrv/tests/host_reservations_list_parser_unittest.cc
src/lib/dhcpsrv/tests/host_unittest.cc
    Replaced SubnetID 0 with SUBNET_ID_UNUSED

src/lib/dhcpsrv/srv_config.cc
    SrvConfig::toElement() - added global reservations output

src/lib/dhcpsrv/tests/cfg_hosts_unittest.cc
    TEST_F(CfgHostsTest, globalSubnetIDs)
    TEST_F(CfgHostsTest, unusedSubnetIDs) - new tests

src/lib/dhcpsrv/tests/host_unittest.cc
    Replaced SubnetID 0 with SUBNET_ID_UNUSED
    TEST_F(HostTest, toText)  - updated to verify global ID output

src/lib/dhcpsrv/tests/mysql_host_data_source_unittest.cc
    TEST_F(MySqlHostDataSourceTest, globalSubnetId4)
    TEST_F(MySqlHostDataSourceTest, globalSubnetId6) - new tests

src/lib/dhcpsrv/tests/srv_config_unittest.cc
    TEST_F(SrvConfigTest, unparseHR) - added global HRs

src/lib/dhcpsrv/testutils/generic_host_data_source_unittest.*
    GenericHostDataSourceTest::testGlobalSubnetId4()
    GenericHostDataSourceTest::testGlobalSubnetId6()

src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_parser.yy
src/bin/dhcp6/json_config_parser.cc
    kea-dhcp6 now parses reservations as a global element

src/bin/dhcp6/tests/config_parser_unittest.cc
    TEST_F(Dhcp6ParserTest, globalReservations) - new test
2018-08-07 06:46:30 -04:00
Tomek Mrugalski
229b95b86a [5682] Parsers regenerated 2018-07-30 19:05:18 +02:00
Thomas Markwalder
ea3d6bca65 [5680] kea-dhcp4/6 now parse hostname-char-set and hostname-char-replacment params
Added to parsing and parsing unit tests.
Servers do not yet utilize the values.

Modified:

src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy

src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp4/tests/fqdn_unittest.cc
src/bin/dhcp4/tests/get_config_unittest.

src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_parser.yy

src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/fqdn_unittest.cc
src/bin/dhcp6/tests/get_config_unittest.
2018-07-27 13:54:10 +02:00
Thomas Markwalder
c71f3d383f [5535] kea-dhcp4 parsing now supports relay "ip-addresses"
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
    Modified to support "ip-address" and
    "ip-addresses" under "relay"

src/bin/dhcp4/tests/get_config_unittest.cc
    Updated per process.

src/bin/dhcp4/tests/config_parser_unittest.cc
    void checkResult() - modified to output parsing error text

    TEST_F(Dhcp4ParserTest, subnetRelayInfo)
    TEST_F(Dhcp4ParserTest, classifySubnets)
    - updated to use new Network methods

    TEST_F(Dhcp4ParserTest, subnetRelayInfoList) - new test
    to verify a list of addresses in relay
2018-04-26 13:54:45 -04:00
Francis Dupont
bcf22140a9 [master] regen flex/bison 2018-04-11 14:44:30 +00:00
Francis Dupont
a2ae14652d [master] regen flex/bison 2018-03-27 12:28:06 +00:00
Francis Dupont
13a8f282eb [master] regen flex 2018-03-22 18:59:28 +00:00
Tomek Mrugalski
1739f6c709 [5484] Bison grammar regenerated. 2018-03-12 19:53:23 +00:00
Thomas Markwalder
8e62a05838 [master] kea-dhcp4/6 now support Postgresql automatic reconnect
Merges branch 'trac5477'
2018-03-08 15:16:42 -05:00
Thomas Markwalder
249219f1fc [5477] dhcpsrv/postgres and kea-dhcp4 now support db reconnect
kea-dhcp4
    added support for max-reconnect-tries and reconnect-wait-time
    to lease and host db parsers

    Added a callback for when DB backends detect loss of connectivity

    Added a self-rescheduling method to attempt to reconnect to the
    backends if retries are enabled

dhcpsrv
    Added a callback that DatabaseConnection derivations should invoke
    when they lose connectivity.

    Added an optional callback parameter from CfgDbAccess::createManagers()
    all the way down to DatabaseConnection ctor.

    pgsql_connection.cc
        PgSqlConnection::~PgSqlConnection() - Added logic to close the
        connection only when the connect state is still OK.
        Otherwise it likes to core dump.

        PgSqlConnection::checkStatementError() - Modified to invoke the
        connectivity lost callback on "fatal" errors

    pgsql_lease_mgr_unittest.cc
    pgsql_host_data_source_unittest.cc
        Added tests to verify that the lost callback is NOT invoked on an
        open failure
2018-02-28 15:29:23 -05:00
Francis Dupont
ac01be53c9 [trac5425a] regen flex/bison 2018-01-18 23:15:39 +00:00
Francis Dupont
4d8719d38b [trac5351] regen bison 2017-12-17 15:07:59 +00:00
Francis Dupont
a3bd7af4d9 [trac5351] regen flex/bison 2017-12-03 12:45:12 +00:00
Francis Dupont
a2cc11e0dd [trac5351] regen flex/bison 2017-12-02 15:39:53 +00:00
Francis Dupont
15158895db [trac5351] regen flex/bison 2017-12-01 15:20:21 +00:00
Francis Dupont
d37e2fc829 [trac5351] regen flex/bison 2017-12-01 10:36:07 +00:00
Francis Dupont
ff211701b7 [trac5351] regen flex/bison 2017-11-29 08:39:15 +00:00
Francis Dupont
e33d5095da [trac5351] regen flex/bison 2017-11-29 07:10:50 +00:00
Francis Dupont
06c3111760 [trac5351] regen bison 2017-11-28 15:47:33 +00:00
Francis Dupont
1bab6cdae9 [trac5351 regen flex/bison 2017-11-28 01:00:12 +00:00
Francis Dupont
c90d0d2ecf [master] Regen flex/bison 2017-10-23 13:25:07 +00:00
Marcin Siodelski
85fbb33e65 [master] Regenerated parsers after merge of #5377. 2017-10-10 14:07:19 +00:00
Francis Dupont
74b6b67b79 [trac5073a] regen flex/bison 2017-09-19 18:39:17 +00:00
Tomek Mrugalski
74b824cc80 [master] Merge branch 'trac5357' (shared network parsers update)
# Conflicts:
#	src/bin/dhcp4/dhcp4_lexer.cc
#	src/bin/dhcp4/dhcp4_parser.cc
#	src/bin/dhcp4/dhcp4_parser.h
#	src/bin/dhcp6/dhcp6_lexer.cc
#	src/bin/dhcp6/dhcp6_parser.cc
#	src/bin/dhcp6/dhcp6_parser.h
2017-09-14 12:02:38 +02:00
Tomek Mrugalski
4e8bfc7cca [5357] Parsers renegerated. 2017-09-13 22:23:57 +02:00