]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2454] doxygen tags added
authorTomek Mrugalski <tomek@isc.org>
Fri, 8 Jul 2022 15:23:54 +0000 (17:23 +0200)
committerTomek Mrugalski <tomek@isc.org>
Thu, 21 Jul 2022 09:00:54 +0000 (09:00 +0000)
20 files changed:
src/lib/dhcp/libdhcp++.cc
src/lib/dhcp/libdhcp++.h
src/lib/dhcp/option.h
src/lib/dhcp/option4_addrlst.h
src/lib/dhcp/option4_client_fqdn.h
src/lib/dhcp/option6_addrlst.h
src/lib/dhcp/option6_auth.h
src/lib/dhcp/option6_client_fqdn.h
src/lib/dhcp/option6_ia.h
src/lib/dhcp/option6_iaaddr.h
src/lib/dhcp/option6_iaprefix.h
src/lib/dhcp/option6_pdexclude.h
src/lib/dhcp/option6_status_code.h
src/lib/dhcp/option_custom.h
src/lib/dhcp/option_int.h
src/lib/dhcp/option_int_array.h
src/lib/dhcp/option_opaque_data_tuples.h
src/lib/dhcp/option_string.h
src/lib/dhcp/option_vendor.h
src/lib/dhcp/option_vendor_class.h

index ca00168212f0ff26a2d122b3fd3813bb34c8991b..805925dc9a8ae9edb27314e5db89a237dd1a09ee 100644 (file)
@@ -458,7 +458,7 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf,
                         const std::string& option_space,
                         isc::dhcp::OptionCollection& options,
                         std::list<uint16_t>& deferred,
-                        bool flexible_pad_end) {
+                        bool check) {
     size_t offset = 0;
     size_t last_offset = 0;
 
@@ -477,8 +477,8 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf,
     const OptionDefContainerTypeIndex& runtime_idx = runtime_option_defs->get<1>();
 
     // Flexible PAD and END parsing.
-    bool flex_pad = (flexible_pad_end && (runtime_idx.count(DHO_PAD) == 0));
-    bool flex_end = (flexible_pad_end && (runtime_idx.count(DHO_END) == 0));
+    bool flex_pad = (check && (runtime_idx.count(DHO_PAD) == 0));
+    bool flex_end = (check && (runtime_idx.count(DHO_END) == 0));
 
     // The buffer being read comprises a set of options, each starting with
     // a one-byte type code and a one-byte length field.
@@ -490,7 +490,7 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf,
         uint8_t opt_type = buf[offset++];
 
         // DHO_END is a special, one octet long option
-        // Valid in dhcp4 space or when flexible_pad_end is true and
+        // Valid in dhcp4 space or when check is true and
         // there is a sub-option configured for this code.
         if ((opt_type == DHO_END) && (space_is_dhcp4 || flex_end)) {
             // just return. Don't need to add DHO_END option
@@ -501,7 +501,7 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf,
 
         // DHO_PAD is just a padding after DHO_END. Let's continue parsing
         // in case we receive a message without DHO_END.
-        // Valid in dhcp4 space or when flexible_pad_end is true and
+        // Valid in dhcp4 space or when check is true and
         // there is a sub-option configured for this code.
         if ((opt_type == DHO_PAD) && (space_is_dhcp4 || flex_pad)) {
             continue;
index b4c7b206e6ce16a96237571ee5225f4c5fb14d6e..81f7e84338328c198c6d151707a44a8c69fe6775 100644 (file)
@@ -217,6 +217,9 @@ public:
     /// @param top indicates if this is the first call to pack the options.
     /// When true logic to emit the message type first is executed. It
     /// defaults to false.
+    /// @param check indicates if the code should be more flexible with
+    /// PAD and END options. If true, PAD and END options will not be parsed.
+    /// This is useful for partial parsing and slightly broken packets.
     static void packOptions4(isc::util::OutputBuffer& buf,
                              const isc::dhcp::OptionCollection& options,
                              bool top = false, bool check = true);
@@ -226,6 +229,8 @@ public:
     ///
     /// @param options The option container which needs to be updated with split
     /// options.
+    /// @param scopedOptions temporary storage for options that are going to be
+    /// split. See @ref ScopedPktOptionsCopy for explanation.
     /// @param used The size of the buffer that has already been used by the
     /// parent option effectively shrinking the maximum supported length for
     /// each options in the container.
index dfb26f378ae4cf0a6e9f83d76c60262e64aee8e5..c469d97efaa6687cb06a7202f6b2c199dc1f2d0f 100644 (file)
@@ -516,6 +516,7 @@ protected:
     /// directly by other classes.
     ///
     /// @param [out] buf output buffer.
+    /// @param check if set to false, allows options larger than 255 for v4
     void packHeader(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Store sub options in a buffer.
@@ -526,6 +527,7 @@ protected:
     /// derived classes that override pack.
     ///
     /// @param [out] buf output buffer.
+    /// @param check if set to false, allows options larger than 255 for v4
     ///
     /// @todo The set of exceptions thrown by this function depend on
     /// exceptions thrown by pack methods invoked on objects
index 73a177a74c678202e351735d5559ca333837bad3..7e17aae0b6a7c860bd9f6a7cc30fc33530f1a106 100644 (file)
@@ -88,6 +88,7 @@ public:
     /// Method will throw if option storing fails for some reason.
     ///
     /// @param buf output buffer (option will be stored there)
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// Returns string representation of the option.
index 2dae79ced3aa019f211886a402eb846af778983c..c34d6b78c6f74673ed4958f2060f7a3cb9ab57de 100644 (file)
@@ -310,9 +310,10 @@ public:
     /// or full.
     DomainNameType getDomainNameType() const;
 
-   /// @brief Writes option in the wire format into a buffer.
+    /// @brief Writes option in the wire format into a buffer.
     ///
     /// @param [out] buf output buffer where option data will be stored.
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses option from the received buffer.
index 1fb6756f1b35640102badd4c9ddde3fe2ab279a0..c171b1dea31f71c9b63bfb61f9f6b9b2db423e04 100644 (file)
@@ -50,6 +50,7 @@ public:
     /// @brief Assembles on-wire form of this option
     ///
     /// @param buf pointer to packet buffer
+    /// @param check if set to false, allows options larger than 255 for v4
     void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received data
index 555877ab3b07a857902635b194530eca1472f3ad..fe2a4d5dc22147fe06d63c10697000e72b679c6f 100644 (file)
@@ -47,6 +47,7 @@ public:
     /// byte after stored option.
     ///
     /// @param buf buffer (option will be stored here)
+    /// @param check if set to false, allows options larger than 255 for v4
     void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// Writes option in wire-format to buf, for computing hash
@@ -142,4 +143,3 @@ protected:
 
 } // isc::dhcp namespace
 } // isc namespace
-
index 613f4ad457036ab45a245a5a049bc7509ce5a0c7..7abe704e999be1aeb3b5f87676426b7bb2289202 100644 (file)
@@ -221,9 +221,10 @@ public:
     /// or full.
     DomainNameType getDomainNameType() const;
 
-   /// @brief Writes option in the wire format into a buffer.
+    /// @brief Writes option in the wire format into a buffer.
     ///
     /// @param [out] buf output buffer where option data will be stored.
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses option from the received buffer.
index 49ca81b2a738e7b837b985cffbb5783d140c9519..9ea7c3e4c24d13a4390b451a7e25e2cd26168b9e 100644 (file)
@@ -46,6 +46,7 @@ public:
     /// byte after stored option.
     ///
     /// @param buf buffer (option will be stored here)
+    /// @param check if set to false, allows options larger than 255 for v4
     void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received buffer
index e3a43af1fbea61ea3ef2caf4e1700c12f48cb230..8a091cf6aa76d2910047f3280d3da083d9fd3d2b 100644 (file)
@@ -55,6 +55,7 @@ public:
     /// byte after stored option.
     ///
     /// @param buf pointer to a buffer
+    /// @param check if set to false, allows options larger than 255 for v4
     void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received buffer.
index 149d7df46d994d0c301c5d2ad7ca942a29acc527..3d9a7f26dd017828dc99fd0b7c86ac9977424d85 100644 (file)
@@ -85,6 +85,7 @@ public:
     /// @throw BadValue if the address is not IPv6
     ///
     /// @param buf pointer to a buffer
+    /// @param check if set to false, allows options larger than 255 for v4
     void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received buffer.
index 7179207c0b355459b85dc054501621fb3d594230..bf409d85550ce1c7d39091fc4e70a293a8cadb32 100644 (file)
@@ -64,6 +64,7 @@ public:
     /// section 4.2 of RFC 6603.
     ///
     /// @param [out] buf Pointer to a buffer.
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received buffer.
index ac57823f68d1c68d74a5e00b9afcda9c90919bed..f133c5d7b8b13b2a4bdc933b3db5c7c001b59c91 100644 (file)
@@ -46,6 +46,7 @@ public:
     /// byte after stored option.
     ///
     /// @param [out] buf Pointer to the output buffer.
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received buffer.
@@ -74,7 +75,7 @@ public:
 
     /// @brief Returns numeric status code.
     uint16_t getStatusCode() const {
-        return (status_code_);        
+        return (status_code_);
     }
 
     /// @brief Returns the name of the status code.
@@ -140,6 +141,7 @@ public:
     /// byte after stored option.
     ///
     /// @param [out] buf Pointer to the output buffer.
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received buffer.
@@ -169,7 +171,7 @@ public:
 
     /// @brief Returns mandatory flag
     bool getMandatoryFlag() const {
-        return (mandatory_flag_);        
+        return (mandatory_flag_);
     }
 
     /// @brief Sets new mandatory flag.
index e8548c34df33927156177f8255312c06e10fff97..9208651e2d439ec3cec1d8c1ac707eade639c248 100644 (file)
@@ -342,6 +342,7 @@ public:
     /// @brief Writes DHCP option in a wire format to a buffer.
     ///
     /// @param buf output buffer (option will be stored there).
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received buffer.
index 6f016426fa34d05a07e045e343f7dab17ccc57f0..10a4cc6d3200961bae6f598b3e76c316c7078c20 100644 (file)
@@ -104,6 +104,7 @@ public:
     /// byte after stored option.
     ///
     /// @param [out] buf buffer (option will be stored here)
+    /// @param check if set to false, allows options larger than 255 for v4
     ///
     /// @throw isc::dhcp::InvalidDataType if size of a data field type is not
     /// equal to 1, 2 or 4 bytes. The data type is not checked in this function
index 232ca61366cd0b91bdb52f85094ddbdf01497503..70803d7cec26f66307a732a2f0a07098b47e663b 100644 (file)
@@ -137,6 +137,7 @@ public:
     /// byte after stored option.
     ///
     /// @param [out] buf buffer (option will be stored here)
+    /// @param check if set to false, allows options larger than 255 for v4
     ///
     /// @throw isc::dhcp::InvalidDataType if size of a data fields type is not
     /// equal to 1, 2 or 4 bytes. The data type is not checked in this function
index a10cd1293931c31d495ea93f40a7dab6516c6e84..aa05d8a58c528a45c068c99f96e4e099e189aed2 100644 (file)
@@ -68,6 +68,7 @@ public:
     /// @brief Renders option into the buffer in the wire format.
     ///
     /// @param [out] buf Buffer to which the option is rendered.
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses buffer holding an option.
index 10159cf6bbe323631ff0d00ca05d3babe68c12a2..241305aa6a5e269aca830d4b838495706ad3c1a6 100644 (file)
@@ -87,6 +87,7 @@ public:
     /// is moved to the end of stored data.
     ///
     /// @param [out] buf output buffer where the option will be stored.
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Decodes option data from the provided buffer.
index de8396ef81f4902077154c65c2f8bba7ef10816e..02227ba3aeb52a7a54edda87d935361599bf5a48 100644 (file)
@@ -57,6 +57,7 @@ public:
     /// unused byte after stored option.
     ///
     /// @param [out] buf buffer (option will be stored here)
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses received buffer
index 11d754ea78863f09cfb589554a9b0d951ef8c766..66450c407347ad61aed70a9175dd1933be496097 100644 (file)
@@ -75,6 +75,7 @@ public:
     /// @brief Renders option into the buffer in the wire format.
     ///
     /// @param [out] buf Buffer to which the option is rendered.
+    /// @param check if set to false, allows options larger than 255 for v4
     virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
 
     /// @brief Parses buffer holding an option.