mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 13:07:50 +00:00
[#1621] updated parsers
This commit is contained in:
parent
bb87d03147
commit
a730cfea4e
@ -42,6 +42,7 @@
|
||||
// "password": "secret1",
|
||||
// "reconnect-wait-time": 3000, // expressed in ms
|
||||
// "max-reconnect-tries": 3,
|
||||
// "disable-dhcp-on-db-loss": true,
|
||||
// "connect-timeout": 3
|
||||
// },
|
||||
|
||||
@ -61,6 +62,7 @@
|
||||
// "password": "secret1",
|
||||
// "reconnect-wait-time": 3000, // expressed in ms
|
||||
// "max-reconnect-tries": 3,
|
||||
// "disable-dhcp-on-db-loss": true,
|
||||
// "connect-timeout": 3
|
||||
// },
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
// "password": "secret1",
|
||||
// "reconnect-wait-time": 3000, // expressed in ms
|
||||
// "max-reconnect-tries": 3,
|
||||
// "disable-dhcp-on-db-loss": true,
|
||||
// "connect-timeout": 3
|
||||
// },
|
||||
|
||||
@ -61,6 +62,7 @@
|
||||
// "password": "secret1",
|
||||
// "reconnect-wait-time": 3000, // expressed in ms
|
||||
// "max-reconnect-tries": 3,
|
||||
// "disable-dhcp-on-db-loss": true,
|
||||
// "connect-timeout": 3
|
||||
// },
|
||||
|
||||
|
@ -6,7 +6,8 @@ Database Connectivity
|
||||
Kea servers (kea-dhcp4 and kea-dhcp6) can be configured to use a variety of
|
||||
database backends for leases, hosts, and configuration. All of them may be
|
||||
configured to support automatic recovery when connectivity is lost (see
|
||||
``max-reconnect-tries`` and ``reconnect-wait-time``).
|
||||
``max-reconnect-tries``, ``reconnect-wait-time`` and
|
||||
``disable-dhcp-on-db-loss``).
|
||||
|
||||
It is important to understand how and when automatic recovery comes into play.
|
||||
Automatic recovery, when configured, only operates after a successful startup
|
||||
@ -28,7 +29,8 @@ allows the configuration to be corrected via command, if required.
|
||||
During normal operations, if connectivity to any of the backends is lost and
|
||||
automatic recovery for that backend is enabled, the server disconnects from the
|
||||
respective backend and then attempts to reconnect. During the recovery process,
|
||||
the server ceases to serve clients but continues to respond to commands. If
|
||||
connectivity to all backends is restored, the server returns to normal
|
||||
operations. If connectivity cannot be restored after ``max-reconnect-tries``,
|
||||
the server issues a fatal error and exits.
|
||||
the server ceases to serve clients according to the ``disable-dhcp-on-db-loss``
|
||||
configured option, but continues to respond to commands. If connectivity to all
|
||||
backends is restored, the server returns to normal operations. If connectivity
|
||||
cannot be restored after ``max-reconnect-tries``, the server issues a fatal
|
||||
error and exits.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// A Bison parser, made by GNU Bison 3.7.5.
|
||||
// A Bison parser, made by GNU Bison 3.5.1.
|
||||
|
||||
// Locations for Bison parsers in C++
|
||||
|
||||
@ -61,13 +61,11 @@ namespace isc { namespace dhcp {
|
||||
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,
|
||||
explicit position (std::string* f = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
: filename (f)
|
||||
@ -77,7 +75,7 @@ namespace isc { namespace dhcp {
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (filename_type* fn = YY_NULLPTR,
|
||||
void initialize (std::string* fn = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
{
|
||||
@ -106,7 +104,7 @@ namespace isc { namespace dhcp {
|
||||
/** \} */
|
||||
|
||||
/// File name to which this position refers.
|
||||
filename_type* filename;
|
||||
std::string* filename;
|
||||
/// Current line number.
|
||||
counter_type line;
|
||||
/// Current column number.
|
||||
@ -149,6 +147,24 @@ namespace isc { namespace dhcp {
|
||||
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
|
||||
@ -166,8 +182,6 @@ namespace isc { namespace dhcp {
|
||||
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;
|
||||
|
||||
@ -184,7 +198,7 @@ namespace isc { namespace dhcp {
|
||||
{}
|
||||
|
||||
/// Construct a 0-width location in \a f, \a l, \a c.
|
||||
explicit location (filename_type* f,
|
||||
explicit location (std::string* f,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
: begin (f, l, c)
|
||||
@ -193,7 +207,7 @@ namespace isc { namespace dhcp {
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (filename_type* f = YY_NULLPTR,
|
||||
void initialize (std::string* f = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
{
|
||||
@ -275,6 +289,20 @@ namespace isc { namespace dhcp {
|
||||
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
|
||||
@ -301,6 +329,6 @@ namespace isc { namespace dhcp {
|
||||
|
||||
#line 14 "dhcp4_parser.yy"
|
||||
} } // isc::dhcp
|
||||
#line 305 "location.hh"
|
||||
#line 333 "location.hh"
|
||||
|
||||
#endif // !YY_PARSER4_LOCATION_HH_INCLUDED
|
||||
|
@ -1,4 +1,4 @@
|
||||
// A Bison parser, made by GNU Bison 3.7.5.
|
||||
// A Bison parser, made by GNU Bison 3.5.1.
|
||||
|
||||
// Starting with Bison 3.2, this file is useless: the structure it
|
||||
// used to define is now defined in "location.hh".
|
||||
|
@ -1,4 +1,4 @@
|
||||
// A Bison parser, made by GNU Bison 3.7.5.
|
||||
// A Bison parser, made by GNU Bison 3.5.1.
|
||||
|
||||
// Starting with Bison 3.2, this file is useless: the structure it
|
||||
// used to define is now defined with the parser itself.
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,8 +1,8 @@
|
||||
// A Bison parser, made by GNU Bison 3.7.5.
|
||||
// A Bison parser, made by GNU Bison 3.5.1.
|
||||
|
||||
// Locations for Bison parsers in C++
|
||||
|
||||
// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002-2015, 2018-2020 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
|
||||
@ -61,13 +61,11 @@ namespace isc { namespace dhcp {
|
||||
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,
|
||||
explicit position (std::string* f = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
: filename (f)
|
||||
@ -77,7 +75,7 @@ namespace isc { namespace dhcp {
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (filename_type* fn = YY_NULLPTR,
|
||||
void initialize (std::string* fn = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
{
|
||||
@ -106,7 +104,7 @@ namespace isc { namespace dhcp {
|
||||
/** \} */
|
||||
|
||||
/// File name to which this position refers.
|
||||
filename_type* filename;
|
||||
std::string* filename;
|
||||
/// Current line number.
|
||||
counter_type line;
|
||||
/// Current column number.
|
||||
@ -149,6 +147,24 @@ namespace isc { namespace dhcp {
|
||||
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
|
||||
@ -166,8 +182,6 @@ namespace isc { namespace dhcp {
|
||||
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;
|
||||
|
||||
@ -184,7 +198,7 @@ namespace isc { namespace dhcp {
|
||||
{}
|
||||
|
||||
/// Construct a 0-width location in \a f, \a l, \a c.
|
||||
explicit location (filename_type* f,
|
||||
explicit location (std::string* f,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
: begin (f, l, c)
|
||||
@ -193,7 +207,7 @@ namespace isc { namespace dhcp {
|
||||
|
||||
|
||||
/// Initialization.
|
||||
void initialize (filename_type* f = YY_NULLPTR,
|
||||
void initialize (std::string* f = YY_NULLPTR,
|
||||
counter_type l = 1,
|
||||
counter_type c = 1)
|
||||
{
|
||||
@ -275,6 +289,20 @@ namespace isc { namespace dhcp {
|
||||
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
|
||||
@ -301,6 +329,6 @@ namespace isc { namespace dhcp {
|
||||
|
||||
#line 14 "dhcp6_parser.yy"
|
||||
} } // isc::dhcp
|
||||
#line 305 "location.hh"
|
||||
#line 333 "location.hh"
|
||||
|
||||
#endif // !YY_PARSER6_LOCATION_HH_INCLUDED
|
||||
|
@ -1,4 +1,4 @@
|
||||
// A Bison parser, made by GNU Bison 3.7.5.
|
||||
// A Bison parser, made by GNU Bison 3.5.1.
|
||||
|
||||
// Starting with Bison 3.2, this file is useless: the structure it
|
||||
// used to define is now defined in "location.hh".
|
||||
|
@ -1,4 +1,4 @@
|
||||
// A Bison parser, made by GNU Bison 3.7.5.
|
||||
// A Bison parser, made by GNU Bison 3.5.1.
|
||||
|
||||
// Starting with Bison 3.2, this file is useless: the structure it
|
||||
// used to define is now defined with the parser itself.
|
||||
|
@ -527,6 +527,7 @@ TEST(DatabaseConnection, toElementDbAccessStringValid) {
|
||||
"\"connect-timeout\" : 200, \n"
|
||||
"\"contact-points\": \"contact_str\", \n"
|
||||
"\"consistency\": \"quorum\", \n"
|
||||
"\"disable-dhcp-on-db-loss\": true, \n"
|
||||
"\"serial-consistency\": \"serial\", \n"
|
||||
"\"host\": \"host_str\", \n"
|
||||
"\"keyspace\": \"keyspace_str\", \n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user