}
/// @brief Sets the forward domain list manager
- /// @param pointer to the new forward manager
+ /// @param forward_mgr pointer to the new forward manager
void setForwardMgr(DdnsDomainListMgrPtr forward_mgr) {
forward_mgr_ = forward_mgr;
}
}
/// @brief Sets the reverse domain list manager
- /// @param pointer to the new reverse manager
+ /// @param reverse_mgr pointer to the new reverse manager
void setReverseMgr(DdnsDomainListMgrPtr reverse_mgr) {
reverse_mgr_ = reverse_mgr;
}
/// @brief Sets the map of TSIG keys
///
- /// @param pointer to the new TSIG key map
+ /// @param keys pointer to the new TSIG key map
void setKeys(const TSIGKeyInfoMapPtr& keys) {
keys_ = keys;
}
TSIGKeyInfoListParser::parse(data::ConstElementPtr key_list) {
TSIGKeyInfoMapPtr keys(new TSIGKeyInfoMap());
data::ConstElementPtr key_config;
+ TSIGKeyInfoParser key_parser;
BOOST_FOREACH(key_config, key_list->listValue()) {
- TSIGKeyInfoParser key_parser;
TSIGKeyInfoPtr key = key_parser.parse(key_config);
// Duplicates are not allowed and should be flagged as an error.
/// that the application can carry out DNS update exchanges with it. Servers
/// are represented by the class, DnsServerInfo.
///
-/// The configuration specification for use with Kea is detailed in the file
-/// dhcp-ddns.spec.
-///
/// The parsing class hierarchy reflects this same scheme. Working top down:
///
/// A DdnsDomainListMgrParser parses a managed domain list entry. It handles
/// @brief Parser for TSIGKeyInfo
///
-/// This class parses the configuration element "tsig-key" defined in
-/// src/bin/d2/dhcp-ddns.spec and creates an instance of a TSIGKeyInfo.
-class TSIGKeyInfoParser : public data::SimpleParser {
+/// This class parses the configuration element "tsig-key"
+/// and creates an instance of a TSIGKeyInfo.
+class TSIGKeyInfoParser : public data::SimpleParser {
public:
/// @brief Performs the actual parsing of the given "tsig-key" element.
///
/// @brief Parser for a list of TSIGKeyInfos
///
/// This class parses a list of "tsig-key" configuration elements.
-/// (see src/bin/d2/dhcp-ddns.spec). The TSIGKeyInfo instances are added
-/// to the given storage upon commit.
+/// The TSIGKeyInfo instances are added to the given storage upon commit.
class TSIGKeyInfoListParser : public data::SimpleParser {
public:
/// @brief Performs the parsing of the given list "tsig-key" elements.
///
/// Creates an empty TSIGKeyInfoMap
///
+ /// Instantiates a TSIGKeyInfoParser
/// It iterates over each key entry in the list:
- /// 1. Instantiate a TSIGKeyInfoParser for the entry
/// 2. Pass the element configuration to the parser's parse method
/// 3. Add the new TSIGKeyInfo instance to the key map
///
/// @param key_list_config is the list of "tsig_key" elements to parse.
///
- /// @return a map containing the TSIGKeyInfo instances
+ /// @return a map containing the TSIGKeyInfo instances
TSIGKeyInfoMapPtr parse(data::ConstElementPtr key_list_config);
};
/// @brief Parser for DnsServerInfo
///
-/// This class parses the configuration element "dns-server" defined in
-/// src/bin/d2/dhcp-ddns.spec and creates an instance of a DnsServerInfo.
+/// This class parses the configuration element "dns-server"
+/// and creates an instance of a DnsServerInfo.
class DnsServerInfoParser : public data::SimpleParser {
public:
/// @brief Performs the actual parsing of the given "dns-server" element.
/// @brief Parser for a list of DnsServerInfos
///
/// This class parses a list of "dns-server" configuration elements.
-/// (see src/bin/d2/dhcp-ddns.spec). The DnsServerInfo instances are added
+/// The DnsServerInfo instances are added
/// to the given storage upon commit.
class DnsServerInfoListParser : public data::SimpleParser{
public:
///
/// Creates an empty server list
/// It iterates over each server entry in the list:
- /// 1. Creates a server instance by passing the entry to @c
+ /// 1. Creates a server instance by passing the entry to @c
/// DnsSeverInfoParser::parse()
/// 2. Adds the server to the server list
///
/// @brief Parser for DdnsDomain
///
-/// This class parses the configuration element "ddns-domain" defined in
-/// src/bin/d2/dhcp-ddns.spec and creates an instance of a DdnsDomain.
+/// This class parses the configuration element "ddns-domain"
+/// and creates an instance of a DdnsDomain.
class DdnsDomainParser : public data::SimpleParser {
public:
/// @brief Performs the actual parsing of the given "ddns-domain" element.
/// @brief Parser for a list of DdnsDomains
///
-/// This class parses a list of "ddns-domain" configuration elements.
-/// (see src/bin/d2/dhcp-ddns.spec) into a map of DdnsDomains.
+/// This class parses a list of "ddns-domain" configuration elements
+/// into a map of DdnsDomains.
class DdnsDomainListParser : public data::SimpleParser {
public:
/// @brief Performs the actual parsing of the given list "ddns-domain"
/// elements.
/// Creates a new DdnsDomain map
/// It iterates over each domain entry in the list:
- /// 1. Creates a DdnsDomain instance by passing the entry into @c
+ /// 1. Creates a DdnsDomain instance by passing the entry into @c
/// DdnsDomainParser::parser()
/// 2. Adds the DdnsDomain instance to the domain map
///
/// @brief Parser for DdnsDomainListMgr
///
/// This class parses the configuration elements "forward-ddns" and
-/// "reverse-ddns" as defined in src/bin/d2/dhcp-ddns.spec. It populates the
-/// given DdnsDomainListMgr with parsed information.
+/// "reverse-ddns". It populates the given DdnsDomainListMgr with parsed
+/// information.
class DdnsDomainListMgrParser : public data::SimpleParser {
public:
/// @brief Performs the actual parsing of the given manager element.
break;
case 65:
-#line 265 "d2_parser.yy" // lalr1.cc:859
+#line 266 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 66:
-#line 267 "d2_parser.yy" // lalr1.cc:859
+#line 268 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ip-address", s);
break;
case 67:
-#line 273 "d2_parser.yy" // lalr1.cc:859
+#line 274 "d2_parser.yy" // lalr1.cc:859
{
- if (yystack_[0].value.as< int64_t > () <= 0) {
- error(yystack_[0].location, "port must be greater than zero");
+ if (yystack_[0].value.as< int64_t > () <= 0 || yystack_[0].value.as< int64_t > () >= 65792 ) {
+ error(yystack_[0].location, "port must be greater than zero but less than 65792");
}
ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("port", i);
break;
case 68:
-#line 281 "d2_parser.yy" // lalr1.cc:859
+#line 282 "d2_parser.yy" // lalr1.cc:859
{
if (yystack_[0].value.as< int64_t > () <= 0) {
error(yystack_[0].location, "dns-server-timeout must be greater than zero");
break;
case 69:
-#line 290 "d2_parser.yy" // lalr1.cc:859
+#line 291 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NCR_PROTOCOL);
}
break;
case 70:
-#line 292 "d2_parser.yy" // lalr1.cc:859
+#line 293 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.back()->set("ncr-protocol", yystack_[0].value.as< ElementPtr > ());
ctx.leave();
break;
case 71:
-#line 298 "d2_parser.yy" // lalr1.cc:859
+#line 299 "d2_parser.yy" // lalr1.cc:859
{ yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("UDP", ctx.loc2pos(yystack_[0].location))); }
#line 940 "d2_parser.cc" // lalr1.cc:859
break;
case 72:
-#line 299 "d2_parser.yy" // lalr1.cc:859
+#line 300 "d2_parser.yy" // lalr1.cc:859
{ yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("TCP", ctx.loc2pos(yystack_[0].location))); }
#line 946 "d2_parser.cc" // lalr1.cc:859
break;
case 73:
-#line 302 "d2_parser.yy" // lalr1.cc:859
+#line 303 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NCR_FORMAT);
}
break;
case 74:
-#line 304 "d2_parser.yy" // lalr1.cc:859
+#line 305 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr json(new StringElement("JSON", ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ncr-format", json);
break;
case 75:
-#line 310 "d2_parser.yy" // lalr1.cc:859
+#line 311 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("forward-ddns", m);
break;
case 76:
-#line 315 "d2_parser.yy" // lalr1.cc:859
+#line 316 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 77:
-#line 320 "d2_parser.yy" // lalr1.cc:859
+#line 321 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("reverse-ddns", m);
break;
case 78:
-#line 325 "d2_parser.yy" // lalr1.cc:859
+#line 326 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 85:
-#line 344 "d2_parser.yy" // lalr1.cc:859
+#line 345 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ddns-domains", l);
break;
case 86:
-#line 349 "d2_parser.yy" // lalr1.cc:859
+#line 350 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 87:
-#line 354 "d2_parser.yy" // lalr1.cc:859
+#line 355 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(l);
break;
case 88:
-#line 357 "d2_parser.yy" // lalr1.cc:859
+#line 358 "d2_parser.yy" // lalr1.cc:859
{
// parsing completed
}
break;
case 93:
-#line 369 "d2_parser.yy" // lalr1.cc:859
+#line 370 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
break;
case 94:
-#line 373 "d2_parser.yy" // lalr1.cc:859
+#line 374 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
}
break;
case 95:
-#line 377 "d2_parser.yy" // lalr1.cc:859
+#line 378 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
break;
case 96:
-#line 380 "d2_parser.yy" // lalr1.cc:859
+#line 381 "d2_parser.yy" // lalr1.cc:859
{
// parsing completed
}
break;
case 103:
-#line 395 "d2_parser.yy" // lalr1.cc:859
+#line 396 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 104:
-#line 397 "d2_parser.yy" // lalr1.cc:859
+#line 398 "d2_parser.yy" // lalr1.cc:859
{
if (yystack_[0].value.as< std::string > () == "") {
error(yystack_[1].location, "Ddns domain name cannot be blank");
break;
case 105:
-#line 407 "d2_parser.yy" // lalr1.cc:859
+#line 408 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 106:
-#line 409 "d2_parser.yy" // lalr1.cc:859
+#line 410 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr elem(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
break;
case 107:
-#line 419 "d2_parser.yy" // lalr1.cc:859
+#line 420 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("dns-servers", l);
break;
case 108:
-#line 424 "d2_parser.yy" // lalr1.cc:859
+#line 425 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 109:
-#line 429 "d2_parser.yy" // lalr1.cc:859
+#line 430 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(l);
break;
case 110:
-#line 432 "d2_parser.yy" // lalr1.cc:859
+#line 433 "d2_parser.yy" // lalr1.cc:859
{
// parsing completed
}
break;
case 113:
-#line 440 "d2_parser.yy" // lalr1.cc:859
+#line 441 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
break;
case 114:
-#line 444 "d2_parser.yy" // lalr1.cc:859
+#line 445 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
}
break;
case 115:
-#line 448 "d2_parser.yy" // lalr1.cc:859
+#line 449 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(m);
break;
case 116:
-#line 451 "d2_parser.yy" // lalr1.cc:859
+#line 452 "d2_parser.yy" // lalr1.cc:859
{
// parsing completed
}
break;
case 123:
-#line 465 "d2_parser.yy" // lalr1.cc:859
+#line 466 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 124:
-#line 467 "d2_parser.yy" // lalr1.cc:859
+#line 468 "d2_parser.yy" // lalr1.cc:859
{
if (yystack_[0].value.as< std::string > () != "") {
error(yystack_[1].location, "hostname is not yet supported");
break;
case 125:
-#line 477 "d2_parser.yy" // lalr1.cc:859
+#line 478 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 126:
-#line 479 "d2_parser.yy" // lalr1.cc:859
+#line 480 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ip-address", s);
break;
case 127:
-#line 485 "d2_parser.yy" // lalr1.cc:859
+#line 486 "d2_parser.yy" // lalr1.cc:859
{
- if (yystack_[0].value.as< int64_t > () <= 0) {
- error(yystack_[0].location, "port must be greater than zero");
+ if (yystack_[0].value.as< int64_t > () <= 0 || yystack_[0].value.as< int64_t > () >= 65792 ) {
+ error(yystack_[0].location, "port must be greater than zero but less than 65792");
}
ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("port", i);
break;
case 128:
-#line 499 "d2_parser.yy" // lalr1.cc:859
+#line 500 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("tsig-keys", l);
break;
case 129:
-#line 504 "d2_parser.yy" // lalr1.cc:859
+#line 505 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 130:
-#line 509 "d2_parser.yy" // lalr1.cc:859
+#line 510 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.push_back(l);
break;
case 131:
-#line 512 "d2_parser.yy" // lalr1.cc:859
+#line 513 "d2_parser.yy" // lalr1.cc:859
{
// parsing completed
}
break;
case 136:
-#line 524 "d2_parser.yy" // lalr1.cc:859
+#line 525 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
break;
case 137:
-#line 528 "d2_parser.yy" // lalr1.cc:859
+#line 529 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
}
break;
case 138:
-#line 532 "d2_parser.yy" // lalr1.cc:859
+#line 533 "d2_parser.yy" // lalr1.cc:859
{
// Parse tsig key list entry map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
break;
case 139:
-#line 536 "d2_parser.yy" // lalr1.cc:859
+#line 537 "d2_parser.yy" // lalr1.cc:859
{
// parsing completed
}
break;
case 147:
-#line 552 "d2_parser.yy" // lalr1.cc:859
+#line 553 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 148:
-#line 554 "d2_parser.yy" // lalr1.cc:859
+#line 555 "d2_parser.yy" // lalr1.cc:859
{
if (yystack_[0].value.as< std::string > () == "") {
error(yystack_[1].location, "TSIG key name cannot be blank");
break;
case 149:
-#line 564 "d2_parser.yy" // lalr1.cc:859
+#line 565 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 150:
-#line 566 "d2_parser.yy" // lalr1.cc:859
+#line 567 "d2_parser.yy" // lalr1.cc:859
{
if (yystack_[0].value.as< std::string > () == "") {
error(yystack_[1].location, "TSIG key algorithm cannot be blank");
break;
case 151:
-#line 575 "d2_parser.yy" // lalr1.cc:859
+#line 576 "d2_parser.yy" // lalr1.cc:859
{
if (yystack_[0].value.as< int64_t > () < 0 || (yystack_[0].value.as< int64_t > () > 0 && (yystack_[0].value.as< int64_t > () % 8 != 0))) {
error(yystack_[0].location, "TSIG key digest-bits must either be zero or a positive, multiple of eight");
break;
case 152:
-#line 583 "d2_parser.yy" // lalr1.cc:859
+#line 584 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 153:
-#line 585 "d2_parser.yy" // lalr1.cc:859
+#line 586 "d2_parser.yy" // lalr1.cc:859
{
if (yystack_[0].value.as< std::string > () == "") {
error(yystack_[1].location, "TSIG key secret cannot be blank");
break;
case 154:
-#line 598 "d2_parser.yy" // lalr1.cc:859
+#line 599 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 155:
-#line 600 "d2_parser.yy" // lalr1.cc:859
+#line 601 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.back()->set("Dhcp6", yystack_[0].value.as< ElementPtr > ());
ctx.leave();
break;
case 156:
-#line 605 "d2_parser.yy" // lalr1.cc:859
+#line 606 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 157:
-#line 607 "d2_parser.yy" // lalr1.cc:859
+#line 608 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.back()->set("Dhcp4", yystack_[0].value.as< ElementPtr > ());
ctx.leave();
break;
case 158:
-#line 617 "d2_parser.yy" // lalr1.cc:859
+#line 618 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("Logging", m);
break;
case 159:
-#line 622 "d2_parser.yy" // lalr1.cc:859
+#line 623 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 163:
-#line 639 "d2_parser.yy" // lalr1.cc:859
+#line 640 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("loggers", l);
break;
case 164:
-#line 644 "d2_parser.yy" // lalr1.cc:859
+#line 645 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 167:
-#line 656 "d2_parser.yy" // lalr1.cc:859
+#line 657 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(l);
break;
case 168:
-#line 660 "d2_parser.yy" // lalr1.cc:859
+#line 661 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
}
break;
case 176:
-#line 675 "d2_parser.yy" // lalr1.cc:859
+#line 676 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 177:
-#line 677 "d2_parser.yy" // lalr1.cc:859
+#line 678 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("name", name);
break;
case 178:
-#line 683 "d2_parser.yy" // lalr1.cc:859
+#line 684 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("debuglevel", dl);
break;
case 179:
-#line 687 "d2_parser.yy" // lalr1.cc:859
+#line 688 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 180:
-#line 689 "d2_parser.yy" // lalr1.cc:859
+#line 690 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("severity", sev);
break;
case 181:
-#line 695 "d2_parser.yy" // lalr1.cc:859
+#line 696 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("output_options", l);
break;
case 182:
-#line 700 "d2_parser.yy" // lalr1.cc:859
+#line 701 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 185:
-#line 709 "d2_parser.yy" // lalr1.cc:859
+#line 710 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
break;
case 186:
-#line 713 "d2_parser.yy" // lalr1.cc:859
+#line 714 "d2_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
}
break;
case 189:
-#line 721 "d2_parser.yy" // lalr1.cc:859
+#line 722 "d2_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 190:
-#line 723 "d2_parser.yy" // lalr1.cc:859
+#line 724 "d2_parser.yy" // lalr1.cc:859
{
ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("output", sev);
129, 130, 131, 132, 133, 134, 135, 138, 143, 143,
155, 156, 159, 163, 170, 170, 177, 178, 181, 185,
196, 206, 206, 218, 219, 223, 224, 225, 226, 227,
- 232, 232, 242, 242, 250, 251, 254, 255, 256, 257,
- 258, 259, 260, 261, 262, 265, 265, 273, 281, 290,
- 290, 298, 299, 302, 302, 310, 310, 320, 320, 330,
- 331, 334, 335, 338, 339, 344, 344, 354, 354, 361,
- 362, 365, 366, 369, 369, 377, 377, 384, 385, 388,
- 389, 390, 391, 395, 395, 407, 407, 419, 419, 429,
- 429, 436, 437, 440, 440, 448, 448, 455, 456, 459,
- 460, 461, 462, 465, 465, 477, 477, 485, 499, 499,
- 509, 509, 516, 517, 520, 521, 524, 524, 532, 532,
- 541, 542, 545, 546, 547, 548, 549, 552, 552, 564,
- 564, 575, 583, 583, 598, 598, 605, 605, 617, 617,
- 630, 631, 635, 639, 639, 651, 652, 656, 656, 664,
- 665, 668, 669, 670, 671, 672, 675, 675, 683, 687,
- 687, 695, 695, 705, 706, 709, 709, 717, 718, 721,
- 721
+ 232, 232, 242, 242, 250, 251, 255, 256, 257, 258,
+ 259, 260, 261, 262, 263, 266, 266, 274, 282, 291,
+ 291, 299, 300, 303, 303, 311, 311, 321, 321, 331,
+ 332, 335, 336, 339, 340, 345, 345, 355, 355, 362,
+ 363, 366, 367, 370, 370, 378, 378, 385, 386, 389,
+ 390, 391, 392, 396, 396, 408, 408, 420, 420, 430,
+ 430, 437, 438, 441, 441, 449, 449, 456, 457, 460,
+ 461, 462, 463, 466, 466, 478, 478, 486, 500, 500,
+ 510, 510, 517, 518, 521, 522, 525, 525, 533, 533,
+ 542, 543, 546, 547, 548, 549, 550, 553, 553, 565,
+ 565, 576, 584, 584, 599, 599, 606, 606, 618, 618,
+ 631, 632, 636, 640, 640, 652, 653, 657, 657, 665,
+ 666, 669, 670, 671, 672, 673, 676, 676, 684, 688,
+ 688, 696, 696, 706, 707, 710, 710, 718, 719, 722,
+ 722
};
// Print the state stack on the debug stream.
#line 14 "d2_parser.yy" // lalr1.cc:1167
} } // isc::d2
#line 2213 "d2_parser.cc" // lalr1.cc:1167
-#line 729 "d2_parser.yy" // lalr1.cc:1168
+#line 730 "d2_parser.yy" // lalr1.cc:1168
void
#ifndef YY_D2_PARSER_D2_PARSER_H_INCLUDED
# define YY_D2_PARSER_D2_PARSER_H_INCLUDED
// // "%code requires" blocks.
-#line 17 "d2_parser.yy" // lalr1.cc:377
+#line 17 "d2_parser.yy" // lalr1.cc:392
#include <string>
#include <cc/data.h>
using namespace isc::data;
using namespace std;
-#line 56 "d2_parser.h" // lalr1.cc:377
+#line 56 "d2_parser.h" // lalr1.cc:392
# include <cassert>
# include <cstdlib> // std::abort
# endif /* ! defined YYDEBUG */
#endif /* ! defined D2_PARSER_DEBUG */
-#line 14 "d2_parser.yy" // lalr1.cc:377
+#line 14 "d2_parser.yy" // lalr1.cc:392
namespace isc { namespace d2 {
-#line 141 "d2_parser.h" // lalr1.cc:377
+#line 141 "d2_parser.h" // lalr1.cc:392
}
-#line 14 "d2_parser.yy" // lalr1.cc:377
+#line 14 "d2_parser.yy" // lalr1.cc:392
} } // isc::d2
-#line 1558 "d2_parser.h" // lalr1.cc:377
+#line 1558 "d2_parser.h" // lalr1.cc:392
};
port: PORT COLON INTEGER {
- if ($3 <= 0) {
- error(@3, "port must be greater than zero");
+ if ($3 <= 0 || $3 >= 65792 ) {
+ error(@3, "port must be greater than zero but less than 65792");
}
ElementPtr i(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("port", i);
};
dns_server_port: PORT COLON INTEGER {
- if ($3 <= 0) {
- error(@3, "port must be greater than zero");
+ if ($3 <= 0 || $3 >= 65792 ) {
+ error(@3, "port must be greater than zero but less than 65792");
}
ElementPtr i(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("port", i);
/// found, then an empty map entry is added for it, thus defaulting the
/// manager to "disabled".
///
- /// @param domain DDNS domain manager element to which defaults should be
+ /// @param global element tree containgin the DDNS domain manager element
+ /// to which defaults should be
/// added
+ /// @param mgr_name name of the manager element within the element tree
+ /// (e.g. "forward-ddns", "reverse-ddns")
/// @param mgr_defaults list of default values from which to add
/// @return returns the number of default values added
static size_t setManagerDefaults(data::ElementPtr global,
-// Generated 201702011423
// A Bison parser, made by GNU Bison 3.0.4.
// Locations for Bison parsers in C++
# include "position.hh"
-#line 14 "d2_parser.yy" // location.cc:296
+#line 14 "d2_parser.yy" // location.cc:337
namespace isc { namespace d2 {
-#line 46 "location.hh" // location.cc:296
+#line 46 "location.hh" // location.cc:337
/// Abstract a location.
class location
{
return ostr;
}
-#line 14 "d2_parser.yy" // location.cc:296
+#line 14 "d2_parser.yy" // location.cc:337
} } // isc::d2
-#line 192 "location.hh" // location.cc:296
+#line 192 "location.hh" // location.cc:337
#endif // !YY_D2_PARSER_LOCATION_HH_INCLUDED
-// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
{
}
-D2ParserContext::~D2ParserContext()
-{
-}
-
isc::data::ElementPtr
D2ParserContext::parseString(const std::string& str, ParserType parser_type)
{
/// @brief Default constructor.
D2ParserContext();
- /// @brief destructor
- virtual ~D2ParserContext();
-
/// @brief JSON elements being parsed.
std::vector<isc::data::ElementPtr> stack_;
-// Generated 201702011423
// A Bison parser, made by GNU Bison 3.0.4.
// Positions for Bison parsers in C++
# endif
# endif
-#line 14 "d2_parser.yy" // location.cc:296
+#line 14 "d2_parser.yy" // location.cc:337
namespace isc { namespace d2 {
-#line 56 "position.hh" // location.cc:296
+#line 56 "position.hh" // location.cc:337
/// Abstract a position.
class position
{
return ostr << pos.line << '.' << pos.column;
}
-#line 14 "d2_parser.yy" // location.cc:296
+#line 14 "d2_parser.yy" // location.cc:337
} } // isc::d2
-#line 180 "position.hh" // location.cc:296
+#line 180 "position.hh" // location.cc:337
#endif // !YY_D2_PARSER_POSITION_HH_INCLUDED
-// Generated 201702011423
// A Bison parser, made by GNU Bison 3.0.4.
// Stack handling for Bison parsers in C++
# include <vector>
-#line 14 "d2_parser.yy" // stack.hh:132
+#line 14 "d2_parser.yy" // stack.hh:151
namespace isc { namespace d2 {
-#line 46 "stack.hh" // stack.hh:132
+#line 46 "stack.hh" // stack.hh:151
template <class T, class S = std::vector<T> >
class stack
{
unsigned int range_;
};
-#line 14 "d2_parser.yy" // stack.hh:132
+#line 14 "d2_parser.yy" // stack.hh:151
} } // isc::d2
-#line 156 "stack.hh" // stack.hh:132
+#line 156 "stack.hh" // stack.hh:151
#endif // !YY_D2_PARSER_STACK_HH_INCLUDED
// Cannot use port 0
config = makeParamsConfigString ("127.0.0.1", 0, 333, "UDP", "JSON");
- SYNTAX_ERROR(config, "<string>:1.40: port must be greater than zero");
+ SYNTAX_ERROR(config, "<string>:1.40: port must be greater than zero but less than 65792");
// Cannot use dns server timeout of 0
config = makeParamsConfigString ("127.0.0.1", 777, 0, "UDP", "JSON");
" \"ncr-format\": \"JSON\", "
"\"tsig-keys\": ["
"{"
- " \"name\": \"d2_key.tmark.org\" , "
+ " \"name\": \"d2_key.example.com\" , "
" \"algorithm\": \"hmac-md5\" , "
" \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
"},"
"],"
"\"forward-ddns\" : {"
"\"ddns-domains\": [ "
- "{ \"name\": \"tmark.org\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ "{ \"name\": \"example.com\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.1\" } , "
" { \"ip-address\": \"127.0.0.2\" } , "
"\"reverse-ddns\" : {"
"\"ddns-domains\": [ "
"{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.1.1\" } , "
" { \"ip-address\": \"127.0.2.1\" } , "
"\"tsig-keys\": [] ,"
"\"forward-ddns\" : {"
"\"ddns-domains\": [ "
- "{ \"name\": \"tmark.org\" , "
+ "{ \"name\": \"example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.1\" } "
" ] } "
", "
- "{ \"name\": \"one.tmark.org\" , "
+ "{ \"name\": \"one.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.2\" } "
" ] } "
DdnsDomainPtr match;
// Verify that an exact match works.
- EXPECT_TRUE(cfg_mgr_->matchForward("tmark.org", match));
- EXPECT_EQ("tmark.org", match->getName());
+ EXPECT_TRUE(cfg_mgr_->matchForward("example.com", match));
+ EXPECT_EQ("example.com", match->getName());
// Verify that search is case insensisitive.
- EXPECT_TRUE(cfg_mgr_->matchForward("TMARK.ORG", match));
- EXPECT_EQ("tmark.org", match->getName());
+ EXPECT_TRUE(cfg_mgr_->matchForward("EXAMPLE.COM", match));
+ EXPECT_EQ("example.com", match->getName());
// Verify that an exact match works.
- EXPECT_TRUE(cfg_mgr_->matchForward("one.tmark.org", match));
- EXPECT_EQ("one.tmark.org", match->getName());
+ EXPECT_TRUE(cfg_mgr_->matchForward("one.example.com", match));
+ EXPECT_EQ("one.example.com", match->getName());
// Verify that a FQDN for sub-domain matches.
- EXPECT_TRUE(cfg_mgr_->matchForward("blue.tmark.org", match));
- EXPECT_EQ("tmark.org", match->getName());
+ EXPECT_TRUE(cfg_mgr_->matchForward("blue.example.com", match));
+ EXPECT_EQ("example.com", match->getName());
// Verify that a FQDN for sub-domain matches.
- EXPECT_TRUE(cfg_mgr_->matchForward("red.one.tmark.org", match));
- EXPECT_EQ("one.tmark.org", match->getName());
+ EXPECT_TRUE(cfg_mgr_->matchForward("red.one.example.com", match));
+ EXPECT_EQ("one.example.com", match->getName());
// Verify that an FQDN with no match, returns the wild card domain.
EXPECT_TRUE(cfg_mgr_->matchForward("shouldbe.wildcard", match));
"\"tsig-keys\": [] ,"
"\"forward-ddns\" : {"
"\"ddns-domains\": [ "
- "{ \"name\": \"tmark.org\" , "
+ "{ \"name\": \"example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.1\" } "
" ] } "
", "
- "{ \"name\": \"one.tmark.org\" , "
+ "{ \"name\": \"one.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.2\" } "
" ] } "
DdnsDomainPtr match;
// Verify that full or partial matches, still match.
- EXPECT_TRUE(cfg_mgr_->matchForward("tmark.org", match));
- EXPECT_EQ("tmark.org", match->getName());
+ EXPECT_TRUE(cfg_mgr_->matchForward("example.com", match));
+ EXPECT_EQ("example.com", match->getName());
- EXPECT_TRUE(cfg_mgr_->matchForward("blue.tmark.org", match));
- EXPECT_EQ("tmark.org", match->getName());
+ EXPECT_TRUE(cfg_mgr_->matchForward("blue.example.com", match));
+ EXPECT_EQ("example.com", match->getName());
- EXPECT_TRUE(cfg_mgr_->matchForward("red.one.tmark.org", match));
- EXPECT_EQ("one.tmark.org", match->getName());
+ EXPECT_TRUE(cfg_mgr_->matchForward("red.one.example.com", match));
+ EXPECT_EQ("one.example.com", match->getName());
// Verify that a FQDN with no match, fails to match.
EXPECT_FALSE(cfg_mgr_->matchForward("shouldbe.wildcard", match));
// Verify that wild card domain is returned for any FQDN.
DdnsDomainPtr match;
- EXPECT_TRUE(cfg_mgr_->matchForward("tmark.org", match));
+ EXPECT_TRUE(cfg_mgr_->matchForward("example.com", match));
EXPECT_EQ("*", match->getName());
EXPECT_TRUE(cfg_mgr_->matchForward("shouldbe.wildcard", match));
EXPECT_EQ("*", match->getName());
"\"ip-address\" : \"1.1.1.1\" , "
"\"port\" : 5031, "
"\"tsig-keys\": ["
- "{ \"name\": \"d2_key.tmark.org\" , "
+ "{ \"name\": \"d2_key.example.com\" , "
" \"algorithm\": \"HMAC-MD5\" ,"
" \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
"} ],"
"\"forward-ddns\" : {"
"\"ddns-domains\": [ "
- "{ \"name\": \"tmark.org\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ "{ \"name\": \"example.com\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.101\" } "
"] } ] }, "
"\"reverse-ddns\" : {"
"\"ddns-domains\": [ "
"{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.101\" , "
" \"port\": 100 } ] } "
" \"change-type\" : 0 , "
" \"forward-change\" : true , "
" \"reverse-change\" : false , "
- " \"fqdn\" : \"fish.tmark.org\" , "
+ " \"fqdn\" : \"fish.example.com\" , "
" \"ip-address\" : \"192.168.2.1\" , "
" \"dhcid\" : \"010203040A7F8E3D\" , "
" \"lease-expires-on\" : \"20130121132405\" , "
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+// file, You can obtain one at http://mozilla.com/MPL/2.0/.
#include <config.h>
#include <gtest/gtest.h>
TEST_F(DnsServerInfoParserTest, invalidEntry) {
// Create a config in which both host and ip address are supplied.
// Verify that parsing fails.
- std::string config = "{ \"hostname\": \"pegasus.tmark\", "
+ std::string config = "{ \"hostname\": \"pegasus.example\", "
" \"ip-address\": \"127.0.0.1\", "
" \"port\": 100} ";
PARSE_FAIL(config, "<string>:1.13: hostname is not yet supported");
config = "{ \"hostname\": \"\", "
" \"ip-address\": \"192.168.5.6\" ,"
" \"port\": -100 }";
- PARSE_FAIL(config, "<string>:1.60-63: port must be greater than zero");
+ PARSE_FAIL(config, "<string>:1.60-63: port must be greater than zero but less than 65792");
}
TEST_F(DnsServerInfoParserTest, validEntry) {
/// @todo When resolvable hostname is supported you'll need this test.
/// // Valid entries for dynamic host
- /// std::string config = "{ \"hostname\": \"pegasus.tmark\" }";
+ /// std::string config = "{ \"hostname\": \"pegasus.example\" }";
/// ASSERT_TRUE(fromJSON(config));
/// // Verify that it builds and commits without throwing.
/// Verify the server exists and has the correct values.
/// DnsServerInfoPtr server = (*servers_)[0];
- /// EXPECT_TRUE(checkServer(server, "pegasus.tmark",
+ /// EXPECT_TRUE(checkServer(server, "pegasus.example",
/// DnsServerInfo::EMPTY_IP_STR,
/// DnsServerInfo::STANDARD_DNS_PORT));
/// 5. That an undefined key name is detected.
TEST_F(DdnsDomainParserTest, invalidDomain) {
// Create a domain configuration without a name
- std::string config = "{ \"key-name\": \"d2_key.tmark.org\" , "
+ std::string config = "{ \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.1\" , "
" \"port\": 100 },"
PARSE_FAIL(config, "String parameter name not found(<string>:1:1)");
// Create a domain configuration with an empty server list.
- config = "{ \"name\": \"tmark.org\" , "
+ config = "{ \"name\": \"example.com\" , "
" \"key-name\": \"\" , "
" \"dns-servers\" : [ "
" ] } ";
- PARSE_FAIL(config, "<string>:1.67: syntax error, unexpected ], expecting {");
+ PARSE_FAIL(config, "<string>:1.69: syntax error, unexpected ], expecting {");
// Create a domain configuration with a mal-formed server entry.
- config = "{ \"name\": \"tmark.org\" , "
+ config = "{ \"name\": \"example.com\" , "
" \"key-name\": \"\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.3\" , "
" \"port\": -1 } ] } ";
- PARSE_FAIL(config, "<string>:1.109-110: port must be greater than zero");
+ PARSE_FAIL(config, "<string>:1.111-112: port must be greater than zero but less than 65792");
// Create a domain configuration without an defined key name
- config = "{ \"name\": \"tmark.org\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ config = "{ \"name\": \"example.com\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } ";
- PARSE_FAIL(config, "DdnsDomain : tmark.org specifies"
- " an undefined key: d2_key.tmark.org (<string>:1:39)");
+ PARSE_FAIL(config, "DdnsDomain : example.com specifies"
+ " an undefined key: d2_key.example.com (<string>:1:41)");
}
/// @brief Verifies the basics of parsing of a DdnsDomain.
TEST_F(DdnsDomainParserTest, validDomain) {
// Add a TSIG key to the test key map, so key validation will pass.
- addKey("d2_key.tmark.org", "HMAC-MD5", "GWG/Xfbju4O2iXGqkSu4PQ==");
+ addKey("d2_key.example.com", "HMAC-MD5", "GWG/Xfbju4O2iXGqkSu4PQ==");
// Create a valid domain configuration entry containing three valid
// servers.
std::string config =
- "{ \"name\": \"tmark.org\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ "{ \"name\": \"example.com\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.1\" , "
" \"port\": 100 },"
ASSERT_TRUE(domain_);
// Verify the name and key_name values.
- EXPECT_EQ("tmark.org", domain_->getName());
- EXPECT_EQ("d2_key.tmark.org", domain_->getKeyName());
+ EXPECT_EQ("example.com", domain_->getName());
+ EXPECT_EQ("d2_key.example.com", domain_->getKeyName());
ASSERT_TRUE(domain_->getTSIGKeyInfo());
ASSERT_TRUE(domain_->getTSIGKeyInfo()->getTSIGKey());
/// it will accurately parse and populate each domain in the list.
TEST_F(DdnsDomainListParserTest, validList) {
// Add keys to key map so key validation passes.
- addKey("d2_key.tmark.org", "HMAC-MD5", "GWG/Xfbju4O2iXGqkSu4PQ==");
+ addKey("d2_key.example.com", "HMAC-MD5", "GWG/Xfbju4O2iXGqkSu4PQ==");
addKey("d2_key.billcat.net", "HMAC-MD5", "GWG/Xfbju4O2iXGqkSu4PQ==");
// Create a valid domain list configuration, with two domains
// that have three servers each.
std::string config =
"[ "
- "{ \"name\": \"tmark.org\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ "{ \"name\": \"example.com\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.1\" , "
" \"port\": 100 },"
EXPECT_EQ(2, domains_->size());
// Verify that the first domain exists and can be retrieved.
- DdnsDomainMap::iterator gotit = domains_->find("tmark.org");
+ DdnsDomainMap::iterator gotit = domains_->find("example.com");
ASSERT_TRUE(gotit != domains_->end());
DdnsDomainPtr& domain = gotit->second;
// Verify the name and key_name values of the first domain.
- EXPECT_EQ("tmark.org", domain->getName());
- EXPECT_EQ("d2_key.tmark.org", domain->getKeyName());
+ EXPECT_EQ("example.com", domain->getName());
+ EXPECT_EQ("d2_key.example.com", domain->getKeyName());
// Verify the TSIGKeyInfo name and that the actual key was created
ASSERT_TRUE(domain->getTSIGKeyInfo());
// the same name.
std::string config =
"[ "
- "{ \"name\": \"tmark.org\" , "
+ "{ \"name\": \"example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } "
", "
- "{ \"name\": \"tmark.org\" , "
+ "{ \"name\": \"example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.3\" , "
" \"port\": 300 } ] } "
"] ";
// Verify that the parsing fails.
PARSE_FAIL(config,
- "Duplicate domain specified:tmark.org (<string>:1:113)");
+ "Duplicate domain specified:example.com (<string>:1:115)");
}
};
"\"ip-address\" : \"127.0.0.1\" , "
"\"port\" : 5031, "
"\"tsig-keys\": ["
- "{ \"name\": \"d2_key.tmark.org\" , "
+ "{ \"name\": \"d2_key.example.com\" , "
" \"algorithm\": \"HMAC-MD5\" ,"
" \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
"} ],"
"\"forward-ddns\" : {"
"\"ddns-domains\": [ "
- "{ \"name\": \"tmark.org.\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ "{ \"name\": \"example.com.\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.101\" } "
"] } ] }, "
"\"reverse-ddns\" : {"
"\"ddns-domains\": [ "
"{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
- " \"key-name\": \"d2_key.tmark.org\" , "
+ " \"key-name\": \"d2_key.example.com\" , "
" \"dns-servers\" : [ "
" { \"ip-address\": \"127.0.0.101\" , "
" \"port\": 100 } ] } "
#-----
,{
"description" : "D2Params.port can't be 0",
-"syntax-error" : "<string>:1.33: port must be greater than zero",
+"syntax-error" : "<string>:1.33: port must be greater than zero but less than 65792",
"data" :
{
"port" : 0,
#-----
,{
"description" : "D2.forward-ddns.dhcp-ddns.dns-servers.port cannot be 0 ",
-"syntax-error" : "<string>:1.97: port must be greater than zero",
+"syntax-error" : "<string>:1.97: port must be greater than zero but less than 65792",
"data" :
{
"forward-ddns" :
#-----
,{
"description" : "D2.reverse-ddns.dhcp-ddns.dns-servers.port cannot be 0 ",
-"syntax-error" : "<string>:1.119: port must be greater than zero",
+"syntax-error" : "<string>:1.119: port must be greater than zero but less than 65792",
"data" :
{
"forward-ddns" : {},
return (answer);
}
+void
+DCfgMgrBase::setCfgDefaults(isc::data::ElementPtr) {
+}
+
+void
+DCfgMgrBase::parseElement(const std::string&, isc::data::ConstElementPtr) {
+};
+
+
void
DCfgMgrBase::buildParams(isc::data::ConstElementPtr params_config) {
// Loop through scalars parsing them and committing them to storage.
/// Element map prior to parsing it.
///
/// @param mutable_config - configuration to which defaults should be added
- virtual void setCfgDefaults(isc::data::ElementPtr mutable_config) {
- }
+ virtual void setCfgDefaults(isc::data::ElementPtr mutable_config);
- /// @brief Parses the an element using an alternate parsing mechanism
+ /// @brief Parses an individual element
///
/// Each element to be parsed is passed into this method to be converted
/// into the requisite application object(s).
/// @param element value of the element as ElementPtr
///
virtual void parseElement(const std::string& element_id,
- isc::data::ConstElementPtr element) {
- };
+ isc::data::ConstElementPtr element);
/// @brief Parses a set of scalar configuration elements into global
/// parameters
controller_ = controller;
}
+isc::data::ConstElementPtr
+DControllerBase::parseFile(const std::string&) {
+ isc::data::ConstElementPtr elements;
+ return (elements);
+}
+
void
DControllerBase::launch(int argc, char* argv[], const bool test_mode) {
// rather than calling exit() here which disrupts gtest.
isc_throw(VersionMessage, getVersion(true));
break;
-
+
case 'W':
// gather Kea config report and throw so main() can catch and
// return rather than calling exit() here which disrupts gtest.
tmp << "linked with:" << std::endl;
tmp << isc::log::Logger::getVersion() << std::endl;
tmp << isc::cryptolink::CryptoLink::getVersion() << std::endl;
- tmp << "database:" << std::endl;
+ tmp << "database:" << std::endl;
#ifdef HAVE_MYSQL
tmp << isc::dhcp::MySqlLeaseMgr::getDBVersion() << std::endl;
#endif
///
/// @return pointer to the elements created
///
- virtual isc::data::ConstElementPtr parseFile(const std::string& file_name) {
- isc::data::ConstElementPtr elements;
- return (elements);
- }
+ virtual isc::data::ConstElementPtr parseFile(const std::string& file_name);
///@brief Parse text into Elements
///