checkResult(status, 1);
EXPECT_TRUE(errorContainsPosition(status, "<string>"));
- /// @todo The option 213 is a standard DHCPv4 option. However, at
- /// this point there is no definition for this option in
- /// libdhcp++, so it should be allowed to define it from the
- /// configuration interface. This test will have to be removed
- /// once definitions for remaining standard options are created.
+ /// There is no definition for unassigned option 170.
config =
"{ \"option-def\": [ {"
- " \"name\": \"access-network-domain-name\","
- " \"code\": 213,"
+ " \"name\": \"unassigned-option-170\","
+ " \"code\": 170,"
" \"type\": \"string\","
" \"space\": \"dhcp4\""
" } ]"
checkResult(status, 0);
def = CfgMgr::instance().getStagingCfg()->
- getCfgOptionDef()->get(DHCP4_OPTION_SPACE, 213);
+ getCfgOptionDef()->get(DHCP4_OPTION_SPACE, 170);
ASSERT_TRUE(def);
// Check the option data.
- EXPECT_EQ("access-network-domain-name", def->getName());
- EXPECT_EQ(213, def->getCode());
+ EXPECT_EQ("unassigned-option-170", def->getName());
+ EXPECT_EQ(170, def->getCode());
EXPECT_EQ(OPT_STRING_TYPE, def->getType());
EXPECT_FALSE(def->getArrayType());
// Expect a single option with the code equal to 100.
ASSERT_EQ(1, std::distance(range.first, range.second));
const uint8_t foo_expected[] = {
- 0xAB, 0xCD, 0xEF, 0x01, 0x05
+ 0xAB, 0xCD, 0xEF, 0x01, 0x05
};
// Check if option is valid in terms of code and carried data.
testOption(*range.first, 56, foo_expected, sizeof(foo_expected));
// Expect a single option with the code equal to 100.
ASSERT_EQ(1, std::distance(range1.first, range1.second));
const uint8_t foo_expected[] = {
- 0xAB, 0xCD, 0xEF, 0x01, 0x05
+ 0xAB, 0xCD, 0xEF, 0x01, 0x05
};
// Check if option is valid in terms of code and carried data.
testOption(*range1.first, 56, foo_expected, sizeof(foo_expected));
const OptionContainerTypeIndex& idx2 = options2->get<1>();
std::pair<OptionContainerTypeIndex::const_iterator,
- OptionContainerTypeIndex::const_iterator> range2 =
- idx2.equal_range(23);
+ OptionContainerTypeIndex::const_iterator> range2 =
+ idx2.equal_range(23);
ASSERT_EQ(1, std::distance(range2.first, range2.second));
const uint8_t foo2_expected[] = {
0x01
"{\n"
" \"option-def\": [\n"
" {\n"
-" \"code\": 213,\n"
-" \"name\": \"access-network-domain-name\",\n"
+" \"code\": 170,\n"
+" \"name\": \"unassigned-option-170\",\n"
" \"space\": \"dhcp4\",\n"
" \"type\": \"string\"\n"
" }\n"
" \"option-def\": [\n"
" {\n"
" \"array\": false,\n"
-" \"code\": 213,\n"
+" \"code\": 170,\n"
" \"encapsulate\": \"\",\n"
-" \"name\": \"access-network-domain-name\",\n"
+" \"name\": \"unassigned-option-170\",\n"
" \"record-types\": \"\",\n"
" \"space\": \"dhcp4\",\n"
" \"type\": \"string\"\n"