Commit 96b1a7eb authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[master] Merge branch 'trac2786'

parents f45931cc 704e1a50
......@@ -463,10 +463,9 @@ Dhcpv6Srv::createStatusCode(uint16_t code, const std::string& text) {
assert(status_code_def);
// As there is no dedicated class to represent Status Code
// the OptionCustom class should be returned here.
boost::shared_ptr<OptionCustom> option_status =
boost::dynamic_pointer_cast<
OptionCustom>(status_code_def->optionFactory(Option::V6, D6O_STATUS_CODE));
// the OptionCustom class is used here instead.
OptionCustomPtr option_status =
OptionCustomPtr(new OptionCustom(*status_code_def, Option::V6));
assert(option_status);
// Set status code to 'code' (0 - means data field #0).
......
......@@ -33,6 +33,7 @@ libb10_dhcp___la_SOURCES += option_custom.cc option_custom.h
libb10_dhcp___la_SOURCES += option_data_types.cc option_data_types.h
libb10_dhcp___la_SOURCES += option_definition.cc option_definition.h
libb10_dhcp___la_SOURCES += option_space.cc option_space.h
libb10_dhcp___la_SOURCES += option_string.cc option_string.h
libb10_dhcp___la_SOURCES += pkt6.cc pkt6.h
libb10_dhcp___la_SOURCES += pkt4.cc pkt4.h
libb10_dhcp___la_SOURCES += pkt_filter.h
......
// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -55,7 +55,7 @@ Option::Option(Universe u, uint16_t type, const OptionBuffer& data)
Option::Option(Universe u, uint16_t type, OptionBufferConstIter first,
OptionBufferConstIter last)
:universe_(u), type_(type), data_(OptionBuffer(first,last)) {
:universe_(u), type_(type), data_(first, last) {
check();
}
......@@ -121,7 +121,7 @@ Option::packOptions(isc::util::OutputBuffer& buf) {
void Option::unpack(OptionBufferConstIter begin,
OptionBufferConstIter end) {
data_ = OptionBuffer(begin, end);
setData(begin, end);
}
void
......@@ -274,13 +274,6 @@ void Option::setUint32(uint32_t value) {
writeUint32(value, &data_[0]);
}
void Option::setData(const OptionBufferConstIter first,
const OptionBufferConstIter last) {
// We will copy entire option buffer, so we have to resize data_.
data_.resize(std::distance(first, last));
std::copy(first, last, data_.begin());
}
bool Option::equal(const OptionPtr& other) const {
return ( (getType() == other->getType()) &&
(getData() == other->getData()) );
......
// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -282,8 +282,13 @@ public:
///
/// @param first iterator pointing to beginning of buffer to copy.
/// @param last iterator pointing to end of buffer to copy.
void setData(const OptionBufferConstIter first,
const OptionBufferConstIter last);
///
/// @tparam InputIterator type of the iterator representing the
/// limits of the buffer to be assigned to a data_ buffer.
template<typename InputIterator>
void setData(InputIterator first, InputIterator last) {
data_.assign(first, last);
}
/// just to force that every option has virtual dtor
virtual ~Option();
......
......@@ -28,30 +28,20 @@ OptionCustom::OptionCustom(const OptionDefinition& def,
}
OptionCustom::OptionCustom(const OptionDefinition& def,
Universe u,
const OptionBuffer& data)
Universe u,
const OptionBuffer& data)
: Option(u, def.getCode(), data.begin(), data.end()),
definition_(def) {
// It is possible that no data is provided if an option
// is being created on a server side. In such case a bunch
// of buffers with default values is first created and then
// the values are replaced using writeXXX functions. Thus
// we need to detect that no data has been specified and
// take a different code path.
if (!data_.empty()) {
createBuffers(data_);
} else {
createBuffers();
}
createBuffers(getData());
}
OptionCustom::OptionCustom(const OptionDefinition& def,
Universe u,
OptionBufferConstIter first,
OptionBufferConstIter last)
Universe u,
OptionBufferConstIter first,
OptionBufferConstIter last)
: Option(u, def.getCode(), first, last),
definition_(def) {
createBuffers(data_);
createBuffers(getData());
}
void
......@@ -517,9 +507,7 @@ OptionCustom::writeString(const std::string& text, const uint32_t index) {
void
OptionCustom::unpack(OptionBufferConstIter begin,
OptionBufferConstIter end) {
data_ = OptionBuffer(begin, end);
// Chop the buffer stored in data_ into set of sub buffers.
createBuffers(data_);
initialize(begin, end);
}
uint16_t
......@@ -543,15 +531,13 @@ OptionCustom::len() {
return (length);
}
void OptionCustom::setData(const OptionBufferConstIter first,
const OptionBufferConstIter last) {
// We will copy entire option buffer, so we have to resize data_.
data_.resize(std::distance(first, last));
std::copy(first, last, data_.begin());
void OptionCustom::initialize(const OptionBufferConstIter first,
const OptionBufferConstIter last) {
setData(first, last);
// Chop the data_ buffer into set of buffers that represent
// option fields data.
createBuffers(data_);
createBuffers(getData());
}
std::string OptionCustom::toText(int indent) {
......
......@@ -280,8 +280,8 @@ public:
///
/// @param first iterator pointing to beginning of buffer to copy.
/// @param last iterator pointing to end of buffer to copy.
void setData(const OptionBufferConstIter first,
const OptionBufferConstIter last);
void initialize(const OptionBufferConstIter first,
const OptionBufferConstIter last);
private:
......@@ -336,6 +336,11 @@ private:
std::string dataFieldToText(const OptionDataType data_type,
const uint32_t index) const;
/// Make this function private as we don't want it to be invoked
/// on OptionCustom object. We rather want that initialize to
/// be called instead.
using Option::setData;
/// Option definition used to create an option.
OptionDefinition definition_;
......
......@@ -22,6 +22,7 @@
#include <dhcp/option_int.h>
#include <dhcp/option_int_array.h>
#include <dhcp/option_space.h>
#include <dhcp/option_string.h>
#include <util/encode/hex.h>
#include <util/strutil.h>
#include <boost/algorithm/string/classification.hpp>
......@@ -160,6 +161,9 @@ OptionDefinition::optionFactory(Option::Universe u, uint16_t type,
}
break;
case OPT_STRING_TYPE:
return (OptionPtr(new OptionString(u, type, begin, end)));
default:
if (u == Option::V6) {
if ((code_ == D6O_IA_NA || code_ == D6O_IA_PD) &&
......@@ -182,7 +186,7 @@ OptionDefinition::optionFactory(Option::Universe u, uint16_t type,
}
}
}
return (OptionPtr(new OptionCustom(*this, u, OptionBuffer(begin, end))));
return (OptionPtr(new OptionCustom(*this, u, begin, end)));
} catch (const Exception& ex) {
isc_throw(InvalidOptionValue, ex.what());
......
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <dhcp/option_string.h>
namespace isc {
namespace dhcp {
OptionString::OptionString(const Option::Universe u, const uint16_t type,
const std::string& value)
: Option(u, type) {
// Try to assign the provided string value. This will throw exception
// if the provided value is empty.
setValue(value);
}
OptionString::OptionString(const Option::Universe u, const uint16_t type,
OptionBufferConstIter begin,
OptionBufferConstIter end)
: Option(u, type) {
// Decode the data. This will throw exception if the buffer is
// truncated.
unpack(begin, end);
}
std::string
OptionString::getValue() const {
const OptionBuffer& data = getData();
return (std::string(data.begin(), data.end()));
}
void
OptionString::setValue(const std::string& value) {
// Sanity check that the string value is at least one byte long.
// This is a requirement for all currently defined options which
// carry a string value.
if (value.empty()) {
isc_throw(isc::OutOfRange, "string value carried by the option '"
<< getType() << "' must not be empty");
}
setData(value.begin(), value.end());
}
uint16_t
OptionString::len() {
return (getHeaderLen() + getData().size());
}
void
OptionString::pack(isc::util::OutputBuffer& buf) {
// Pack option header.
packHeader(buf);
// Pack data.
const OptionBuffer& data = getData();
buf.writeData(&data[0], data.size());
// That's it. We don't pack any sub-options here, because this option
// must not contain sub-options.
}
void
OptionString::unpack(OptionBufferConstIter begin,
OptionBufferConstIter end) {
if (std::distance(begin, end) == 0) {
isc_throw(isc::OutOfRange, "failed to parse an option '"
<< getType() << "' holding string value"
<< " - empty value is not accepted");
}
setData(begin, end);
}
} // end of isc::dhcp namespace
} // end of isc namespace
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#ifndef OPTION_STRING_H
#define OPTION_STRING_H
#include <dhcp/option.h>
#include <util/buffer.h>
#include <boost/shared_ptr.hpp>
#include <string>
namespace isc {
namespace dhcp {
/// @brief Class which represents an option carrying a single string value.
///
/// This class represents an option carrying a single string value.
/// Currently this class imposes that the minimal length of the carried
/// string is 1.
///
/// @todo In the future this class may be extended with some more string
/// content checks and encoding methods if required.
class OptionString : public Option {
public:
/// @brief Constructor, used to create options to be sent.
///
/// This constructor creates an instance of option which carries a
/// string value specified as constructor's parameter. This constructor
/// is most often used to create an instance of an option which will
/// be sent in the outgoing packet.
///
/// @param u universe (V4 or V6).
/// @param type option code.
/// @param value a string value to be carried by the option.
///
/// @throw isc::OutOfRange if provided string is empty.
OptionString(const Option::Universe u, const uint16_t type,
const std::string& value);
/// @brief Constructor, used for receiving options.
///
/// This constructor creates an instance of the option from the provided
/// chunk of buffer. This buffer may hold the data received on the wire.
///
/// @param u universe (V4 or V6).
/// @param type option code.
/// @param begin iterator pointing to the first byte of the buffer chunk.
/// @param end iterator pointing to the last byte of the buffer chunk.
///
/// @throw isc::OutOfRange if provided buffer is truncated.
OptionString(const Option::Universe u, const uint16_t type,
OptionBufferConstIter begin, OptionBufferConstIter end);
/// @brief Returns length of the whole option, including header.
///
/// @return length of the whole option.
virtual uint16_t len();
/// @brief Returns the string value held by the option.
///
/// @return string value held by the option.
std::string getValue() const;
/// @brief Sets the string value to be held by the option.
///
/// @param value string value to be set.
///
/// @throw isc::OutOfRange if a string value to be set is empty.
void setValue(const std::string& value);
/// @brief Creates on-wire format of the option.
///
/// This function creates on-wire format of the option and appends it to
/// the data existing in the provided buffer. The internal buffer's pointer
/// is moved to the end of stored data.
///
/// @param [out] buf output buffer where the option will be stored.
virtual void pack(isc::util::OutputBuffer& buf);
/// @brief Decodes option data from the provided buffer.
///
/// This function decodes option data from the provided buffer. Note that
/// it does not decode the option code and length, so the iterators must
/// point to the begining and end of the option payload respectively.
/// The size of the decoded payload must be at least 1 byte.
///
/// @param begin the iterator pointing to the option payload.
/// @param end the iterator pointing to the end of the option payload.
///
/// @throw isc::OutOfRange if provided buffer is truncated.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
};
/// Pointer to the OptionString object.
typedef boost::shared_ptr<OptionString> OptionStringPtr;
} // namespace isc::dhcp
} // namespace isc
#endif // OPTION_STRING_H
......@@ -84,7 +84,7 @@ const OptionDefParams OPTION_DEF_PARAMS4[] = {
{ "host-name", DHO_HOST_NAME, OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
{ "boot-size", DHO_BOOT_SIZE, OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" },
{ "merit-dump", DHO_MERIT_DUMP, OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
{ "domain-name", DHO_DOMAIN_NAME, OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" },
{ "domain-name", DHO_DOMAIN_NAME, OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
{ "swap-server", DHO_SWAP_SERVER, OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
{ "root-path", DHO_ROOT_PATH, OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
{ "extensions-path", DHO_EXTENSIONS_PATH, OPT_STRING_TYPE,
......
......@@ -41,6 +41,7 @@ libdhcp___unittests_SOURCES += option_definition_unittest.cc
libdhcp___unittests_SOURCES += option_custom_unittest.cc
libdhcp___unittests_SOURCES += option_unittest.cc
libdhcp___unittests_SOURCES += option_space_unittest.cc
libdhcp___unittests_SOURCES += option_string_unittest.cc
libdhcp___unittests_SOURCES += pkt4_unittest.cc
libdhcp___unittests_SOURCES += pkt6_unittest.cc
libdhcp___unittests_SOURCES += duid_unittest.cc
......
......@@ -24,6 +24,7 @@
#include <dhcp/option_custom.h>
#include <dhcp/option_int.h>
#include <dhcp/option_int_array.h>
#include <dhcp/option_string.h>
#include <util/buffer.h>
#include <gtest/gtest.h>
......@@ -372,7 +373,7 @@ TEST_F(LibDhcpTest, unpackOptions6) {
/// is no restriction on the data length being carried by them.
/// For simplicity, we assign data of the length 3 for each
/// of them.
static uint8_t v4Opts[] = {
static uint8_t v4_opts[] = {
12, 3, 0, 1, 2, // Hostname
60, 3, 10, 11, 12, // Class Id
14, 3, 20, 21, 22, // Merit Dump File
......@@ -403,18 +404,18 @@ TEST_F(LibDhcpTest, packOptions4) {
opts.insert(make_pair(opt1->getType(), opt4));
opts.insert(make_pair(opt1->getType(), opt5));
vector<uint8_t> expVect(v4Opts, v4Opts + sizeof(v4Opts));
vector<uint8_t> expVect(v4_opts, v4_opts + sizeof(v4_opts));
OutputBuffer buf(100);
EXPECT_NO_THROW(LibDHCP::packOptions(buf, opts));
ASSERT_EQ(buf.getLength(), sizeof(v4Opts));
EXPECT_EQ(0, memcmp(v4Opts, buf.getData(), sizeof(v4Opts)));
ASSERT_EQ(buf.getLength(), sizeof(v4_opts));
EXPECT_EQ(0, memcmp(v4_opts, buf.getData(), sizeof(v4_opts)));
}
TEST_F(LibDhcpTest, unpackOptions4) {
vector<uint8_t> v4packed(v4Opts, v4Opts + sizeof(v4Opts));
vector<uint8_t> v4packed(v4_opts, v4_opts + sizeof(v4_opts));
isc::dhcp::Option::OptionCollection options; // list of options
ASSERT_NO_THROW(
......@@ -423,38 +424,43 @@ TEST_F(LibDhcpTest, unpackOptions4) {
isc::dhcp::Option::OptionCollection::const_iterator x = options.find(12);
ASSERT_FALSE(x == options.end()); // option 1 should exist
EXPECT_EQ(12, x->second->getType()); // this should be option 12
ASSERT_EQ(3, x->second->getData().size()); // it should be of length 3
EXPECT_EQ(5, x->second->len()); // total option length 5
EXPECT_EQ(0, memcmp(&x->second->getData()[0], v4Opts+2, 3)); // data len=3
// Option 12 holds a string so let's cast it to an appropriate type.
OptionStringPtr option12 = boost::static_pointer_cast<OptionString>(x->second);
ASSERT_TRUE(option12);
EXPECT_EQ(12, option12->getType()); // this should be option 12
ASSERT_EQ(3, option12->getValue().length()); // it should be of length 3
EXPECT_EQ(5, option12->len()); // total option length 5
EXPECT_EQ(0, memcmp(&option12->getValue()[0], v4_opts + 2, 3)); // data len=3
x = options.find(60);
ASSERT_FALSE(x == options.end()); // option 2 should exist
EXPECT_EQ(60, x->second->getType()); // this should be option 60
ASSERT_EQ(3, x->second->getData().size()); // it should be of length 3
EXPECT_EQ(5, x->second->len()); // total option length 5
EXPECT_EQ(0, memcmp(&x->second->getData()[0], v4Opts+7, 3)); // data len=3
EXPECT_EQ(0, memcmp(&x->second->getData()[0], v4_opts + 7, 3)); // data len=3
x = options.find(14);
ASSERT_FALSE(x == options.end()); // option 3 should exist
EXPECT_EQ(14, x->second->getType()); // this should be option 14
ASSERT_EQ(3, x->second->getData().size()); // it should be of length 3
EXPECT_EQ(5, x->second->len()); // total option length 5
EXPECT_EQ(0, memcmp(&x->second->getData()[0], v4Opts+12, 3)); // data len=3
OptionStringPtr option14 = boost::static_pointer_cast<OptionString>(x->second);
ASSERT_TRUE(option14);
EXPECT_EQ(14, option14->getType()); // this should be option 14
ASSERT_EQ(3, option14->getValue().length()); // it should be of length 3
EXPECT_EQ(5, option14->len()); // total option length 5
EXPECT_EQ(0, memcmp(&option14->getValue()[0], v4_opts + 12, 3)); // data len=3
x = options.find(254);
ASSERT_FALSE(x == options.end()); // option 3 should exist
EXPECT_EQ(254, x->second->getType()); // this should be option 254
ASSERT_EQ(3, x->second->getData().size()); // it should be of length 3
EXPECT_EQ(5, x->second->len()); // total option length 5
EXPECT_EQ(0, memcmp(&x->second->getData()[0], v4Opts+17, 3)); // data len=3
EXPECT_EQ(0, memcmp(&x->second->getData()[0], v4_opts + 17, 3)); // data len=3
x = options.find(128);
ASSERT_FALSE(x == options.end()); // option 3 should exist
EXPECT_EQ(128, x->second->getType()); // this should be option 254
ASSERT_EQ(3, x->second->getData().size()); // it should be of length 3
EXPECT_EQ(5, x->second->len()); // total option length 5
EXPECT_EQ(0, memcmp(&x->second->getData()[0], v4Opts+22, 3)); // data len=3
EXPECT_EQ(0, memcmp(&x->second->getData()[0], v4_opts + 22, 3)); // data len=3
x = options.find(0);
EXPECT_TRUE(x == options.end()); // option 0 not found
......@@ -532,7 +538,7 @@ TEST_F(LibDhcpTest, stdOptionDefs4) {
// It will be used to create most of the options.
std::vector<uint8_t> buf(48, 1);
OptionBufferConstIter begin = buf.begin();
OptionBufferConstIter end = buf.begin();
OptionBufferConstIter end = buf.end();
LibDhcpTest::testStdOptionDefs4(DHO_SUBNET_MASK, begin, end,
typeid(OptionCustom));
......@@ -568,25 +574,25 @@ TEST_F(LibDhcpTest, stdOptionDefs4) {
typeid(Option4AddrLst));
LibDhcpTest::testStdOptionDefs4(DHO_HOST_NAME, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_BOOT_SIZE, begin, begin + 2,
typeid(OptionInt<uint16_t>));
LibDhcpTest::testStdOptionDefs4(DHO_MERIT_DUMP, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_DOMAIN_NAME, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_SWAP_SERVER, begin, end,
typeid(OptionCustom));
LibDhcpTest::testStdOptionDefs4(DHO_ROOT_PATH, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_EXTENSIONS_PATH, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_IP_FORWARDING, begin, end,
typeid(OptionCustom));
......@@ -652,7 +658,7 @@ TEST_F(LibDhcpTest, stdOptionDefs4) {
typeid(OptionCustom));
LibDhcpTest::testStdOptionDefs4(DHO_NIS_DOMAIN, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_NIS_SERVERS, begin, end,
typeid(Option4AddrLst));
......@@ -674,7 +680,7 @@ TEST_F(LibDhcpTest, stdOptionDefs4) {
typeid(OptionInt<uint8_t>));
LibDhcpTest::testStdOptionDefs4(DHO_NETBIOS_SCOPE, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_FONT_SERVERS, begin, end,
typeid(Option4AddrLst));
......@@ -701,7 +707,7 @@ TEST_F(LibDhcpTest, stdOptionDefs4) {
typeid(Option));
LibDhcpTest::testStdOptionDefs4(DHO_DHCP_MESSAGE, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_DHCP_MAX_MESSAGE_SIZE, begin, begin + 2,
typeid(OptionInt<uint16_t>));
......@@ -719,7 +725,7 @@ TEST_F(LibDhcpTest, stdOptionDefs4) {
typeid(Option));
LibDhcpTest::testStdOptionDefs4(DHO_NWIP_DOMAIN_NAME, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs4(DHO_NWIP_SUBOPTIONS, begin, end,
typeid(Option));
......@@ -908,10 +914,10 @@ TEST_F(LibDhcpTest, stdOptionDefs6) {
typeid(Option6AddrLst));
LibDhcpTest::testStdOptionDefs6(D6O_NEW_POSIX_TIMEZONE, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs6(D6O_NEW_TZDB_TIMEZONE, begin, end,
typeid(OptionCustom));
typeid(OptionString));
LibDhcpTest::testStdOptionDefs6(D6O_ERO, begin, end,
typeid(OptionIntArray<uint16_t>));
......
......@@ -1324,7 +1324,7 @@ TEST_F(OptionCustomTest, unpack) {
// The purpose of this test is to verify that new data can be set for
// a custom option.
TEST_F(OptionCustomTest, setData) {
TEST_F(OptionCustomTest, initialize) {
OptionDefinition opt_def("OPTION_FOO", 1000, "ipv6-address", true);