mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
[#2454] doxygen tags added
This commit is contained in:
@@ -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;
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
|
@@ -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.
|
||||
|
@@ -313,6 +313,7 @@ public:
|
||||
/// @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.
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -224,6 +224,7 @@ public:
|
||||
/// @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.
|
||||
|
@@ -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
|
||||
|
@@ -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.
|
||||
|
@@ -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.
|
||||
|
@@ -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.
|
||||
|
@@ -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.
|
||||
@@ -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.
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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.
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user