diff options
author | Razvan Becheriu <razvan@isc.org> | 2022-10-11 18:32:41 +0200 |
---|---|---|
committer | Razvan Becheriu <razvan@isc.org> | 2022-10-25 09:06:44 +0200 |
commit | 50790b654a4cc76101ecac7b21ca72215207658c (patch) | |
tree | a5b8743bb31df39649ca9a5010504ae7d30b2a77 /src/bin | |
parent | [#2548] set valid_lft_ and preferred_lft_ to 0 instead of setting cltt_ (diff) | |
download | kea-50790b654a4cc76101ecac7b21ca72215207658c.tar.xz kea-50790b654a4cc76101ecac7b21ca72215207658c.zip |
[#2548] addressed review comments
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/dhcp4/dhcp4_messages.cc | 2 | ||||
-rw-r--r-- | src/bin/dhcp4/dhcp4_messages.mes | 10 | ||||
-rw-r--r-- | src/bin/dhcp6/dhcp6_messages.cc | 4 | ||||
-rw-r--r-- | src/bin/dhcp6/dhcp6_messages.mes | 20 | ||||
-rw-r--r-- | src/bin/dhcp6/tests/dhcp6_test_utils.h | 29 |
5 files changed, 37 insertions, 28 deletions
diff --git a/src/bin/dhcp4/dhcp4_messages.cc b/src/bin/dhcp4/dhcp4_messages.cc index 7f2ebf6a9a..b80cf16c26 100644 --- a/src/bin/dhcp4/dhcp4_messages.cc +++ b/src/bin/dhcp4/dhcp4_messages.cc @@ -311,7 +311,7 @@ const char* values[] = { "DHCP4_RELEASE", "%1: address %2 was released properly.", "DHCP4_RELEASE_DELETED", "%1: address %2 was properly deleted on release.", "DHCP4_RELEASE_EXCEPTION", "%1: while trying to release address %2 an exception occurred: %3", - "DHCP4_RELEASE_EXPIRED", "%1: address %2 was properly expired on release.", + "DHCP4_RELEASE_EXPIRED", "%1: address %2 expired on release.", "DHCP4_RELEASE_FAIL", "%1: failed to remove lease for address %2", "DHCP4_RELEASE_FAIL_NO_LEASE", "%1: client is trying to release non-existing lease %2", "DHCP4_RELEASE_FAIL_WRONG_CLIENT", "%1: client is trying to release the lease %2 which belongs to a different client", diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index 742d4fcd23..b1d171124d 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -791,11 +791,11 @@ is a normal operation during client shutdown. The first argument includes the client and transaction identification information. The second argument includes the released IPv4 address. -% DHCP4_RELEASE_EXPIRED %1: address %2 was properly expired on release. -This informational message indicates that an address was properly expired on -release. It is a normal operation during client shutdown. The first argument -includes the client and transaction identification information. The second -argument includes the released IPv4 address. +% DHCP4_RELEASE_EXPIRED %1: address %2 expired on release. +This informational message indicates that an address expired on release. It is +a normal operation during client shutdown. The first argument includes the +client and transaction identification information. The second argument includes +the released IPv4 address. % DHCP4_RELEASE_DELETED %1: address %2 was properly deleted on release. This informational message indicates that an address was properly deleted on diff --git a/src/bin/dhcp6/dhcp6_messages.cc b/src/bin/dhcp6/dhcp6_messages.cc index b93c162c7c..f2486a373a 100644 --- a/src/bin/dhcp6/dhcp6_messages.cc +++ b/src/bin/dhcp6/dhcp6_messages.cc @@ -304,13 +304,13 @@ const char* values[] = { "DHCP6_RECLAIM_EXPIRED_LEASES_FAIL", "failed to reclaim expired leases: %1", "DHCP6_RELEASE_NA", "%1: binding for address %2 and iaid=%3 was released properly", "DHCP6_RELEASE_NA_DELETED", "%1: binding for address %2 and iaid=%3 was properly deleted on release", - "DHCP6_RELEASE_NA_EXPIRED", "%1: binding for address %2 and iaid=%3 was properly expired on release", + "DHCP6_RELEASE_NA_EXPIRED", "%1: binding for address %2 and iaid=%3 expired on release", "DHCP6_RELEASE_NA_FAIL", "%1: failed to remove address lease for address %2 and iaid=%3", "DHCP6_RELEASE_NA_FAIL_WRONG_DUID", "%1: client tried to release address %2, but it belongs to another client using duid=%3", "DHCP6_RELEASE_NA_FAIL_WRONG_IAID", "%1: client tried to release address %2, but it used wrong IAID (expected %3, but got %4)", "DHCP6_RELEASE_PD", "%1: prefix %2/%3 for iaid=%4 was released properly", "DHCP6_RELEASE_PD_DELETED", "%1: prefix %2/%3 for iaid=%4 was properly deleted on release", - "DHCP6_RELEASE_PD_EXPIRED", "%1: prefix %2/%3 for iaid=%4 was properly expired on release", + "DHCP6_RELEASE_PD_EXPIRED", "%1: prefix %2/%3 for iaid=%4 expired on release", "DHCP6_RELEASE_PD_FAIL", "%1: failed to release prefix %2/%3 for iaid=%4", "DHCP6_RELEASE_PD_FAIL_WRONG_DUID", "%1: client tried to release prefix %2/%3, but it belongs to another client (duid=%4)", "DHCP6_RELEASE_PD_FAIL_WRONG_IAID", "%1: client tried to release prefix %2/%3, but it used wrong IAID (expected %4, but got %5)", diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index 470e2c1660..aef2a91bc1 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -799,11 +799,11 @@ is a normal operation during client shutdown. The first argument includes the client and transaction identification information. The second and third argument hold the released IPv6 address and IAID respectively. -% DHCP6_RELEASE_NA_EXPIRED %1: binding for address %2 and iaid=%3 was properly expired on release -This informational message indicates that an address was properly expired on -release. It is a normal operation during client shutdown. The first argument -includes the client and transaction identification information. The second and -third argument hold the released IPv6 address and IAID respectively. +% DHCP6_RELEASE_NA_EXPIRED %1: binding for address %2 and iaid=%3 expired on release +This informational message indicates that an address expired on release. It is a +normal operation during client shutdown. The first argument includes the client +and transaction identification information. The second and third argument hold +the released IPv6 address and IAID respectively. % DHCP6_RELEASE_NA_DELETED %1: binding for address %2 and iaid=%3 was properly deleted on release This informational message indicates that an address was properly deleted on @@ -841,11 +841,11 @@ is a normal operation during client shutdown. The first argument holds the client and transaction identification information. The second and third argument hold the prefix and its length. The fourth argument holds IAID. -% DHCP6_RELEASE_PD_EXPIRED %1: prefix %2/%3 for iaid=%4 was properly expired on release -This informational message indicates that a prefix was properly expired on -release. It is a normal operation during client shutdown. The first argument -holds the client and transaction identification information. The second and -third argument hold the prefix and its length. The fourth argument holds IAID. +% DHCP6_RELEASE_PD_EXPIRED %1: prefix %2/%3 for iaid=%4 expired on release +This informational message indicates that a prefix expired on release. It is a +normal operation during client shutdown. The first argument holds the client and +transaction identification information. The second and third argument hold the +prefix and its length. The fourth argument holds IAID. % DHCP6_RELEASE_PD_DELETED %1: prefix %2/%3 for iaid=%4 was properly deleted on release This informational message indicates that a prefix was properly deleted on diff --git a/src/bin/dhcp6/tests/dhcp6_test_utils.h b/src/bin/dhcp6/tests/dhcp6_test_utils.h index 48953ad39f..39a5e834d2 100644 --- a/src/bin/dhcp6/tests/dhcp6_test_utils.h +++ b/src/bin/dhcp6/tests/dhcp6_test_utils.h @@ -147,7 +147,6 @@ public: /// /// See fake_received_ field for description virtual isc::dhcp::Pkt6Ptr receivePacket(int /*timeout*/) { - // If there is anything prepared as fake incoming // traffic, use it if (!fake_received_.empty()) { @@ -338,9 +337,17 @@ public: /// @brief Constructor NakedDhcpv6SrvTest(); - // Generate IA_NA or IA_PD option with specified parameters - boost::shared_ptr<isc::dhcp::Option6IA> generateIA(uint16_t type, uint32_t iaid, - uint32_t t1, uint32_t t2); + /// @brief Generate IA_NA or IA_PD option with specified parameters + /// + /// @param type The option type (usually 4 for IA_NA, 25 for IA_PD) + /// @param iaid The identity association identifier (id of IA) + /// @param t1 The T1 time + /// @param t2 The t2 time + /// @return The generated option + boost::shared_ptr<isc::dhcp::Option6IA> generateIA(uint16_t type, + uint32_t iaid, + uint32_t t1, + uint32_t t2); /// @brief generates interface-id option, based on text /// @@ -349,9 +356,8 @@ public: /// @return pointer to the option object isc::dhcp::OptionPtr generateInterfaceId(const std::string& iface_id) { isc::dhcp::OptionBuffer tmp(iface_id.begin(), iface_id.end()); - return (isc::dhcp::OptionPtr - (new isc::dhcp::Option(isc::dhcp::Option::V6, - D6O_INTERFACE_ID, tmp))); + return (isc::dhcp::OptionPtr(new isc::dhcp::Option(isc::dhcp::Option::V6, + D6O_INTERFACE_ID, tmp))); } /// @brief Generate binary data option @@ -364,7 +370,8 @@ public: /// @param data_size number of bytes of data to generate /// /// @return Pointer to the new option - isc::dhcp::OptionPtr generateBinaryOption(const DHCPv6OptionType type, size_t data_size) { + isc::dhcp::OptionPtr generateBinaryOption(const DHCPv6OptionType type, + size_t data_size) { if (data_size == 0) { return (isc::dhcp::OptionPtr (new isc::dhcp::Option(isc::dhcp::Option::V6, type))); @@ -461,8 +468,10 @@ public: /// @param expected_t2 expected T2 in IA_NA option /// @param check_addr whether to check for address with 0 lifetimes void checkIA_NAStatusCode(const boost::shared_ptr<isc::dhcp::Option6IA>& ia, - uint16_t expected_status_code, uint32_t expected_t1, - uint32_t expected_t2, bool check_addr = true); + uint16_t expected_status_code, + uint32_t expected_t1, + uint32_t expected_t2, + bool check_addr = true); void checkMsgStatusCode(const isc::dhcp::Pkt6Ptr& msg, uint16_t expected_status) { |