mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 05:27:55 +00:00
[#1386] kea-dhcp4/6 now parse ddns-use-conflict-resolution
Both servers parse and store ddns-use-conflict-resolution but do nothing with it. doc/examples/kea4/all-keys.json doc/examples/kea4/with-ddns.json doc/examples/kea6/all-keys.json doc/examples/kea6/with-ddns.json Added entries for ddns-use-conflict-resolution src/bin/dhcp4/dhcp4_lexer.ll src/bin/dhcp4/dhcp4_parser.yy src/bin/dhcp4/json_config_parser.cc src/bin/dhcp4/tests/get_config_unittest.cc Added support for ddns-use-conflict-resolution src/bin/dhcp4/tests/get_config_unittest.cc.skel Changed important calls to ASSERT_NO_THROW_LOG to ease debugging src/bin/dhcp6/dhcp6_lexer.ll src/bin/dhcp6/dhcp6_parser.yy src/bin/dhcp6/json_config_parser.cc src/bin/dhcp6/tests/get_config_unittest.cc Added support for ddns-use-conflict-resolution src/bin/dhcp6/tests/get_config_unittest.cc.skel Changed important calls to ASSERT_NO_THROW_LOG to ease debugging src/lib/dhcpsrv/parsers/base_network_parser.cc Fixed copy/paste error
This commit is contained in:
parent
f8174588d5
commit
00305bc7d4
@ -155,6 +155,13 @@
|
||||
// may be specified at the global, shared-network and subnet levels.
|
||||
"ddns-update-on-renew": true,
|
||||
|
||||
// Boolean flag, which is passed to kea-dhcp-ddns with each DDNS
|
||||
// udpate request to indicate whether or not DNS update conflict
|
||||
// resolution as described in RFC 4703 should be employed for the
|
||||
// given update request. The default value for this flag is true.
|
||||
// It may be specified at the global, shared-network and subnet levels.
|
||||
"ddns-use-conflict-resolution": true,
|
||||
|
||||
// Time in seconds specifying how long a declined lease should be
|
||||
// excluded from DHCP assignments. The default value is 24 hours.
|
||||
"decline-probation-period": 86400,
|
||||
@ -627,6 +634,9 @@
|
||||
// Shared network level value. See description at the global level.
|
||||
"ddns-update-on-renew": true,
|
||||
|
||||
// Shared network level value. See description at the global level.
|
||||
"ddns-use-conflict-resolution": true,
|
||||
|
||||
// Shared network level value. See description at the global level.
|
||||
"hostname-char-replacement": "x",
|
||||
|
||||
@ -740,6 +750,9 @@
|
||||
// Subnet level value. See description at the global level.
|
||||
"ddns-update-on-renew": true,
|
||||
|
||||
// Subnet level value. See description at the global level.
|
||||
"ddns-use-conflict-resolution": true,
|
||||
|
||||
// Subnet level value. See description at the global level.
|
||||
"hostname-char-replacement": "x",
|
||||
|
||||
|
@ -59,6 +59,8 @@
|
||||
"ddns-replace-client-name" : "when-present",
|
||||
"ddns-generated-prefix" : "test.prefix",
|
||||
"ddns-qualifying-suffix" : "test.suffix.",
|
||||
"ddns-update-on-renew" : false,
|
||||
"ddns-use-conflict-resolution" : true,
|
||||
"hostname-char-set": "[^A-Za-z0-9.-]",
|
||||
"hostname-char-replacement": "x",
|
||||
|
||||
|
@ -115,6 +115,13 @@
|
||||
// may be specified at the global, shared-network and subnet levels.
|
||||
"ddns-update-on-renew": true,
|
||||
|
||||
// Boolean flag, which is passed to kea-dhcp-ddns with each DDNS
|
||||
// udpate request to indicate whether or not DNS update conflict
|
||||
// resolution as described in RFC 4703 should be employed for the
|
||||
// given update request. The default value for this flag is true.
|
||||
// It may be specified at the global, shared-network and subnet levels.
|
||||
"ddns-use-conflict-resolution": true,
|
||||
|
||||
// Time in seconds specifying how long a declined lease should be
|
||||
// excluded from DHCP assignments. The default value is 24 hours.
|
||||
"decline-probation-period": 86400,
|
||||
@ -574,6 +581,9 @@
|
||||
// Shared network level value. See description at the global level.
|
||||
"ddns-update-on-renew": true,
|
||||
|
||||
// Shared network level value. See description at the global level.
|
||||
"ddns-use-conflict-resolution": true,
|
||||
|
||||
// Shared network level value. See description at the global level.
|
||||
"hostname-char-replacement": "x",
|
||||
|
||||
@ -679,6 +689,9 @@
|
||||
// Subnet level value. See description at the global level.
|
||||
"ddns-update-on-renew": true,
|
||||
|
||||
// Subnet level value. See description at the global level.
|
||||
"ddns-use-conflict-resolution": true,
|
||||
|
||||
// Subnet level value. See description at the global level.
|
||||
"hostname-char-replacement": "x",
|
||||
|
||||
|
@ -62,6 +62,8 @@
|
||||
"ddns-replace-client-name" : "when-present",
|
||||
"ddns-generated-prefix" : "test.prefix",
|
||||
"ddns-qualifying-suffix" : "test.suffix.",
|
||||
"ddns-update-on-renew" : false,
|
||||
"ddns-use-conflict-resolution" : true,
|
||||
"hostname-char-set": "[^A-Za-z0-9.-]",
|
||||
"hostname-char-replacement": "x",
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -758,6 +758,17 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
|
||||
}
|
||||
}
|
||||
|
||||
\"ddns-use-conflict-resolution\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::DHCP4:
|
||||
case isc::dhcp::Parser4Context::SUBNET4:
|
||||
case isc::dhcp::Parser4Context::SHARED_NETWORK:
|
||||
return isc::dhcp::Dhcp4Parser::make_DDNS_USE_CONFLICT_RESOLUTION(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("ddns-use-conflict-resolution", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"subnet4\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::DHCP4:
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -123,6 +123,7 @@ using namespace std;
|
||||
DDNS_GENERATED_PREFIX "ddns-generated-prefix"
|
||||
DDNS_QUALIFYING_SUFFIX "ddns-qualifying-suffix"
|
||||
DDNS_UPDATE_ON_RENEW "ddns-update-on-renew"
|
||||
DDNS_USE_CONFLICT_RESOLUTION "ddns-use-conflict-resolution"
|
||||
STORE_EXTENDED_INFO "store-extended-info"
|
||||
SUBNET4 "subnet4"
|
||||
SUBNET_4O6_INTERFACE "4o6-interface"
|
||||
@ -497,6 +498,7 @@ global_param: valid_lifetime
|
||||
| ddns_generated_prefix
|
||||
| ddns_qualifying_suffix
|
||||
| ddns_update_on_renew
|
||||
| ddns_use_conflict_resolution
|
||||
| store_extended_info
|
||||
| statistic_default_sample_count
|
||||
| statistic_default_sample_age
|
||||
@ -667,6 +669,12 @@ ddns_update_on_renew: DDNS_UPDATE_ON_RENEW COLON BOOLEAN {
|
||||
ctx.stack_.back()->set("ddns-update-on-renew", b);
|
||||
};
|
||||
|
||||
ddns_use_conflict_resolution: DDNS_USE_CONFLICT_RESOLUTION COLON BOOLEAN {
|
||||
ctx.unique("ddns-use-conflict-resolution", ctx.loc2pos(@1));
|
||||
ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("ddns-use-conflict-resolution", b);
|
||||
};
|
||||
|
||||
hostname_char_set: HOSTNAME_CHAR_SET {
|
||||
ctx.unique("hostname-char-set", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
@ -1383,6 +1391,7 @@ subnet4_param: valid_lifetime
|
||||
| ddns_generated_prefix
|
||||
| ddns_qualifying_suffix
|
||||
| ddns_update_on_renew
|
||||
| ddns_use_conflict_resolution
|
||||
| hostname_char_set
|
||||
| hostname_char_replacement
|
||||
| store_extended_info
|
||||
@ -1541,6 +1550,7 @@ shared_network_param: name
|
||||
| ddns_generated_prefix
|
||||
| ddns_qualifying_suffix
|
||||
| ddns_update_on_renew
|
||||
| ddns_use_conflict_resolution
|
||||
| hostname_char_set
|
||||
| hostname_char_replacement
|
||||
| store_extended_info
|
||||
|
@ -643,6 +643,7 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
|
||||
(config_pair.first == "ddns-generated-prefix") ||
|
||||
(config_pair.first == "ddns-qualifying-suffix") ||
|
||||
(config_pair.first == "ddns-update-on-renew") ||
|
||||
(config_pair.first == "ddns-use-conflict-resolution") ||
|
||||
(config_pair.first == "store-extended-info") ||
|
||||
(config_pair.first == "statistic-default-sample-count") ||
|
||||
(config_pair.first == "statistic-default-sample-age") ||
|
||||
|
@ -1,9 +1,8 @@
|
||||
// Generated 202010091455
|
||||
// A Bison parser, made by GNU Bison 3.7.2.
|
||||
// A Bison parser, made by GNU Bison 3.0.4.
|
||||
|
||||
// Locations for Bison parsers in C++
|
||||
|
||||
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -39,164 +38,44 @@
|
||||
#ifndef YY_PARSER4_LOCATION_HH_INCLUDED
|
||||
# define YY_PARSER4_LOCATION_HH_INCLUDED
|
||||
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
# include "position.hh"
|
||||
|
||||
# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus
|
||||
# if 201103L <= __cplusplus
|
||||
# define YY_NULLPTR nullptr
|
||||
# else
|
||||
# define YY_NULLPTR 0
|
||||
# endif
|
||||
# else
|
||||
# define YY_NULLPTR ((void*)0)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#line 14 "dhcp4_parser.yy"
|
||||
#line 14 "dhcp4_parser.yy" // location.cc:296
|
||||
namespace isc { namespace dhcp {
|
||||
#line 59 "location.hh"
|
||||
|
||||
/// A point in a source file.
|
||||
class position
|
||||
{
|
||||
public:
|
||||
/// Type for file name.
|
||||
typedef const std::string filename_type;
|
||||
/// Type for line and column numbers.
|
||||
typedef int counter_type;
|
||||
|
||||
/// Construct a position.
|
||||
explicit position (filename_type* f = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
: filename (f)
|
||||
, line (l)
|
||||
, column (c)
|
||||
{}
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (filename_type* fn = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
{
|
||||
filename = fn;
|
||||
line = l;
|
||||
column = c;
|
||||
}
|
||||
|
||||
/** \name Line and Column related manipulators
|
||||
** \{ */
|
||||
/// (line related) Advance to the COUNT next lines.
|
||||
void lines (counter_type count = 1)
|
||||
{
|
||||
if (count)
|
||||
{
|
||||
column = 1;
|
||||
line = add_ (line, count, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// (column related) Advance to the COUNT next columns.
|
||||
void columns (counter_type count = 1)
|
||||
{
|
||||
column = add_ (column, count, 1);
|
||||
}
|
||||
/** \} */
|
||||
|
||||
/// File name to which this position refers.
|
||||
filename_type* filename;
|
||||
/// Current line number.
|
||||
counter_type line;
|
||||
/// Current column number.
|
||||
counter_type column;
|
||||
|
||||
private:
|
||||
/// Compute max (min, lhs+rhs).
|
||||
static counter_type add_ (counter_type lhs, counter_type rhs, counter_type min)
|
||||
{
|
||||
return lhs + rhs < min ? min : lhs + rhs;
|
||||
}
|
||||
};
|
||||
|
||||
/// Add \a width columns, in place.
|
||||
inline position&
|
||||
operator+= (position& res, position::counter_type width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns.
|
||||
inline position
|
||||
operator+ (position res, position::counter_type width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns, in place.
|
||||
inline position&
|
||||
operator-= (position& res, position::counter_type width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns.
|
||||
inline position
|
||||
operator- (position res, position::counter_type width)
|
||||
{
|
||||
return res -= width;
|
||||
}
|
||||
|
||||
/** \brief Intercept output stream redirection.
|
||||
** \param ostr the destination output stream
|
||||
** \param pos a reference to the position to redirect
|
||||
*/
|
||||
template <typename YYChar>
|
||||
std::basic_ostream<YYChar>&
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
|
||||
{
|
||||
if (pos.filename)
|
||||
ostr << *pos.filename << ':';
|
||||
return ostr << pos.line << '.' << pos.column;
|
||||
}
|
||||
|
||||
/// Two points in a source file.
|
||||
#line 46 "location.hh" // location.cc:296
|
||||
/// Abstract a location.
|
||||
class location
|
||||
{
|
||||
public:
|
||||
/// Type for file name.
|
||||
typedef position::filename_type filename_type;
|
||||
/// Type for line and column numbers.
|
||||
typedef position::counter_type counter_type;
|
||||
|
||||
/// Construct a location from \a b to \a e.
|
||||
location (const position& b, const position& e)
|
||||
: begin (b)
|
||||
, end (e)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a 0-width location in \a p.
|
||||
explicit location (const position& p = position ())
|
||||
: begin (p)
|
||||
, end (p)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a 0-width location in \a f, \a l, \a c.
|
||||
explicit location (filename_type* f,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
explicit location (std::string* f,
|
||||
unsigned int l = 1u,
|
||||
unsigned int c = 1u)
|
||||
: begin (f, l, c)
|
||||
, end (f, l, c)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (filename_type* f = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
void initialize (std::string* f = YY_NULLPTR,
|
||||
unsigned int l = 1u,
|
||||
unsigned int c = 1u)
|
||||
{
|
||||
begin.initialize (f, l, c);
|
||||
end = begin;
|
||||
@ -212,13 +91,13 @@ namespace isc { namespace dhcp {
|
||||
}
|
||||
|
||||
/// Extend the current location to the COUNT next columns.
|
||||
void columns (counter_type count = 1)
|
||||
void columns (int count = 1)
|
||||
{
|
||||
end += count;
|
||||
}
|
||||
|
||||
/// Extend the current location to the COUNT next lines.
|
||||
void lines (counter_type count = 1)
|
||||
void lines (int count = 1)
|
||||
{
|
||||
end.lines (count);
|
||||
}
|
||||
@ -233,49 +112,57 @@ namespace isc { namespace dhcp {
|
||||
};
|
||||
|
||||
/// Join two locations, in place.
|
||||
inline location&
|
||||
operator+= (location& res, const location& end)
|
||||
inline location& operator+= (location& res, const location& end)
|
||||
{
|
||||
res.end = end.end;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Join two locations.
|
||||
inline location
|
||||
operator+ (location res, const location& end)
|
||||
inline location operator+ (location res, const location& end)
|
||||
{
|
||||
return res += end;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position, in place.
|
||||
inline location&
|
||||
operator+= (location& res, location::counter_type width)
|
||||
inline location& operator+= (location& res, int width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position.
|
||||
inline location
|
||||
operator+ (location res, location::counter_type width)
|
||||
inline location operator+ (location res, int width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns to the end position, in place.
|
||||
inline location&
|
||||
operator-= (location& res, location::counter_type width)
|
||||
inline location& operator-= (location& res, int width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns to the end position.
|
||||
inline location
|
||||
operator- (location res, location::counter_type width)
|
||||
inline location operator- (location res, int width)
|
||||
{
|
||||
return res -= width;
|
||||
}
|
||||
|
||||
/// Compare two location objects.
|
||||
inline bool
|
||||
operator== (const location& loc1, const location& loc2)
|
||||
{
|
||||
return loc1.begin == loc2.begin && loc1.end == loc2.end;
|
||||
}
|
||||
|
||||
/// Compare two location objects.
|
||||
inline bool
|
||||
operator!= (const location& loc1, const location& loc2)
|
||||
{
|
||||
return !(loc1 == loc2);
|
||||
}
|
||||
|
||||
/** \brief Intercept output stream redirection.
|
||||
** \param ostr the destination output stream
|
||||
** \param loc a reference to the location to redirect
|
||||
@ -283,11 +170,10 @@ namespace isc { namespace dhcp {
|
||||
** Avoid duplicate information.
|
||||
*/
|
||||
template <typename YYChar>
|
||||
std::basic_ostream<YYChar>&
|
||||
inline std::basic_ostream<YYChar>&
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
|
||||
{
|
||||
location::counter_type end_col
|
||||
= 0 < loc.end.column ? loc.end.column - 1 : 0;
|
||||
unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
|
||||
ostr << loc.begin;
|
||||
if (loc.end.filename
|
||||
&& (!loc.begin.filename
|
||||
@ -300,8 +186,7 @@ namespace isc { namespace dhcp {
|
||||
return ostr;
|
||||
}
|
||||
|
||||
#line 14 "dhcp4_parser.yy"
|
||||
#line 14 "dhcp4_parser.yy" // location.cc:296
|
||||
} } // isc::dhcp
|
||||
#line 305 "location.hh"
|
||||
|
||||
#line 192 "location.hh" // location.cc:296
|
||||
#endif // !YY_PARSER4_LOCATION_HH_INCLUDED
|
||||
|
@ -1,12 +1,180 @@
|
||||
// Generated 202010091455
|
||||
// A Bison parser, made by GNU Bison 3.7.2.
|
||||
// A Bison parser, made by GNU Bison 3.0.4.
|
||||
|
||||
// Starting with Bison 3.2, this file is useless: the structure it
|
||||
// used to define is now defined in "location.hh".
|
||||
//
|
||||
// To get rid of this file:
|
||||
// 1. add '%require "3.2"' (or newer) to your grammar file
|
||||
// 2. remove references to this file from your build system
|
||||
// 3. if you used to include it, include "location.hh" instead.
|
||||
// Positions for Bison parsers in C++
|
||||
|
||||
#include "location.hh"
|
||||
// Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// As a special exception, you may create a larger work that contains
|
||||
// part or all of the Bison parser skeleton and distribute that work
|
||||
// under terms of your choice, so long as that work isn't itself a
|
||||
// parser generator using the skeleton or a modified version thereof
|
||||
// as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
// the parser skeleton itself, you may (at your option) remove this
|
||||
// special exception, which will cause the skeleton and the resulting
|
||||
// Bison output files to be licensed under the GNU General Public
|
||||
// License without this special exception.
|
||||
|
||||
// This special exception was added by the Free Software Foundation in
|
||||
// version 2.2 of Bison.
|
||||
|
||||
/**
|
||||
** \file position.hh
|
||||
** Define the isc::dhcp::position class.
|
||||
*/
|
||||
|
||||
#ifndef YY_PARSER4_POSITION_HH_INCLUDED
|
||||
# define YY_PARSER4_POSITION_HH_INCLUDED
|
||||
|
||||
# include <algorithm> // std::max
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
|
||||
# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
# define YY_NULLPTR nullptr
|
||||
# else
|
||||
# define YY_NULLPTR 0
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#line 14 "dhcp4_parser.yy" // location.cc:296
|
||||
namespace isc { namespace dhcp {
|
||||
#line 56 "position.hh" // location.cc:296
|
||||
/// Abstract a position.
|
||||
class position
|
||||
{
|
||||
public:
|
||||
/// Construct a position.
|
||||
explicit position (std::string* f = YY_NULLPTR,
|
||||
unsigned int l = 1u,
|
||||
unsigned int c = 1u)
|
||||
: filename (f)
|
||||
, line (l)
|
||||
, column (c)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (std::string* fn = YY_NULLPTR,
|
||||
unsigned int l = 1u,
|
||||
unsigned int c = 1u)
|
||||
{
|
||||
filename = fn;
|
||||
line = l;
|
||||
column = c;
|
||||
}
|
||||
|
||||
/** \name Line and Column related manipulators
|
||||
** \{ */
|
||||
/// (line related) Advance to the COUNT next lines.
|
||||
void lines (int count = 1)
|
||||
{
|
||||
if (count)
|
||||
{
|
||||
column = 1u;
|
||||
line = add_ (line, count, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// (column related) Advance to the COUNT next columns.
|
||||
void columns (int count = 1)
|
||||
{
|
||||
column = add_ (column, count, 1);
|
||||
}
|
||||
/** \} */
|
||||
|
||||
/// File name to which this position refers.
|
||||
std::string* filename;
|
||||
/// Current line number.
|
||||
unsigned int line;
|
||||
/// Current column number.
|
||||
unsigned int column;
|
||||
|
||||
private:
|
||||
/// Compute max(min, lhs+rhs) (provided min <= lhs).
|
||||
static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min)
|
||||
{
|
||||
return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs
|
||||
? rhs + lhs
|
||||
: min);
|
||||
}
|
||||
};
|
||||
|
||||
/// Add \a width columns, in place.
|
||||
inline position&
|
||||
operator+= (position& res, int width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns.
|
||||
inline position
|
||||
operator+ (position res, int width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns, in place.
|
||||
inline position&
|
||||
operator-= (position& res, int width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns.
|
||||
inline position
|
||||
operator- (position res, int width)
|
||||
{
|
||||
return res -= width;
|
||||
}
|
||||
|
||||
/// Compare two position objects.
|
||||
inline bool
|
||||
operator== (const position& pos1, const position& pos2)
|
||||
{
|
||||
return (pos1.line == pos2.line
|
||||
&& pos1.column == pos2.column
|
||||
&& (pos1.filename == pos2.filename
|
||||
|| (pos1.filename && pos2.filename
|
||||
&& *pos1.filename == *pos2.filename)));
|
||||
}
|
||||
|
||||
/// Compare two position objects.
|
||||
inline bool
|
||||
operator!= (const position& pos1, const position& pos2)
|
||||
{
|
||||
return !(pos1 == pos2);
|
||||
}
|
||||
|
||||
/** \brief Intercept output stream redirection.
|
||||
** \param ostr the destination output stream
|
||||
** \param pos a reference to the position to redirect
|
||||
*/
|
||||
template <typename YYChar>
|
||||
inline std::basic_ostream<YYChar>&
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
|
||||
{
|
||||
if (pos.filename)
|
||||
ostr << *pos.filename << ':';
|
||||
return ostr << pos.line << '.' << pos.column;
|
||||
}
|
||||
|
||||
#line 14 "dhcp4_parser.yy" // location.cc:296
|
||||
} } // isc::dhcp
|
||||
#line 180 "position.hh" // location.cc:296
|
||||
#endif // !YY_PARSER4_POSITION_HH_INCLUDED
|
||||
|
@ -1,9 +1,157 @@
|
||||
// Generated 202010091455
|
||||
// A Bison parser, made by GNU Bison 3.7.2.
|
||||
// A Bison parser, made by GNU Bison 3.0.4.
|
||||
|
||||
// Starting with Bison 3.2, this file is useless: the structure it
|
||||
// used to define is now defined with the parser itself.
|
||||
//
|
||||
// To get rid of this file:
|
||||
// 1. add '%require "3.2"' (or newer) to your grammar file
|
||||
// 2. remove references to this file from your build system.
|
||||
// Stack handling for Bison parsers in C++
|
||||
|
||||
// Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// As a special exception, you may create a larger work that contains
|
||||
// part or all of the Bison parser skeleton and distribute that work
|
||||
// under terms of your choice, so long as that work isn't itself a
|
||||
// parser generator using the skeleton or a modified version thereof
|
||||
// as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
// the parser skeleton itself, you may (at your option) remove this
|
||||
// special exception, which will cause the skeleton and the resulting
|
||||
// Bison output files to be licensed under the GNU General Public
|
||||
// License without this special exception.
|
||||
|
||||
// This special exception was added by the Free Software Foundation in
|
||||
// version 2.2 of Bison.
|
||||
|
||||
/**
|
||||
** \file stack.hh
|
||||
** Define the isc::dhcp::stack class.
|
||||
*/
|
||||
|
||||
#ifndef YY_PARSER4_STACK_HH_INCLUDED
|
||||
# define YY_PARSER4_STACK_HH_INCLUDED
|
||||
|
||||
# include <vector>
|
||||
|
||||
#line 14 "dhcp4_parser.yy" // stack.hh:132
|
||||
namespace isc { namespace dhcp {
|
||||
#line 46 "stack.hh" // stack.hh:132
|
||||
template <class T, class S = std::vector<T> >
|
||||
class stack
|
||||
{
|
||||
public:
|
||||
// Hide our reversed order.
|
||||
typedef typename S::reverse_iterator iterator;
|
||||
typedef typename S::const_reverse_iterator const_iterator;
|
||||
|
||||
stack ()
|
||||
: seq_ ()
|
||||
{
|
||||
seq_.reserve (200);
|
||||
}
|
||||
|
||||
stack (unsigned int n)
|
||||
: seq_ (n)
|
||||
{}
|
||||
|
||||
inline
|
||||
T&
|
||||
operator[] (unsigned int i)
|
||||
{
|
||||
return seq_[seq_.size () - 1 - i];
|
||||
}
|
||||
|
||||
inline
|
||||
const T&
|
||||
operator[] (unsigned int i) const
|
||||
{
|
||||
return seq_[seq_.size () - 1 - i];
|
||||
}
|
||||
|
||||
/// Steal the contents of \a t.
|
||||
///
|
||||
/// Close to move-semantics.
|
||||
inline
|
||||
void
|
||||
push (T& t)
|
||||
{
|
||||
seq_.push_back (T());
|
||||
operator[](0).move (t);
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
pop (unsigned int n = 1)
|
||||
{
|
||||
for (; n; --n)
|
||||
seq_.pop_back ();
|
||||
}
|
||||
|
||||
void
|
||||
clear ()
|
||||
{
|
||||
seq_.clear ();
|
||||
}
|
||||
|
||||
inline
|
||||
typename S::size_type
|
||||
size () const
|
||||
{
|
||||
return seq_.size ();
|
||||
}
|
||||
|
||||
inline
|
||||
const_iterator
|
||||
begin () const
|
||||
{
|
||||
return seq_.rbegin ();
|
||||
}
|
||||
|
||||
inline
|
||||
const_iterator
|
||||
end () const
|
||||
{
|
||||
return seq_.rend ();
|
||||
}
|
||||
|
||||
private:
|
||||
stack (const stack&);
|
||||
stack& operator= (const stack&);
|
||||
/// The wrapped container.
|
||||
S seq_;
|
||||
};
|
||||
|
||||
/// Present a slice of the top of a stack.
|
||||
template <class T, class S = stack<T> >
|
||||
class slice
|
||||
{
|
||||
public:
|
||||
slice (const S& stack, unsigned int range)
|
||||
: stack_ (stack)
|
||||
, range_ (range)
|
||||
{}
|
||||
|
||||
inline
|
||||
const T&
|
||||
operator [] (unsigned int i) const
|
||||
{
|
||||
return stack_[range_ - i];
|
||||
}
|
||||
|
||||
private:
|
||||
const S& stack_;
|
||||
unsigned int range_;
|
||||
};
|
||||
|
||||
#line 14 "dhcp4_parser.yy" // stack.hh:132
|
||||
} } // isc::dhcp
|
||||
#line 156 "stack.hh" // stack.hh:132
|
||||
|
||||
#endif // !YY_PARSER4_STACK_HH_INCLUDED
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <dhcp4/json_config_parser.h>
|
||||
#include <dhcp4/tests/dhcp4_test_utils.h>
|
||||
#include <dhcp4/tests/get_config_unittest.h>
|
||||
#include <testutils/gtest_utils.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
@ -2267,6 +2268,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2343,6 +2345,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2443,6 +2446,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2543,6 +2547,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2649,6 +2654,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2826,6 +2832,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3003,6 +3010,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3105,6 +3113,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3210,6 +3219,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3315,6 +3325,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3417,6 +3428,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3519,6 +3531,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3648,6 +3661,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3776,6 +3790,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3905,6 +3920,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4033,6 +4049,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4139,6 +4156,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4274,6 +4292,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4376,6 +4395,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4460,6 +4480,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4544,6 +4565,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4637,6 +4659,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4721,6 +4744,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4805,6 +4829,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4889,6 +4914,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4973,6 +4999,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5092,6 +5119,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5211,6 +5239,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5340,6 +5369,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5452,6 +5482,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5607,6 +5638,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5735,6 +5767,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5880,6 +5913,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5999,6 +6033,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6123,6 +6158,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6242,6 +6278,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6354,6 +6391,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6500,6 +6538,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6617,6 +6656,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6738,6 +6778,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6814,6 +6855,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6890,6 +6932,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": true,\n"
|
||||
@ -6992,6 +7035,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"when-present\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": true,\n"
|
||||
@ -7094,6 +7138,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"always\",\n"
|
||||
" \"ddns-send-updates\": false,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": true,\n"
|
||||
@ -7196,6 +7241,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7298,6 +7344,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7400,6 +7447,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7580,6 +7628,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7697,6 +7746,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7952,6 +8002,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8084,6 +8135,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8264,6 +8316,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8392,6 +8445,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8466,6 +8520,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8540,6 +8595,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 12345,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8614,6 +8670,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8688,6 +8745,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8790,6 +8848,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8892,6 +8951,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8994,6 +9054,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9096,6 +9157,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9224,6 +9286,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9326,6 +9389,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9428,6 +9492,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9531,6 +9596,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9638,6 +9704,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9745,6 +9812,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9876,6 +9944,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -10056,6 +10125,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -10238,6 +10308,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -10397,6 +10468,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -10524,6 +10596,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -10651,6 +10724,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -10727,6 +10801,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -10801,6 +10876,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -11103,16 +11179,16 @@ TEST_P(Dhcp4GetConfigTest, run) {
|
||||
std::cerr << ",\n";
|
||||
}
|
||||
std::cerr << " // CONFIGURATION " << config_counter;
|
||||
ASSERT_NO_THROW(expected = prettyPrint(dhcp));
|
||||
ASSERT_NO_THROW(outputFormatted(dhcp->str()));
|
||||
ASSERT_NO_THROW_LOG(expected = prettyPrint(dhcp));
|
||||
ASSERT_NO_THROW_LOG(outputFormatted(dhcp->str()));
|
||||
} else {
|
||||
expected = UNPARSED_CONFIGS[config_counter];
|
||||
// get the expected config using the dhcpv4 syntax parser
|
||||
ElementPtr jsond;
|
||||
ASSERT_NO_THROW(jsond = parseDHCP4(expected, true));
|
||||
ASSERT_NO_THROW_LOG(jsond = parseDHCP4(expected, true));
|
||||
ElementPtr jsonj;
|
||||
// get the expected config using the generic JSON syntax parser
|
||||
ASSERT_NO_THROW(jsonj = parseJSON(expected));
|
||||
ASSERT_NO_THROW_LOG(jsonj = parseJSON(expected));
|
||||
// the generic JSON parser does not handle comments
|
||||
EXPECT_TRUE(isEquivalent(jsond, moveComments(jsonj)));
|
||||
// check that unparsed and expected values match
|
||||
@ -11133,7 +11209,7 @@ TEST_P(Dhcp4GetConfigTest, run) {
|
||||
// is it a fixed point?
|
||||
ConstSrvConfigPtr extracted2 = CfgMgr::instance().getStagingCfg();
|
||||
ConstElementPtr unparsed2;
|
||||
ASSERT_NO_THROW(unparsed2 = extracted2->toElement());
|
||||
ASSERT_NO_THROW_LOG(unparsed2 = extracted2->toElement());
|
||||
ASSERT_TRUE(unparsed2);
|
||||
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <dhcp4/json_config_parser.h>
|
||||
#include <dhcp4/tests/dhcp4_test_utils.h>
|
||||
#include <dhcp4/tests/get_config_unittest.h>
|
||||
#include <testutils/gtest_utils.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
@ -314,16 +315,16 @@ TEST_P(Dhcp4GetConfigTest, run) {
|
||||
std::cerr << ",\n";
|
||||
}
|
||||
std::cerr << " // CONFIGURATION " << config_counter;
|
||||
ASSERT_NO_THROW(expected = prettyPrint(dhcp));
|
||||
ASSERT_NO_THROW(outputFormatted(dhcp->str()));
|
||||
ASSERT_NO_THROW_LOG(expected = prettyPrint(dhcp));
|
||||
ASSERT_NO_THROW_LOG(outputFormatted(dhcp->str()));
|
||||
} else {
|
||||
expected = UNPARSED_CONFIGS[config_counter];
|
||||
// get the expected config using the dhcpv4 syntax parser
|
||||
ElementPtr jsond;
|
||||
ASSERT_NO_THROW(jsond = parseDHCP4(expected, true));
|
||||
ASSERT_NO_THROW_LOG(jsond = parseDHCP4(expected, true));
|
||||
ElementPtr jsonj;
|
||||
// get the expected config using the generic JSON syntax parser
|
||||
ASSERT_NO_THROW(jsonj = parseJSON(expected));
|
||||
ASSERT_NO_THROW_LOG(jsonj = parseJSON(expected));
|
||||
// the generic JSON parser does not handle comments
|
||||
EXPECT_TRUE(isEquivalent(jsond, moveComments(jsonj)));
|
||||
// check that unparsed and expected values match
|
||||
@ -344,7 +345,7 @@ TEST_P(Dhcp4GetConfigTest, run) {
|
||||
// is it a fixed point?
|
||||
ConstSrvConfigPtr extracted2 = CfgMgr::instance().getStagingCfg();
|
||||
ConstElementPtr unparsed2;
|
||||
ASSERT_NO_THROW(unparsed2 = extracted2->toElement());
|
||||
ASSERT_NO_THROW_LOG(unparsed2 = extracted2->toElement());
|
||||
ASSERT_TRUE(unparsed2);
|
||||
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -989,6 +989,18 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
|
||||
}
|
||||
}
|
||||
|
||||
\"ddns-use-conflict-resolution\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::DHCP6:
|
||||
case isc::dhcp::Parser6Context::SUBNET6:
|
||||
case isc::dhcp::Parser6Context::SHARED_NETWORK:
|
||||
return isc::dhcp::Dhcp6Parser::make_DDNS_USE_CONFLICT_RESOLUTION(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("ddns-use-conflict-resolution", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
\"subnet6\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::DHCP6:
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -111,6 +111,7 @@ using namespace std;
|
||||
DDNS_GENERATED_PREFIX "ddns-generated-prefix"
|
||||
DDNS_QUALIFYING_SUFFIX "ddns-qualifying-suffix"
|
||||
DDNS_UPDATE_ON_RENEW "ddns-update-on-renew"
|
||||
DDNS_USE_CONFLICT_RESOLUTION "ddns-use-conflict-resolution"
|
||||
STORE_EXTENDED_INFO "store-extended-info"
|
||||
SUBNET6 "subnet6"
|
||||
OPTION_DEF "option-def"
|
||||
@ -505,6 +506,7 @@ global_param: data_directory
|
||||
| ddns_generated_prefix
|
||||
| ddns_qualifying_suffix
|
||||
| ddns_update_on_renew
|
||||
| ddns_use_conflict_resolution
|
||||
| store_extended_info
|
||||
| statistic_default_sample_count
|
||||
| statistic_default_sample_age
|
||||
@ -675,6 +677,12 @@ ddns_update_on_renew: DDNS_UPDATE_ON_RENEW COLON BOOLEAN {
|
||||
ctx.stack_.back()->set("ddns-update-on-renew", b);
|
||||
};
|
||||
|
||||
ddns_use_conflict_resolution: DDNS_USE_CONFLICT_RESOLUTION COLON BOOLEAN {
|
||||
ctx.unique("ddns-use-conflict-resolution", ctx.loc2pos(@1));
|
||||
ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("ddns-use-conflict-resolution", b);
|
||||
};
|
||||
|
||||
hostname_char_set: HOSTNAME_CHAR_SET {
|
||||
ctx.unique("hostname-char-set", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
@ -1395,6 +1403,7 @@ subnet6_param: preferred_lifetime
|
||||
| ddns_generated_prefix
|
||||
| ddns_qualifying_suffix
|
||||
| ddns_update_on_renew
|
||||
| ddns_use_conflict_resolution
|
||||
| store_extended_info
|
||||
| unknown_map_entry
|
||||
;
|
||||
@ -1541,6 +1550,7 @@ shared_network_param: name
|
||||
| ddns_generated_prefix
|
||||
| ddns_qualifying_suffix
|
||||
| ddns_update_on_renew
|
||||
| ddns_use_conflict_resolution
|
||||
| store_extended_info
|
||||
| unknown_map_entry
|
||||
;
|
||||
|
@ -776,6 +776,7 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
|
||||
(config_pair.first == "ddns-generated-prefix") ||
|
||||
(config_pair.first == "ddns-qualifying-suffix") ||
|
||||
(config_pair.first == "ddns-update-on-renew") ||
|
||||
(config_pair.first == "ddns-use-conflict-resolution") ||
|
||||
(config_pair.first == "store-extended-info") ||
|
||||
(config_pair.first == "statistic-default-sample-count") ||
|
||||
(config_pair.first == "statistic-default-sample-age") ||
|
||||
|
@ -1,9 +1,8 @@
|
||||
// Generated 202010091455
|
||||
// A Bison parser, made by GNU Bison 3.7.2.
|
||||
// A Bison parser, made by GNU Bison 3.0.4.
|
||||
|
||||
// Locations for Bison parsers in C++
|
||||
|
||||
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -39,164 +38,44 @@
|
||||
#ifndef YY_PARSER6_LOCATION_HH_INCLUDED
|
||||
# define YY_PARSER6_LOCATION_HH_INCLUDED
|
||||
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
# include "position.hh"
|
||||
|
||||
# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus
|
||||
# if 201103L <= __cplusplus
|
||||
# define YY_NULLPTR nullptr
|
||||
# else
|
||||
# define YY_NULLPTR 0
|
||||
# endif
|
||||
# else
|
||||
# define YY_NULLPTR ((void*)0)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#line 14 "dhcp6_parser.yy"
|
||||
#line 14 "dhcp6_parser.yy" // location.cc:296
|
||||
namespace isc { namespace dhcp {
|
||||
#line 59 "location.hh"
|
||||
|
||||
/// A point in a source file.
|
||||
class position
|
||||
{
|
||||
public:
|
||||
/// Type for file name.
|
||||
typedef const std::string filename_type;
|
||||
/// Type for line and column numbers.
|
||||
typedef int counter_type;
|
||||
|
||||
/// Construct a position.
|
||||
explicit position (filename_type* f = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
: filename (f)
|
||||
, line (l)
|
||||
, column (c)
|
||||
{}
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (filename_type* fn = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
{
|
||||
filename = fn;
|
||||
line = l;
|
||||
column = c;
|
||||
}
|
||||
|
||||
/** \name Line and Column related manipulators
|
||||
** \{ */
|
||||
/// (line related) Advance to the COUNT next lines.
|
||||
void lines (counter_type count = 1)
|
||||
{
|
||||
if (count)
|
||||
{
|
||||
column = 1;
|
||||
line = add_ (line, count, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// (column related) Advance to the COUNT next columns.
|
||||
void columns (counter_type count = 1)
|
||||
{
|
||||
column = add_ (column, count, 1);
|
||||
}
|
||||
/** \} */
|
||||
|
||||
/// File name to which this position refers.
|
||||
filename_type* filename;
|
||||
/// Current line number.
|
||||
counter_type line;
|
||||
/// Current column number.
|
||||
counter_type column;
|
||||
|
||||
private:
|
||||
/// Compute max (min, lhs+rhs).
|
||||
static counter_type add_ (counter_type lhs, counter_type rhs, counter_type min)
|
||||
{
|
||||
return lhs + rhs < min ? min : lhs + rhs;
|
||||
}
|
||||
};
|
||||
|
||||
/// Add \a width columns, in place.
|
||||
inline position&
|
||||
operator+= (position& res, position::counter_type width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns.
|
||||
inline position
|
||||
operator+ (position res, position::counter_type width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns, in place.
|
||||
inline position&
|
||||
operator-= (position& res, position::counter_type width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns.
|
||||
inline position
|
||||
operator- (position res, position::counter_type width)
|
||||
{
|
||||
return res -= width;
|
||||
}
|
||||
|
||||
/** \brief Intercept output stream redirection.
|
||||
** \param ostr the destination output stream
|
||||
** \param pos a reference to the position to redirect
|
||||
*/
|
||||
template <typename YYChar>
|
||||
std::basic_ostream<YYChar>&
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
|
||||
{
|
||||
if (pos.filename)
|
||||
ostr << *pos.filename << ':';
|
||||
return ostr << pos.line << '.' << pos.column;
|
||||
}
|
||||
|
||||
/// Two points in a source file.
|
||||
#line 46 "location.hh" // location.cc:296
|
||||
/// Abstract a location.
|
||||
class location
|
||||
{
|
||||
public:
|
||||
/// Type for file name.
|
||||
typedef position::filename_type filename_type;
|
||||
/// Type for line and column numbers.
|
||||
typedef position::counter_type counter_type;
|
||||
|
||||
/// Construct a location from \a b to \a e.
|
||||
location (const position& b, const position& e)
|
||||
: begin (b)
|
||||
, end (e)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a 0-width location in \a p.
|
||||
explicit location (const position& p = position ())
|
||||
: begin (p)
|
||||
, end (p)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a 0-width location in \a f, \a l, \a c.
|
||||
explicit location (filename_type* f,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
explicit location (std::string* f,
|
||||
unsigned int l = 1u,
|
||||
unsigned int c = 1u)
|
||||
: begin (f, l, c)
|
||||
, end (f, l, c)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (filename_type* f = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
void initialize (std::string* f = YY_NULLPTR,
|
||||
unsigned int l = 1u,
|
||||
unsigned int c = 1u)
|
||||
{
|
||||
begin.initialize (f, l, c);
|
||||
end = begin;
|
||||
@ -212,13 +91,13 @@ namespace isc { namespace dhcp {
|
||||
}
|
||||
|
||||
/// Extend the current location to the COUNT next columns.
|
||||
void columns (counter_type count = 1)
|
||||
void columns (int count = 1)
|
||||
{
|
||||
end += count;
|
||||
}
|
||||
|
||||
/// Extend the current location to the COUNT next lines.
|
||||
void lines (counter_type count = 1)
|
||||
void lines (int count = 1)
|
||||
{
|
||||
end.lines (count);
|
||||
}
|
||||
@ -233,49 +112,57 @@ namespace isc { namespace dhcp {
|
||||
};
|
||||
|
||||
/// Join two locations, in place.
|
||||
inline location&
|
||||
operator+= (location& res, const location& end)
|
||||
inline location& operator+= (location& res, const location& end)
|
||||
{
|
||||
res.end = end.end;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Join two locations.
|
||||
inline location
|
||||
operator+ (location res, const location& end)
|
||||
inline location operator+ (location res, const location& end)
|
||||
{
|
||||
return res += end;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position, in place.
|
||||
inline location&
|
||||
operator+= (location& res, location::counter_type width)
|
||||
inline location& operator+= (location& res, int width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position.
|
||||
inline location
|
||||
operator+ (location res, location::counter_type width)
|
||||
inline location operator+ (location res, int width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns to the end position, in place.
|
||||
inline location&
|
||||
operator-= (location& res, location::counter_type width)
|
||||
inline location& operator-= (location& res, int width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns to the end position.
|
||||
inline location
|
||||
operator- (location res, location::counter_type width)
|
||||
inline location operator- (location res, int width)
|
||||
{
|
||||
return res -= width;
|
||||
}
|
||||
|
||||
/// Compare two location objects.
|
||||
inline bool
|
||||
operator== (const location& loc1, const location& loc2)
|
||||
{
|
||||
return loc1.begin == loc2.begin && loc1.end == loc2.end;
|
||||
}
|
||||
|
||||
/// Compare two location objects.
|
||||
inline bool
|
||||
operator!= (const location& loc1, const location& loc2)
|
||||
{
|
||||
return !(loc1 == loc2);
|
||||
}
|
||||
|
||||
/** \brief Intercept output stream redirection.
|
||||
** \param ostr the destination output stream
|
||||
** \param loc a reference to the location to redirect
|
||||
@ -283,11 +170,10 @@ namespace isc { namespace dhcp {
|
||||
** Avoid duplicate information.
|
||||
*/
|
||||
template <typename YYChar>
|
||||
std::basic_ostream<YYChar>&
|
||||
inline std::basic_ostream<YYChar>&
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
|
||||
{
|
||||
location::counter_type end_col
|
||||
= 0 < loc.end.column ? loc.end.column - 1 : 0;
|
||||
unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
|
||||
ostr << loc.begin;
|
||||
if (loc.end.filename
|
||||
&& (!loc.begin.filename
|
||||
@ -300,8 +186,7 @@ namespace isc { namespace dhcp {
|
||||
return ostr;
|
||||
}
|
||||
|
||||
#line 14 "dhcp6_parser.yy"
|
||||
#line 14 "dhcp6_parser.yy" // location.cc:296
|
||||
} } // isc::dhcp
|
||||
#line 305 "location.hh"
|
||||
|
||||
#line 192 "location.hh" // location.cc:296
|
||||
#endif // !YY_PARSER6_LOCATION_HH_INCLUDED
|
||||
|
@ -1,12 +1,180 @@
|
||||
// Generated 202010091455
|
||||
// A Bison parser, made by GNU Bison 3.7.2.
|
||||
// A Bison parser, made by GNU Bison 3.0.4.
|
||||
|
||||
// Starting with Bison 3.2, this file is useless: the structure it
|
||||
// used to define is now defined in "location.hh".
|
||||
//
|
||||
// To get rid of this file:
|
||||
// 1. add '%require "3.2"' (or newer) to your grammar file
|
||||
// 2. remove references to this file from your build system
|
||||
// 3. if you used to include it, include "location.hh" instead.
|
||||
// Positions for Bison parsers in C++
|
||||
|
||||
#include "location.hh"
|
||||
// Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// As a special exception, you may create a larger work that contains
|
||||
// part or all of the Bison parser skeleton and distribute that work
|
||||
// under terms of your choice, so long as that work isn't itself a
|
||||
// parser generator using the skeleton or a modified version thereof
|
||||
// as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
// the parser skeleton itself, you may (at your option) remove this
|
||||
// special exception, which will cause the skeleton and the resulting
|
||||
// Bison output files to be licensed under the GNU General Public
|
||||
// License without this special exception.
|
||||
|
||||
// This special exception was added by the Free Software Foundation in
|
||||
// version 2.2 of Bison.
|
||||
|
||||
/**
|
||||
** \file position.hh
|
||||
** Define the isc::dhcp::position class.
|
||||
*/
|
||||
|
||||
#ifndef YY_PARSER6_POSITION_HH_INCLUDED
|
||||
# define YY_PARSER6_POSITION_HH_INCLUDED
|
||||
|
||||
# include <algorithm> // std::max
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
|
||||
# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
# define YY_NULLPTR nullptr
|
||||
# else
|
||||
# define YY_NULLPTR 0
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#line 14 "dhcp6_parser.yy" // location.cc:296
|
||||
namespace isc { namespace dhcp {
|
||||
#line 56 "position.hh" // location.cc:296
|
||||
/// Abstract a position.
|
||||
class position
|
||||
{
|
||||
public:
|
||||
/// Construct a position.
|
||||
explicit position (std::string* f = YY_NULLPTR,
|
||||
unsigned int l = 1u,
|
||||
unsigned int c = 1u)
|
||||
: filename (f)
|
||||
, line (l)
|
||||
, column (c)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (std::string* fn = YY_NULLPTR,
|
||||
unsigned int l = 1u,
|
||||
unsigned int c = 1u)
|
||||
{
|
||||
filename = fn;
|
||||
line = l;
|
||||
column = c;
|
||||
}
|
||||
|
||||
/** \name Line and Column related manipulators
|
||||
** \{ */
|
||||
/// (line related) Advance to the COUNT next lines.
|
||||
void lines (int count = 1)
|
||||
{
|
||||
if (count)
|
||||
{
|
||||
column = 1u;
|
||||
line = add_ (line, count, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// (column related) Advance to the COUNT next columns.
|
||||
void columns (int count = 1)
|
||||
{
|
||||
column = add_ (column, count, 1);
|
||||
}
|
||||
/** \} */
|
||||
|
||||
/// File name to which this position refers.
|
||||
std::string* filename;
|
||||
/// Current line number.
|
||||
unsigned int line;
|
||||
/// Current column number.
|
||||
unsigned int column;
|
||||
|
||||
private:
|
||||
/// Compute max(min, lhs+rhs) (provided min <= lhs).
|
||||
static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min)
|
||||
{
|
||||
return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs
|
||||
? rhs + lhs
|
||||
: min);
|
||||
}
|
||||
};
|
||||
|
||||
/// Add \a width columns, in place.
|
||||
inline position&
|
||||
operator+= (position& res, int width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns.
|
||||
inline position
|
||||
operator+ (position res, int width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns, in place.
|
||||
inline position&
|
||||
operator-= (position& res, int width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns.
|
||||
inline position
|
||||
operator- (position res, int width)
|
||||
{
|
||||
return res -= width;
|
||||
}
|
||||
|
||||
/// Compare two position objects.
|
||||
inline bool
|
||||
operator== (const position& pos1, const position& pos2)
|
||||
{
|
||||
return (pos1.line == pos2.line
|
||||
&& pos1.column == pos2.column
|
||||
&& (pos1.filename == pos2.filename
|
||||
|| (pos1.filename && pos2.filename
|
||||
&& *pos1.filename == *pos2.filename)));
|
||||
}
|
||||
|
||||
/// Compare two position objects.
|
||||
inline bool
|
||||
operator!= (const position& pos1, const position& pos2)
|
||||
{
|
||||
return !(pos1 == pos2);
|
||||
}
|
||||
|
||||
/** \brief Intercept output stream redirection.
|
||||
** \param ostr the destination output stream
|
||||
** \param pos a reference to the position to redirect
|
||||
*/
|
||||
template <typename YYChar>
|
||||
inline std::basic_ostream<YYChar>&
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
|
||||
{
|
||||
if (pos.filename)
|
||||
ostr << *pos.filename << ':';
|
||||
return ostr << pos.line << '.' << pos.column;
|
||||
}
|
||||
|
||||
#line 14 "dhcp6_parser.yy" // location.cc:296
|
||||
} } // isc::dhcp
|
||||
#line 180 "position.hh" // location.cc:296
|
||||
#endif // !YY_PARSER6_POSITION_HH_INCLUDED
|
||||
|
@ -1,9 +1,157 @@
|
||||
// Generated 202010091455
|
||||
// A Bison parser, made by GNU Bison 3.7.2.
|
||||
// A Bison parser, made by GNU Bison 3.0.4.
|
||||
|
||||
// Starting with Bison 3.2, this file is useless: the structure it
|
||||
// used to define is now defined with the parser itself.
|
||||
//
|
||||
// To get rid of this file:
|
||||
// 1. add '%require "3.2"' (or newer) to your grammar file
|
||||
// 2. remove references to this file from your build system.
|
||||
// Stack handling for Bison parsers in C++
|
||||
|
||||
// Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// As a special exception, you may create a larger work that contains
|
||||
// part or all of the Bison parser skeleton and distribute that work
|
||||
// under terms of your choice, so long as that work isn't itself a
|
||||
// parser generator using the skeleton or a modified version thereof
|
||||
// as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
// the parser skeleton itself, you may (at your option) remove this
|
||||
// special exception, which will cause the skeleton and the resulting
|
||||
// Bison output files to be licensed under the GNU General Public
|
||||
// License without this special exception.
|
||||
|
||||
// This special exception was added by the Free Software Foundation in
|
||||
// version 2.2 of Bison.
|
||||
|
||||
/**
|
||||
** \file stack.hh
|
||||
** Define the isc::dhcp::stack class.
|
||||
*/
|
||||
|
||||
#ifndef YY_PARSER6_STACK_HH_INCLUDED
|
||||
# define YY_PARSER6_STACK_HH_INCLUDED
|
||||
|
||||
# include <vector>
|
||||
|
||||
#line 14 "dhcp6_parser.yy" // stack.hh:132
|
||||
namespace isc { namespace dhcp {
|
||||
#line 46 "stack.hh" // stack.hh:132
|
||||
template <class T, class S = std::vector<T> >
|
||||
class stack
|
||||
{
|
||||
public:
|
||||
// Hide our reversed order.
|
||||
typedef typename S::reverse_iterator iterator;
|
||||
typedef typename S::const_reverse_iterator const_iterator;
|
||||
|
||||
stack ()
|
||||
: seq_ ()
|
||||
{
|
||||
seq_.reserve (200);
|
||||
}
|
||||
|
||||
stack (unsigned int n)
|
||||
: seq_ (n)
|
||||
{}
|
||||
|
||||
inline
|
||||
T&
|
||||
operator[] (unsigned int i)
|
||||
{
|
||||
return seq_[seq_.size () - 1 - i];
|
||||
}
|
||||
|
||||
inline
|
||||
const T&
|
||||
operator[] (unsigned int i) const
|
||||
{
|
||||
return seq_[seq_.size () - 1 - i];
|
||||
}
|
||||
|
||||
/// Steal the contents of \a t.
|
||||
///
|
||||
/// Close to move-semantics.
|
||||
inline
|
||||
void
|
||||
push (T& t)
|
||||
{
|
||||
seq_.push_back (T());
|
||||
operator[](0).move (t);
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
pop (unsigned int n = 1)
|
||||
{
|
||||
for (; n; --n)
|
||||
seq_.pop_back ();
|
||||
}
|
||||
|
||||
void
|
||||
clear ()
|
||||
{
|
||||
seq_.clear ();
|
||||
}
|
||||
|
||||
inline
|
||||
typename S::size_type
|
||||
size () const
|
||||
{
|
||||
return seq_.size ();
|
||||
}
|
||||
|
||||
inline
|
||||
const_iterator
|
||||
begin () const
|
||||
{
|
||||
return seq_.rbegin ();
|
||||
}
|
||||
|
||||
inline
|
||||
const_iterator
|
||||
end () const
|
||||
{
|
||||
return seq_.rend ();
|
||||
}
|
||||
|
||||
private:
|
||||
stack (const stack&);
|
||||
stack& operator= (const stack&);
|
||||
/// The wrapped container.
|
||||
S seq_;
|
||||
};
|
||||
|
||||
/// Present a slice of the top of a stack.
|
||||
template <class T, class S = stack<T> >
|
||||
class slice
|
||||
{
|
||||
public:
|
||||
slice (const S& stack, unsigned int range)
|
||||
: stack_ (stack)
|
||||
, range_ (range)
|
||||
{}
|
||||
|
||||
inline
|
||||
const T&
|
||||
operator [] (unsigned int i) const
|
||||
{
|
||||
return stack_[range_ - i];
|
||||
}
|
||||
|
||||
private:
|
||||
const S& stack_;
|
||||
unsigned int range_;
|
||||
};
|
||||
|
||||
#line 14 "dhcp6_parser.yy" // stack.hh:132
|
||||
} } // isc::dhcp
|
||||
#line 156 "stack.hh" // stack.hh:132
|
||||
|
||||
#endif // !YY_PARSER6_STACK_HH_INCLUDED
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <dhcp6/json_config_parser.h>
|
||||
#include <dhcp6/tests/dhcp6_test_utils.h>
|
||||
#include <dhcp6/tests/get_config_unittest.h>
|
||||
#include <testutils/gtest_utils.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
@ -1997,6 +1998,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2078,6 +2080,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2193,6 +2196,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2375,6 +2379,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2557,6 +2562,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2739,6 +2745,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2854,6 +2861,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -2962,6 +2970,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3070,6 +3079,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3210,6 +3220,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3317,6 +3328,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3426,6 +3438,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3537,6 +3550,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3663,6 +3677,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3772,6 +3787,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3861,6 +3877,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -3950,6 +3967,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4048,6 +4066,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4137,6 +4156,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4226,6 +4246,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4350,6 +4371,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4474,6 +4496,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4608,6 +4631,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4725,6 +4749,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -4885,6 +4910,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5035,6 +5061,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5195,6 +5222,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5317,6 +5345,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5443,6 +5472,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5524,6 +5554,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5605,6 +5636,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5712,6 +5744,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -5819,6 +5852,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6004,6 +6038,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6126,6 +6161,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6256,6 +6292,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": true,\n"
|
||||
@ -6363,6 +6400,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"when-present\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": true,\n"
|
||||
@ -6470,6 +6508,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"always\",\n"
|
||||
" \"ddns-send-updates\": false,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": true,\n"
|
||||
@ -6577,6 +6616,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6809,6 +6849,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -6939,6 +6980,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7020,6 +7062,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7101,6 +7144,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7312,6 +7356,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7445,6 +7490,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7526,6 +7572,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7605,6 +7652,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7684,6 +7732,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 12345,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7763,6 +7812,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7856,6 +7906,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -7963,6 +8014,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8070,6 +8122,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8178,6 +8231,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8291,6 +8345,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8404,6 +8459,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8513,6 +8569,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8623,6 +8680,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8738,6 +8796,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -8862,6 +8921,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9060,6 +9120,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9259,6 +9320,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9340,6 +9402,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9419,6 +9482,7 @@ const char* UNPARSED_CONFIGS[] = {
|
||||
" \"ddns-replace-client-name\": \"never\",\n"
|
||||
" \"ddns-send-updates\": true,\n"
|
||||
" \"ddns-update-on-renew\": false,\n"
|
||||
" \"ddns-use-conflict-resolution\": true,\n"
|
||||
" \"decline-probation-period\": 86400,\n"
|
||||
" \"dhcp-ddns\": {\n"
|
||||
" \"enable-updates\": false,\n"
|
||||
@ -9719,9 +9783,9 @@ TEST_P(Dhcp6GetConfigTest, run) {
|
||||
// unparse it
|
||||
ConstSrvConfigPtr extracted = CfgMgr::instance().getStagingCfg();
|
||||
ConstElementPtr unparsed;
|
||||
ASSERT_NO_THROW(unparsed = extracted->toElement());
|
||||
ASSERT_NO_THROW_LOG(unparsed = extracted->toElement());
|
||||
ConstElementPtr dhcp;
|
||||
ASSERT_NO_THROW(dhcp = unparsed->get("Dhcp6"));
|
||||
ASSERT_NO_THROW_LOG(dhcp = unparsed->get("Dhcp6"));
|
||||
ASSERT_TRUE(dhcp);
|
||||
|
||||
// dump if wanted else check
|
||||
@ -9731,16 +9795,16 @@ TEST_P(Dhcp6GetConfigTest, run) {
|
||||
std::cerr << ",\n";
|
||||
}
|
||||
std::cerr << " // CONFIGURATION " << config_counter;
|
||||
ASSERT_NO_THROW(expected = prettyPrint(dhcp));
|
||||
ASSERT_NO_THROW(outputFormatted(dhcp->str()));
|
||||
ASSERT_NO_THROW_LOG(expected = prettyPrint(dhcp));
|
||||
ASSERT_NO_THROW_LOG(outputFormatted(dhcp->str()));
|
||||
} else {
|
||||
expected = UNPARSED_CONFIGS[config_counter];
|
||||
// get the expected config using the dhcpv6 syntax parser
|
||||
ElementPtr jsond;
|
||||
ASSERT_NO_THROW(jsond = parseDHCP6(expected, true));
|
||||
ASSERT_NO_THROW_LOG(jsond = parseDHCP6(expected, true));
|
||||
// get the expected config using the generic JSON syntax parser
|
||||
ElementPtr jsonj;
|
||||
ASSERT_NO_THROW(jsonj = parseJSON(expected));
|
||||
ASSERT_NO_THROW_LOG(jsonj = parseJSON(expected));
|
||||
// the generic JSON parser does not handle comments
|
||||
EXPECT_TRUE(isEquivalent(jsond, moveComments(jsonj)));
|
||||
// check that unparsed and expected values match
|
||||
@ -9761,7 +9825,7 @@ TEST_P(Dhcp6GetConfigTest, run) {
|
||||
// is it a fixed point?
|
||||
ConstSrvConfigPtr extracted2 = CfgMgr::instance().getStagingCfg();
|
||||
ConstElementPtr unparsed2;
|
||||
ASSERT_NO_THROW(unparsed2 = extracted2->toElement());
|
||||
ASSERT_NO_THROW_LOG(unparsed2 = extracted2->toElement());
|
||||
ASSERT_TRUE(unparsed2);
|
||||
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <dhcp6/json_config_parser.h>
|
||||
#include <dhcp6/tests/dhcp6_test_utils.h>
|
||||
#include <dhcp6/tests/get_config_unittest.h>
|
||||
#include <testutils/gtest_utils.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
@ -306,9 +307,9 @@ TEST_P(Dhcp6GetConfigTest, run) {
|
||||
// unparse it
|
||||
ConstSrvConfigPtr extracted = CfgMgr::instance().getStagingCfg();
|
||||
ConstElementPtr unparsed;
|
||||
ASSERT_NO_THROW(unparsed = extracted->toElement());
|
||||
ASSERT_NO_THROW_LOG(unparsed = extracted->toElement());
|
||||
ConstElementPtr dhcp;
|
||||
ASSERT_NO_THROW(dhcp = unparsed->get("Dhcp6"));
|
||||
ASSERT_NO_THROW_LOG(dhcp = unparsed->get("Dhcp6"));
|
||||
ASSERT_TRUE(dhcp);
|
||||
|
||||
// dump if wanted else check
|
||||
@ -318,16 +319,16 @@ TEST_P(Dhcp6GetConfigTest, run) {
|
||||
std::cerr << ",\n";
|
||||
}
|
||||
std::cerr << " // CONFIGURATION " << config_counter;
|
||||
ASSERT_NO_THROW(expected = prettyPrint(dhcp));
|
||||
ASSERT_NO_THROW(outputFormatted(dhcp->str()));
|
||||
ASSERT_NO_THROW_LOG(expected = prettyPrint(dhcp));
|
||||
ASSERT_NO_THROW_LOG(outputFormatted(dhcp->str()));
|
||||
} else {
|
||||
expected = UNPARSED_CONFIGS[config_counter];
|
||||
// get the expected config using the dhcpv6 syntax parser
|
||||
ElementPtr jsond;
|
||||
ASSERT_NO_THROW(jsond = parseDHCP6(expected, true));
|
||||
ASSERT_NO_THROW_LOG(jsond = parseDHCP6(expected, true));
|
||||
// get the expected config using the generic JSON syntax parser
|
||||
ElementPtr jsonj;
|
||||
ASSERT_NO_THROW(jsonj = parseJSON(expected));
|
||||
ASSERT_NO_THROW_LOG(jsonj = parseJSON(expected));
|
||||
// the generic JSON parser does not handle comments
|
||||
EXPECT_TRUE(isEquivalent(jsond, moveComments(jsonj)));
|
||||
// check that unparsed and expected values match
|
||||
@ -348,7 +349,7 @@ TEST_P(Dhcp6GetConfigTest, run) {
|
||||
// is it a fixed point?
|
||||
ConstSrvConfigPtr extracted2 = CfgMgr::instance().getStagingCfg();
|
||||
ConstElementPtr unparsed2;
|
||||
ASSERT_NO_THROW(unparsed2 = extracted2->toElement());
|
||||
ASSERT_NO_THROW_LOG(unparsed2 = extracted2->toElement());
|
||||
ASSERT_TRUE(unparsed2);
|
||||
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ BaseNetworkParser::parseDdnsParams(const data::ConstElementPtr& network_data,
|
||||
}
|
||||
|
||||
if (network_data->contains("ddns-use-conflict-resolution")) {
|
||||
network->setDdnsUpdateOnRenew(getBoolean(network_data, "ddns-use-conflict-resolution"));
|
||||
network->setDdnsUseConflictResolution(getBoolean(network_data, "ddns-use-conflict-resolution"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,8 +287,7 @@ const ParamsList SimpleParser4::INHERIT_TO_SUBNET4 = {
|
||||
"t2-percent",
|
||||
"store-extended-info",
|
||||
"cache-threshold",
|
||||
"cache-max-age",
|
||||
"ddns-use-conflict-resolution"
|
||||
"cache-max-age"
|
||||
};
|
||||
|
||||
/// @brief This table defines all pool parameters.
|
||||
|
Loading…
x
Reference in New Issue
Block a user