]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3860] addressed review
authorRazvan Becheriu <razvan@isc.org>
Fri, 12 Sep 2025 09:06:57 +0000 (12:06 +0300)
committerFrancis Dupont <fdupont@isc.org>
Fri, 12 Sep 2025 21:44:55 +0000 (23:44 +0200)
doc/sphinx/arm/ext-radius.rst
src/hooks/dhcp/radius/client_attribute.cc
src/hooks/dhcp/radius/client_attribute.h
src/hooks/dhcp/radius/radius_parsers.cc
src/hooks/dhcp/radius/tests/attribute_unittests.cc
src/hooks/dhcp/radius/tests/config_unittests.cc
src/hooks/dhcp/radius/tests/dictionary_unittests.cc

index 6d32aae0a926e48ce77921bf9efaf4ae35fa1e82..6427d1a05708ed3b1018a9af34e16fe38047ed89 100644 (file)
@@ -235,7 +235,7 @@ At the service level, three sections can be configured:
 
    Vendor-Specific attribute can be specified in two ways: using a ``raw``
    value which must include the vendor and the vsa data, note that the ``data``
-   value is no longer supported sine Kea 3.1.2, and the ``expr`` value
+   value is no longer supported since Kea 3.1.2, and the ``expr`` value
    is evaluated to the content of the attribute. The second way was added
    by 3.1.2 and allows to specify a vendor attribute which is automatically
    embedded into a Vendor-Specific attribute.
index b011488be81fcd0578852384763e4202edc603d3..5e3b1118a1c0adab074f70d2dfc62390e44508ff 100644 (file)
@@ -658,7 +658,7 @@ AttrVsa::AttrVsa(const uint8_t type, const uint32_t vendor,
 }
 
 AttributePtr
-AttrVsa::fromText(const uint8_t type, const string& repr) {
+AttrVsa::fromText(const uint8_t /* type */, const string& /* repr */) {
     isc_throw(NotImplemented, "Can't decode vsa from text");
 }
 
index 8d2879b1caf0079e7adbcfe4c8b343765422fd94..b20e71b6a226b1f72a184f530535799ba76bc185 100644 (file)
@@ -813,7 +813,6 @@ private:
     std::string value_;
 };
 
-
 /// @brief Collection of attributes.
 ///
 /// Designed to not handle vendor attributes so can be keyed by type only.
@@ -841,12 +840,6 @@ public:
     Attributes() : container_() {
     }
 
-    /// @brief Copy constructor.
-    ///
-    /// @param other source attributes.
-    Attributes(const Attributes& other) : container_(other.container_) {
-    }
-
     /// @brief Destructor.
     virtual ~Attributes() {
         clear();
index dc4526bbe8bd3e18107a8ede1aad290542ba299a..4dc11f5fa5dd20679f5c93e0d41462e98f7d9caa 100644 (file)
@@ -109,7 +109,7 @@ RadiusConfigParser::parse(ElementPtr& config) {
         if (!AttrDefs::instance().getByType(1)) {
             uint32_t vendor = 0;
             try {
-              AttrDefs::instance().readDictionary(riref.dictionary_, vendor);
+                AttrDefs::instance().readDictionary(riref.dictionary_, vendor);
             } catch (const exception& ex) {
                 isc_throw(BadValue, "can't read radius dictionary: "
                           << ex.what());
index 02e9c3b48e216bad47301aa4f6f128b646444764..419592390fc41cc209f52a75f69adcc956a09e60 100644 (file)
@@ -243,8 +243,7 @@ TEST_F(AttributeTest, attrInt) {
     EXPECT_THROW_MSG(attr->toIpv6Prefix(), TypeError,
                      "the attribute value type must be ipv6prefix, not integer");
     EXPECT_THROW_MSG(attr->toIpv6PrefixLen(), TypeError,
-                     "the attribute value type must be ipv6prefix, not integer"
-);
+                     "the attribute value type must be ipv6prefix, not integer");
     EXPECT_THROW_MSG(attr->toVendorId(), TypeError,
                      "the attribute value type must be vsa, not integer");
     EXPECT_THROW_MSG(attr->toVsaData(), TypeError,
@@ -584,8 +583,8 @@ TEST_F(AttributeTest, attrVsa) {
                                         too_big_binary), BadValue,
                      "value is too large 250 > 249");
 
-    vector<uint8_t> too_bigvalue(MAX_STRING_LEN + 1, 0x87);
-    EXPECT_THROW_MSG(Attribute::fromBytes(def, too_bigvalue), BadValue,
+    vector<uint8_t> too_big_value(MAX_STRING_LEN + 1, 0x87);
+    EXPECT_THROW_MSG(Attribute::fromBytes(def, too_big_value), BadValue,
                      "value is too large 254 > 253");
 
     EXPECT_THROW_MSG(attr->toString(), TypeError,
index ea03e69795da932f71c5125091c55dad2b209bda..1c67a9bb7dfe1afea87c960952053b2a8c670419 100644 (file)
@@ -76,7 +76,7 @@ public:
     static const char* TEST_FILE;
 };
 
-const char* ConfigTest::TEST_FILE  = "test-dictonary";
+const char* ConfigTest::TEST_FILE = "test-dictionary";
 
 // Verify that a configuration must be a map.
 TEST_F(ConfigTest, notMap) {
index b2cc58ec7a2ad81a834a1175d10e72e4bcce44a6..1942dfd5e1a1c6082ac546f1eff7b4189b84419c 100644 (file)
@@ -98,7 +98,7 @@ public:
     static const char* TEST_FILE;
 };
 
-const char* DictionaryTest::TEST_FILE  = "test-dictionary";
+const char* DictionaryTest::TEST_FILE = "test-dictionary";
 
 // Verifies standards definitions can be read from the dictionary.
 TEST_F(DictionaryTest, standard) {
@@ -160,11 +160,11 @@ TEST_F(DictionaryTest, parseLine) {
                      "0 is reserved at line 1");
     EXPECT_THROW_MSG(parseLine("BEGIN-VENDOR"), BadValue,
                      "expected 2 tokens, got 1 at line 1");
-    EXPECT_THROW_MSG(parseLine("BEGIN-VENDOR  my-vendor 1"), BadValue,
+    EXPECT_THROW_MSG(parseLine("BEGIN-VENDOR my-vendor 1"), BadValue,
                      "expected 2 tokens, got 3 at line 1");
     EXPECT_THROW_MSG(parseLine("END-VENDOR", 1), BadValue,
                      "expected 2 tokens, got 1 at line 1");
-    EXPECT_THROW_MSG(parseLine("END-VENDOR  my-vendor 1", 1), BadValue,
+    EXPECT_THROW_MSG(parseLine("END-VENDOR my-vendor 1", 1), BadValue,
                      "expected 2 tokens, got 3 at line 1");
 
     EXPECT_THROW_MSG(parseLine("BEGIN-TLV my-vendor"), BadValue,
@@ -237,7 +237,7 @@ TEST_F(DictionaryTest, integerConstant) {
         "VENDOR DSL-Forum 3561",
         "BEGIN-VENDOR DSL-Forum",
         "ATTRIBUTE Agent-Circuit-Id 1 string",
-        "VALUE  Agent-Circuit-Id My-Value 1",
+        "VALUE Agent-Circuit-Id My-Value 1",
         "END-VENDOR DSL-Forum"
     };
     expected = "attribute 'Agent-Circuit-Id' in vendor 3561";
@@ -321,7 +321,7 @@ TEST_F(DictionaryTest, beginEndVendor) {
     list<string> begin_unknown = {
         "BEGIN-VENDOR foo"
     };
-    string expected =  "unsupported embedded begin vendor, ";
+    string expected = "unsupported embedded begin vendor, ";
     expected += "1 is still open at line 1";
     EXPECT_THROW_MSG(parseLines(begin_unknown, 1), BadValue, expected);
     // Value must be a known name or integer.
@@ -362,7 +362,7 @@ TEST_F(DictionaryTest, beginEndVendor) {
         "ATTRIBUTE Actual-Data-Rate-Upstream 129 integer"
     };
     EXPECT_NO_THROW_LOG(parseLines(positive_n, 0, 3561));
-    auto adru =  AttrDefs::instance().getByType(129, 3561);
+    auto adru = AttrDefs::instance().getByType(129, 3561);
     ASSERT_TRUE(adru);
     EXPECT_EQ(129, adru->type_);
     EXPECT_EQ(PW_TYPE_INTEGER, adru->value_type_);
@@ -421,7 +421,7 @@ TEST_F(DictionaryTest, hookAttributes) {
 // Verifies the $INCLUDE entry.
 TEST_F(DictionaryTest, include) {
     list<string> include;
-    include.push_back("# Including the dictonary");
+    include.push_back("# Including the dictionary");
     include.push_back(string("$INCLUDE ") + string(TEST_DICTIONARY));
     include.push_back("# Dictionary included");
     include.push_back("VENDOR ISC 2495");