Skip to content

Commit

Permalink
[#3587] addressed review
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Becheriu authored and tmarkwalder committed Oct 28, 2024
1 parent bc9a6f0 commit 31754d8
Show file tree
Hide file tree
Showing 55 changed files with 1,296 additions and 1,312 deletions.
4 changes: 2 additions & 2 deletions doc/examples/kea4/all-keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
"name": "late",

// Boolean flag indicating whether the class expression is only evaluated
// when the selected configuration (i.e. pool,subnet, shared-network)
// includes this class name in an "evaluate-additional-classes" list. The
// when the selected configuration (i.e. pool, subnet, shared-network)
// includes this class name in its "evaluate-additional-classes" list. The
// default value false means that the class test expression must
// always be evaluated.
"only-in-additional-list": true,
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/kea4/classify2.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"client-classes": [

// This class is included by the second subnet in its 'evaluate-additional-classes'
// list so only-in-addtional-list is enabled. This ensures the class will only
// list so 'only-in-additional-list' is enabled. This ensures the class will only
// be evaluated if the second subnet is selected. The test expression returns true.
// Note it is not possible to depend on VoIP class because it is not yet
// defined.
Expand Down
5 changes: 3 additions & 2 deletions doc/examples/kea6/classify2.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
// One packet can belong to zero or more classes.
"client-classes": [

// This class is required by the second subnet and is evaluated only
// if it is required. The test expression returns true.
// This class is included by the second subnet in its 'evaluate-additional-classes'
// list so 'only-in-additional-list' is enabled. This ensures the class will only
// be evaluated if the second subnet is selected. The test expression returns true.
// Note it is not possible to depend on cable-modems class because it
// is not yet defined.
{
Expand Down
7 changes: 3 additions & 4 deletions doc/sphinx/arm/classify.rst
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@ A client class definition can contain the following properties:
- The ``only-in-additional-list`` flag is not mandatory; when its value is set to
``false`` (the default), membership is determined during classification and is
available for subnet selection, for instance. When the value is set to
``true``, membership is evaluated only if the class appears in an ``evaluate-
additional-classes`` list and is usable only for option configuration.
``true``, membership is evaluated only if the class appears in an
``evaluate-additional-classes`` list and is usable only for option configuration.
- The ``user-context`` is not mandatory and represents a map with user-defined data
and possibly configuration options for hook libraries.
- The ``next-server`` parameter is not mandatory and configures the ``siaddr`` field in
Expand Down Expand Up @@ -1294,15 +1294,14 @@ the option to members of class "melon":
}]
}


Clients that match class "melon" will have a value of 123 for option "foo",
while clients that do not match "melon" will have a value of 456 for option
"foo".

.. note::

Though examples above are for DHCPv4, class-tagging syntax and
behavior is the same for DHPCv6.
behavior is the same for DHCPv6.

Classes and Hooks
=================
Expand Down
6 changes: 4 additions & 2 deletions doc/sphinx/arm/dhcp4-srv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3474,12 +3474,12 @@ over ``option-data`` in a class. If ``option-data`` is moved to a
required class and required in the subnet, a class evaluated earlier
may take precedence.

Additional evaluation is also available at the shared network and pool levels.
Additional evaluation is also available at shared network and pool levels.
The order in which additional classes are considered is: pool, subnet,
and shared network, i.e. in the same order from the way in which
``option-data`` is processed.

Since Kea version 2.7.4 additional client classes configured without
Since Kea version 2.7.4 additional classes configured without
a test expression are unconditionally added, i.e. they are considered
to always be evaluated to ``true``.

Expand Down Expand Up @@ -8311,6 +8311,8 @@ at which it is currently supported.
+-----------------------------+----------------------------+--------------+-------------+-------------+-------------+
| require-client-classes | no | n/a | yes | yes | yes |
+-----------------------------+----------------------------+--------------+-------------+-------------+-------------+
| evaluate-additional-classes | no | n/a | yes | yes | yes |
+-----------------------------+----------------------------+--------------+-------------+-------------+-------------+
| reservations-global | yes | n/a | yes | yes | n/a |
+-----------------------------+----------------------------+--------------+-------------+-------------+-------------+
| reservations-in-subnet | yes | n/a | yes | yes | n/a |
Expand Down
16 changes: 9 additions & 7 deletions doc/sphinx/arm/dhcp6-srv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4668,22 +4668,22 @@ For example:
]
}

The ``only-in-additional-list`` parameter is needed here to force
evaluation of the class after the lease has been allocated and thus the
reserved class has been also assigned.
The ``only-in-additional-list`` parameter is needed here to force evaluation
of the class after the lease has been allocated and thus the reserved
class has been also assigned.

.. note::

The classes specified in non-global host reservations
are assigned to the processed packet after all classes with the
``only-in-additional-list` parameter set to ``false`` have been evaluated.
``only-in-additional-list`` parameter set to ``false`` have been evaluated.
This means that these classes must not depend on the
statically assigned classes from the host reservations. If
such a dependency is needed, the ``only-in-addtional-list`` must
such a dependency is needed, the ``only-in-additional-list`` parameter must
be set to ``true`` for the dependent classes. Such classes are
evaluated after the static classes have been assigned to the packet.
This, however, imposes additional configuration overhead, because
all classes marked as ``only-in-addtional-list`` must be listed in the
all classes marked as ``only-in-additional-list`` must be listed in the
``evaluate-additional-classes`` list for every subnet where they are used.

.. note::
Expand Down Expand Up @@ -8059,7 +8059,9 @@ at which it is currently supported.
+-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+
| renew-timer | yes | n/a | yes | yes | n/a | n/a |
+-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+
| require-client-classes | n/a | n/a | yes | yes | yes | yes |
| require-client-classes | no | n/a | yes | yes | yes | yes |
+-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+
| evaluate-additional-classes | no | n/a | yes | yes | yes | yes |
+-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+
| reservations-global | yes | n/a | yes | yes | n/a | n/a |
+-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/arm/hooks-class-cmds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,4 @@ returned if they are not specified for the class.
``only-in-additional-list`` and deprecated. In order to allow users time
to migrate class commands will still accept it as input but translate it
to ``only-in-additional-list`` on output. Eventually support for the
old name wil be removed.
old name will be removed.
2 changes: 1 addition & 1 deletion doc/sphinx/arm/hooks-ha.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ lease, it parks the client response until the peers acknowledge the lease
update. At that point, the server unparks the response and sends it to the
client. This applies to client queries that cause lease changes, such as
DHCPREQUEST for DHCPv4 and Request, Renew, and Rebind for DHCPv6. It does not
apply to DHPCDISCOVERs (v4) or Solicits (v6).
apply to DHCPDISCOVERs (v4) or Solicits (v6).

.. _ha-maintenance:

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/umls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ These diagrams are focused on those aspects of Kea processing that will be most
Main Loop
^^^^^^^^^

The main loop is common to both DHCPv4 and DHPCv6 servers.
The main loop is common to both DHCPv4 and DHCPv6 servers.

.. figure:: uml/main-loop.*

Expand Down
10 changes: 4 additions & 6 deletions src/bin/admin/tests/mysql_tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ mysql_wipe() {
}

# Checks that a column in a table exists.
# param table name of table containgin the column
# param column name of the column to check
# param table name of table containing the column
check_table_column() {
column=$1;shift
table=$1;shift
Expand Down Expand Up @@ -966,16 +966,14 @@ mysql_upgrade_25_to_26_test() {
# client_classes been added to dhcp6_options
check_table_column client_classes dhcp6_options

# check rename of require_client_classes to evaluate_additaionl_classes.
check_table_column evaluate_additional_classes dhcp4_shared_network
check_table_column evaluate_additional_classes dhcp4_shared_network
# check rename of require_client_classes to evaluate_additional_classes.
check_table_column evaluate_additional_classes dhcp4_shared_network
check_table_column evaluate_additional_classes dhcp4_subnet
check_table_column evaluate_additional_classes dhcp4_pool
check_table_column evaluate_additional_classes dhcp6_shared_network
check_table_column evaluate_additional_classes dhcp6_subnet
check_table_column evaluate_additional_classes dhcp4_pool
check_table_column evaluate_additional_classes dhcp6_pd_pool
check_table_column evaluate_additional_classes dhcp6_pool
check_table_column evaluate_additional_classes dhcp6_pd_pool

# check rename of only_if_required to only_in_additional_list.
check_table_column only_in_additional_list dhcp4_client_class
Expand Down
14 changes: 6 additions & 8 deletions src/bin/admin/tests/pgsql_tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ run_statement() {
}

# Checks that a column in a table exists.
# param table name of table containgin the column
# param column name of the column to check
# param table name of table containing the column
check_table_column() {
column=$1;shift
table=$1;shift
Expand Down Expand Up @@ -1053,21 +1053,19 @@ pgsql_upgrade_24_to_25_test() {

pgsql_upgrade_25_to_26_test() {
# client_classes been added to dhcp4_options
check_table_column client_classes dhcp4_options;
check_table_column client_classes dhcp4_options

# client_classes been added to dhcp6_options
check_table_column client_classes dhcp6_options;
check_table_column client_classes dhcp6_options

# check rename of require_client_classes to evaluate_additaionl_classes.
check_table_column evaluate_additional_classes dhcp4_shared_network
check_table_column evaluate_additional_classes dhcp4_shared_network
# check rename of require_client_classes to evaluate_additional_classes.
check_table_column evaluate_additional_classes dhcp4_shared_network
check_table_column evaluate_additional_classes dhcp4_subnet
check_table_column evaluate_additional_classes dhcp4_pool
check_table_column evaluate_additional_classes dhcp6_shared_network
check_table_column evaluate_additional_classes dhcp6_subnet
check_table_column evaluate_additional_classes dhcp4_pool
check_table_column evaluate_additional_classes dhcp6_pd_pool
check_table_column evaluate_additional_classes dhcp6_pool
check_table_column evaluate_additional_classes dhcp6_pd_pool

# check rename of only_if_required to only_in_additional_list.
check_table_column only_in_additional_list dhcp4_client_class
Expand Down
Loading

0 comments on commit 31754d8

Please sign in to comment.