summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotrek Zadroga <piotrek@isc.org>2023-03-15 15:38:22 +0100
committerPiotrek Zadroga <piotrek@isc.org>2023-03-23 14:51:23 +0100
commit68943dc5ec2f82f718baa38b6f81857483504733 (patch)
treeb64b17305cee9dad0a97500f53d981538b9e4c6a
parent[#939] Updating comments and documentation (diff)
downloadkea-68943dc5ec2f82f718baa38b6f81857483504733.tar.xz
kea-68943dc5ec2f82f718baa38b6f81857483504733.zip
[#939] Simplifying constructor
-rw-r--r--src/lib/dhcp/option_opaque_data_tuples.cc10
-rw-r--r--src/lib/dhcp/option_opaque_data_tuples.h10
2 files changed, 7 insertions, 13 deletions
diff --git a/src/lib/dhcp/option_opaque_data_tuples.cc b/src/lib/dhcp/option_opaque_data_tuples.cc
index 967b9d31b3..1145da929a 100644
--- a/src/lib/dhcp/option_opaque_data_tuples.cc
+++ b/src/lib/dhcp/option_opaque_data_tuples.cc
@@ -27,16 +27,6 @@ OptionOpaqueDataTuples::OptionOpaqueDataTuples(Option::Universe u,
unpack(begin, end);
}
-OptionOpaqueDataTuples::OptionOpaqueDataTuples(Option::Universe u,
- const uint16_t type,
- OptionBufferConstIter begin,
- OptionBufferConstIter end,
- OpaqueDataTuple::LengthFieldType lenFieldType)
- : Option(u, type) {
- prefLenFieldType_ = lenFieldType;
- unpack(begin, end);
-}
-
OptionPtr
OptionOpaqueDataTuples::clone() const {
return (cloneInternal<OptionOpaqueDataTuples>());
diff --git a/src/lib/dhcp/option_opaque_data_tuples.h b/src/lib/dhcp/option_opaque_data_tuples.h
index 4f74b5d441..6e6f37cd1c 100644
--- a/src/lib/dhcp/option_opaque_data_tuples.h
+++ b/src/lib/dhcp/option_opaque_data_tuples.h
@@ -64,8 +64,8 @@ public:
/// @brief Constructor.
///
- /// This constructor creates an instance of an OpaqueDataTuple option using
- /// a buffer with on-wire data. This constructor allows to explicitly set
+ /// This constructor creates an instance of an OptionOpaqueDataTuples option
+ /// using a buffer with on-wire data. This constructor allows to explicitly set
/// tuple's length field type.
/// It may throw an exception if the @c unpack method throws.
///
@@ -78,7 +78,10 @@ public:
OptionOpaqueDataTuples(Option::Universe u, const uint16_t type,
OptionBufferConstIter begin,
OptionBufferConstIter end,
- OpaqueDataTuple::LengthFieldType lenFieldType);
+ OpaqueDataTuple::LengthFieldType lenFieldType)
+ : Option(u, type), prefLenFieldType_(lenFieldType) {
+ unpack(begin, end);
+ }
/// @brief Copies this option and returns a pointer to the copy.
OptionPtr clone() const;
@@ -155,6 +158,7 @@ public:
private:
/// @brief holds information of explicitly assigned tuple length field.
+ ///
/// Normally tuple length is evaluated basing on Option's universe.
/// But there may be cases when e.g. for v4 universe tuple length field
/// is 2 bytes long (e.g. DHCPv4 SZTP Redirect Option #143 bootstrap-server-list).