mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 14:35:29 +00:00
[#1781] Additional review comments
src/hooks/dhcp/high_availability/query_filter.h Added commentary src/hooks/dhcp/high_availability/tests/query_filter_unittest.cc Added commentary
This commit is contained in:
@@ -138,9 +138,17 @@ public:
|
|||||||
|
|
||||||
/// @brief Checks if this server should process the DHCPv4 query.
|
/// @brief Checks if this server should process the DHCPv4 query.
|
||||||
///
|
///
|
||||||
/// This method takes into account enabled scopes for this server and
|
/// This method uses a table of DHCPv4 message types to determine whether or
|
||||||
/// HA mode to determine whether this query should be processed. It
|
/// not a query needs further analysis to determine which HA server
|
||||||
/// triggers load balancing when load balancing mode is enabled.
|
/// should handle it or if it should simply be processed by this server.
|
||||||
|
///
|
||||||
|
/// For message types that qualify (e.g. DHCPDISCOVER, DHCPREQUEST, etc),
|
||||||
|
/// it then takes into account enabled scopes for this server and HA mode
|
||||||
|
/// to determine whether this query should be processed. It triggers load
|
||||||
|
/// balancing when load balancing mode is enabled.
|
||||||
|
///
|
||||||
|
/// Non-qualifying message types (e.g. DHCPLEASEQUERY) are passed
|
||||||
|
/// through for handling by this server.
|
||||||
///
|
///
|
||||||
/// @param query4 pointer to the DHCPv4 query instance.
|
/// @param query4 pointer to the DHCPv4 query instance.
|
||||||
/// @param [out] scope_class name of the class which corresponds to the
|
/// @param [out] scope_class name of the class which corresponds to the
|
||||||
@@ -154,9 +162,17 @@ public:
|
|||||||
|
|
||||||
/// @brief Checks if this server should process the DHCPv6 query.
|
/// @brief Checks if this server should process the DHCPv6 query.
|
||||||
///
|
///
|
||||||
/// This method takes into account enabled scopes for this server and
|
/// This method uses a table of DHCPv6 message types to determine whether or
|
||||||
/// HA mode to determine whether this query should be processed. It
|
/// not a query needs further analysis to determine which HA server
|
||||||
/// triggers load balancing when load balancing mode is enabled.
|
/// should handle it or if it should simply be processed by this server.
|
||||||
|
///
|
||||||
|
/// For message types that qualify (e.g. DHCPV6_SOLICIT, DHCPV6_REQUEST, etc),
|
||||||
|
/// it then takes into account enabled scopes for this server and HA mode
|
||||||
|
/// to determine whether this query should be processed. It triggers load
|
||||||
|
/// balancing when load balancing mode is enabled.
|
||||||
|
///
|
||||||
|
/// Non-qualifying message types (e.g. DHCPV6_LEASEQUERY) are passed through
|
||||||
|
/// for handling by this server.
|
||||||
///
|
///
|
||||||
/// @param query6 pointer to the DHCPv6 query instance.
|
/// @param query6 pointer to the DHCPv6 query instance.
|
||||||
/// @param [out] scope_class name of the class which corresponds to the
|
/// @param [out] scope_class name of the class which corresponds to the
|
||||||
|
@@ -768,7 +768,9 @@ QueryFilterTest::loadBalancingHaTypes4() {
|
|||||||
ASSERT_TRUE(server1_pkt && server2_pkt) << "do not have both scopes in "
|
ASSERT_TRUE(server1_pkt && server2_pkt) << "do not have both scopes in "
|
||||||
<< max_scope_tries << ", load balance broken?";
|
<< max_scope_tries << ", load balance broken?";
|
||||||
|
|
||||||
// We exceed DHCP_TYPES_EOF just to be sure.
|
// Iterate over message types. While setting message type to zero is
|
||||||
|
// semantically invalid, it is useful for testing here. Similarly we exceed
|
||||||
|
// DHCP_TYPES_EOF just to be sure.
|
||||||
for (uint8_t msg_type = 0; msg_type < DHCP_TYPES_EOF + 2; ++msg_type) {
|
for (uint8_t msg_type = 0; msg_type < DHCP_TYPES_EOF + 2; ++msg_type) {
|
||||||
// All message types should be in scope for server1.
|
// All message types should be in scope for server1.
|
||||||
server1_pkt->setType(msg_type);
|
server1_pkt->setType(msg_type);
|
||||||
@@ -844,7 +846,9 @@ QueryFilterTest::loadBalancingHaTypes6() {
|
|||||||
ASSERT_TRUE(server1_pkt && server2_pkt) << "do not have both scopes in "
|
ASSERT_TRUE(server1_pkt && server2_pkt) << "do not have both scopes in "
|
||||||
<< max_scope_tries << ", load balance broken?";
|
<< max_scope_tries << ", load balance broken?";
|
||||||
|
|
||||||
// We exceed DHCPV6_TYPES_EOF just to be sure.
|
// Iterate over message types. While setting message type to zero is
|
||||||
|
// semantically invalid, it is useful for testing here. Similarly we exceed
|
||||||
|
// DHCPV6_TYPES_EOF just to be sure.
|
||||||
for (uint8_t msg_type = 0; msg_type < DHCPV6_TYPES_EOF + 2; ++msg_type) {
|
for (uint8_t msg_type = 0; msg_type < DHCPV6_TYPES_EOF + 2; ++msg_type) {
|
||||||
// All message types should be in scope for server1.
|
// All message types should be in scope for server1.
|
||||||
server1_pkt->setType(msg_type);
|
server1_pkt->setType(msg_type);
|
||||||
|
Reference in New Issue
Block a user