mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 22:15:23 +00:00
[#2116] remove cql code
This commit is contained in:
@@ -50,7 +50,7 @@ IncludeCategories:
|
||||
- Regex: '^<config.h>$'
|
||||
Priority: 0
|
||||
# Kea's own files
|
||||
- Regex: '^<(asiodns|asiolink|cc|cfgrpt|config|config_backend|cql|cryptolink|database|dhcp|dhcpsrv|dhcp_ddns|dns|eval|exceptions|hooks|http|log|mysql|pgsql|process|stats|testutils|util|yang|admin|agent|d2|dhcp4|dhcp6|keactrl|lfc|netconf|perfdhcp|shell)/'
|
||||
- Regex: '^<(asiodns|asiolink|cc|cfgrpt|config|config_backend|cryptolink|database|dhcp|dhcpsrv|dhcp_ddns|dns|eval|exceptions|hooks|http|log|mysql|pgsql|process|stats|testutils|util|yang|admin|agent|d2|dhcp4|dhcp6|keactrl|lfc|netconf|perfdhcp|shell)/'
|
||||
Priority: 1
|
||||
# C++ standard library headers
|
||||
- Regex: '^<[[:alnum:]]>$'
|
||||
|
@@ -31,7 +31,6 @@ shellcheck:
|
||||
- SCRIPTS+="src/bin/admin/admin-utils.sh "
|
||||
- SCRIPTS+="src/bin/admin/kea-admin.in "
|
||||
- SCRIPTS+="src/bin/admin/tests/admin_tests.sh.in "
|
||||
- SCRIPTS+="src/bin/admin/tests/cql_tests.sh.in "
|
||||
- SCRIPTS+="src/bin/admin/tests/memfile_tests.sh.in "
|
||||
- SCRIPTS+="src/bin/admin/tests/mysql_tests.sh.in "
|
||||
- SCRIPTS+="src/bin/admin/tests/pgsql_tests.sh.in "
|
||||
@@ -56,11 +55,6 @@ shellcheck:
|
||||
- SCRIPTS+="src/lib/testutils/dhcp_test_lib.sh.in "
|
||||
- SCRIPTS+="src/lib/testutils/xml_reporting_test_lib.sh.in "
|
||||
- SCRIPTS+="src/hooks/dhcp/run_script/tests/run_script_test.sh.in "
|
||||
- SCRIPTS+="src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh.in "
|
||||
- SCRIPTS+="src/share/database/scripts/cql/upgrade_2.0_to_3.0.sh.in "
|
||||
- SCRIPTS+="src/share/database/scripts/cql/upgrade_3.0_to_4.0.sh.in "
|
||||
- SCRIPTS+="src/share/database/scripts/cql/upgrade_4.0_to_5.0.sh.in "
|
||||
- SCRIPTS+="src/share/database/scripts/cql/wipe_data.sh.in "
|
||||
- SCRIPTS+="src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in "
|
||||
- SCRIPTS+="src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in "
|
||||
- SCRIPTS+="src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in "
|
||||
@@ -104,7 +98,6 @@ shellcheck:
|
||||
- SCRIPTS+="tools/add-config-h.sh "
|
||||
- SCRIPTS+="tools/bump-lib-versions.sh "
|
||||
- SCRIPTS+="tools/check-for-duplicate-includes.sh "
|
||||
- SCRIPTS+="tools/cql_config "
|
||||
- SCRIPTS+="tools/mk_cfgrpt.sh "
|
||||
- SCRIPTS+="tools/path_replacer.sh.in "
|
||||
- SCRIPTS+="tools/print-generated-files.sh "
|
||||
|
@@ -175,9 +175,9 @@ such long periods, code tends to be refactored several times. The change you mad
|
||||
some other change or by the code that hasn't been written yet.
|
||||
|
||||
See Building Kea with Unit Tests for instructions on how to run unit-tests. If you happen to touch
|
||||
any database related code, make sure you compile your code with –with-mysql, –with-pgsql and/or
|
||||
–with-cql as needed. For example, if you change something substantial, make sure the other
|
||||
compilation options still work.
|
||||
any database related code, make sure you compile your code with –with-mysql and/or –with-pgsql as
|
||||
needed. For example, if you change something substantial, make sure the other compilation options
|
||||
still work.
|
||||
|
||||
If you happen to add new files or have modified any Makefile.am files, it is also a good idea to
|
||||
check if you haven't broken the distribution process:
|
||||
@@ -192,8 +192,8 @@ enable various additional consistency checks that reduce performance but help du
|
||||
you happen to modify anything in the documentation, use `–-enable-generate-docs`. If you are
|
||||
modifying DHCP code, you are likely to be interested in enabling a non-default database backends for
|
||||
DHCP. Note that if the backend is not enabled, the database-specific unit-tests are skipped. To
|
||||
enable the MySQL backend, use the switch `–with-mysql`; for PostgreSQL, use `–with-pgsql` and for
|
||||
Cassandra use `--with-cql`. A complete list of all switches can be obtained with the command:
|
||||
enable the MySQL backend, use the switch `–with-mysql`; for PostgreSQL, use `–with-pgsql`.
|
||||
A complete list of all switches can be obtained with the command:
|
||||
|
||||
```bash
|
||||
./configure --help
|
||||
|
96
configure.ac
96
configure.ac
@@ -824,76 +824,16 @@ if test "${pgsql_ssl}" = "yes"; then
|
||||
AC_DEFINE([HAVE_PGSQL_SSL], [1], [PostgreSQL was built with OpenSSL support])
|
||||
fi
|
||||
|
||||
# allow building kea programs with static link to cassandra cpp-driver.
|
||||
AC_ARG_ENABLE([cql-static-lib],
|
||||
[AS_HELP_STRING([--enable-cql-static-lib],
|
||||
[build programs with cassandra cpp driver static library [[default=no]]])],
|
||||
[enable_cql_static_lib=yes], [enable_cql_static_lib=no])
|
||||
AM_CONDITIONAL(USE_CQL_STATIC_LIB, test "$enable_cql_static_lib" = yes)
|
||||
#AC_DEFINE USE_CQL_STATIC_LIB? (unused)
|
||||
|
||||
cql_lib="cassandra"
|
||||
if test "${enable_cql_static_lib}" = "yes" ; then
|
||||
cql_lib="${cql_lib}_static"
|
||||
fi
|
||||
|
||||
cql_config="no"
|
||||
AC_ARG_WITH([cql],
|
||||
[AS_HELP_STRING([--with-cql[[=PATH]]],
|
||||
[path to pkg-config or the Cassandra CQL 'cql_config' script (deprecated)])],
|
||||
[cql_config="$withval"])
|
||||
|
||||
if test "${cql_config}" = "yes" ; then
|
||||
CQL_CONFIG="$PKG_CONFIG"
|
||||
elif test "${cql_config}" != "no" ; then
|
||||
CQL_CONFIG="${cql_config}"
|
||||
if test "${cql_config}" != "no" ; then
|
||||
AC_MSG_ERROR([$CQL_CONFIG CAssandra is no longer supported])
|
||||
fi
|
||||
|
||||
if test "$CQL_CONFIG" != "" ; then
|
||||
if test -d "$CQL_CONFIG" -o ! -x "$CQL_CONFIG" ; then
|
||||
AC_MSG_ERROR([--with-cql should point to a pkg-config or cql_config program])
|
||||
fi
|
||||
|
||||
$CQL_CONFIG --print-errors $cql_lib
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_ERROR([$CQL_CONFIG $cql_lib failed])
|
||||
fi
|
||||
|
||||
CQL_INCLUDEDIR=`$CQL_CONFIG --cflags-only-I $cql_lib`
|
||||
CQL_CPPFLAGS=`$CQL_CONFIG --cflags-only-other $cql_lib`
|
||||
CQL_LIBS=`$CQL_CONFIG --libs $cql_lib`
|
||||
CQL_LIBS="$CQL_LIBS $CRYPTO_LIBS"
|
||||
CQL_VERSION=`$CQL_CONFIG --modversion $cql_lib`
|
||||
|
||||
CQL_CPPFLAGS="${CQL_CPPFLAGS} ${CQL_INCLUDEDIR}"
|
||||
AC_SUBST(CQL_CPPFLAGS)
|
||||
AC_SUBST(CQL_LIBS)
|
||||
|
||||
# Check that a simple program using CQL functions can compile and link.
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
LIBS_SAVED="$LIBS"
|
||||
|
||||
CPPFLAGS="$CQL_CPPFLAGS $CPPFLAGS"
|
||||
LIBS="$CQL_LIBS $LIBS"
|
||||
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([#include <cassandra.h>],
|
||||
[CassCluster* cluster = cass_cluster_new();
|
||||
cass_cluster_free(cluster);])],
|
||||
[AC_MSG_RESULT([checking for Cassandra CQL headers and library... yes])],
|
||||
[AC_MSG_RESULT([checking for Cassandra CQL headers and library... no])
|
||||
AC_MSG_ERROR([Needs Cassandra CQL library])]
|
||||
)
|
||||
CPPFLAGS=$CPPFLAGS_SAVED
|
||||
LIBS=$LIBS_SAVED
|
||||
|
||||
# Note that CQL is present in the config.h file
|
||||
AC_DEFINE([HAVE_CQL], [1], [CQL is present])
|
||||
fi
|
||||
|
||||
# ... and at the shell level, so Makefile.am can take action depending on this.
|
||||
AM_CONDITIONAL(HAVE_CQL, test "$CQL_CONFIG" != "")
|
||||
|
||||
# Check for sysrepo.
|
||||
AX_SYSREPO
|
||||
|
||||
@@ -1554,8 +1494,6 @@ AC_CONFIG_FILES([src/bin/admin/Makefile])
|
||||
AC_CONFIG_FILES([src/bin/admin/kea-admin],
|
||||
[chmod +x src/bin/admin/kea-admin])
|
||||
AC_CONFIG_FILES([src/bin/admin/tests/Makefile])
|
||||
AC_CONFIG_FILES([src/bin/admin/tests/cql_tests.sh],
|
||||
[chmod +x src/bin/admin/tests/cql_tests.sh])
|
||||
AC_CONFIG_FILES([src/bin/admin/tests/data/Makefile])
|
||||
AC_CONFIG_FILES([src/bin/admin/tests/admin_tests.sh],
|
||||
[chmod +x src/bin/admin/tests/admin_tests.sh])
|
||||
@@ -1726,9 +1664,6 @@ AC_CONFIG_FILES([src/lib/mysql/tests/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/pgsql/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/pgsql/tests/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/pgsql/testutils/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/cql/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/cql/tests/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/cql/testutils/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/process/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/process/tests/Makefile])
|
||||
AC_CONFIG_FILES([src/lib/process/testutils/Makefile])
|
||||
@@ -1755,17 +1690,6 @@ AC_CONFIG_FILES([src/share/Makefile])
|
||||
AC_CONFIG_FILES([src/share/api/Makefile])
|
||||
AC_CONFIG_FILES([src/share/database/Makefile])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/Makefile])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/cql/Makefile])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh],
|
||||
[chmod +x src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/cql/upgrade_2.0_to_3.0.sh],
|
||||
[chmod +x src/share/database/scripts/cql/upgrade_2.0_to_3.0.sh])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/cql/upgrade_3.0_to_4.0.sh],
|
||||
[chmod +x src/share/database/scripts/cql/upgrade_3.0_to_4.0.sh])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/cql/upgrade_4.0_to_5.0.sh],
|
||||
[chmod +x src/share/database/scripts/cql/upgrade_4.0_to_5.0.sh])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/cql/wipe_data.sh],
|
||||
[chmod +x src/share/database/scripts/cql/wipe_data.sh])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/mysql/Makefile])
|
||||
AC_CONFIG_FILES([src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh],
|
||||
[chmod +x src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh])
|
||||
@@ -2022,22 +1946,6 @@ PostgreSQL:
|
||||
END
|
||||
fi
|
||||
|
||||
if test "$CQL_CPPFLAGS" != "" ; then
|
||||
cat >> config.report << END
|
||||
|
||||
Cassandra CQL (deprecated):
|
||||
CQL_VERSION: ${CQL_VERSION}
|
||||
CQL_CPPFLAGS: ${CQL_CPPFLAGS}
|
||||
CQL_LIBS: ${CQL_LIBS}
|
||||
END
|
||||
else
|
||||
cat >> config.report << END
|
||||
|
||||
Cassandra CQL:
|
||||
no
|
||||
END
|
||||
fi
|
||||
|
||||
if "${HAVE_SYSREPO}"; then
|
||||
cat >> config.report << END
|
||||
|
||||
|
@@ -19,7 +19,6 @@ nobase_dist_doc_DATA += examples/kea4/all-keys.json
|
||||
nobase_dist_doc_DATA += examples/kea4/all-keys-netconf.json
|
||||
nobase_dist_doc_DATA += examples/kea4/all-options.json
|
||||
nobase_dist_doc_DATA += examples/kea4/backends.json
|
||||
nobase_dist_doc_DATA += examples/kea4/cassandra.json
|
||||
nobase_dist_doc_DATA += examples/kea4/classify.json
|
||||
nobase_dist_doc_DATA += examples/kea4/classify2.json
|
||||
nobase_dist_doc_DATA += examples/kea4/comments.json
|
||||
@@ -45,7 +44,6 @@ nobase_dist_doc_DATA += examples/kea6/all-keys.json
|
||||
nobase_dist_doc_DATA += examples/kea6/all-keys-netconf.json
|
||||
nobase_dist_doc_DATA += examples/kea6/all-options.json
|
||||
nobase_dist_doc_DATA += examples/kea6/backends.json
|
||||
nobase_dist_doc_DATA += examples/kea6/cassandra.json
|
||||
nobase_dist_doc_DATA += examples/kea6/classify.json
|
||||
nobase_dist_doc_DATA += examples/kea6/classify2.json
|
||||
nobase_dist_doc_DATA += examples/kea6/comments.json
|
||||
|
@@ -873,7 +873,6 @@ INPUT = ../../src/bin/agent \
|
||||
../../src/lib/cfgrpt \
|
||||
../../src/lib/config \
|
||||
../../src/lib/config_backend \
|
||||
../../src/lib/cql \
|
||||
../../src/lib/cryptolink \
|
||||
../../src/lib/d2srv \
|
||||
../../src/lib/database \
|
||||
|
@@ -102,7 +102,6 @@ a native (i.e. not cross-compiled) Kea build.
|
||||
|
||||
Required and optional Kea dependencies, usually available as packages:
|
||||
- Python (built-in)
|
||||
- Cassandra (skipped here)
|
||||
- libssl-dev (built-in in the full image)
|
||||
- liblog4cplus-dev (in liblog4cplus package, load both the library and
|
||||
the development part)
|
||||
|
@@ -389,29 +389,6 @@ local all postgres trust
|
||||
section in the <a href="https://kea.readthedocs.io">Kea Administrator
|
||||
Reference Manual</a>).
|
||||
|
||||
|
||||
@subsection cqlUnitTestsPrerequisites Cassandra database
|
||||
|
||||
@todo: Describe steps necessary to set up Cassandra database suitable
|
||||
for running unittests.
|
||||
|
||||
It seems this was enough:
|
||||
|
||||
-# Launch cassandra if not running (-f for foreground)
|
||||
@verbatim
|
||||
% cassandra -f
|
||||
@endverbatim
|
||||
|
||||
The tool is cqlsh:
|
||||
|
||||
-# Run the tool
|
||||
@verbatim
|
||||
% cqlsh
|
||||
Connected to Test Cluster at 127.0.0.1:9042.
|
||||
[cqlsh 5.0.1 | Cassandra 3.11.1 | CQL spec 3.4.4 | Native protocol v4]
|
||||
Use HELP for help.
|
||||
cqlsh> @endverbatim\n
|
||||
|
||||
@section unitTestsKerberos Kerberos Configuration for Unit Tests
|
||||
|
||||
The GSS-TSIG hook library uses the GSS-API with Kerberos. While there are
|
||||
|
@@ -74,7 +74,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
// For memfile, it's important to always specify lfc-interval, so
|
||||
// the lease file would not grow without bounds and be sanitized
|
||||
|
@@ -309,7 +309,7 @@
|
||||
// Port on which the database is available.
|
||||
"port": 3306,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
@@ -331,41 +331,25 @@
|
||||
// Port on which the database is available.
|
||||
"port": 5432,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "postgresql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
"user": "kea"
|
||||
},
|
||||
{
|
||||
// Name of the database to connect to.
|
||||
"keyspace": "kea",
|
||||
|
||||
// Host on which the database resides.
|
||||
"contact-points": "127.0.0.1",
|
||||
|
||||
// Database password.
|
||||
"password": "kea",
|
||||
|
||||
// Port on which the database is available.
|
||||
"port": 9042,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
"type": "cql",
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
"user": "kea",
|
||||
|
||||
// Consistency level for all queries.
|
||||
// Supported values: any, one, two, three, quorum, all,
|
||||
// local-quorum, each-quorum, serial, local-serial, local-one.
|
||||
"consistency": "quorum",
|
||||
|
||||
// Serial consistency level for all queries.
|
||||
// Supported values: any, one, two, three, quorum, all,
|
||||
// local-quorum, each-quorum, serial, local-serial, local-one.
|
||||
"serial-consistency": "serial",
|
||||
|
||||
// Connection reconnect wait time.
|
||||
// This parameter governs how long Kea waits before attempting
|
||||
// to reconnect. Expressed in milliseconds. The default is 2000 [ms]
|
||||
@@ -381,16 +365,7 @@
|
||||
"on-fail": "stop-retry-exit",
|
||||
|
||||
// Connection connect timeout.
|
||||
"connect-timeout": 100,
|
||||
|
||||
// Connection request timeout.
|
||||
"request-timeout": 100,
|
||||
|
||||
// Connection tcp keepalive.
|
||||
"tcp-keepalive": 100,
|
||||
|
||||
// Connection tcp nodelay.
|
||||
"tcp-nodelay": true
|
||||
"connect-timeout": 100
|
||||
}
|
||||
],
|
||||
|
||||
@@ -481,8 +456,8 @@
|
||||
// because non stored leases will be lost upon Kea server restart.
|
||||
"persist": true,
|
||||
|
||||
// Lease database backend type, i.e. "memfile", "mysql",
|
||||
// "postgresql" or "cql".
|
||||
// Lease database backend type, i.e. "memfile", "mysql", or
|
||||
// "postgresql".
|
||||
"type": "memfile"
|
||||
},
|
||||
|
||||
@@ -1023,7 +998,7 @@
|
||||
// Name of the database to connect to.
|
||||
"name": "config",
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql"
|
||||
}
|
||||
],
|
||||
|
@@ -309,7 +309,7 @@
|
||||
// Port on which the database is available.
|
||||
"port": 3306,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
@@ -345,41 +345,25 @@
|
||||
// Port on which the database is available.
|
||||
"port": 5432,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "postgresql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
"user": "kea"
|
||||
},
|
||||
{
|
||||
// Name of the database to connect to.
|
||||
"keyspace": "kea",
|
||||
|
||||
// Host on which the database resides.
|
||||
"contact-points": "127.0.0.1",
|
||||
|
||||
// Database password.
|
||||
"password": "kea",
|
||||
|
||||
// Port on which the database is available.
|
||||
"port": 9042,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
"type": "cql",
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
"user": "kea",
|
||||
|
||||
// Consistency level for all queries.
|
||||
// Supported values: any, one, two, three, quorum, all,
|
||||
// local-quorum, each-quorum, serial, local-serial, local-one.
|
||||
"consistency": "quorum",
|
||||
|
||||
// Serial consistency level for all queries.
|
||||
// Supported values: any, one, two, three, quorum, all,
|
||||
// local-quorum, each-quorum, serial, local-serial, local-one.
|
||||
"serial-consistency": "serial",
|
||||
|
||||
// Connection reconnect wait time.
|
||||
// This parameter governs how long Kea waits before attempting
|
||||
// to reconnect. Expressed in milliseconds. The default is 2000 [ms]
|
||||
@@ -395,16 +379,7 @@
|
||||
"on-fail": "stop-retry-exit",
|
||||
|
||||
// Connection connect timeout.
|
||||
"connect-timeout": 100,
|
||||
|
||||
// Connection request timeout.
|
||||
"request-timeout": 100,
|
||||
|
||||
// Connection tcp keepalive.
|
||||
"tcp-keepalive": 100,
|
||||
|
||||
// Connection tcp nodelay.
|
||||
"tcp-nodelay": true
|
||||
"connect-timeout": 100
|
||||
}
|
||||
],
|
||||
|
||||
@@ -510,8 +485,8 @@
|
||||
// because non stored leases will be lost upon Kea server restart.
|
||||
"persist": true,
|
||||
|
||||
// Lease database backend type, i.e. "memfile", "mysql",
|
||||
// "postgresql" or "cql".
|
||||
// Lease database backend type, i.e. "memfile", "mysql" or
|
||||
// "postgresql".
|
||||
"type": "memfile"
|
||||
},
|
||||
|
||||
@@ -1052,7 +1027,7 @@
|
||||
// Name of the database to connect to.
|
||||
"name": "config",
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql"
|
||||
}
|
||||
],
|
||||
|
@@ -4,7 +4,6 @@
|
||||
// - memfile
|
||||
// - MySQL
|
||||
// - PostgreSQL
|
||||
// - CQL (Cassandra) backend
|
||||
|
||||
{ "Dhcp4":
|
||||
|
||||
@@ -66,21 +65,6 @@
|
||||
// "connect-timeout": 3
|
||||
// },
|
||||
|
||||
// 4. CQL (Cassandra) backend. Leases will be stored in Cassandra
|
||||
// database. Make sure it is up, running and properly initialized. See
|
||||
// kea-admin documentation for details on how to initialize the
|
||||
// database. The only strictly required parameters are type, keyspace
|
||||
// and contact-points. At least one contact point must be specified, but
|
||||
// more than one is required for redundancy. Make sure you specify the
|
||||
// contact points without spaces. Kea must be compiled with --with-cql
|
||||
// option to use this backend.
|
||||
// "lease-database": {
|
||||
// "type": "cql",
|
||||
// "keyspace": "keatest",
|
||||
// "contact-points": "192.0.2.1,192.0.2.2,192.0.2.3",
|
||||
// "port": 9042
|
||||
// },
|
||||
|
||||
// Addresses will be assigned with a lifetime of 4000 seconds.
|
||||
"valid-lifetime": 4000,
|
||||
|
||||
|
@@ -1,121 +0,0 @@
|
||||
// This is an example configuration file for the DHCPv4 server in Kea.
|
||||
// It is a basic scenario with one IPv4 subnet configured. It demonstrates
|
||||
// how to configure Kea to use CQL (Cassandra) backend
|
||||
|
||||
{ "Dhcp4":
|
||||
|
||||
{
|
||||
// Kea is told to listen on ethX interface only.
|
||||
"interfaces-config": {
|
||||
"interfaces": [ "ethX" ]
|
||||
},
|
||||
|
||||
// 4. CQL (Cassandra) backend. Leases will be stored in Cassandra
|
||||
// database. Make sure it is up, running and properly initialized. See
|
||||
// kea-admin documentation for details on how to initialize the
|
||||
// database. The only strictly required parameters are type, keyspace
|
||||
// and contact-points. At least one contact point must be specified, but
|
||||
// more than one is required for redundancy. Make sure you specify the
|
||||
// contact points without spaces. Kea must be compiled with --with-cql
|
||||
// option to use this backend.
|
||||
"lease-database": {
|
||||
"type": "cql",
|
||||
"keyspace": "keatest",
|
||||
"contact-points": "192.0.2.1,192.0.2.2,192.0.2.3",
|
||||
"port": 9042,
|
||||
|
||||
// Cassandra supports many additonal parameters that are typically
|
||||
// not needed, but may be used to tweak your deployment.
|
||||
|
||||
// This parameter governs how long Kea waits before attempting
|
||||
// to reconnect. Expressed in milliseconds. The default is 2000 [ms].
|
||||
"reconnect-wait-time": 2000,
|
||||
|
||||
// This parameter sets the timeout for connecting to a node. Expressed
|
||||
// in milliseconds. The default is 5000 [ms].
|
||||
"connect-timeout": 5000,
|
||||
|
||||
// This parameter sets the timeout for waiting for a response
|
||||
// from a node. Expressed in milliseconds. The default is 12000 [ms].
|
||||
"request-timeout": 12000,
|
||||
|
||||
// This parameter governs the TCP keep-alive mechanism. Expressed
|
||||
// in seconds of delay. The default is disabled. In this example
|
||||
// it is set to 20 minutes.
|
||||
"tcp-keepalive": 1200,
|
||||
|
||||
// This parameter enables/disables Nagle's algorithm on connections.
|
||||
// The default is true.
|
||||
"tcp-nodelay": true,
|
||||
|
||||
// This parameter configures consistency level. The default is "quorum".
|
||||
// Supported values:
|
||||
// - any
|
||||
// - one
|
||||
// - two
|
||||
// - three
|
||||
// - quorum
|
||||
// - all
|
||||
// - local-quorum
|
||||
// - each-quorum
|
||||
// - serial
|
||||
// - local-serial
|
||||
// - local-one
|
||||
// See https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigConsistency.html for more details.
|
||||
"consistency": "quorum",
|
||||
|
||||
// This parameter configures serial consistency level which manages
|
||||
// lightweight transaction isolation. The default is "serial".
|
||||
// Supported values:
|
||||
// - any
|
||||
// - one
|
||||
// - two
|
||||
// - three
|
||||
// - quorum
|
||||
// - all
|
||||
// - local-quorum
|
||||
// - each-quorum
|
||||
// - serial
|
||||
// - local-serial
|
||||
// - local-one
|
||||
// See https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigSerialConsistency.html for more details.
|
||||
"serial-consistency": "serial"
|
||||
},
|
||||
|
||||
// Addresses will be assigned with a lifetime of 4000 seconds.
|
||||
"valid-lifetime": 4000,
|
||||
|
||||
// Renew and rebind timers are commented out. This implies that options
|
||||
// 58 and 59 will not be sent to the client. In this case it is up to
|
||||
// the client to pick the timer values according to RFC2131. Uncomment the
|
||||
// timers to send these options to the client.
|
||||
// "renew-timer": 1000,
|
||||
// "rebind-timer": 2000,
|
||||
|
||||
// The following list defines subnets. We have only one subnet
|
||||
// here. We tell Kea that it is directly available over local interface.
|
||||
"subnet4": [
|
||||
{
|
||||
"pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ],
|
||||
"subnet": "192.0.2.0/24",
|
||||
"interface": "ethX"
|
||||
}
|
||||
],
|
||||
|
||||
// The following configures logging. It assumes that messages with at
|
||||
// least informational level (info, warn, error and fatal) should be
|
||||
// logged to stdout.
|
||||
"loggers": [
|
||||
{
|
||||
"name": "kea-dhcp4",
|
||||
"output_options": [
|
||||
{
|
||||
"output": "stdout"
|
||||
}
|
||||
],
|
||||
"severity": "INFO"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
},
|
||||
|
||||
// We need to specify the database used to store leases. As of September
|
||||
// 2016, four database backends are supported: MySQL, PostgreSQL, Cassandra, and
|
||||
// 2016, four database backends are supported: MySQL, PostgreSQL and
|
||||
// the in-memory database, Memfile. We'll use memfile because it doesn't
|
||||
// require any prior set up.
|
||||
"lease-database": {
|
||||
|
@@ -28,8 +28,8 @@
|
||||
|
||||
// Use Memfile lease database backend to store leases in a CSV file.
|
||||
// Depending on how Kea was compiled, it may also support SQL databases
|
||||
// (MySQL and/or PostgreSQL) and even Cassandra. Those database backends
|
||||
// require more parameters, like name, host and possibly user and password.
|
||||
// (MySQL and/or PostgreSQL). Those database backends require more
|
||||
// parameters, like name, host and possibly user and password.
|
||||
// There are dedicated examples for each backend. See Section 7.2.2 "Lease
|
||||
// Storage" for details.
|
||||
"lease-database": {
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
// Note, we're setting the maximum number of row read errors to 100,
|
||||
// (defaults to 0, meaning unlimited).
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile"
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile"
|
||||
|
@@ -9,9 +9,9 @@
|
||||
"interfaces": [ "ethX" ]
|
||||
},
|
||||
|
||||
// We need to specify the database used to store leases. As of September
|
||||
// 2016, four database backends are supported: MySQL, PostgreSQL, Cassandra, and
|
||||
// the in-memory database, Memfile. We'll use memfile because it doesn't
|
||||
// We need to specify the database used to store leases. As of April
|
||||
// 2022, three database backends are supported: MySQL, PostgreSQL, and the
|
||||
// in-memory database, Memfile. We'll use memfile because it doesn't
|
||||
// require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile"
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We will use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -269,7 +269,7 @@
|
||||
// Port on which the database is available.
|
||||
"port": 3306,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
@@ -291,41 +291,25 @@
|
||||
// Port on which the database is available.
|
||||
"port": 5432,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "postgresql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
"user": "kea"
|
||||
},
|
||||
{
|
||||
// Name of the database to connect to.
|
||||
"keyspace": "kea",
|
||||
|
||||
// Host on which the database resides.
|
||||
"contact-points": "127.0.0.1",
|
||||
|
||||
// Database password.
|
||||
"password": "kea",
|
||||
|
||||
// Port on which the database is available.
|
||||
"port": 9042,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
"type": "cql",
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
"user": "kea",
|
||||
|
||||
// Consistency level for all queries.
|
||||
// Supported values: any, one, two, three, quorum, all,
|
||||
// local-quorum, each-quorum, serial, local-serial, local-one.
|
||||
"consistency": "quorum",
|
||||
|
||||
// Serial consistency level for all queries.
|
||||
// Supported values: any, one, two, three, quorum, all,
|
||||
// local-quorum, each-quorum, serial, local-serial, local-one.
|
||||
"serial-consistency": "serial",
|
||||
|
||||
// Connection reconnect wait time.
|
||||
// This parameter governs how long Kea waits before attempting
|
||||
// to reconnect. Expressed in milliseconds. The default is 2000 [ms]
|
||||
@@ -341,16 +325,7 @@
|
||||
"on-fail": "stop-retry-exit",
|
||||
|
||||
// Connection connect timeout.
|
||||
"connect-timeout": 100,
|
||||
|
||||
// Connection request timeout.
|
||||
"request-timeout": 100,
|
||||
|
||||
// Connection tcp keepalive.
|
||||
"tcp-keepalive": 100,
|
||||
|
||||
// Connection tcp nodelay.
|
||||
"tcp-nodelay": true
|
||||
"connect-timeout": 100
|
||||
}
|
||||
],
|
||||
|
||||
@@ -425,8 +400,8 @@
|
||||
// because non stored leases will be lost upon Kea server restart.
|
||||
"persist": true,
|
||||
|
||||
// Lease database backend type, i.e. "memfile", "mysql",
|
||||
// "postgresql" or "cql".
|
||||
// Lease database backend type, i.e. "memfile", "mysql", or
|
||||
// "postgresql".
|
||||
"type": "memfile"
|
||||
},
|
||||
|
||||
@@ -1011,7 +986,7 @@
|
||||
// Name of the database to connect to.
|
||||
"name": "config",
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql"
|
||||
}
|
||||
],
|
||||
|
@@ -269,7 +269,7 @@
|
||||
// Port on which the database is available.
|
||||
"port": 3306,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
@@ -305,41 +305,25 @@
|
||||
// Port on which the database is available.
|
||||
"port": 5432,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "postgresql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
"user": "kea"
|
||||
},
|
||||
{
|
||||
// Name of the database to connect to.
|
||||
"keyspace": "kea",
|
||||
|
||||
// Host on which the database resides.
|
||||
"contact-points": "127.0.0.1",
|
||||
|
||||
// Database password.
|
||||
"password": "kea",
|
||||
|
||||
// Port on which the database is available.
|
||||
"port": 9042,
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
"type": "cql",
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql",
|
||||
|
||||
// User name to be used to access the database.
|
||||
"user": "kea",
|
||||
|
||||
// Consistency level for all queries.
|
||||
// Supported values: any, one, two, three, quorum, all,
|
||||
// local-quorum, each-quorum, serial, local-serial, local-one.
|
||||
"consistency": "quorum",
|
||||
|
||||
// Serial consistency level for all queries.
|
||||
// Supported values: any, one, two, three, quorum, all,
|
||||
// local-quorum, each-quorum, serial, local-serial, local-one.
|
||||
"serial-consistency": "serial",
|
||||
|
||||
// Connection reconnect wait time.
|
||||
// This parameter governs how long Kea waits before attempting
|
||||
// to reconnect. Expressed in milliseconds. The default is 2000 [ms]
|
||||
@@ -355,16 +339,7 @@
|
||||
"on-fail": "stop-retry-exit",
|
||||
|
||||
// Connection connect timeout.
|
||||
"connect-timeout": 100,
|
||||
|
||||
// Connection request timeout.
|
||||
"request-timeout": 100,
|
||||
|
||||
// Connection tcp keepalive.
|
||||
"tcp-keepalive": 100,
|
||||
|
||||
// Connection tcp nodelay.
|
||||
"tcp-nodelay": true
|
||||
"connect-timeout": 100
|
||||
}
|
||||
],
|
||||
|
||||
@@ -454,8 +429,8 @@
|
||||
// because non stored leases will be lost upon Kea server restart.
|
||||
"persist": true,
|
||||
|
||||
// Lease database backend type, i.e. "memfile", "mysql",
|
||||
// "postgresql" or "cql".
|
||||
// Lease database backend type, i.e. "memfile", "mysql" or
|
||||
// "postgresql".
|
||||
"type": "memfile"
|
||||
},
|
||||
|
||||
@@ -1040,7 +1015,7 @@
|
||||
// Name of the database to connect to.
|
||||
"name": "config",
|
||||
|
||||
// Type of the database, e.g. "mysql", "postgresql", "cql".
|
||||
// Type of the database, e.g. "mysql", "postgresql".
|
||||
"type": "mysql"
|
||||
}
|
||||
],
|
||||
|
@@ -4,7 +4,6 @@
|
||||
// - memfile
|
||||
// - MySQL
|
||||
// - PostgreSQL
|
||||
// - CQL (Cassandra) backend
|
||||
|
||||
{ "Dhcp6":
|
||||
|
||||
@@ -66,21 +65,6 @@
|
||||
// "connect-timeout": 3
|
||||
// },
|
||||
|
||||
// 4. CQL (Cassandra) backend. Leases will be stored in Cassandra
|
||||
// database. Make sure it is up, running and properly initialized. See
|
||||
// kea-admin documentation for details on how to initialize the
|
||||
// database. The only strictly required parameters are type, keyspace
|
||||
// and contact-points. At least one contact point must be specified, but
|
||||
// more than one is required for redundancy. Make sure you specify the
|
||||
// contact points without spaces. Kea must be compiled with --with-cql
|
||||
// option to use this backend.
|
||||
// "lease-database": {
|
||||
// "type": "cql",
|
||||
// "keyspace": "keatest",
|
||||
// "contact-points": "192.0.2.1,192.0.2.2,192.0.2.3",
|
||||
// "port": 9042
|
||||
// },
|
||||
|
||||
// Addresses will be assigned with preferred and valid lifetimes
|
||||
// being 3000 and 4000, respectively. Client is told to start
|
||||
// renewing after 1000 seconds. If the server does not respond
|
||||
|
@@ -1,122 +0,0 @@
|
||||
// This is an example configuration file for the DHCPv6 server in Kea.
|
||||
// It is a basic scenario with one IPv6 subnet configured. It demonstrates
|
||||
// how to configure Kea to use CQL (Cassandra) backend.
|
||||
|
||||
{ "Dhcp6":
|
||||
|
||||
{
|
||||
// Kea is told to listen on ethX interface only.
|
||||
"interfaces-config": {
|
||||
"interfaces": [ "ethX" ]
|
||||
},
|
||||
|
||||
// CQL (Cassandra) backend. Leases will be stored in Cassandra database. Make
|
||||
// sure it is up, running and properly initialized. See kea-admin documentation
|
||||
// for details on how to initialize the database. The only strictly required
|
||||
// parameters are type, keyspace and contact-points. At least one contact point
|
||||
// must be specified, but more than one is required for redundancy. Make sure
|
||||
// you specify the contact points without spaces. Kea must be compiled with
|
||||
// --with-cql option to use this backend.
|
||||
"lease-database": {
|
||||
"type": "cql",
|
||||
"keyspace": "keatest",
|
||||
"contact-points": "192.0.2.1,192.0.2.2,192.0.2.3",
|
||||
"port": 9042,
|
||||
|
||||
// Cassandra supports many additonal parameters that are typically
|
||||
// not needed, but may be used to tweak your deployment.
|
||||
|
||||
// This parameter governs how long Kea waits before attempting
|
||||
// to reconnect. Expressed in milliseconds. The default is 2000 [ms].
|
||||
"reconnect-wait-time": 2000,
|
||||
|
||||
// This parameter sets the timeout for connecting to a node. Expressed
|
||||
// in milliseconds. The default is 5000 [ms].
|
||||
"connect-timeout": 5000,
|
||||
|
||||
// This parameter sets the timeout for waiting for a response
|
||||
// from a node. Expressed in milliseconds. The default is 12000 [ms].
|
||||
"request-timeout": 12000,
|
||||
|
||||
// This parameter governs the TCP keep-alive mechanism. Expressed
|
||||
// in seconds of delay. The default is disabled. In this example it is
|
||||
// set to 20 minutes.
|
||||
"tcp-keepalive": 1200,
|
||||
|
||||
// This parameter enables/disables Nagle's algorithm on connections.
|
||||
// The default is true.
|
||||
"tcp-nodelay": true,
|
||||
|
||||
// This parameter configures consistency level. The default is "quorum".
|
||||
// Supported values:
|
||||
// - any
|
||||
// - one
|
||||
// - two
|
||||
// - three
|
||||
// - quorum
|
||||
// - all
|
||||
// - local-quorum
|
||||
// - each-quorum
|
||||
// - serial
|
||||
// - local-serial
|
||||
// - local-one
|
||||
// See https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigConsistency.html for more details.
|
||||
"consistency": "quorum",
|
||||
|
||||
// This parameter configures serial consistency level which manages
|
||||
// lightweight transaction isolation. The default is "serial".
|
||||
// Supported values:
|
||||
// - any
|
||||
// - one
|
||||
// - two
|
||||
// - three
|
||||
// - quorum
|
||||
// - all
|
||||
// - local-quorum
|
||||
// - each-quorum
|
||||
// - serial
|
||||
// - local-serial
|
||||
// - local-one
|
||||
// See https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigSerialConsistency.html for more details.
|
||||
"serial-consistency": "serial"
|
||||
},
|
||||
|
||||
// Addresses will be assigned with preferred and valid lifetimes
|
||||
// being 3000 and 4000, respectively. Client is told to start
|
||||
// renewing after 1000 seconds. If the server does not respond
|
||||
// after 2000 seconds since the lease was granted, client is supposed
|
||||
// to start REBIND procedure (emergency renewal that allows switching
|
||||
// to a different server).
|
||||
"preferred-lifetime": 3000,
|
||||
"valid-lifetime": 4000,
|
||||
"renew-timer": 1000,
|
||||
"rebind-timer": 2000,
|
||||
|
||||
// The following list defines subnets. Each subnet consists of at
|
||||
// least subnet and pool entries.
|
||||
"subnet6": [
|
||||
{
|
||||
"pools": [ { "pool": "2001:db8:1::/80" } ],
|
||||
"subnet": "2001:db8:1::/64",
|
||||
"interface": "ethX"
|
||||
}
|
||||
],
|
||||
|
||||
// The following configures logging. It assumes that messages with at
|
||||
// least informational level (info, warn, error and fatal) should be
|
||||
// logged to stdout.
|
||||
"loggers": [
|
||||
{
|
||||
"name": "kea-dhcp6",
|
||||
"output_options": [
|
||||
{
|
||||
"output": "stdout"
|
||||
}
|
||||
],
|
||||
"debuglevel": 0,
|
||||
"severity": "INFO"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
@@ -32,7 +32,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -26,8 +26,8 @@
|
||||
|
||||
// Use Memfile lease database backend to store leases in a CSV file.
|
||||
// Depending on how Kea was compiled, it may also support SQL databases
|
||||
// (MySQL and/or PostgreSQL) and even Cassandra. Those database backends
|
||||
// require more parameters, like name, host and possibly user and password.
|
||||
// (MySQL and/or PostgreSQL). Those database backends require more
|
||||
// parameters, like name, host and possibly user and password.
|
||||
// There are dedicated examples for each backend. See Section 7.2.2 "Lease
|
||||
// Storage" for details.
|
||||
"lease-database": {
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
// Note, we're setting the maximum number of row read errors to 100,
|
||||
// (defaults to 0, meaning unlimited).
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile"
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile"
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile"
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile"
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
// We need to specify the database used to store leases. As of
|
||||
// September 2016, four database backends are supported: MySQL,
|
||||
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
|
||||
// PostgreSQL and the in-memory database, Memfile.
|
||||
// We'll use memfile because it doesn't require any prior set up.
|
||||
"lease-database": {
|
||||
"type": "memfile",
|
||||
|
@@ -36,8 +36,8 @@
|
||||
|
||||
// Use Memfile lease database backend to store leases in a CSV file.
|
||||
// Depending on how Kea was compiled, it may also support SQL databases
|
||||
// (MySQL and/or PostgreSQL) and even Cassandra. Those database backends
|
||||
// require more parameters, like name, host and possibly user and password.
|
||||
// (MySQL and/or PostgreSQL). Those database backends require more
|
||||
// parameters, like name, host and possibly user and password.
|
||||
// There are dedicated examples for each backend. See Section 7.2.2 "Lease
|
||||
// Storage" for details.
|
||||
"lease-database": {
|
||||
|
@@ -36,8 +36,8 @@
|
||||
|
||||
// Use Memfile lease database backend to store leases in a CSV file.
|
||||
// Depending on how Kea was compiled, it may also support SQL databases
|
||||
// (MySQL and/or PostgreSQL) and even Cassandra. Those database backends
|
||||
// require more parameters, like name, host and possibly user and password.
|
||||
// (MySQL and/or PostgreSQL). Those database backends require more
|
||||
// parameters, like name, host and possibly user and password.
|
||||
// There are dedicated examples for each backend. See Section 7.2.2 "Lease
|
||||
// Storage" for details.
|
||||
"lease-database": {
|
||||
|
@@ -61,8 +61,8 @@ currently supported commands are:
|
||||
useful when upgrading Kea.
|
||||
|
||||
- ``lease-dump`` — dumps the contents of the lease database (for MySQL or
|
||||
PostgreSQL backends) to a CSV (comma-separated values) text file. (Support
|
||||
for the Cassandra backend has been deprecated.)
|
||||
PostgreSQL backends) to a CSV (comma-separated values) text file.
|
||||
|
||||
The first line of the file contains the column names. This can be used
|
||||
as a way to switch from a database backend to a memfile backend.
|
||||
Alternatively, it can be used as a diagnostic tool, so it provides a portable
|
||||
@@ -82,9 +82,6 @@ supported types are:
|
||||
- ``pgsql`` — information is stored in a PostgreSQL relational
|
||||
database.
|
||||
|
||||
- ``cql`` — information is stored in an Apache Cassandra database.
|
||||
This backend is deprecated.
|
||||
|
||||
Additional parameters may be needed, depending on the setup and
|
||||
specific operation: username, password, and database name or the
|
||||
directory where specific files are located. See the appropriate manual
|
||||
@@ -102,32 +99,32 @@ backend is essential for the success of the deployment.
|
||||
|
||||
.. table:: List of available backends
|
||||
|
||||
+---------------+----------------+----------------+---------------+--------------+
|
||||
| Feature | Memfile | MySQL | PostgreSQL | CQL |
|
||||
| | | | | (Cassandra) |
|
||||
+===============+================+================+===============+==============+
|
||||
| Status | Stable | Stable | Stable | Deprecated |
|
||||
| | | | | |
|
||||
+---------------+----------------+----------------+---------------+--------------+
|
||||
| Data format | CSV file | SQL RMDB | SQL RMDB | NoSQL |
|
||||
| | | | | database |
|
||||
| | | | | (Cassandra) |
|
||||
+---------------+----------------+----------------+---------------+--------------+
|
||||
| Leases | yes | yes | yes | yes |
|
||||
+---------------+----------------+----------------+---------------+--------------+
|
||||
| Host | no | yes | yes | yes |
|
||||
| reservations | | | | |
|
||||
| | | | | |
|
||||
+---------------+----------------+----------------+---------------+--------------+
|
||||
| Options | no | yes | yes | yes |
|
||||
| defined on | | | | |
|
||||
| per host | | | | |
|
||||
| basis | | | | |
|
||||
+---------------+----------------+----------------+---------------+--------------+
|
||||
| Configuration | no | yes | no | no |
|
||||
| backend | | | | |
|
||||
| | | | | |
|
||||
+---------------+----------------+----------------+---------------+--------------+
|
||||
+---------------+----------------+----------------+---------------+
|
||||
| Feature | Memfile | MySQL | PostgreSQL |
|
||||
| | | | |
|
||||
+===============+================+================+===============+
|
||||
| Status | Stable | Stable | Stable |
|
||||
| | | | |
|
||||
+---------------+----------------+----------------+---------------+
|
||||
| Data format | CSV file | SQL RMDB | SQL RMDB |
|
||||
| | | | |
|
||||
| | | | |
|
||||
+---------------+----------------+----------------+---------------+
|
||||
| Leases | yes | yes | yes |
|
||||
+---------------+----------------+----------------+---------------+
|
||||
| Host | no | yes | yes |
|
||||
| reservations | | | |
|
||||
| | | | |
|
||||
+---------------+----------------+----------------+---------------+
|
||||
| Options | no | yes | yes |
|
||||
| defined on | | | |
|
||||
| per host | | | |
|
||||
| basis | | | |
|
||||
+---------------+----------------+----------------+---------------+
|
||||
| Configuration | no | yes | yes |
|
||||
| backend | | | |
|
||||
| | | | |
|
||||
+---------------+----------------+----------------+---------------+
|
||||
|
||||
Memfile
|
||||
-------
|
||||
@@ -602,106 +599,6 @@ supported:
|
||||
|
||||
$ ./configure [other-options] --disable-pgsql-ssl
|
||||
|
||||
.. _cql-database:
|
||||
|
||||
Cassandra
|
||||
---------
|
||||
|
||||
Cassandra (sometimes referred to as CQL) is the newest backend added to Kea; initial
|
||||
development was contributed by Deutsche Telekom. The Cassandra backend
|
||||
is able to store leases, host reservations, and options defined on a
|
||||
per-host basis.
|
||||
|
||||
.. note::
|
||||
|
||||
The Cassandra backend was deprecated in Kea 1.9.9. New users are discouraged from
|
||||
using Cassandra and existing users should consider a migration strategy. See
|
||||
:ref:`deprecated` for details.
|
||||
|
||||
.. _cql-database-create:
|
||||
|
||||
First-Time Creation of the Cassandra Database
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
When setting up the Cassandra database for the first time,
|
||||
the keyspace area within it must be created. This needs to be done
|
||||
manually; it cannot be performed by ``kea-admin``.
|
||||
|
||||
To create the database:
|
||||
|
||||
1. Export ``CQLSH_HOST`` environment variable:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ export CQLSH_HOST=localhost
|
||||
|
||||
2. Log into CQL:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ cqlsh
|
||||
cql>
|
||||
|
||||
3. Create the CQL keyspace:
|
||||
|
||||
::
|
||||
|
||||
cql> CREATE KEYSPACE keyspace-name WITH replication = {'class' : 'SimpleStrategy','replication_factor' : 1};
|
||||
|
||||
(``keyspace-name`` is the name chosen for the keyspace.)
|
||||
|
||||
4. At this point, the database tables can be created.
|
||||
To do this:
|
||||
|
||||
::
|
||||
|
||||
cqlsh -k keyspace-name -f path-to-kea/share/kea/scripts/cql/dhcpdb_create.cql
|
||||
|
||||
(``path-to-kea`` is the location where Kea is installed.)
|
||||
|
||||
It is also possible to exit Cassandra and create the tables using
|
||||
the ``kea-admin`` tool. If the tables were not created in Step 4, do so now by
|
||||
running the ``kea-admin`` tool:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ kea-admin db-init cql -n database-name
|
||||
|
||||
Do not do this if the tables were created in Step 4. ``kea-admin``
|
||||
implements rudimentary checks; it will refuse to initialize a database
|
||||
that contains any existing tables. To start from scratch,
|
||||
all data must be removed manually. (This process is a manual operation
|
||||
on purpose, to avoid accidentally irretrievable mistakes by ``kea-admin``.)
|
||||
|
||||
.. _cql-upgrade:
|
||||
|
||||
Upgrading a Cassandra Database From an Earlier Version of Kea
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sometimes a new Kea version uses a newer database schema, so the
|
||||
existing database needs to be upgraded. This can be done using the
|
||||
``kea-admin db-upgrade`` command.
|
||||
|
||||
To check the current version of the database, use the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ kea-admin db-version cql -n database-name
|
||||
|
||||
(See :ref:`kea-database-version`
|
||||
for a discussion about versioning.) If the version does not match the
|
||||
minimum required for the new version of Kea (as described in the release
|
||||
notes), the database needs to be upgraded.
|
||||
|
||||
Before upgrading, please make sure that the database is backed up. The
|
||||
upgrade process does not discard any data, but depending on the nature
|
||||
of the changes, it may be impossible to subsequently downgrade to an
|
||||
earlier version. To perform an upgrade, issue the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ kea-admin db-upgrade cql -n database-name
|
||||
|
||||
Using Read-Only Databases With Host Reservations
|
||||
------------------------------------------------
|
||||
|
||||
|
@@ -82,5 +82,3 @@ Currently the support for each database is:
|
||||
- PostgreSQL only uses the configuration to enable the SSL/TLS support
|
||||
in the client library (libpq). Anything else must be done in the
|
||||
PostgreSQL local configuration.
|
||||
|
||||
- Cassandra/CQL does not support this.
|
||||
|
@@ -288,7 +288,7 @@ Lease Storage
|
||||
|
||||
All leases issued by the server are stored in the lease database.
|
||||
There are four database backends available: memfile
|
||||
(the default), MySQL, PostgreSQL, and Cassandra (deprecated).
|
||||
(the default), MySQL, PostgreSQL.
|
||||
|
||||
Memfile - Basic Storage for Leases
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -425,7 +425,7 @@ Lease Database Configuration
|
||||
|
||||
Lease database configuration is controlled through the
|
||||
``Dhcp4``/``lease-database`` parameters. The database type must be set to
|
||||
``memfile``, ``mysql``, ``postgresql``, or ``cql``, e.g.:
|
||||
``memfile``, ``mysql``, or ``postgresql``, e.g.:
|
||||
|
||||
::
|
||||
|
||||
@@ -433,8 +433,7 @@ Lease database configuration is controlled through the
|
||||
|
||||
Next, the name of the database to hold the leases must be set; this is
|
||||
the name used when the database was created (see
|
||||
:ref:`mysql-database-create`, :ref:`pgsql-database-create`, or
|
||||
:ref:`cql-database-create`).
|
||||
:ref:`mysql-database-create` or :ref:`pgsql-database-create`).
|
||||
|
||||
For MySQL or PostgreSQL:
|
||||
|
||||
@@ -442,12 +441,6 @@ For MySQL or PostgreSQL:
|
||||
|
||||
"Dhcp4": { "lease-database": { "name": "database-name" , ... }, ... }
|
||||
|
||||
For Cassandra:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp4": { "lease-database": { "keyspace": "database-name" , ... }, ... }
|
||||
|
||||
If the database is located on a different system from the DHCPv4 server,
|
||||
the database host name must also be specified:
|
||||
|
||||
@@ -455,12 +448,6 @@ the database host name must also be specified:
|
||||
|
||||
"Dhcp4": { "lease-database": { "host": "remote-host-name", ... }, ... }
|
||||
|
||||
For Cassandra, multiple contact points can be provided:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp4": { "lease-database": { "contact-points": "remote-host-name[, ...]" , ... }, ... }
|
||||
|
||||
Normally, the database is on the same machine as the DHCPv4 server.
|
||||
In this case, set the value to the empty string:
|
||||
|
||||
@@ -468,12 +455,6 @@ In this case, set the value to the empty string:
|
||||
|
||||
"Dhcp4": { "lease-database": { "host" : "", ... }, ... }
|
||||
|
||||
For Cassandra:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp4": { "lease-database": { "contact-points": "", ... }, ... }
|
||||
|
||||
Should the database use a port other than the default, it may be
|
||||
specified as well:
|
||||
|
||||
@@ -504,9 +485,7 @@ If the server is unable to reconnect to the database after making the
|
||||
maximum number of attempts, the server will exit. A value of 0 (the
|
||||
default) disables automatic recovery and the server will exit
|
||||
immediately upon detecting a loss of connectivity (MySQL and PostgreSQL
|
||||
only). For Cassandra, Kea uses an interface that connects to
|
||||
all nodes in a cluster at the same time. Any connectivity issues should
|
||||
be handled by internal Cassandra mechanisms.
|
||||
only).
|
||||
|
||||
The number of milliseconds the server waits between attempts to
|
||||
reconnect to the lease database after connectivity has been lost may
|
||||
@@ -518,7 +497,7 @@ also be specified:
|
||||
|
||||
The default value for MySQL and PostgreSQL is 0, which disables automatic
|
||||
recovery and causes the server to exit immediately upon detecting the
|
||||
loss of connectivity. The default value for Cassandra is 2000 ms.
|
||||
loss of connectivity.
|
||||
|
||||
::
|
||||
|
||||
@@ -555,13 +534,6 @@ The possible values are:
|
||||
exclusively as a configuration tool.
|
||||
|
||||
The host parameter is used by the MySQL and PostgreSQL backends.
|
||||
Cassandra has a concept of contact points that can be used to
|
||||
contact the cluster, instead of a single IP or hostname. It takes a
|
||||
list of comma-separated IP addresses, which may be specified as:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp4": { "lease-database": { "contact-points" : "192.0.2.1,192.0.2.2", ... }, ... }
|
||||
|
||||
Finally, the credentials of the account under which the server will
|
||||
access the database should be set:
|
||||
@@ -576,82 +548,6 @@ access the database should be set:
|
||||
If there is no password to the account, set the password to the empty
|
||||
string ``""``. (This is the default.)
|
||||
|
||||
.. _cassandra-database-configuration4:
|
||||
|
||||
Cassandra-Specific Parameters
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The Cassandra backend is configured slightly differently. Cassandra has
|
||||
a concept of contact points that can be used to contact the cluster,
|
||||
instead of a single IP or hostname. It takes a list of comma-separated
|
||||
IP addresses, which may be specified as:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp4": {
|
||||
"lease-database": {
|
||||
"type": "cql",
|
||||
"contact-points": "ip-address1, ip-address2 [,...]",
|
||||
...
|
||||
},
|
||||
...
|
||||
}
|
||||
|
||||
Cassandra also supports a number of optional parameters:
|
||||
|
||||
- ``reconnect-wait-time`` - governs how long Kea waits before
|
||||
attempting to reconnect. Expressed in milliseconds. The default is
|
||||
2000 [ms].
|
||||
|
||||
- ``connect-timeout`` - sets the timeout for connecting to a node.
|
||||
Expressed in milliseconds. The default is 5000 [ms].
|
||||
|
||||
- ``request-timeout`` - sets the timeout for waiting for a response
|
||||
from a node. Expressed in milliseconds. The default is 12000 [ms].
|
||||
|
||||
- ``tcp-keepalive`` - governs the TCP keep-alive mechanism. Expressed
|
||||
in seconds of delay. If the parameter is not present, the mechanism
|
||||
is disabled.
|
||||
|
||||
- ``tcp-nodelay`` - enables/disables Nagle's algorithm on connections.
|
||||
The default is ``true``.
|
||||
|
||||
- ``consistency`` - configures the consistency level. The default is
|
||||
``quorum``. Supported values are: ``any``, ``one``, ``two``, ``three``, ``quorum``, ``all``,
|
||||
``local-quorum``, ``each-quorum``, ``serial``, ``local-serial``, and ``local-one``. See
|
||||
`Cassandra
|
||||
consistency <https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigConsistency.html>`__
|
||||
for more details.
|
||||
|
||||
- ``serial-consistency`` - configures the serial consistency level, which
|
||||
manages lightweight transaction isolation. The default is ``serial``.
|
||||
Supported values are: ``any``, ``one``, ``two``, ``three``, ``quorum``, ``all``, ``local-quorum``,
|
||||
``each-quorum``, ``serial``, ``local-serial``, and ``local-one``. See `Cassandra serial
|
||||
consistency <https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigSerialConsistency.html>`__
|
||||
for more details.
|
||||
|
||||
For example, a complex Cassandra configuration with most parameters
|
||||
specified could look as follows:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp4": {
|
||||
"lease-database": {
|
||||
"type": "cql",
|
||||
"keyspace": "keatest",
|
||||
"contact-points": "192.0.2.1, 192.0.2.2, 192.0.2.3",
|
||||
"port": 9042,
|
||||
"reconnect-wait-time": 2000,
|
||||
"connect-timeout": 5000,
|
||||
"request-timeout": 12000,
|
||||
"tcp-keepalive": 1,
|
||||
"tcp-nodelay": true
|
||||
},
|
||||
...
|
||||
}
|
||||
|
||||
Similar parameters can be specified for the hosts database.
|
||||
|
||||
.. _hosts4-storage:
|
||||
|
||||
Hosts Storage
|
||||
@@ -663,8 +559,7 @@ lease database. In fact, the Kea server opens independent connections for
|
||||
each purpose, be it lease or hosts information, which gives
|
||||
the most flexibility. Kea can keep leases and host reservations
|
||||
separately, but can also point to the same database. Currently the
|
||||
supported hosts database types are MySQL, PostgreSQL, and Cassandra,
|
||||
although support for Cassandra has been deprecated.
|
||||
supported hosts database types are MySQL and PostgreSQL.
|
||||
|
||||
The following configuration can be used to configure a
|
||||
connection to MySQL:
|
||||
@@ -762,9 +657,7 @@ If the server is unable to reconnect to the database after making the
|
||||
maximum number of attempts, the server will exit. A value of 0 (the
|
||||
default) disables automatic recovery and the server will exit
|
||||
immediately upon detecting a loss of connectivity (MySQL and PostgreSQL
|
||||
only). For Cassandra, Kea uses an interface that connects to
|
||||
all nodes in a cluster at the same time. Any connectivity issues should
|
||||
be handled by internal Cassandra mechanisms.
|
||||
only).
|
||||
|
||||
The number of milliseconds the server waits between attempts to
|
||||
reconnect to the host database after connectivity has been lost may also
|
||||
@@ -776,7 +669,7 @@ be specified:
|
||||
|
||||
The default value for MySQL and PostgreSQL is 0, which disables automatic
|
||||
recovery and causes the server to exit immediately upon detecting the
|
||||
loss of connectivity. The default value for Cassandra is 2000 ms.
|
||||
loss of connectivity.
|
||||
|
||||
::
|
||||
|
||||
@@ -828,8 +721,6 @@ entry, as in:
|
||||
|
||||
"Dhcp4": { "hosts-databases": [ { "type": "mysql", ... }, ... ], ... }
|
||||
|
||||
For Cassandra-specific parameters, see :ref:`cassandra-database-configuration4`.
|
||||
|
||||
If the same host is configured both in-file and in-database, Kea does not issue a warning,
|
||||
as it would if both were specified in the same data source.
|
||||
Instead, the host configured in-file has priority over the one configured
|
||||
@@ -4653,15 +4544,15 @@ reserved class has been also assigned.
|
||||
:ref:`subnet-selection-with-class-reservations4`
|
||||
for specific use cases.
|
||||
|
||||
.. _reservations4-mysql-pgsql-cql:
|
||||
.. _reservations4-mysql-pgsql:
|
||||
|
||||
Storing Host Reservations in MySQL, PostgreSQL, or Cassandra
|
||||
------------------------------------------------------------
|
||||
Storing Host Reservations in MySQL or PostgreSQL
|
||||
------------------------------------------------
|
||||
|
||||
Kea can store host reservations in MySQL, PostgreSQL, or
|
||||
Cassandra. See :ref:`hosts4-storage` for information on how to
|
||||
configure Kea to use reservations stored in MySQL, PostgreSQL, or
|
||||
Cassandra. Kea provides a dedicated hook for managing reservations in a
|
||||
Kea can store host reservations in MySQL or PostgreSQL.
|
||||
See :ref:`hosts4-storage` for information on how to
|
||||
configure Kea to use reservations stored in MySQL or PostgreSQL.
|
||||
Kea provides a dedicated hook for managing reservations in a
|
||||
database; section :ref:`host-cmds` provides detailed information.
|
||||
The `Kea wiki
|
||||
<https://gitlab.isc.org/isc-projects/kea/wikis/designs/commands#23-host-reservations-hr-management>`__
|
||||
@@ -5300,7 +5191,7 @@ for the same IP address within a given subnet. Setting this parameter to
|
||||
file and in the host database backend, via the ``host-cmds`` hook library.
|
||||
|
||||
This setting is currently supported by the most popular host database
|
||||
backends, i.e. MySQL and PostgreSQL. It is not supported for Cassandra,
|
||||
backends, i.e. MySQL and PostgreSQL.
|
||||
Host Cache (see :ref:`hooks-host-cache`), or the RADIUS backend
|
||||
(see :ref:`hooks-radius`). An attempt to set ``ip-reservations-unique``
|
||||
to ``false`` when any of these three backends is in use yields a
|
||||
|
@@ -245,7 +245,7 @@ Lease Storage
|
||||
|
||||
All leases issued by the server are stored in the lease database.
|
||||
There are four database backends available: memfile
|
||||
(the default), MySQL, PostgreSQL, and Cassandra (deprecated).
|
||||
(the default), MySQL, PostgreSQL.
|
||||
|
||||
Memfile - Basic Storage for Leases
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -382,7 +382,7 @@ Lease Database Configuration
|
||||
|
||||
Lease database configuration is controlled through the
|
||||
``Dhcp6``/``lease-database`` parameters. The database type must be set to
|
||||
``memfile``, ``mysql``, or ``postgresql``, or ``cql``, e.g.:
|
||||
``memfile``, ``mysql``, or ``postgresql``, e.g.:
|
||||
|
||||
::
|
||||
|
||||
@@ -390,8 +390,7 @@ Lease database configuration is controlled through the
|
||||
|
||||
Next, the name of the database to hold the leases must be set; this is
|
||||
the name used when the database was created (see
|
||||
:ref:`mysql-database-create`, :ref:`pgsql-database-create`, or
|
||||
:ref:`cql-database-create`).
|
||||
:ref:`mysql-database-create` or :ref:`pgsql-database-create`).
|
||||
|
||||
For MySQL or PostgreSQL:
|
||||
|
||||
@@ -399,12 +398,6 @@ For MySQL or PostgreSQL:
|
||||
|
||||
"Dhcp6": { "lease-database": { "name": "database-name" , ... }, ... }
|
||||
|
||||
For Cassandra:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp6": { "lease-database": { "keyspace": "database-name" , ... }, ... }
|
||||
|
||||
If the database is located on a different system from the DHCPv6 server,
|
||||
the database host name must also be specified:
|
||||
|
||||
@@ -412,12 +405,6 @@ the database host name must also be specified:
|
||||
|
||||
"Dhcp6": { "lease-database": { "host": "remote-host-name", ... }, ... }
|
||||
|
||||
For Cassandra, multiple contact points can be provided:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp6": { "lease-database": { "contact-points": "remote-host-name[, ...]" , ... }, ... }
|
||||
|
||||
Normally, the database is on the same machine as the DHCPv6 server.
|
||||
In this case, set the value to the empty string:
|
||||
|
||||
@@ -425,12 +412,6 @@ In this case, set the value to the empty string:
|
||||
|
||||
"Dhcp6": { "lease-database": { "host" : "", ... }, ... }
|
||||
|
||||
For Cassandra:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp6": { "lease-database": { "contact-points": "", ... }, ... }
|
||||
|
||||
Should the database use a port other than the default, it may be
|
||||
specified as well:
|
||||
|
||||
@@ -461,9 +442,7 @@ If the server is unable to reconnect to the database after making the
|
||||
maximum number of attempts, the server will exit. A value of 0 (the
|
||||
default) disables automatic recovery and the server will exit
|
||||
immediately upon detecting a loss of connectivity (MySQL and PostgreSQL
|
||||
only). For Cassandra, Kea uses an interface that connects to
|
||||
all nodes in a cluster at the same time. Any connectivity issues should
|
||||
be handled by internal Cassandra mechanisms.
|
||||
only).
|
||||
|
||||
The number of milliseconds the server waits between attempts to
|
||||
reconnect to the lease database after connectivity has been lost may
|
||||
@@ -475,7 +454,7 @@ also be specified:
|
||||
|
||||
The default value for MySQL and PostgreSQL is 0, which disables automatic
|
||||
recovery and causes the server to exit immediately upon detecting the
|
||||
loss of connectivity. The default value for Cassandra is 2000 ms.
|
||||
loss of connectivity.
|
||||
|
||||
::
|
||||
|
||||
@@ -512,13 +491,6 @@ The possible values are:
|
||||
exclusively as a configuration tool.
|
||||
|
||||
The host parameter is used by the MySQL and PostgreSQL backends.
|
||||
Cassandra has a concept of contact points that can be used to
|
||||
contact the cluster, instead of a single IP or hostname. It takes a
|
||||
list of comma-separated IP addresses, which may be specified as:
|
||||
|
||||
::
|
||||
|
||||
"Dhcp6": { "lease-database": { "contact-points" : "192.0.2.1,192.0.2.2", ... }, ... }
|
||||
|
||||
Finally, the credentials of the account under which the server will
|
||||
access the database should be set:
|
||||
@@ -533,14 +505,6 @@ access the database should be set:
|
||||
If there is no password to the account, set the password to the empty
|
||||
string ``""``. (This is the default.)
|
||||
|
||||
.. _cassandra-database-configuration6:
|
||||
|
||||
Cassandra-Specific Parameters
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The parameters are the same for both DHCPv4 and DHCPv6. See
|
||||
:ref:`cassandra-database-configuration4` for details.
|
||||
|
||||
.. _hosts6-storage:
|
||||
|
||||
Hosts Storage
|
||||
@@ -552,7 +516,7 @@ lease database. In fact, the Kea server opens independent connections for
|
||||
each purpose, be it lease or hosts information, which gives
|
||||
the most flexibility. Kea can keep leases and host reservations
|
||||
separately, but can also point to the same database. Currently the
|
||||
supported hosts database types are MySQL, PostgreSQL, and Cassandra.
|
||||
supported hosts database types are MySQL and PostgreSQL.
|
||||
|
||||
The following configuration can be used to configure a
|
||||
connection to MySQL:
|
||||
@@ -650,9 +614,7 @@ If the server is unable to reconnect to the database after making the
|
||||
maximum number of attempts, the server will exit. A value of 0 (the
|
||||
default) disables automatic recovery and the server will exit
|
||||
immediately upon detecting a loss of connectivity (MySQL and PostgreSQL
|
||||
only). For Cassandra, Kea uses an interface that connects to
|
||||
all nodes in a cluster at the same time. Any connectivity issues should
|
||||
be handled by internal Cassandra mechanisms.
|
||||
only).
|
||||
|
||||
The number of milliseconds the server waits between attempts to
|
||||
reconnect to the host database after connectivity has been lost may also
|
||||
@@ -664,7 +626,7 @@ be specified:
|
||||
|
||||
The default value for MySQL and PostgreSQL is 0, which disables automatic
|
||||
recovery and causes the server to exit immediately upon detecting the
|
||||
loss of connectivity. The default value for Cassandra is 2000 ms.
|
||||
loss of connectivity.
|
||||
|
||||
::
|
||||
|
||||
@@ -716,8 +678,6 @@ entry, as in:
|
||||
|
||||
"Dhcp6": { "hosts-databases": [ { "type": "mysql", ... }, ... ], ... }
|
||||
|
||||
For Cassandra-specific parameters, see :ref:`cassandra-database-configuration4`.
|
||||
|
||||
If the same host is configured both in-file and in-database, Kea does not issue a warning,
|
||||
as it would if both were specified in the same data source.
|
||||
Instead, the host configured in-file has priority over the one configured
|
||||
@@ -4032,15 +3992,15 @@ reserved class has been also assigned.
|
||||
:ref:`subnet-selection-with-class-reservations6`
|
||||
for specific use cases.
|
||||
|
||||
.. _reservations6-mysql-pgsql-cql:
|
||||
.. _reservations6-mysql-pgsql:
|
||||
|
||||
Storing Host Reservations in MySQL, PostgreSQL, or Cassandra
|
||||
------------------------------------------------------------
|
||||
Storing Host Reservations in MySQL or PostgreSQL
|
||||
------------------------------------------------
|
||||
|
||||
Kea can store host reservations in MySQL, PostgreSQL, or
|
||||
Cassandra. See :ref:`hosts6-storage` for information on
|
||||
how to configure Kea to use reservations stored in MySQL, PostgreSQL, or
|
||||
Cassandra. Kea provides a dedicated hook for managing reservations in a
|
||||
Kea can store host reservations in MySQL or PostgreSQL.
|
||||
See :ref:`hosts6-storage` for information on how to
|
||||
configure Kea to use reservations stored in MySQL or PostgreSQL.
|
||||
Kea provides a dedicated hook for managing reservations in a
|
||||
database; section :ref:`host-cmds` provides detailed information.
|
||||
The `Kea wiki
|
||||
<https://gitlab.isc.org/isc-projects/kea/wikis/designs/commands#23-host-reservations-hr-management>`__
|
||||
@@ -4664,7 +4624,7 @@ allows such reservations to be created both in the Kea configuration
|
||||
file and in the host database backend, via the ``host-cmds`` hook library.
|
||||
|
||||
This setting is currently supported by the most popular host database
|
||||
backends, i.e. MySQL and PostgreSQL. It is not supported for Cassandra,
|
||||
backends, i.e. MySQL and PostgreSQL.
|
||||
Host Cache (see :ref:`hooks-host-cache`), or the RADIUS backend
|
||||
(see :ref:`hooks-radius`). An attempt to set ``ip-reservations-unique``
|
||||
to ``false`` when any of these three backends is in use yields a
|
||||
@@ -6562,7 +6522,7 @@ option is actually needed. An example configuration looks as follows:
|
||||
"comment": "Those v4-v6 migration technologies are tricky.",
|
||||
"experimental": true,
|
||||
"billing-department": 42,
|
||||
"contact-points": [ "Alice", "Bob" ]
|
||||
"contacts": [ "Alice", "Bob" ]
|
||||
}
|
||||
} ]
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ To exclude the installation and generation of docs, type:
|
||||
|
||||
$ ./hammer.py build -p local -x install docs
|
||||
|
||||
The basic scope can be extended by mysql, pgsql, cql, native-pkg,
|
||||
The basic scope can be extended by mysql, pgsql, native-pkg,
|
||||
radius, shell, and forge.
|
||||
|
||||
.. note::
|
||||
|
@@ -1107,9 +1107,9 @@ In some cases, though, it is desirable to disable lease updates and/or
|
||||
database synchronization between the active servers, if the exchange of
|
||||
information about the allocated leases is performed using some other
|
||||
mechanism. Kea supports various database types that can be used to store
|
||||
leases, including MySQL and PostgreSQL; Cassandra support is deprecated as of Kea 1.9.9. Those databases
|
||||
include built-in solutions for data replication which are often used by
|
||||
Kea administrators to provide redundancy.
|
||||
leases, including MySQL and PostgreSQL. Those databases include built-in
|
||||
solutions for data replication which are often used by Kea administrators
|
||||
to provide redundancy.
|
||||
|
||||
The HA hook library supports such scenarios by disabling lease updates
|
||||
over the control channel and/or lease-database synchronization, leaving
|
||||
|
@@ -17,9 +17,8 @@ information in the database.
|
||||
``kea-dhcp6`` process.
|
||||
|
||||
In principle, this hook library can be used with any backend that may
|
||||
introduce performance degradation (MySQL, PostgreSQL, Cassandra, or
|
||||
RADIUS). Host Cache must be loaded for the RADIUS accounting mechanism
|
||||
to work.
|
||||
introduce performance degradation (MySQL, PostgreSQL or RADIUS). Host Cache
|
||||
must be loaded for the RADIUS accounting mechanism to work.
|
||||
|
||||
The Host Cache hook library is very simple. It takes only one
|
||||
optional parameter (``maximum``), which defines the maximum number of hosts
|
||||
|
@@ -4,8 +4,8 @@
|
||||
==============================
|
||||
|
||||
Kea allows users to store lease information in several
|
||||
backends (memfile, MySQL, PostgreSQL, and Cassandra), and this library
|
||||
provides an interface that can manipulate leases in a unified, safe way.
|
||||
backends (memfile, MySQL and PostgreSQL), and this library provides an
|
||||
interface that can manipulate leases in a unified, safe way.
|
||||
In particular, it allows things that were previously impossible: lease
|
||||
manipulation in memfile while Kea is running, sanity check changes,
|
||||
lease existence checks, and removal of all leases belonging to a
|
||||
@@ -698,9 +698,7 @@ brevity.
|
||||
|
||||
Generally, the returned list is not sorted in any particular order. Some
|
||||
lease database backends may sort leases in ascending order of addresses,
|
||||
but the controlling client must not rely on this behavior. In cases of
|
||||
highly distributed databases, such as Cassandra (now deprecated), ordering may be
|
||||
inefficient or even impossible.
|
||||
but the controlling client must not rely on this behavior.
|
||||
|
||||
The ``count`` parameter contains the number of returned leases on the
|
||||
page.
|
||||
|
@@ -261,8 +261,6 @@ the following:
|
||||
PostgreSQL:
|
||||
no
|
||||
|
||||
Cassandra CQL:
|
||||
no
|
||||
Google Test:
|
||||
no
|
||||
Google Benchmark:
|
||||
|
@@ -357,20 +357,19 @@ loaded by the correct process per the table below.
|
||||
| | |this library do not affect other subnets or configuration |
|
||||
| | |parameters currently used by the server. |
|
||||
+-----------------+---------------+------------------------------------------------------------+
|
||||
| Lease Commands | Kea open |This hook library offers a number of |
|
||||
| | source |commands used to manage leases. Kea can store |
|
||||
| | |lease information in various backends: memfile, MySQL, |
|
||||
| | |PostgreSQL, and Cassandra. This library provides a unified |
|
||||
| | |interface to manipulate leases in an unified, safe |
|
||||
| Lease Commands | Kea open |This hook library offers a number of commands used to |
|
||||
| | |manage leases. Kea can store lease information in various |
|
||||
| | |backends: memfile, MySQL, PostgreSQL. This library provides |
|
||||
| | |a unified interface to manipulate leases in an unified, safe|
|
||||
| | |way. In particular, it allows manipulation of memfile leases|
|
||||
| | |while Kea is running, sanity check changes, lease |
|
||||
| | |existence checks, and removal of all leases belonging to a |
|
||||
| | |specific subnet. It can also catch obscure errors, like |
|
||||
| | |the addition of a lease with subnet-id that does not exist |
|
||||
| | |in the configuration, or configuration of a lease to use an |
|
||||
| | |address that is outside of the subnet to which it is |
|
||||
| | |supposed to belong. This library allows easy management of |
|
||||
| | |user contexts associated with leases. |
|
||||
| | |while Kea is running, sanity check changes, lease existence |
|
||||
| | |checks, and removal of all leases belonging to a specific |
|
||||
| | |subnet. It can also catch obscure errors, like the addition |
|
||||
| | |of a lease with subnet-id that does not exist in the |
|
||||
| | |configuration, or configuration of a lease to use an address|
|
||||
| | |that is outside of the subnet to which it is supposed to |
|
||||
| | |belong. This library allows easy management of user contexts|
|
||||
| | |associated with leases. |
|
||||
+-----------------+---------------+------------------------------------------------------------+
|
||||
| High | Kea open |The risk of DHCP service unavailability can be minimized |
|
||||
| Availability | source |by setting up a pair of DHCP servers in a network. Two |
|
||||
@@ -1528,33 +1527,33 @@ Database Backend
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
Log entries can be inserted into a database when Kea is configured with
|
||||
database backend support. Kea uses a table named ``logs``, that includes a timestamp
|
||||
(timeuuid for Cassandra) generated by the database software, and a
|
||||
text log with the same format as files without the timestamp.
|
||||
database backend support. Kea uses a table named ``logs``, that includes a
|
||||
timestamp generated by the database software, and a text log with the same
|
||||
format as files without the timestamp.
|
||||
|
||||
Please refer to :ref:`mysql-database` for information on using a MySQL database;
|
||||
to :ref:`pgsql-database` for PostgreSQL database information; or to
|
||||
:ref:`cql-database` for information on using a Cassandra (CQL) database. The
|
||||
``logs`` table is part of the Kea database schemas.
|
||||
or to :ref:`pgsql-database` for PostgreSQL database information. The ``logs``
|
||||
table is part of the Kea database schemas.
|
||||
|
||||
Configuration parameters are extended by standard lease database
|
||||
parameters as defined in :ref:`database-configuration4`. The ``type``
|
||||
parameter should be ``mysql``, ``postgresql``, ``cql``, or ``logfile``; when
|
||||
parameter should be ``mysql``, ``postgresql``, or ``logfile``; when
|
||||
it is absent or set to ``logfile``, files are used.
|
||||
|
||||
This database feature is experimental. No specific tools are provided
|
||||
to operate the database, but standard tools may be used, for example,
|
||||
to dump the logs table from a CQL database:
|
||||
to dump the logs table from a MYSQL database:
|
||||
|
||||
::
|
||||
|
||||
$ echo 'SELECT dateOf(timeuuid), log FROM logs;' | cqlsh -k database-name
|
||||
|
||||
system.dateof(timeuuid) | log
|
||||
---------------------------------+---------------------------------------
|
||||
2018-01-06 01:02:03.227000+0000 | Address: 192.2.1.100 has been renewed ...
|
||||
...
|
||||
(12 rows)
|
||||
$ mysql --user keatest --password keatest -e "select * from logs;"
|
||||
+---------------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+----+
|
||||
| timestamp | address | log | id |
|
||||
+---------------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+----+
|
||||
| 2022-03-30 17:38:41 | 192.168.50.1 | Address: 192.168.50.1 has been assigned for 0 hrs 10 mins 0 secs to a device with hardware address: hwtype=1 ff:01:02:03:ff:04, client-id: 00:01:02:03:04:05:06 | 31 |
|
||||
| 2022-03-30 17:38:43 | 192.168.50.1 | Address: 192.168.50.1 has been assigned for 0 hrs 10 mins 0 secs to a device with hardware address: hwtype=1 ff:01:02:03:ff:04, client-id: 00:01:02:03:04:05:06 | 32 |
|
||||
| 2022-03-30 17:38:45 | 192.168.50.1 | Address: 192.168.50.1 has been assigned for 0 hrs 10 mins 0 secs to a device with hardware address: hwtype=1 ff:01:02:03:ff:04, client-id: 00:01:02:03:04:05:06 | 33 |
|
||||
+---------------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+----+
|
||||
|
||||
Like all the other database-centric features, forensic logging supports database
|
||||
connection recovery, which can be enabled by setting the ``on-fail`` parameter.
|
||||
@@ -2437,11 +2436,6 @@ users retrieve larger host reservations lists in smaller chunks. For
|
||||
small deployments with few reservations, it is easier to use
|
||||
``reservation-get-all`` (see :ref:`command-reservation-get-all`).
|
||||
|
||||
.. note::
|
||||
|
||||
``reservation-get-page`` is not supported by the Cassandra
|
||||
host backend.
|
||||
|
||||
.. _command-reservation-get-by-hostname:
|
||||
|
||||
The ``reservation-get-by-hostname`` Command
|
||||
|
@@ -95,12 +95,6 @@ the system:
|
||||
or on a machine reachable over a network is required. Note that running
|
||||
the unit tests requires a local PostgreSQL server.
|
||||
|
||||
- The cpp-driver from DataStax is needed when using the ``--with-cql``
|
||||
configuration flag to build Kea with the Cassandra database backend.
|
||||
In this case, an instance of the Cassandra server running locally
|
||||
or on a machine reachable over a network is required. Note that running
|
||||
the unit tests requires a local Cassandra server.
|
||||
|
||||
- The FreeRADIUS client library is required to connect to a RADIUS server.
|
||||
This is specified using the ``--with-freeradius`` configuration switch.
|
||||
|
||||
@@ -212,10 +206,6 @@ options. Some commonly used options are:
|
||||
Build Kea with code to allow it to store leases and host reservations
|
||||
in a PostgreSQL database.
|
||||
|
||||
- ``--with-cql``
|
||||
Build Kea with code to allow it to store leases and host reservations
|
||||
in a Cassandra (CQL) database. Support for Cassandra is now deprecated.
|
||||
|
||||
- ``--with-log4cplus``
|
||||
Define the path to find the Log4cplus headers and libraries. Normally
|
||||
this is not necessary.
|
||||
@@ -406,14 +396,12 @@ DHCP Database Installation and Configuration
|
||||
Kea stores its leases in a lease database. The software has been written
|
||||
in a way that makes it possible to choose which database product should
|
||||
be used to store the lease information. Kea supports four
|
||||
database backends: MySQL, PostgreSQL, Cassandra[1], and memfile. To limit
|
||||
external dependencies, MySQL, PostgreSQL, and Cassandra support are
|
||||
disabled by default and only memfile is available. Support for the
|
||||
optional external database backend must be explicitly included when Kea
|
||||
is built. This section covers the building of Kea with one of the
|
||||
optional backends and the creation of the lease database.
|
||||
|
||||
[1] As of Kea 1.9.9, support for Cassandra is deprecated.
|
||||
database backends: MySQL, PostgreSQL and memfile. To limit external
|
||||
dependencies, MySQL and PostgreSQL support are disabled by default and only
|
||||
memfile is available. Support for the optional external database backend must
|
||||
be explicitly included when Kea is built.
|
||||
This section covers the building of Kea with one of the optional backends and
|
||||
the creation of the lease database.
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -476,63 +464,6 @@ the switch:
|
||||
See :ref:`pgsql-database-create` for details regarding PostgreSQL
|
||||
database configuration.
|
||||
|
||||
Building with CQL (Cassandra) Support
|
||||
-------------------------------------
|
||||
|
||||
As of Kea 1.9.9, support for Cassandra is deprecated. It is still
|
||||
available in current versions, but the support will be removed in a future
|
||||
version; new users are encouraged to choose an alternative.
|
||||
|
||||
Install Cassandra according to the instructions for the system. The
|
||||
Cassandra project website contains useful pointers:
|
||||
https://cassandra.apache.org.
|
||||
|
||||
If a cpp-driver package is available as binary or as source,
|
||||
simply install or build and install the package. Then build and install
|
||||
Kea as described in :ref:`installation`. To enable the
|
||||
Cassandra (CQL) database code, at the "configure" step (see :ref:`configure`), enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ ./configure [other-options] --with-cql=path-to-pkg-config
|
||||
|
||||
If ``pkg-config`` is at its standard location (and thus in the
|
||||
shell path), the path does not need to be specified. If it does not work
|
||||
(e.g. no pkg-config, package not available in pkg-config with the
|
||||
cassandra name), the ``cql_config`` script in the tools/ directory
|
||||
can still be used as described below.
|
||||
|
||||
Download and compile cpp-driver from DataStax. For details regarding
|
||||
dependencies for building cpp-driver, see the project homepage
|
||||
https://github.com/datastax/cpp-driver.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ git clone https://github.com/datastax/cpp-driver.git
|
||||
$ cd cpp-driver
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake ..
|
||||
$ make
|
||||
|
||||
Kea's cpp-driver does not include the cql_config script. A
|
||||
cql_config script is present in the tools/ directory of the Kea sources.
|
||||
Before using it, please create a cql_config_defines.sh file in the same
|
||||
directory (there is an example available in cql_config_define.sh.sample;
|
||||
copy it over to cql_config_defines.sh and edit the path
|
||||
specified in it) and change the environment variable CPP_DRIVER_PATH to
|
||||
point to the directory where the cpp-driver sources are located. Make
|
||||
sure that appropriate access rights are set on this file; it should be
|
||||
executable by the system user building Kea.
|
||||
|
||||
Build and install Kea as described in :ref:`installation`,
|
||||
with the following modification. To enable the Cassandra (CQL) database
|
||||
code, at the "configure" step (see :ref:`configure`), enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ ./configure [other-options] --with-cql=path-to-cql_config
|
||||
|
||||
|
||||
|
||||
.. include:: hammer.rst
|
||||
@@ -633,21 +564,6 @@ This section lists significant features that have been or will be removed. We tr
|
||||
deprecate features before removing them to signal
|
||||
to current users to plan a migration. New users should not rely on deprecated features.
|
||||
|
||||
Cassandra (CQL) Support
|
||||
-----------------------
|
||||
|
||||
Cassandra is a non-relational NoSQL database. This feature never gained much
|
||||
traction with users, particularly compared to the level of interest in and deployments of
|
||||
the alternatives, MySQL and PostgreSQL.
|
||||
|
||||
The non-relational nature of Cassandra makes it exceedingly difficult to implement more complex
|
||||
DHCP features, such as the configuration backend. Cassandra also introduces performance degradation,
|
||||
is complicated to set up, and is an ongoing maintenance burden.
|
||||
|
||||
Cassandra support is deprecated as of Kea 1.9.9. The feature will
|
||||
function as before in the Kea 2.0.x and 2.1.x series, but will print a warning. The
|
||||
feature will be removed entirely in a future release.
|
||||
|
||||
Sysrepo 0.x
|
||||
-----------
|
||||
|
||||
|
@@ -211,8 +211,7 @@ libraries), or hook libraries (open source or premium).
|
||||
| ``kea-dhcp4.database``, | core | Used to log messages |
|
||||
| ``kea-dhcp6.database`` | | relating to general |
|
||||
| | | operations on the |
|
||||
| | | relational databases |
|
||||
| | | and Cassandra. |
|
||||
| | | relational databases. |
|
||||
+----------------------------------+------------------------+--------------------------------+
|
||||
| ``kea-dhcp4.ddns``, | core | Used by the DHCP |
|
||||
| ``kea-dhcp6.ddns`` | | server to log |
|
||||
|
@@ -200,9 +200,9 @@ Securing Database Connections
|
||||
-----------------------------
|
||||
|
||||
Kea can use an external MySQL or PostgreSQL database to store configuration,
|
||||
host reservations, or leases, or for forensic logging. (Support for Cassandra is deprecated.) The use
|
||||
of databases is a popular feature, but it
|
||||
is optional; it is also possible to store data in a flat file on disk.
|
||||
host reservations, or leases, or for forensic logging. The use of databases is a
|
||||
popular feature, but it is optional; it is also possible to store data in a flat
|
||||
file on disk.
|
||||
|
||||
When using a database, Kea stores and uses the following credentials to authenticate with the database:
|
||||
username, password, host, port, and database name. **These are stored in clear text
|
||||
@@ -211,11 +211,6 @@ in the configuration file.**
|
||||
Depending on the database configuration, it is also possible to verify whether the system user matches the
|
||||
database username. Consult the MySQL or PostgreSQL manual for details.
|
||||
|
||||
Kea does not currently support SSL/TLS connection to databases. There is a community-contributed patch
|
||||
available for `SSL support for MySQL <https://github.com/isc-projects/kea/pull/15>`_ and
|
||||
`SSL support for Cassandra <https://github.com/isc-projects/kea/pull/118>`_. If the communication
|
||||
channel to the database is a concern, the database can be run locally on the Kea server.
|
||||
|
||||
Information Leakage Through Logging
|
||||
-----------------------------------
|
||||
|
||||
|
@@ -291,16 +291,9 @@ This grammar is generated from ``dhcp4_parser.yy``. See :ref:`dhcp4` for more de
|
||||
| lfc_interval
|
||||
| readonly
|
||||
| connect_timeout
|
||||
| contact_points
|
||||
| max_reconnect_tries
|
||||
| reconnect_wait_time
|
||||
| on_fail
|
||||
| request_timeout
|
||||
| tcp_keepalive
|
||||
| tcp_nodelay
|
||||
| keyspace
|
||||
| consistency
|
||||
| serial_consistency
|
||||
| max_row_errors
|
||||
| trust_anchor
|
||||
| cert_file
|
||||
@@ -313,7 +306,6 @@ This grammar is generated from ``dhcp4_parser.yy``. See :ref:`dhcp4` for more de
|
||||
db_type ::= "memfile"
|
||||
| "mysql"
|
||||
| "postgresql"
|
||||
| "cql"
|
||||
|
||||
user ::= "user" ":" STRING
|
||||
|
||||
@@ -333,20 +325,6 @@ This grammar is generated from ``dhcp4_parser.yy``. See :ref:`dhcp4` for more de
|
||||
|
||||
connect_timeout ::= "connect-timeout" ":" INTEGER
|
||||
|
||||
request_timeout ::= "request-timeout" ":" INTEGER
|
||||
|
||||
tcp_keepalive ::= "tcp-keepalive" ":" INTEGER
|
||||
|
||||
tcp_nodelay ::= "tcp-nodelay" ":" BOOLEAN
|
||||
|
||||
contact_points ::= "contact-points" ":" STRING
|
||||
|
||||
keyspace ::= "keyspace" ":" STRING
|
||||
|
||||
consistency ::= "consistency" ":" STRING
|
||||
|
||||
serial_consistency ::= "serial-consistency" ":" STRING
|
||||
|
||||
max_reconnect_tries ::= "max-reconnect-tries" ":" INTEGER
|
||||
|
||||
reconnect_wait_time ::= "reconnect-wait-time" ":" INTEGER
|
||||
|
@@ -274,16 +274,9 @@ This grammar is generated from ``dhcp6_parser.yy``. See :ref:`dhcp6` for more de
|
||||
| lfc_interval
|
||||
| readonly
|
||||
| connect_timeout
|
||||
| contact_points
|
||||
| max_reconnect_tries
|
||||
| reconnect_wait_time
|
||||
| on_fail
|
||||
| request_timeout
|
||||
| tcp_keepalive
|
||||
| tcp_nodelay
|
||||
| keyspace
|
||||
| consistency
|
||||
| serial_consistency
|
||||
| max_row_errors
|
||||
| trust_anchor
|
||||
| cert_file
|
||||
@@ -296,7 +289,6 @@ This grammar is generated from ``dhcp6_parser.yy``. See :ref:`dhcp6` for more de
|
||||
db_type ::= "memfile"
|
||||
| "mysql"
|
||||
| "postgresql"
|
||||
| "cql"
|
||||
|
||||
user ::= "user" ":" STRING
|
||||
|
||||
@@ -326,22 +318,8 @@ This grammar is generated from ``dhcp6_parser.yy``. See :ref:`dhcp6` for more de
|
||||
|
||||
max_row_errors ::= "max-row-errors" ":" INTEGER
|
||||
|
||||
request_timeout ::= "request-timeout" ":" INTEGER
|
||||
|
||||
tcp_keepalive ::= "tcp-keepalive" ":" INTEGER
|
||||
|
||||
tcp_nodelay ::= "tcp-nodelay" ":" BOOLEAN
|
||||
|
||||
contact_points ::= "contact-points" ":" STRING
|
||||
|
||||
max_reconnect_tries ::= "max-reconnect-tries" ":" INTEGER
|
||||
|
||||
keyspace ::= "keyspace" ":" STRING
|
||||
|
||||
consistency ::= "consistency" ":" STRING
|
||||
|
||||
serial_consistency ::= "serial-consistency" ":" STRING
|
||||
|
||||
trust_anchor ::= "trust-anchor" ":" STRING
|
||||
|
||||
cert_file ::= "cert-file" ":" STRING
|
||||
|
@@ -107,11 +107,6 @@ Some optional features of Kea have additional dependencies.
|
||||
requires PostgreSQL headers and libraries. This is an optional
|
||||
dependency; Kea can be built without PostgreSQL support.
|
||||
|
||||
- To store lease information in a Cassandra database (CQL),
|
||||
Kea requires Cassandra headers and libraries. This is an optional
|
||||
dependency; Kea can be built without Cassandra support. (Cassandra
|
||||
support is deprecated.)
|
||||
|
||||
- Integration with RADIUS is provided in Kea via the hook library
|
||||
available to ISC's paid support customers. Use of this library requires
|
||||
the FreeRADIUS-client library to be present on the system where Kea
|
||||
|
@@ -191,66 +191,6 @@ checked_pgsql_version() {
|
||||
return "${EXIT_CODE}"
|
||||
}
|
||||
|
||||
cql_execute() {
|
||||
query=$1
|
||||
shift
|
||||
|
||||
if test -n "${db_port+x}"; then
|
||||
export CQLSH_PORT="${db_port}"
|
||||
fi
|
||||
|
||||
if [ $# -gt 1 ]; then
|
||||
run_command \
|
||||
cqlsh "$@" -e "$query"
|
||||
else
|
||||
run_command \
|
||||
cqlsh -u "${db_user}" -p "${db_password}" -k "${db_name}" \
|
||||
${extra_arguments} -e "${query}"
|
||||
fi
|
||||
|
||||
if [ "${EXIT_CODE}" -ne 0 ]; then
|
||||
printf "cqlsh returned with exit status %s\n" "${EXIT_CODE}"
|
||||
fi
|
||||
|
||||
printf '%s\n' "${OUTPUT}"
|
||||
return "${EXIT_CODE}"
|
||||
}
|
||||
|
||||
cql_execute_script() {
|
||||
file=$1
|
||||
shift
|
||||
|
||||
if test -n "${db_port+x}"; then
|
||||
export CQLSH_PORT="${db_port}"
|
||||
fi
|
||||
|
||||
if [ $# -gt 1 ]; then
|
||||
run_command \
|
||||
cqlsh "$@" -e "$file"
|
||||
else
|
||||
run_command \
|
||||
cqlsh -u "${db_user}" -p "${db_password}" -k "${db_name}" \
|
||||
${extra_arguments} -f "${file}"
|
||||
fi
|
||||
|
||||
if [ "${EXIT_CODE}" -ne 0 ]; then
|
||||
printf "cqlsh returned with exit status %s\n" "${EXIT_CODE}"
|
||||
fi
|
||||
|
||||
printf '%s\n' "${OUTPUT}"
|
||||
return "${EXIT_CODE}"
|
||||
}
|
||||
|
||||
cql_version() {
|
||||
run_command \
|
||||
cql_execute "SELECT version, minor FROM schema_version" "$@"
|
||||
version="${OUTPUT}"
|
||||
select_exit_code="${EXIT_CODE}"
|
||||
version=$(echo "$version" | grep -A 1 "+" | grep -v "+" | tr -d ' ' | cut -d "|" -f 1-2 | tr "|" ".")
|
||||
echo "$version"
|
||||
return "${select_exit_code}"
|
||||
}
|
||||
|
||||
# recount IPv4 leases from scratch
|
||||
_RECOUNT4_QUERY=\
|
||||
"
|
||||
|
@@ -72,7 +72,7 @@ COMMAND: Currently supported operations are:
|
||||
- lease-upload: Uploads leases from a CSV file to the database.
|
||||
- stats-recount: Recounts lease statistics.
|
||||
|
||||
BACKEND - one of the supported backends: memfile|mysql|pgsql|cql
|
||||
BACKEND - one of the supported backends: memfile|mysql|pgsql
|
||||
|
||||
PARAMETERS: Parameters are optional in general, but may be required
|
||||
for specific operations.
|
||||
@@ -307,30 +307,6 @@ pgsql_init() {
|
||||
exit 0
|
||||
}
|
||||
|
||||
cql_init() {
|
||||
printf 'Checking if there is a database initialized already...\n'
|
||||
|
||||
run_command \
|
||||
cql_execute "DESCRIBE tables;"
|
||||
|
||||
# Shellcheck complaints about missing quotes and word splitting here. There
|
||||
# is no problem here as wc -w always returns a single number.
|
||||
# shellcheck disable=SC2046
|
||||
if test "$(printf '%s' "${OUTPUT}" | grep -c '<empty>')" -gt 0; then
|
||||
printf 'Creating and initializing tables using script %s...\n' "${scripts_dir}/cql/dhcpdb_create.cql"
|
||||
cql_execute_script "${scripts_dir}/cql/dhcpdb_create.cql"
|
||||
else
|
||||
log_error "Expected empty database ${db_name}. Aborting, the following tables are present:
|
||||
${OUTPUT}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
version=$(cql_version)
|
||||
printf "Database version reported after initialization: %s\n" "$version"
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
### Functions that implement database version checking commands
|
||||
memfile_version() {
|
||||
# @todo Implement this?
|
||||
@@ -421,41 +397,6 @@ pgsql_upgrade() {
|
||||
exit 0
|
||||
}
|
||||
|
||||
cql_upgrade() {
|
||||
version=$(cql_version)
|
||||
printf "Database version reported before upgrade: %s\n" "$version"
|
||||
|
||||
# Check if the scripts directory exists at all.
|
||||
if [ ! -d ${scripts_dir}/cql ]; then
|
||||
log_error "Invalid scripts directory: ${scripts_dir}/cql"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if directory is readable.
|
||||
if [ ! -r ${scripts_dir}/cql ]; then
|
||||
log_error "Directory is not readable: ${scripts_dir}/cql"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if there are upgrade scripts.
|
||||
run_command \
|
||||
find "${scripts_dir}/cql" -name 'upgrade*.sh' -type f
|
||||
if [ "${EXIT_CODE}" -eq 0 ]; then # Upgrade scripts are present.
|
||||
for script in "${scripts_dir}"/cql/upgrade*.sh
|
||||
do
|
||||
echo "Processing $script file..."
|
||||
"${script}" -u "${db_user}" -p "${db_password}" \
|
||||
-k "${db_name}" ${extra_arguments}
|
||||
done
|
||||
else
|
||||
echo "No upgrade script available."
|
||||
fi
|
||||
|
||||
version=$(cql_version)
|
||||
printf "Database version reported after upgrade: %s\n" "$version"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Utility function which tests if the given file exists and
|
||||
# if so notifies the user and provides them the opportunity
|
||||
# to abort the current command.
|
||||
@@ -606,48 +547,6 @@ pgsql_dump() {
|
||||
exit 0
|
||||
}
|
||||
|
||||
cql_dump() {
|
||||
# Get the query appropriate to lease version. Explicitly specify all columns
|
||||
# so that they are returned in expected order.
|
||||
if [ ${dhcp_version} -eq 4 ]; then
|
||||
dump_query="SELECT address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context FROM lease4"
|
||||
elif [ ${dhcp_version} -eq 6 ]; then
|
||||
dump_query="SELECT address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,hwtype,hwaddr_source,state,user_context FROM lease6"
|
||||
else
|
||||
log_error "lease-dump: lease type ( -4 or -6 ) needs to be specified"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if file was specified.
|
||||
if [ "$dump_file" = "" ]; then
|
||||
log_error "lease-dump: output file needs to be specified with -o"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If output file exists, notify user, allow them a chance to bail.
|
||||
check_file_overwrite "$dump_file"
|
||||
|
||||
# Run query, check for failure.
|
||||
run_command \
|
||||
cql_execute "${dump_query}"
|
||||
if [ "${EXIT_CODE}" -ne 0 ]; then
|
||||
log_error "lease-dump: cql_execute failed, exit code ${EXIT_CODE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Parse and display header.
|
||||
echo "${OUTPUT}" | head -n 2 | tail -n 1 | sed -e 's/[[:space:]]*//g' | sed -e 's/|/,/g' > "$dump_file"
|
||||
|
||||
# Parse and display contents - done separately from header to allow sorting
|
||||
# by address. awk script replaces head -n -2 which is not portable.
|
||||
echo "${OUTPUT}" | tail -n +4 | awk 'n>=2 { print a[n%2] } { a[n%2]=$0; n=n+1 }' | sed -e 's/[[:space:]]*//g' | sed -e 's/|/,/g' | sort -r >> "$dump_file"
|
||||
|
||||
echo "lease${dhcp_version} successfully dumped to ${dump_file}"
|
||||
exit 0
|
||||
}
|
||||
|
||||
######################## functions used in lease-upload ########################
|
||||
|
||||
# Finds the position of a column by name, starting with 1.
|
||||
@@ -863,7 +762,7 @@ if [ -z "${backend}" ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
is_in_list "${backend}" "memfile mysql pgsql cql"
|
||||
is_in_list "${backend}" "memfile mysql pgsql"
|
||||
if [ "${_inlist}" -eq 0 ]; then
|
||||
log_error "invalid backend: ${backend}"
|
||||
exit 1
|
||||
@@ -1024,9 +923,6 @@ case ${command} in
|
||||
pgsql)
|
||||
pgsql_init
|
||||
;;
|
||||
cql)
|
||||
cql_init
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
db-version)
|
||||
@@ -1041,9 +937,6 @@ case ${command} in
|
||||
pgsql)
|
||||
checked_pgsql_version
|
||||
;;
|
||||
cql)
|
||||
cql_version
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
db-upgrade)
|
||||
@@ -1057,9 +950,6 @@ case ${command} in
|
||||
pgsql)
|
||||
pgsql_upgrade
|
||||
;;
|
||||
cql)
|
||||
cql_upgrade
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
lease-dump)
|
||||
@@ -1073,9 +963,6 @@ case ${command} in
|
||||
pgsql)
|
||||
pgsql_dump
|
||||
;;
|
||||
cql)
|
||||
cql_dump
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
lease-upload)
|
||||
@@ -1090,10 +977,6 @@ case ${command} in
|
||||
pgsql)
|
||||
lease_upload
|
||||
;;
|
||||
cql)
|
||||
log_error 'lease-export cql is deprecated'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
stats-recount)
|
||||
@@ -1107,9 +990,6 @@ case ${command} in
|
||||
pgsql)
|
||||
pgsql_recount
|
||||
;;
|
||||
cql)
|
||||
log_info "cql does not keep lease statistics"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
1
src/bin/admin/tests/.gitignore
vendored
1
src/bin/admin/tests/.gitignore
vendored
@@ -2,4 +2,3 @@
|
||||
/memfile_tests.sh
|
||||
/mysql_tests.sh
|
||||
/pgsql_tests.sh
|
||||
/cql_tests.sh
|
||||
|
@@ -4,7 +4,6 @@ SUBDIRS = data .
|
||||
EXTRA_DIST =
|
||||
EXTRA_DIST += dhcpdb_create_1.0.mysql
|
||||
EXTRA_DIST += dhcpdb_create_1.0.pgsql
|
||||
EXTRA_DIST += dhcpdb_create_1.0.cql
|
||||
|
||||
# Shell tests
|
||||
SHTESTS =
|
||||
@@ -16,9 +15,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
SHTESTS += pgsql_tests.sh
|
||||
endif
|
||||
if HAVE_CQL
|
||||
SHTESTS += cql_tests.sh
|
||||
endif
|
||||
|
||||
# Run tests on "make check".
|
||||
check_SCRIPTS = $(SHTESTS)
|
||||
|
@@ -1,507 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2014-2021 Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
# SC1091: Not following: ... was not specified as input (see shellcheck -x).
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
# SC2154: ... is referenced but not assigned.
|
||||
# Reason: some variables are sourced.
|
||||
|
||||
# Exit with error if commands exit with non-zero and if undefined variables are
|
||||
# used.
|
||||
set -eu
|
||||
|
||||
# Include common test library.
|
||||
. "@abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh"
|
||||
|
||||
# Include admin utilities
|
||||
. "@abs_top_srcdir@/src/bin/admin/admin-utils.sh"
|
||||
|
||||
# Set path to the production schema scripts
|
||||
db_scripts_dir="@abs_top_srcdir@/src/share/database/scripts"
|
||||
|
||||
# Set location of the kea-admin.
|
||||
kea_admin="@abs_top_builddir@/src/bin/admin/kea-admin"
|
||||
|
||||
cql_wipe() {
|
||||
# Wipe the database.
|
||||
run_command \
|
||||
cql_execute_script $db_scripts_dir/cql/dhcpdb_drop.cql
|
||||
assert_eq 0 "${EXIT_CODE}" "drop table query failed, expected %d, returned %d"
|
||||
}
|
||||
|
||||
cql_db_init_test() {
|
||||
test_start "cql.init"
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
# Create the database
|
||||
run_command \
|
||||
"${kea_admin}" db-init cql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
|
||||
assert_eq 0 "${EXIT_CODE}" "kea-admin db-init cql failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Verify that all the expected tables exist
|
||||
|
||||
# Check schema_version table
|
||||
run_command \
|
||||
cql_execute "SELECT version, minor FROM schema_version;"
|
||||
assert_eq 0 "${EXIT_CODE}" "schema_version table check failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Check lease4 table
|
||||
run_command \
|
||||
cql_execute "SELECT address, hwaddr, client_id, valid_lifetime, expire, subnet_id, fqdn_fwd, fqdn_rev, hostname, state, user_context FROM lease4;"
|
||||
assert_eq 0 "${EXIT_CODE}" "lease4 table check failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Check lease6 table
|
||||
run_command \
|
||||
cql_execute "SELECT address, duid, valid_lifetime, expire, subnet_id, pref_lifetime, lease_type, iaid, prefix_len, fqdn_fwd, fqdn_rev, hostname, state, user_context FROM lease6;"
|
||||
assert_eq 0 "${EXIT_CODE}" "lease6 table check failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Check lease6_types table
|
||||
run_command \
|
||||
cql_execute "SELECT lease_type, name FROM lease6_types;"
|
||||
assert_eq 0 "${EXIT_CODE}" "lease6_types table check failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Check lease_state table
|
||||
run_command \
|
||||
cql_execute "SELECT state, name FROM lease_state;"
|
||||
assert_eq 0 "${EXIT_CODE}" "lease_state table check failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Trying to create it again should fail. This verifies the db present
|
||||
# check
|
||||
echo "Making sure keyspace creation fails the second time..."
|
||||
run_command \
|
||||
"${kea_admin}" db-init cql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
|
||||
assert_eq 2 "${EXIT_CODE}" "kea-admin failed to deny db-init, expected exit code: %d, actual: %d"
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
test_finish 0
|
||||
}
|
||||
|
||||
cql_db_version_test() {
|
||||
test_start "cql.version"
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
# Create the database.
|
||||
run_command \
|
||||
"${kea_admin}" db-init cql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
|
||||
assert_eq 0 "${EXIT_CODE}" "kea-admin db-init cql failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Verify that kea-admin db-version returns the correct version.
|
||||
version=$("${kea_admin}" db-version cql -u "${db_user}" -p "${db_password}" -n "${db_name}")
|
||||
assert_str_eq "5.0" "${version}" "Expected kea-admin to return %s, returned value was %s"
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
test_finish 0
|
||||
}
|
||||
|
||||
cql_upgrade_test() {
|
||||
test_start "cql.upgrade"
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
# Initialize database to schema 1.0.
|
||||
run_command \
|
||||
cql_execute_script "@abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.cql"
|
||||
assert_eq 0 "${EXIT_CODE}" "cannot initialize the database, expected exit code: %d, actual: %d"
|
||||
|
||||
run_command \
|
||||
"${kea_admin}" db-upgrade cql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
|
||||
assert_eq 0 "${EXIT_CODE}" "db-upgrade failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
test_finish 0
|
||||
}
|
||||
|
||||
cql_lease4_dump_test() {
|
||||
test_start "cql.lease4_dump_test"
|
||||
|
||||
test_dir="@abs_top_srcdir@/src/bin/admin/tests"
|
||||
output_dir="@abs_top_builddir@/src/bin/admin/tests"
|
||||
|
||||
output_file="$output_dir/data/cql.lease4_dump_test.output.csv"
|
||||
sorted_file="$output_dir/data/cql.lease4_dump_test.output.sorted.csv"
|
||||
ref_file="$test_dir/data/cql.lease4_dump_test.reference.csv"
|
||||
|
||||
# Wipe out any residuals from prior failed runs.
|
||||
if [ -e $output_file ]
|
||||
then
|
||||
rm $output_file
|
||||
fi
|
||||
|
||||
if [ -e $sorted_file ]
|
||||
then
|
||||
rm $sorted_file
|
||||
fi
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
# Create the database
|
||||
run_command \
|
||||
"${kea_admin}" db-init cql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
|
||||
assert_eq 0 "${EXIT_CODE}" "kea-admin db-init cql failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Insert the reference record.
|
||||
# -1073741302 corresponds to 192.0.2.10
|
||||
# -1073741301 corresponds to 192.0.2.11
|
||||
# -1073741300 corresponds to 192.0.2.12
|
||||
# 1430694930 corresponds to 2015-04-04 01:15:30
|
||||
# 1433464245 corresponds to 2015-05-05 02:30:45
|
||||
# 1436173267 corresponds to 2015-06-06 11:01:07
|
||||
insert_cql="\
|
||||
INSERT INTO lease4 (address, hwaddr, client_id, valid_lifetime, expire, subnet_id, \
|
||||
fqdn_fwd, fqdn_rev, hostname, state, user_context) \
|
||||
VALUES (-1073741302,textAsBlob('20'),textAsBlob('30'),40,1430694930,50,true,true,'one.example.com', 0, '');\
|
||||
INSERT INTO lease4 (address, hwaddr, client_id, valid_lifetime, expire, subnet_id, \
|
||||
fqdn_fwd, fqdn_rev, hostname, state, user_context) \
|
||||
VALUES (-1073741301,NULL,textAsBlob('123'),40,1433464245,50,true,true,'', 1, '');\
|
||||
INSERT INTO lease4 (address, hwaddr, client_id, valid_lifetime, expire, subnet_id, \
|
||||
fqdn_fwd, fqdn_rev, hostname, state, user_context) \
|
||||
VALUES (-1073741300,textAsBlob('22'),NULL,40,1436173267,50,true,true,'three.example.com', 2, '');"
|
||||
|
||||
run_command \
|
||||
cql_execute "$insert_cql"
|
||||
assert_eq 0 "${EXIT_CODE}" "insert into lease4 failed, expected exit code %d, actual %d"
|
||||
|
||||
# Dump lease4 to output_file.
|
||||
run_command \
|
||||
"${kea_admin}" lease-dump cql -4 -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" -o $output_file
|
||||
assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -4 failed, expected exit code %d, actual %d"
|
||||
|
||||
# sort data so we can compare
|
||||
sort -g "${output_file}" > "${sorted_file}"
|
||||
|
||||
# Compare the dump output to reference file, they should be identical.
|
||||
run_command \
|
||||
cmp -s $sorted_file $ref_file
|
||||
assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d"
|
||||
|
||||
# remove the output file.
|
||||
rm $output_file
|
||||
|
||||
# remove the sorted file.
|
||||
rm $sorted_file
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
test_finish 0
|
||||
}
|
||||
|
||||
cql_lease6_dump_test() {
|
||||
test_start "cql.lease6_dump_test"
|
||||
|
||||
test_dir="@abs_top_srcdir@/src/bin/admin/tests"
|
||||
output_dir="@abs_top_builddir@/src/bin/admin/tests"
|
||||
|
||||
output_file="$output_dir/data/cql.lease6_dump_test.output.csv"
|
||||
sorted_file="$output_dir/data/cql.lease6_dump_test.output.sorted.csv"
|
||||
ref_file="$test_dir/data/cql.lease6_dump_test.reference.csv"
|
||||
|
||||
# Wipe out any residuals from prior failed runs.
|
||||
if [ -e $output_file ]
|
||||
then
|
||||
rm $output_file
|
||||
fi
|
||||
|
||||
if [ -e $sorted_file ]
|
||||
then
|
||||
rm $sorted_file
|
||||
fi
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
# Create the database.
|
||||
run_command \
|
||||
"${kea_admin}" db-init cql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
|
||||
assert_eq 0 "${EXIT_CODE}" "could not create database, expected exit code %d, actual %d"
|
||||
|
||||
# Insert the reference record.
|
||||
# 1430694930 corresponds to 2015-04-04 01:15:30
|
||||
# 1433464245 corresponds to 2015-05-05 02:30:45
|
||||
# 1436173267 corresponds to 2015-06-06 11:01:07
|
||||
insert_cql="\
|
||||
INSERT INTO lease6 (address, duid, valid_lifetime, expire, subnet_id, \
|
||||
pref_lifetime, lease_type, iaid, prefix_len, fqdn_fwd, fqdn_rev, hostname, \
|
||||
hwaddr, hwtype, hwaddr_source, state, user_context) \
|
||||
VALUES ('2001:db8::10',textAsBlob('20'),30,1430694930,40,50,1,60,70,true,true, \
|
||||
'one.example.com',textAsBlob('80'),90,16,0,'');\
|
||||
INSERT INTO lease6 (address, duid, valid_lifetime, expire, subnet_id, \
|
||||
pref_lifetime, lease_type, iaid, prefix_len, fqdn_fwd, fqdn_rev, hostname, \
|
||||
hwaddr, hwtype, hwaddr_source, state, user_context) \
|
||||
VALUES ('2001:db8::11',NULL,30,1433464245,40,50,1,60,70,true,true, \
|
||||
'',textAsBlob('80'),90,1,1,'');\
|
||||
INSERT INTO lease6 (address, duid, valid_lifetime, expire, subnet_id, \
|
||||
pref_lifetime, lease_type, iaid, prefix_len, fqdn_fwd, fqdn_rev, hostname, \
|
||||
hwaddr, hwtype, hwaddr_source, state, user_context) \
|
||||
VALUES ('2001:db8::12',textAsBlob('21'),30,1436173267,40,50,1,60,70,true,true, \
|
||||
'three.example.com',textAsBlob('80'),90,4,2,'');"
|
||||
|
||||
run_command \
|
||||
cql_execute "$insert_cql"
|
||||
assert_eq 0 "${EXIT_CODE}" "insert into lease6 failed, expected exit code %d, actual %d"
|
||||
|
||||
# Dump lease4 to output_file.
|
||||
run_command \
|
||||
"${kea_admin}" lease-dump cql -6 -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" -o $output_file
|
||||
assert_eq 0 "${EXIT_CODE}" "kea-admin lease-dump -6 failed, status code %d"
|
||||
|
||||
# sort data so we can compare
|
||||
sort -g "${output_file}" > "${sorted_file}"
|
||||
|
||||
# Compare the dump output to reference file, they should be identical.
|
||||
run_command \
|
||||
cmp -s $sorted_file $ref_file
|
||||
assert_eq 0 "${EXIT_CODE}" "dump file does not match reference file, expected exit code %d, actual %d"
|
||||
|
||||
# remove the output file.
|
||||
rm $output_file
|
||||
|
||||
# remove the sorted file.
|
||||
rm $sorted_file
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
test_finish 0
|
||||
}
|
||||
|
||||
# Upgrades an existing schema to a target newer version
|
||||
# param target_version - desired schema version as "major.minor"
|
||||
cql_upgrade_schema_to_version() {
|
||||
target_version=$1
|
||||
|
||||
# Check if the scripts directory exists at all.
|
||||
if [ ! -d ${db_scripts_dir}/cql ]; then
|
||||
log_error "Invalid scripts directory: ${db_scripts_dir}/cql"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if there are any files in it
|
||||
num_files=$(find ${db_scripts_dir}/cql/upgrade*.sh -type f | wc -l)
|
||||
if [ "${num_files}" -eq 0 ]; then
|
||||
log_error "No scripts in ${db_scripts_dir}/cql?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version=$(cql_version)
|
||||
for script in "${db_scripts_dir}"/cql/upgrade*.sh
|
||||
do
|
||||
if [ "${version}" = "${target_version}" ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Processing $script file..."
|
||||
"${script}" -u "${db_user}" -p "${db_password}" -k "${db_name}"
|
||||
version=$(cql_version)
|
||||
done
|
||||
|
||||
echo "Schema upgraded to $version"
|
||||
}
|
||||
|
||||
# Verifies that you can upgrade from an earlier version and
|
||||
# that unused subnet ID values in hosts and options tables are
|
||||
# converted to -1
|
||||
cql_unused_subnet_id_test() {
|
||||
test_start "cql.unused_subnet_id_test"
|
||||
|
||||
# Let's wipe the whole database
|
||||
cql_wipe
|
||||
|
||||
# We need to create an older database with lease data so we can
|
||||
# verify the upgrade mechanisms which convert subnet id values
|
||||
#
|
||||
# Initialize database to schema 1.0.
|
||||
cql_execute_script "@abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.cql"
|
||||
|
||||
# Now upgrade to schema 2.0, the version just before global HRs
|
||||
cql_upgrade_schema_to_version 2.0
|
||||
|
||||
# Now we need insert some hosts to "migrate" for both v4 and v6
|
||||
qry="\
|
||||
INSERT INTO host_reservations (id, host_identifier_type, host_identifier, host_ipv4_subnet_id, host_ipv6_subnet_id, hostname, option_subnet_id) \
|
||||
VALUES (1, 0, textAsBlob('0123456'), 0, 0, 'host0', 0);\
|
||||
INSERT INTO host_reservations (id, host_identifier_type, host_identifier, host_ipv4_subnet_id, host_ipv6_subnet_id, hostname, option_subnet_id) \
|
||||
VALUES (2, 0, textAsBlob('1123456'), 4, 0, 'Host1', 4);\
|
||||
INSERT INTO host_reservations (id, host_identifier_type, host_identifier, host_ipv4_subnet_id, host_ipv6_subnet_id, hostname, option_subnet_id) \
|
||||
VALUES (3, 0, textAsBlob('2123456'), 0, 6, 'host2', 6);\
|
||||
INSERT INTO host_reservations (id, host_identifier_type, host_identifier, host_ipv4_subnet_id, host_ipv6_subnet_id, hostname, option_subnet_id) \
|
||||
VALUES (4, 0, textAsBlob('3123456'), 4, 6, 'Host3', 0);\
|
||||
INSERT INTO host_reservations (id, host_identifier_type, host_identifier, host_ipv4_subnet_id, host_ipv6_subnet_id, hostname, option_subnet_id) \
|
||||
VALUES (5, 0, textAsBlob('3123456'), -1, 6, 'host3', 6);"
|
||||
|
||||
run_command \
|
||||
cql_execute "$qry"
|
||||
assert_eq 0 "${EXIT_CODE}" "insert hosts failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Ok, we have a 2.0 database with hosts and options. Let's upgrade it.
|
||||
run_command \
|
||||
"${kea_admin}" db-upgrade cql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
|
||||
|
||||
# Upgrade should succeed
|
||||
assert_eq 0 "${EXIT_CODE}" "upgrade failed"
|
||||
|
||||
test_dir="@abs_top_srcdir@/src/bin/admin/tests"
|
||||
ref_file="$test_dir/data/cql.subnet_id_test.reference.csv"
|
||||
|
||||
output_dir="@abs_top_builddir@/src/bin/admin/tests"
|
||||
export_file="$output_dir/data/cql.subnet_id_test.csv"
|
||||
sorted_file="$output_dir/data/cql.subnet_id_test.sorted.csv"
|
||||
|
||||
# Fetch host_reservation data for comparison
|
||||
echo "Exporting host_reservation data to $export_file ..."
|
||||
|
||||
qry="\
|
||||
SELECT id, host_ipv4_subnet_id, host_ipv6_subnet_id, hostname, lower_case_hostname, option_subnet_id\
|
||||
FROM hosts WHERE id IN (1,2,3,4,5) ALLOW FILTERING;"
|
||||
|
||||
run_command \
|
||||
cql_execute "$qry"
|
||||
printf '%s\n' "${OUTPUT}" > "${export_file}"
|
||||
assert_eq 0 "${EXIT_CODE}" "insert hosts failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# sort data so we can compare
|
||||
grep -F '|' "${export_file}" | sort -V | tr -d " " | sed 's/|/,/g' > $sorted_file
|
||||
|
||||
# Compare the dump output to reference file, they should be identical.
|
||||
run_command \
|
||||
cmp -s $sorted_file $ref_file
|
||||
assert_eq 0 "${EXIT_CODE}" "export file does not match reference file, expected exit code %d, actual %d"
|
||||
|
||||
# remove the output file.
|
||||
rm $export_file
|
||||
|
||||
# remove the sorted file.
|
||||
rm $sorted_file
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
# Report test success.
|
||||
test_finish 0
|
||||
}
|
||||
|
||||
# Verifies that you can upgrade from an earlier version and
|
||||
# that all hosts and options from old host_reservation table (version 3.0) are
|
||||
# converted to new schema (version 4.0) with new key partition key and are
|
||||
# moved to new hosts table
|
||||
cql_upgrade_hosts_test() {
|
||||
test_start "cql.update_hosts_test"
|
||||
|
||||
# Let's wipe the whole database
|
||||
cql_wipe
|
||||
|
||||
# We need to create an older database with lease data so we can
|
||||
# verify the upgrade mechanisms which convert subnet id values
|
||||
#
|
||||
# Initialize database to schema 1.0.
|
||||
cql_execute_script "@abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.cql"
|
||||
|
||||
# Now upgrade to schema 3.0, the version just before global HRs
|
||||
cql_upgrade_schema_to_version 3.0
|
||||
|
||||
# Now we need insert some hosts to "migrate" for both v4 and v6
|
||||
test_dir="@abs_top_srcdir@/src/bin/admin/tests"
|
||||
data_file="$test_dir/data/cql.hosts_data_test.csv"
|
||||
ref_file="$test_dir/data/cql.hosts_data_test.reference.csv"
|
||||
|
||||
output_dir="@abs_top_builddir@/src/bin/admin/tests"
|
||||
export_file="$output_dir/data/cql.hosts_test.csv"
|
||||
sorted_file="$output_dir/data/cql.hosts_test.sorted.csv"
|
||||
|
||||
# Fetch host_reservation data for comparison
|
||||
echo "Exporting host_reservation data to $export_file ..."
|
||||
|
||||
qry="\
|
||||
COPY host_reservations \
|
||||
(id, host_identifier, host_identifier_type, host_ipv4_subnet_id, \
|
||||
host_ipv6_subnet_id, host_ipv4_address, host_ipv4_next_server, \
|
||||
host_ipv4_server_hostname, host_ipv4_boot_file_name, hostname, \
|
||||
auth_key, user_context, host_ipv4_client_classes, \
|
||||
host_ipv6_client_classes, reserved_ipv6_prefix_address, \
|
||||
reserved_ipv6_prefix_length, reserved_ipv6_prefix_address_type, \
|
||||
iaid, option_universe, option_code, option_value, \
|
||||
option_formatted_value, option_space, option_is_persistent, \
|
||||
option_client_class, option_subnet_id, option_user_context, \
|
||||
option_scope_id) \
|
||||
FROM '$data_file'"
|
||||
|
||||
run_command \
|
||||
cql_execute "$qry"
|
||||
assert_eq 0 "${EXIT_CODE}" "insert hosts failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# Ok, we have a 3.0 database with hosts and options. Let's upgrade it.
|
||||
run_command \
|
||||
"${kea_admin}" db-upgrade cql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
|
||||
|
||||
# Upgrade should succeed
|
||||
assert_eq 0 "${EXIT_CODE}" "upgrade failed"
|
||||
|
||||
qry="\
|
||||
COPY hosts \
|
||||
(id, key, host_identifier, host_identifier_type, host_ipv4_subnet_id, \
|
||||
host_ipv6_subnet_id, host_ipv4_address, host_ipv4_next_server, \
|
||||
host_ipv4_server_hostname, host_ipv4_boot_file_name, hostname, \
|
||||
lower_case_hostname, auth_key, user_context, \
|
||||
host_ipv4_client_classes, \
|
||||
host_ipv6_client_classes, reserved_ipv6_prefix_address, \
|
||||
reserved_ipv6_prefix_length, reserved_ipv6_prefix_address_type, \
|
||||
iaid, option_universe, option_code, option_value, \
|
||||
option_formatted_value, option_space, option_is_persistent, \
|
||||
option_client_class, option_subnet_id, option_user_context, \
|
||||
option_scope_id) \
|
||||
TO '$export_file'"
|
||||
|
||||
run_command \
|
||||
cql_execute "$qry"
|
||||
assert_eq 0 "${EXIT_CODE}" "insert hosts failed, expected exit code: %d, actual: %d"
|
||||
|
||||
# sort data so we can compare
|
||||
sort -V "${export_file}" > "${sorted_file}"
|
||||
|
||||
# Compare the dump output to reference file, they should be identical.
|
||||
run_command \
|
||||
cmp -s $sorted_file $ref_file
|
||||
assert_eq 0 "${EXIT_CODE}" "export file does not match reference file, expected exit code %d, actual %d"
|
||||
|
||||
# remove the output file.
|
||||
rm $export_file
|
||||
|
||||
# remove the sorted file.
|
||||
rm $sorted_file
|
||||
|
||||
# Wipe the database.
|
||||
cql_wipe
|
||||
|
||||
# Report test success.
|
||||
test_finish 0
|
||||
}
|
||||
|
||||
|
||||
# Run tests.
|
||||
cql_db_init_test
|
||||
cql_db_version_test
|
||||
cql_upgrade_test
|
||||
cql_lease4_dump_test
|
||||
cql_lease6_dump_test
|
||||
cql_unused_subnet_id_test
|
||||
cql_upgrade_hosts_test
|
@@ -1,8 +1,3 @@
|
||||
EXTRA_DIST = \
|
||||
lease4_dump_test.reference.csv \
|
||||
lease6_dump_test.reference.csv \
|
||||
cql.lease4_dump_test.reference.csv \
|
||||
cql.lease6_dump_test.reference.csv \
|
||||
cql.subnet_id_test.reference.csv \
|
||||
cql.hosts_data_test.csv \
|
||||
cql.hosts_data_test.reference.csv
|
||||
lease6_dump_test.reference.csv
|
||||
|
@@ -1,24 +0,0 @@
|
||||
1105657659805715115,0x4142434445464748494b,1,1,101,0,0,,,host60,,,,,2001:db8::1,128,0,0,1,17,0x,2495,dhcp6,False,,0,,3
|
||||
2129388898029710264,0x414243444548,0,2,102,0,0,,,Host61,,,,,2001:db8::1,128,0,0,0,1,0x,312131,vendor-encapsulated-options,False,,0,,3
|
||||
2370585748436022247,0x414243444548,0,2,102,0,0,,,host62,,,,,2001:db8::1,128,0,0,0,67,0x,my-boot-file,dhcp4,True,,0,,3
|
||||
2459636980433777721,0x4142434445464748494b,1,1,101,0,0,,,,,,,,2001:db8::1,128,0,0,1,59,0x,my-boot-file,dhcp6,True,,0,{ \"comment\": \"a host reservation\" },3
|
||||
5403514763123047131,0x414243444547,0,1,101,-1073741307,0,,,,,,,,::,0,-1,-1,0,254,0x,192.0.2.3,dhcp4,False,,0,,3
|
||||
5501234819855171334,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,1,17,0x,2495,dhcp6,False,,0,,3
|
||||
5747907930644082856,0x4142434445464748494b,1,1,101,0,0,,,,,,,,2001:db8::1,128,0,0,1,1,0x,,isc2,True,,0,,3
|
||||
5955003068494074400,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,1,59,0x,my-boot-file,dhcp6,True,,0,,3
|
||||
6399013866147252670,0x4142434445464748494b,1,1,101,0,0,,,,,,,,2001:db8::1,128,0,0,1,32,0x,3600,dhcp6,False,,0,,3
|
||||
6783601303445960591,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,1,32,0x,3600,dhcp6,False,,0,,3
|
||||
7821756928114620236,0x414243444547,0,1,101,-1073741307,0,,,,,,,,::,0,-1,-1,0,23,0x,64,dhcp4,False,,0,,3
|
||||
8973539074684426388,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,0,1,0x,,isc,True,,0,,3
|
||||
9211831388923168274,0x414243444547,0,1,101,-1073741307,0,,,,,,,,::,0,-1,-1,0,2,0x,"10.0.0.5,10.0.0.3,10.0.3.4",isc,False,,0,,3
|
||||
-650687214220680074,0x4142434445464748494b,1,1,101,0,0,,,,,,,,2001:db8::1,128,0,0,1,1024,0x,2001:db8:1::1,dhcp6,False,,0,,3
|
||||
-1123502337428230752,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,0,254,0x,192.0.2.3,dhcp4,False,,0,,3
|
||||
-1210691761766369036,0x414243444547,0,1,101,-1073741307,0,,,,,,,,::,0,-1,-1,0,67,0x,my-boot-file,dhcp4,True,,0,{ \"comment\": \"a host reservation\" },3
|
||||
-3907456719587717375,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,0,2,0x,"10.0.0.5,10.0.0.3,10.0.3.4",isc,False,,0,,3
|
||||
-5169419091664697091,0x4142434445464748494b,1,1,101,0,0,,,,,,,,2001:db8::1,128,0,0,1,2,0x,"3000::1,3000::2,3000::3",isc2,False,,0,,3
|
||||
-6372549629773775261,0x414243444547,0,1,101,-1073741307,0,,,,,,,,::,0,-1,-1,0,1,0x,312131,vendor-encapsulated-options,False,,0,,3
|
||||
-6378104957663278797,0x414243444547,0,1,101,-1073741307,0,,,,,,,,::,0,-1,-1,0,1,0x,,isc,True,,0,,3
|
||||
-7724068518921719729,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,1,1024,0x,2001:db8:1::1,dhcp6,False,,0,,3
|
||||
-7804940982500935489,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,0,23,0x,64,dhcp4,False,,0,,3
|
||||
-8100784457292204371,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,1,1,0x,,isc2,True,,0,,3
|
||||
-8306770918748488616,0x414243444548,0,2,102,0,0,,,,,,,,2001:db8::1,128,0,0,1,2,0x,"3000::1,3000::2,3000::3",isc2,False,,0,,3
|
Can't render this file because it contains an unexpected character in line 4 and column 121.
|
@@ -1,24 +0,0 @@
|
||||
1105657659805715115,5367868710821401223,0x4142434445464748494b,1,1,101,0,0,,,host60,host60,,,,,2001:db8::1,128,0,0,1,17,0x,2495,dhcp6,False,,0,,3
|
||||
2129388898029710264,-4885955325122621964,0x414243444548,0,2,102,0,0,,,Host61,host61,,,,,2001:db8::1,128,0,0,0,1,0x,312131,vendor-encapsulated-options,False,,0,,3
|
||||
2370585748436022247,-4885955325122621964,0x414243444548,0,2,102,0,0,,,host62,host62,,,,,2001:db8::1,128,0,0,0,67,0x,my-boot-file,dhcp4,True,,0,,3
|
||||
2459636980433777721,5367868710821401223,0x4142434445464748494b,1,1,101,0,0,,,,,,,,,2001:db8::1,128,0,0,1,59,0x,my-boot-file,dhcp6,True,,0,{ \"comment\": \"a host reservation\" },3
|
||||
5403514763123047131,4012104063077014549,0x414243444547,0,1,101,-1073741307,0,,,,,,,,,::,0,-1,-1,0,254,0x,192.0.2.3,dhcp4,False,,0,,3
|
||||
5501234819855171334,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,1,17,0x,2495,dhcp6,False,,0,,3
|
||||
5747907930644082856,5367868710821401223,0x4142434445464748494b,1,1,101,0,0,,,,,,,,,2001:db8::1,128,0,0,1,1,0x,,isc2,True,,0,,3
|
||||
5955003068494074400,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,1,59,0x,my-boot-file,dhcp6,True,,0,,3
|
||||
6399013866147252670,5367868710821401223,0x4142434445464748494b,1,1,101,0,0,,,,,,,,,2001:db8::1,128,0,0,1,32,0x,3600,dhcp6,False,,0,,3
|
||||
6783601303445960591,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,1,32,0x,3600,dhcp6,False,,0,,3
|
||||
7821756928114620236,4012104063077014549,0x414243444547,0,1,101,-1073741307,0,,,,,,,,,::,0,-1,-1,0,23,0x,64,dhcp4,False,,0,,3
|
||||
8973539074684426388,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,0,1,0x,,isc,True,,0,,3
|
||||
9211831388923168274,4012104063077014549,0x414243444547,0,1,101,-1073741307,0,,,,,,,,,::,0,-1,-1,0,2,0x,"10.0.0.5,10.0.0.3,10.0.3.4",isc,False,,0,,3
|
||||
-650687214220680074,5367868710821401223,0x4142434445464748494b,1,1,101,0,0,,,,,,,,,2001:db8::1,128,0,0,1,1024,0x,2001:db8:1::1,dhcp6,False,,0,,3
|
||||
-1123502337428230752,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,0,254,0x,192.0.2.3,dhcp4,False,,0,,3
|
||||
-1210691761766369036,4012104063077014549,0x414243444547,0,1,101,-1073741307,0,,,,,,,,,::,0,-1,-1,0,67,0x,my-boot-file,dhcp4,True,,0,{ \"comment\": \"a host reservation\" },3
|
||||
-3907456719587717375,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,0,2,0x,"10.0.0.5,10.0.0.3,10.0.3.4",isc,False,,0,,3
|
||||
-5169419091664697091,5367868710821401223,0x4142434445464748494b,1,1,101,0,0,,,,,,,,,2001:db8::1,128,0,0,1,2,0x,"3000::1,3000::2,3000::3",isc2,False,,0,,3
|
||||
-6372549629773775261,4012104063077014549,0x414243444547,0,1,101,-1073741307,0,,,,,,,,,::,0,-1,-1,0,1,0x,312131,vendor-encapsulated-options,False,,0,,3
|
||||
-6378104957663278797,4012104063077014549,0x414243444547,0,1,101,-1073741307,0,,,,,,,,,::,0,-1,-1,0,1,0x,,isc,True,,0,,3
|
||||
-7724068518921719729,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,1,1024,0x,2001:db8:1::1,dhcp6,False,,0,,3
|
||||
-7804940982500935489,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,0,23,0x,64,dhcp4,False,,0,,3
|
||||
-8100784457292204371,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,1,1,0x,,isc2,True,,0,,3
|
||||
-8306770918748488616,-4885955325122621964,0x414243444548,0,2,102,0,0,,,,,,,,,2001:db8::1,128,0,0,1,2,0x,"3000::1,3000::2,3000::3",isc2,False,,0,,3
|
Can't render this file because it contains an unexpected character in line 4 and column 142.
|
@@ -1,4 +0,0 @@
|
||||
address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context
|
||||
-1073741302,0x3230,0x3330,40,1430694930,50,True,True,one.example.com,0,
|
||||
-1073741301,null,0x313233,40,1433464245,50,True,True,,1,
|
||||
-1073741300,0x3232,null,40,1436173267,50,True,True,three.example.com,2,
|
|
@@ -1,4 +0,0 @@
|
||||
address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,hwtype,hwaddr_source,state,user_context
|
||||
2001:db8::10,0x3230,30,1430694930,40,50,1,60,70,True,True,one.example.com,0x3830,90,16,0,
|
||||
2001:db8::11,null,30,1433464245,40,50,1,60,70,True,True,,0x3830,90,1,1,
|
||||
2001:db8::12,0x3231,30,1436173267,40,50,1,60,70,True,True,three.example.com,0x3830,90,4,2,
|
|
@@ -1,6 +0,0 @@
|
||||
id,host_ipv4_subnet_id,host_ipv6_subnet_id,hostname,lower_case_hostname,option_subnet_id
|
||||
1,-1,-1,host0,host0,-1
|
||||
2,4,-1,Host1,host1,4
|
||||
3,-1,6,host2,host2,6
|
||||
4,4,6,Host3,host3,-1
|
||||
5,-1,6,host3,host3,6
|
|
@@ -1,193 +0,0 @@
|
||||
-- Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
|
||||
-- Copyright (C) 2015-2017 Deutsche Telekom AG.
|
||||
|
||||
-- Author: Razvan Becheriu <razvan.becheriu@qualitance.com>
|
||||
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
-- This is the Kea schema 1.0 specification for Cassandra CQL.
|
||||
-- Note: this is outdated version on purpose and it used to test upgrade
|
||||
-- process. Do not update this file to 2.0 or any later.
|
||||
|
||||
-- The schema is reasonably portable (with the exception of the engine
|
||||
-- specification, which is Cassandra CQL-specific). Minor changes might be needed for
|
||||
-- other databases.
|
||||
|
||||
-- To create the schema, either type the command:
|
||||
|
||||
-- cqlsh -u <user> -p <password> -k <database> -f dhcpdb_create.cql
|
||||
|
||||
-- ... at the command prompt, or log in to the CQL database and at the "cqlsh>"
|
||||
-- prompt, issue the command:
|
||||
|
||||
-- SOURCE dhcpdb_create.cql
|
||||
|
||||
-- This script is also called from kea-admin, see kea-admin db-init cql
|
||||
|
||||
-- Over time, Kea database schema will evolve. Each version is marked with
|
||||
-- major.minor version. This file is organized sequentially, i.e. database
|
||||
-- is initialized to 1.0, then upgraded to 2.0 etc. This may be somewhat
|
||||
-- sub-optimal, but it ensues consistency with upgrade scripts. (It is much
|
||||
-- easier to maintain init and upgrade scripts if they look the same).
|
||||
-- Since initialization is done only once, its performance is not an issue.
|
||||
|
||||
-- This line starts database initialization to 1.0.
|
||||
|
||||
-- Holds the IPv4 leases.
|
||||
-- -----------------------------------------------------
|
||||
-- Table `lease4`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS lease4 (
|
||||
address int,
|
||||
hwaddr blob,
|
||||
client_id blob,
|
||||
valid_lifetime bigint,
|
||||
expire bigint,
|
||||
subnet_id int,
|
||||
fqdn_fwd boolean,
|
||||
fqdn_rev boolean,
|
||||
hostname varchar,
|
||||
state int,
|
||||
PRIMARY KEY ((address))
|
||||
);
|
||||
|
||||
-- Create search indexes for lease4 table
|
||||
CREATE INDEX IF NOT EXISTS lease4index1 ON lease4 (client_id);
|
||||
CREATE INDEX IF NOT EXISTS lease4index2 ON lease4 (subnet_id);
|
||||
CREATE INDEX IF NOT EXISTS lease4index3 ON lease4 (hwaddr);
|
||||
CREATE INDEX IF NOT EXISTS lease4index4 ON lease4 (expire);
|
||||
CREATE INDEX IF NOT EXISTS lease4index5 ON lease4 (state);
|
||||
|
||||
-- Holds the IPv6 leases.
|
||||
-- N.B. The use of a VARCHAR for the address is temporary for development:
|
||||
-- it will eventually be replaced by BINARY(16).
|
||||
-- -----------------------------------------------------
|
||||
-- Table `lease6`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS lease6 (
|
||||
address varchar,
|
||||
valid_lifetime bigint,
|
||||
expire bigint,
|
||||
subnet_id int,
|
||||
pref_lifetime bigint,
|
||||
duid blob,
|
||||
iaid int,
|
||||
lease_type int,
|
||||
prefix_len int,
|
||||
fqdn_fwd boolean,
|
||||
fqdn_rev boolean,
|
||||
hostname varchar,
|
||||
hwaddr blob,
|
||||
hwtype int,
|
||||
hwaddr_source int,
|
||||
state int,
|
||||
PRIMARY KEY ((address))
|
||||
);
|
||||
|
||||
-- Create search indexes for lease6 table
|
||||
CREATE INDEX IF NOT EXISTS lease6index1 ON lease6 (duid);
|
||||
CREATE INDEX IF NOT EXISTS lease6index2 ON lease6 (iaid);
|
||||
CREATE INDEX IF NOT EXISTS lease6index3 ON lease6 (lease_type);
|
||||
CREATE INDEX IF NOT EXISTS lease6index4 ON lease6 (subnet_id);
|
||||
CREATE INDEX IF NOT EXISTS lease6index5 ON lease6 (expire);
|
||||
CREATE INDEX IF NOT EXISTS lease6index6 ON lease6 (state);
|
||||
|
||||
-- ... and a definition of lease6 types. This table is a convenience for
|
||||
-- users of the database - if they want to view the lease table and use the
|
||||
-- type names, they can join this table with the lease6 table.
|
||||
-- Make sure those values match Lease6::LeaseType enum (see src/bin/dhcpsrv/
|
||||
-- lease_mgr.h)
|
||||
-- -----------------------------------------------------
|
||||
-- Table `lease6_types`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS lease6_types (
|
||||
lease_type int, -- Lease type code.
|
||||
name varchar, -- Name of the lease type
|
||||
PRIMARY KEY ((lease_type))
|
||||
);
|
||||
INSERT INTO lease6_types (lease_type, name) VALUES (0, 'IA_NA'); -- Non-temporary v6 addresses
|
||||
INSERT INTO lease6_types (lease_type, name) VALUES (1, 'IA_TA'); -- Temporary v6 addresses
|
||||
INSERT INTO lease6_types (lease_type, name) VALUES (2, 'IA_PD'); -- Prefix delegations
|
||||
|
||||
-- Kea keeps track of the hardware/MAC address source, i.e. how the address
|
||||
-- was obtained. Depending on the technique and your network topology, it may
|
||||
-- be more or less trustworthy. This table is a convenience for
|
||||
-- users of the database - if they want to view the lease table and use the
|
||||
-- type names, they can join this table with the lease6 table. For details,
|
||||
-- see constants defined in src/lib/dhcp/dhcp/pkt.h for detailed explanation.
|
||||
-- -----------------------------------------------------
|
||||
-- Table `lease_hwaddr_source`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS lease_hwaddr_source (
|
||||
hwaddr_source int,
|
||||
name varchar,
|
||||
PRIMARY KEY ((hwaddr_source))
|
||||
);
|
||||
|
||||
-- Hardware address obtained from raw sockets
|
||||
INSERT INTO lease_hwaddr_source (hwaddr_source, name) VALUES (1, 'HWADDR_SOURCE_RAW');
|
||||
|
||||
-- Hardware address converted from IPv6 link-local address with EUI-64
|
||||
INSERT INTO lease_hwaddr_source (hwaddr_source, name) VALUES (2, 'HWADDR_SOURCE_IPV6_LINK_LOCAL');
|
||||
|
||||
-- Hardware address extracted from client-id (duid)
|
||||
INSERT INTO lease_hwaddr_source (hwaddr_source, name) VALUES (4, 'HWADDR_SOURCE_DUID');
|
||||
|
||||
-- Hardware address extracted from client address relay option (RFC6939)
|
||||
INSERT INTO lease_hwaddr_source (hwaddr_source, name) VALUES (8, 'HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION');
|
||||
|
||||
-- Hardware address extracted from remote-id option (RFC4649)
|
||||
INSERT INTO lease_hwaddr_source (hwaddr_source, name) VALUES (16, 'HWADDR_SOURCE_REMOTE_ID');
|
||||
|
||||
-- Hardware address extracted from subscriber-id option (RFC4580)
|
||||
INSERT INTO lease_hwaddr_source (hwaddr_source, name) VALUES (32, 'HWADDR_SOURCE_SUBSCRIBER_ID');
|
||||
|
||||
-- Hardware address extracted from docsis options
|
||||
INSERT INTO lease_hwaddr_source (hwaddr_source, name) VALUES (64, 'HWADDR_SOURCE_DOCSIS_CMTS');
|
||||
|
||||
-- Create table holding mapping of the lease states to their names.
|
||||
-- This is not used in queries from the DHCP server but rather in
|
||||
-- direct queries from the lease database management tools.
|
||||
-- -----------------------------------------------------
|
||||
-- Table `lease_state`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS lease_state (
|
||||
state int,
|
||||
name varchar,
|
||||
PRIMARY KEY ((state))
|
||||
);
|
||||
|
||||
-- Insert currently defined state names.
|
||||
INSERT INTO lease_state (state, name) VALUES (0, 'default');
|
||||
INSERT INTO lease_state (state, name) VALUES (1, 'declined');
|
||||
INSERT INTO lease_state (state, name) VALUES (2, 'expired-reclaimed');
|
||||
|
||||
-- Finally, the version of the schema. We start at 1.0 during development.
|
||||
-- This table is only modified during schema upgrades. For historical reasons
|
||||
-- (related to the names of the columns in the BIND 10 DNS database file), the
|
||||
-- first column is called "version" and not "major".
|
||||
-- Note: This MUST be kept in step with src/share/database/scripts/cassandra/dhcpdb_create.cql,
|
||||
-- which defines the schema for the unit tests.
|
||||
-- -----------------------------------------------------
|
||||
-- Table `schema_version`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS schema_version (
|
||||
version int,
|
||||
minor int,
|
||||
PRIMARY KEY ((version))
|
||||
);
|
||||
|
||||
INSERT INTO schema_version (version, minor) VALUES (1, 0);
|
||||
|
||||
-- This line concludes database initialization to version 1.0.
|
||||
|
@@ -68,9 +68,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
d2_unittests_LDFLAGS += $(PGSQL_LIBS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
d2_unittests_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
d2_unittests_LDFLAGS += $(GTEST_LDFLAGS)
|
||||
|
||||
d2_unittests_LDADD = $(top_builddir)/src/bin/d2/libd2.la
|
||||
|
@@ -10,9 +10,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
AM_CPPFLAGS += $(CQL_CPPFLAGS)
|
||||
endif
|
||||
|
||||
AM_CXXFLAGS = $(KEA_CXXFLAGS)
|
||||
|
||||
@@ -63,9 +60,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
kea_dhcp4_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
|
||||
endif
|
||||
if HAVE_CQL
|
||||
kea_dhcp4_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
|
||||
endif
|
||||
|
||||
kea_dhcp4_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
|
||||
kea_dhcp4_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
|
||||
@@ -86,9 +80,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
kea_dhcp4_LDFLAGS += $(PGSQL_LIBS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
kea_dhcp4_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
|
||||
kea_dhcp4dir = $(pkgdatadir)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -397,15 +397,6 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
|
||||
}
|
||||
}
|
||||
|
||||
\"cql\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::DATABASE_TYPE:
|
||||
return isc::dhcp::Dhcp4Parser::make_CQL(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("cql", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"user\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
@@ -483,39 +474,6 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
|
||||
}
|
||||
}
|
||||
|
||||
\"keyspace\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp4Parser::make_KEYSPACE(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("keyspace", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"consistency\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp4Parser::make_CONSISTENCY(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("consistency", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"serial-consistency\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp4Parser::make_SERIAL_CONSISTENCY(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("serial-consistency", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"reconnect-wait-time\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
@@ -565,50 +523,6 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
|
||||
}
|
||||
}
|
||||
|
||||
\"request-timeout\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp4Parser::make_REQUEST_TIMEOUT(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("request-timeout", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"tcp-keepalive\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp4Parser::make_TCP_KEEPALIVE(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("tcp-keepalive", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"tcp-nodelay\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp4Parser::make_TCP_NODELAY(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("tcp-nodelay", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"contact-points\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp4Parser::make_CONTACT_POINTS(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp4Parser::make_STRING("contact-points", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"max-reconnect-tries\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -82,7 +82,6 @@ using namespace std;
|
||||
MEMFILE "memfile"
|
||||
MYSQL "mysql"
|
||||
POSTGRESQL "postgresql"
|
||||
CQL "cql"
|
||||
USER "user"
|
||||
PASSWORD "password"
|
||||
HOST "host"
|
||||
@@ -91,19 +90,12 @@ using namespace std;
|
||||
LFC_INTERVAL "lfc-interval"
|
||||
READONLY "readonly"
|
||||
CONNECT_TIMEOUT "connect-timeout"
|
||||
CONTACT_POINTS "contact-points"
|
||||
KEYSPACE "keyspace"
|
||||
CONSISTENCY "consistency"
|
||||
SERIAL_CONSISTENCY "serial-consistency"
|
||||
MAX_RECONNECT_TRIES "max-reconnect-tries"
|
||||
RECONNECT_WAIT_TIME "reconnect-wait-time"
|
||||
ON_FAIL "on-fail"
|
||||
STOP_RETRY_EXIT "stop-retry-exit"
|
||||
SERVE_RETRY_EXIT "serve-retry-exit"
|
||||
SERVE_RETRY_CONTINUE "serve-retry-continue"
|
||||
REQUEST_TIMEOUT "request-timeout"
|
||||
TCP_KEEPALIVE "tcp-keepalive"
|
||||
TCP_NODELAY "tcp-nodelay"
|
||||
MAX_ROW_ERRORS "max-row-errors"
|
||||
TRUST_ANCHOR "trust-anchor"
|
||||
CERT_FILE "cert-file"
|
||||
@@ -973,16 +965,9 @@ database_map_param: database_type
|
||||
| lfc_interval
|
||||
| readonly
|
||||
| connect_timeout
|
||||
| contact_points
|
||||
| max_reconnect_tries
|
||||
| reconnect_wait_time
|
||||
| on_fail
|
||||
| request_timeout
|
||||
| tcp_keepalive
|
||||
| tcp_nodelay
|
||||
| keyspace
|
||||
| consistency
|
||||
| serial_consistency
|
||||
| max_row_errors
|
||||
| trust_anchor
|
||||
| cert_file
|
||||
@@ -1002,7 +987,6 @@ database_type: TYPE {
|
||||
db_type: MEMFILE { $$ = ElementPtr(new StringElement("memfile", ctx.loc2pos(@1))); }
|
||||
| MYSQL { $$ = ElementPtr(new StringElement("mysql", ctx.loc2pos(@1))); }
|
||||
| POSTGRESQL { $$ = ElementPtr(new StringElement("postgresql", ctx.loc2pos(@1))); }
|
||||
| CQL { $$ = ElementPtr(new StringElement("cql", ctx.loc2pos(@1))); }
|
||||
;
|
||||
|
||||
user: USER {
|
||||
@@ -1071,60 +1055,6 @@ connect_timeout: CONNECT_TIMEOUT COLON INTEGER {
|
||||
ctx.stack_.back()->set("connect-timeout", n);
|
||||
};
|
||||
|
||||
request_timeout: REQUEST_TIMEOUT COLON INTEGER {
|
||||
ctx.unique("request-timeout", ctx.loc2pos(@1));
|
||||
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("request-timeout", n);
|
||||
};
|
||||
|
||||
tcp_keepalive: TCP_KEEPALIVE COLON INTEGER {
|
||||
ctx.unique("tcp-keepalive", ctx.loc2pos(@1));
|
||||
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("tcp-keepalive", n);
|
||||
};
|
||||
|
||||
tcp_nodelay: TCP_NODELAY COLON BOOLEAN {
|
||||
ctx.unique("tcp-nodelay", ctx.loc2pos(@1));
|
||||
ElementPtr n(new BoolElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("tcp-nodelay", n);
|
||||
};
|
||||
|
||||
contact_points: CONTACT_POINTS {
|
||||
ctx.unique("contact-points", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
} COLON STRING {
|
||||
ElementPtr cp(new StringElement($4, ctx.loc2pos(@4)));
|
||||
ctx.stack_.back()->set("contact-points", cp);
|
||||
ctx.leave();
|
||||
};
|
||||
|
||||
keyspace: KEYSPACE {
|
||||
ctx.unique("keyspace", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
} COLON STRING {
|
||||
ElementPtr ks(new StringElement($4, ctx.loc2pos(@4)));
|
||||
ctx.stack_.back()->set("keyspace", ks);
|
||||
ctx.leave();
|
||||
};
|
||||
|
||||
consistency: CONSISTENCY {
|
||||
ctx.unique("consistency", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
} COLON STRING {
|
||||
ElementPtr c(new StringElement($4, ctx.loc2pos(@4)));
|
||||
ctx.stack_.back()->set("consistency", c);
|
||||
ctx.leave();
|
||||
};
|
||||
|
||||
serial_consistency: SERIAL_CONSISTENCY {
|
||||
ctx.unique("serial-consistency", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
} COLON STRING {
|
||||
ElementPtr c(new StringElement($4, ctx.loc2pos(@4)));
|
||||
ctx.stack_.back()->set("serial-consistency", c);
|
||||
ctx.leave();
|
||||
};
|
||||
|
||||
max_reconnect_tries: MAX_RECONNECT_TRIES COLON INTEGER {
|
||||
ctx.unique("max-reconnect-tries", ctx.loc2pos(@1));
|
||||
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||
|
@@ -57,9 +57,6 @@
|
||||
#ifdef HAVE_PGSQL
|
||||
#include <dhcpsrv/pgsql_lease_mgr.h>
|
||||
#endif
|
||||
#ifdef HAVE_CQL
|
||||
#include <dhcpsrv/cql_lease_mgr.h>
|
||||
#endif
|
||||
#include <dhcpsrv/memfile_lease_mgr.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
@@ -4129,9 +4126,6 @@ Dhcpv4Srv::getVersion(bool extended) {
|
||||
#endif
|
||||
#ifdef HAVE_PGSQL
|
||||
tmp << PgSqlLeaseMgr::getDBVersion() << endl;
|
||||
#endif
|
||||
#ifdef HAVE_CQL
|
||||
tmp << CqlLeaseMgr::getDBVersion() << endl;
|
||||
#endif
|
||||
tmp << Memfile_LeaseMgr::getDBVersion(Memfile_LeaseMgr::V4);
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
// A Bison parser, made by GNU Bison 3.8.2.
|
||||
// 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
|
||||
@@ -15,7 +15,7 @@
|
||||
// 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 <https://www.gnu.org/licenses/>.
|
||||
// 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
|
||||
@@ -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
|
||||
|
@@ -117,9 +117,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
dhcp4_unittests_LDFLAGS += $(PGSQL_LIBS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
dhcp4_unittests_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
dhcp4_unittests_LDFLAGS += $(GTEST_LDFLAGS)
|
||||
|
||||
dhcp4_unittests_LDADD = $(top_builddir)/src/bin/dhcp4/libdhcp4.la
|
||||
@@ -144,10 +141,6 @@ if HAVE_PGSQL
|
||||
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/pgsql/testutils/libpgsqltest.la
|
||||
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
|
||||
endif
|
||||
if HAVE_CQL
|
||||
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/cql/testutils/libcqltest.la
|
||||
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
|
||||
endif
|
||||
|
||||
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/database/testutils/libdatabasetest.la
|
||||
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
|
||||
|
@@ -15,10 +15,6 @@
|
||||
#include <dhcpsrv/subnet_id.h>
|
||||
#include <testutils/gtest_utils.h>
|
||||
|
||||
#ifdef HAVE_CQL
|
||||
#include <cql/testutils/cql_schema.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MYSQL
|
||||
#include <mysql/testutils/mysql_schema.h>
|
||||
#endif
|
||||
@@ -112,37 +108,33 @@ namespace {
|
||||
/// - Using PostgreSQL lease database backend to store leases
|
||||
///
|
||||
/// - Configuration 10:
|
||||
/// - Simple configuration with a single subnet and single pool
|
||||
/// - Using Cassandra lease database backend to store leases
|
||||
///
|
||||
/// - Configuration 11:
|
||||
/// - Simple configuration with a single subnet
|
||||
/// - One in-pool reservation for a circuit-id of 'charter950'
|
||||
///
|
||||
/// - Configuration 12:
|
||||
/// - Configuration 11:
|
||||
/// - Simple configuration with a single subnet
|
||||
/// - One in-pool reservation for MAC address aa:bb:cc:dd:ee:ff
|
||||
/// - The reservations-in-subnet flag is set to true
|
||||
///
|
||||
/// - Configuration 13:
|
||||
/// - Configuration 12:
|
||||
/// - Simple configuration with a single subnet as in #12
|
||||
/// - The reservations-in-subnet flag is set to false for testing that the
|
||||
/// reservations are ignored
|
||||
///
|
||||
/// - Configuration 14:
|
||||
/// - Configuration 13:
|
||||
/// - Simple configuration with a single subnet
|
||||
/// - Two host reservations, one out of the pool, another one in pool
|
||||
/// - The reservations-in-subnet and reservations-out-of-pool flags are set to
|
||||
/// true to test that only out of pool reservations are honored.
|
||||
///
|
||||
/// - Configuration 15:
|
||||
/// - Configuration 14:
|
||||
/// - Use for testing authoritative flag
|
||||
/// - 1 subnet: 10.0.0.0/24
|
||||
/// - 1 pool: 10.0.0.10-10.0.0.100
|
||||
/// - authoritative flag is set to true, thus the server responds
|
||||
/// with DHCPNAK to requests from unknown clients.
|
||||
///
|
||||
/// - Configuration 16:
|
||||
/// - Configuration 15:
|
||||
/// - Use for testing authoritative flag
|
||||
/// - 1 subnet: 10.0.0.0/24
|
||||
/// - 1 pool: 10.0.0.10-10.0.0.100
|
||||
@@ -416,24 +408,6 @@ const char* DORA_CONFIGS[] = {
|
||||
"}",
|
||||
|
||||
// Configuration 10
|
||||
"{ \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},"
|
||||
"\"lease-database\": {"
|
||||
" \"type\": \"cql\","
|
||||
" \"name\": \"keatest\","
|
||||
" \"user\": \"keatest\","
|
||||
" \"password\": \"keatest\""
|
||||
"},"
|
||||
"\"valid-lifetime\": 600,"
|
||||
"\"subnet4\": [ { "
|
||||
" \"subnet\": \"10.0.0.0/24\", "
|
||||
" \"id\": 1,"
|
||||
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]"
|
||||
" } ]"
|
||||
"}",
|
||||
|
||||
// Configuration 11
|
||||
"{ \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},"
|
||||
@@ -451,7 +425,7 @@ const char* DORA_CONFIGS[] = {
|
||||
"} ]"
|
||||
"}",
|
||||
|
||||
// Configuration 12
|
||||
// Configuration 11
|
||||
"{ \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},"
|
||||
@@ -471,7 +445,7 @@ const char* DORA_CONFIGS[] = {
|
||||
"} ]"
|
||||
"}",
|
||||
|
||||
// Configuration 13
|
||||
// Configuration 12
|
||||
"{ \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},"
|
||||
@@ -490,7 +464,7 @@ const char* DORA_CONFIGS[] = {
|
||||
"} ]"
|
||||
"}",
|
||||
|
||||
// Configuration 14
|
||||
// Configuration 13
|
||||
"{ \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},"
|
||||
@@ -514,7 +488,7 @@ const char* DORA_CONFIGS[] = {
|
||||
"} ]"
|
||||
"}",
|
||||
|
||||
// Configuration 15
|
||||
// Configuration 14
|
||||
"{ \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},"
|
||||
@@ -531,7 +505,7 @@ const char* DORA_CONFIGS[] = {
|
||||
" } ]"
|
||||
"}",
|
||||
|
||||
// Configuration 16
|
||||
// Configuration 15
|
||||
"{ \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},"
|
||||
@@ -548,7 +522,7 @@ const char* DORA_CONFIGS[] = {
|
||||
" } ]"
|
||||
"}",
|
||||
|
||||
// Configuration 17
|
||||
// Configuration 16
|
||||
"{ \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},"
|
||||
@@ -568,7 +542,6 @@ const char* DORA_CONFIGS[] = {
|
||||
" }"
|
||||
"]"
|
||||
"}"
|
||||
|
||||
};
|
||||
|
||||
/// @brief Test fixture class for testing 4-way (DORA) exchanges.
|
||||
@@ -1097,7 +1070,7 @@ void
|
||||
DORATest::authoritative() {
|
||||
Dhcp4Client client(Dhcp4Client::SELECTING);
|
||||
// Configure DHCP server.
|
||||
configure(DORA_CONFIGS[15], *client.getServer());
|
||||
configure(DORA_CONFIGS[14], *client.getServer());
|
||||
client.includeClientId("11:22");
|
||||
|
||||
// Try to renew an address that is outside the pool.
|
||||
@@ -1211,7 +1184,7 @@ void
|
||||
DORATest::notAuthoritative() {
|
||||
Dhcp4Client client(Dhcp4Client::SELECTING);
|
||||
// Configure DHCP server.
|
||||
configure(DORA_CONFIGS[16], *client.getServer());
|
||||
configure(DORA_CONFIGS[15], *client.getServer());
|
||||
client.includeClientId("11:22");
|
||||
|
||||
// Try to renew an address that is outside the pool.
|
||||
@@ -2144,7 +2117,7 @@ DORATest::reservationModeDisabled() {
|
||||
// Configure DHCP server. In this configuration the reservations flags are
|
||||
// set to false. Thus, the server should ignore the reservation for
|
||||
// this client.
|
||||
configure(DORA_CONFIGS[13], *client.getServer());
|
||||
configure(DORA_CONFIGS[12], *client.getServer());
|
||||
// Client requests the 10.0.0.50 address and the server should assign it
|
||||
// as it ignores the reservation in the current mode.
|
||||
ASSERT_NO_THROW(client.doDORA(boost::shared_ptr<
|
||||
@@ -2159,7 +2132,7 @@ DORATest::reservationModeDisabled() {
|
||||
ASSERT_EQ("10.0.0.50", client.config_.lease_.addr_.toText());
|
||||
|
||||
// Reconfigure the server to respect the host reservations.
|
||||
configure(DORA_CONFIGS[12], *client.getServer());
|
||||
configure(DORA_CONFIGS[11], *client.getServer());
|
||||
|
||||
// The client requests the previously allocated address again, but the
|
||||
// server should allocate the reserved address this time.
|
||||
@@ -2218,7 +2191,7 @@ DORATest::reservationModeOutOfPool() {
|
||||
Dhcp4Client clientA(Dhcp4Client::SELECTING);
|
||||
clientA.setHWAddress("aa:bb:cc:dd:ee:ff");
|
||||
// Configure the server to respect out of the pool reservations.
|
||||
configure(DORA_CONFIGS[14], *clientA.getServer());
|
||||
configure(DORA_CONFIGS[13], *clientA.getServer());
|
||||
// The client for which we have a reservation is doing 4-way exchange
|
||||
// and requests a different address than reserved. The server should
|
||||
// allocate the reserved address to this client.
|
||||
@@ -2563,7 +2536,7 @@ DORATest::changingCircuitId() {
|
||||
client.useRelay(true, IOAddress("10.0.0.1"), IOAddress("10.0.0.2"));
|
||||
|
||||
// Configure DHCP server.
|
||||
configure(DORA_CONFIGS[11], *client.getServer());
|
||||
configure(DORA_CONFIGS[10], *client.getServer());
|
||||
|
||||
// Send DHCPDISCOVER.
|
||||
boost::shared_ptr<IOAddress> requested_address(new IOAddress("10.0.0.9"));
|
||||
@@ -2636,7 +2609,7 @@ DORATest::storeExtendedInfoEnabled() {
|
||||
client.setCircuitId("charter950");
|
||||
|
||||
// Configure DHCP server.
|
||||
configure(DORA_CONFIGS[17], *client.getServer());
|
||||
configure(DORA_CONFIGS[16], *client.getServer());
|
||||
// Client A performs 4-way exchange and should obtain a reserved
|
||||
// address.
|
||||
ASSERT_NO_THROW_LOG(client.doDORA(boost::shared_ptr<
|
||||
@@ -2684,7 +2657,7 @@ DORATest::storeExtendedInfoDisabled() {
|
||||
client.setCircuitId("charter950");
|
||||
|
||||
// Configure DHCP server.
|
||||
configure(DORA_CONFIGS[17], *client.getServer());
|
||||
configure(DORA_CONFIGS[16], *client.getServer());
|
||||
// Client A performs 4-way exchange and should obtain a reserved
|
||||
// address.
|
||||
ASSERT_NO_THROW_LOG(client.doDORA(boost::shared_ptr<
|
||||
@@ -2799,46 +2772,4 @@ TEST_F(DORAPgSQLTest, multiStageBootMultiThreading) {
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CQL
|
||||
|
||||
// Starting tests which require Cassandra backend availability. Those tests
|
||||
// will not be executed if Kea has been compiled without the
|
||||
// --with-cql.
|
||||
class DORACQLTest : public DORATest {
|
||||
public:
|
||||
/// @brief Constructor.
|
||||
///
|
||||
/// Recreates CQL schema for a test.
|
||||
DORACQLTest() : DORATest() {
|
||||
// Ensure we have the proper schema with no transient data.
|
||||
db::test::createCqlSchema();
|
||||
}
|
||||
|
||||
/// @brief Destructor.
|
||||
///
|
||||
/// Destroys CQL schema.
|
||||
virtual ~DORACQLTest() {
|
||||
// If data wipe enabled, delete transient data otherwise destroy the schema
|
||||
db::test::destroyCqlSchema();
|
||||
}
|
||||
};
|
||||
|
||||
// Test that the client using the same hardware address but multiple
|
||||
// client identifiers will obtain multiple leases (CQL lease database).
|
||||
TEST_F(DORACQLTest, multiStageBoot) {
|
||||
Dhcpv4SrvMTTestGuard guard(*this, false);
|
||||
// DORA_CONFIGS[10] to be used for server configuration.
|
||||
testMultiStageBoot(10);
|
||||
}
|
||||
|
||||
// Test that the client using the same hardware address but multiple
|
||||
// client identifiers will obtain multiple leases (CQL lease database).
|
||||
TEST_F(DORACQLTest, multiStageBootMultiThreading) {
|
||||
Dhcpv4SrvMTTestGuard guard(*this, true);
|
||||
// DORA_CONFIGS[10] to be used for server configuration.
|
||||
testMultiStageBoot(10);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // end of anonymous namespace
|
||||
|
@@ -276,7 +276,6 @@ TEST(ParserTest, file) {
|
||||
"all-keys.json",
|
||||
"all-options.json",
|
||||
"backends.json",
|
||||
"cassandra.json",
|
||||
"classify.json",
|
||||
"classify2.json",
|
||||
"comments.json",
|
||||
|
@@ -10,9 +10,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
AM_CPPFLAGS += $(CQL_CPPFLAGS)
|
||||
endif
|
||||
|
||||
AM_CXXFLAGS = $(KEA_CXXFLAGS)
|
||||
|
||||
@@ -61,9 +58,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
kea_dhcp6_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
|
||||
endif
|
||||
if HAVE_CQL
|
||||
kea_dhcp6_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
|
||||
endif
|
||||
|
||||
kea_dhcp6_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
|
||||
|
||||
@@ -85,9 +79,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
kea_dhcp6_LDFLAGS += $(PGSQL_LIBS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
kea_dhcp6_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
|
||||
kea_dhcp6dir = $(pkgdatadir)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -594,15 +594,6 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
|
||||
}
|
||||
}
|
||||
|
||||
\"cql\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::DATABASE_TYPE:
|
||||
return isc::dhcp::Dhcp6Parser::make_CQL(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("cql", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"user\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
@@ -681,39 +672,6 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
|
||||
}
|
||||
}
|
||||
|
||||
\"keyspace\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp6Parser::make_KEYSPACE(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("keyspace", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"consistency\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp6Parser::make_CONSISTENCY(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("consistency", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"serial-consistency\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp6Parser::make_SERIAL_CONSISTENCY(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("serial-consistency", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"reconnect-wait-time\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
@@ -763,50 +721,6 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
|
||||
}
|
||||
}
|
||||
|
||||
\"request-timeout\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp6Parser::make_REQUEST_TIMEOUT(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("request-timeout", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"tcp-keepalive\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp6Parser::make_TCP_KEEPALIVE(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("tcp-keepalive", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"tcp-nodelay\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp6Parser::make_TCP_NODELAY(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("tcp-nodelay", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"contact-points\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||
return isc::dhcp::Dhcp6Parser::make_CONTACT_POINTS(driver.loc_);
|
||||
default:
|
||||
return isc::dhcp::Dhcp6Parser::make_STRING("contact-points", driver.loc_);
|
||||
}
|
||||
}
|
||||
|
||||
\"max-reconnect-tries\" {
|
||||
switch(driver.ctx_) {
|
||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -67,7 +67,6 @@ using namespace std;
|
||||
MEMFILE "memfile"
|
||||
MYSQL "mysql"
|
||||
POSTGRESQL "postgresql"
|
||||
CQL "cql"
|
||||
USER "user"
|
||||
PASSWORD "password"
|
||||
HOST "host"
|
||||
@@ -76,19 +75,12 @@ using namespace std;
|
||||
LFC_INTERVAL "lfc-interval"
|
||||
READONLY "readonly"
|
||||
CONNECT_TIMEOUT "connect-timeout"
|
||||
CONTACT_POINTS "contact-points"
|
||||
MAX_RECONNECT_TRIES "max-reconnect-tries"
|
||||
RECONNECT_WAIT_TIME "reconnect-wait-time"
|
||||
ON_FAIL "on-fail"
|
||||
STOP_RETRY_EXIT "stop-retry-exit"
|
||||
SERVE_RETRY_EXIT "serve-retry-exit"
|
||||
SERVE_RETRY_CONTINUE "serve-retry-continue"
|
||||
KEYSPACE "keyspace"
|
||||
CONSISTENCY "consistency"
|
||||
SERIAL_CONSISTENCY "serial-consistency"
|
||||
REQUEST_TIMEOUT "request-timeout"
|
||||
TCP_KEEPALIVE "tcp-keepalive"
|
||||
TCP_NODELAY "tcp-nodelay"
|
||||
MAX_ROW_ERRORS "max-row-errors"
|
||||
TRUST_ANCHOR "trust-anchor"
|
||||
CERT_FILE "cert-file"
|
||||
@@ -923,16 +915,9 @@ database_map_param: database_type
|
||||
| lfc_interval
|
||||
| readonly
|
||||
| connect_timeout
|
||||
| contact_points
|
||||
| max_reconnect_tries
|
||||
| reconnect_wait_time
|
||||
| on_fail
|
||||
| request_timeout
|
||||
| tcp_keepalive
|
||||
| tcp_nodelay
|
||||
| keyspace
|
||||
| consistency
|
||||
| serial_consistency
|
||||
| max_row_errors
|
||||
| trust_anchor
|
||||
| cert_file
|
||||
@@ -952,7 +937,6 @@ database_type: TYPE {
|
||||
db_type: MEMFILE { $$ = ElementPtr(new StringElement("memfile", ctx.loc2pos(@1))); }
|
||||
| MYSQL { $$ = ElementPtr(new StringElement("mysql", ctx.loc2pos(@1))); }
|
||||
| POSTGRESQL { $$ = ElementPtr(new StringElement("postgresql", ctx.loc2pos(@1))); }
|
||||
| CQL { $$ = ElementPtr(new StringElement("cql", ctx.loc2pos(@1))); }
|
||||
;
|
||||
|
||||
user: USER {
|
||||
@@ -1046,66 +1030,12 @@ max_row_errors: MAX_ROW_ERRORS COLON INTEGER {
|
||||
ctx.stack_.back()->set("max-row-errors", n);
|
||||
};
|
||||
|
||||
request_timeout: REQUEST_TIMEOUT COLON INTEGER {
|
||||
ctx.unique("request-timeout", ctx.loc2pos(@1));
|
||||
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("request-timeout", n);
|
||||
};
|
||||
|
||||
tcp_keepalive: TCP_KEEPALIVE COLON INTEGER {
|
||||
ctx.unique("tcp-keepalive", ctx.loc2pos(@1));
|
||||
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("tcp-keepalive", n);
|
||||
};
|
||||
|
||||
tcp_nodelay: TCP_NODELAY COLON BOOLEAN {
|
||||
ctx.unique("tcp-nodelay", ctx.loc2pos(@1));
|
||||
ElementPtr n(new BoolElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("tcp-nodelay", n);
|
||||
};
|
||||
|
||||
contact_points: CONTACT_POINTS {
|
||||
ctx.unique("contact-points", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
} COLON STRING {
|
||||
ElementPtr cp(new StringElement($4, ctx.loc2pos(@4)));
|
||||
ctx.stack_.back()->set("contact-points", cp);
|
||||
ctx.leave();
|
||||
};
|
||||
|
||||
max_reconnect_tries: MAX_RECONNECT_TRIES COLON INTEGER {
|
||||
ctx.unique("max-reconnect-tries", ctx.loc2pos(@1));
|
||||
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||
ctx.stack_.back()->set("max-reconnect-tries", n);
|
||||
};
|
||||
|
||||
keyspace: KEYSPACE {
|
||||
ctx.unique("keyspace", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
} COLON STRING {
|
||||
ElementPtr ks(new StringElement($4, ctx.loc2pos(@4)));
|
||||
ctx.stack_.back()->set("keyspace", ks);
|
||||
ctx.leave();
|
||||
};
|
||||
|
||||
consistency: CONSISTENCY {
|
||||
ctx.unique("consistency", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
} COLON STRING {
|
||||
ElementPtr c(new StringElement($4, ctx.loc2pos(@4)));
|
||||
ctx.stack_.back()->set("consistency", c);
|
||||
ctx.leave();
|
||||
};
|
||||
|
||||
serial_consistency: SERIAL_CONSISTENCY {
|
||||
ctx.unique("serial-consistency", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
} COLON STRING {
|
||||
ElementPtr c(new StringElement($4, ctx.loc2pos(@4)));
|
||||
ctx.stack_.back()->set("serial-consistency", c);
|
||||
ctx.leave();
|
||||
};
|
||||
|
||||
trust_anchor: TRUST_ANCHOR {
|
||||
ctx.unique("trust-anchor", ctx.loc2pos(@1));
|
||||
ctx.enter(ctx.NO_KEYWORD);
|
||||
|
@@ -61,9 +61,6 @@
|
||||
#ifdef HAVE_PGSQL
|
||||
#include <dhcpsrv/pgsql_lease_mgr.h>
|
||||
#endif
|
||||
#ifdef HAVE_CQL
|
||||
#include <dhcpsrv/cql_lease_mgr.h>
|
||||
#endif
|
||||
#include <dhcpsrv/memfile_lease_mgr.h>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
@@ -4186,9 +4183,6 @@ Dhcpv6Srv::getVersion(bool extended) {
|
||||
#endif
|
||||
#ifdef HAVE_PGSQL
|
||||
tmp << PgSqlLeaseMgr::getDBVersion() << endl;
|
||||
#endif
|
||||
#ifdef HAVE_CQL
|
||||
tmp << CqlLeaseMgr::getDBVersion() << endl;
|
||||
#endif
|
||||
tmp << Memfile_LeaseMgr::getDBVersion(Memfile_LeaseMgr::V6);
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
// A Bison parser, made by GNU Bison 3.8.2.
|
||||
// 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
|
||||
@@ -15,7 +15,7 @@
|
||||
// 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 <https://www.gnu.org/licenses/>.
|
||||
// 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
|
||||
@@ -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
|
||||
|
@@ -121,9 +121,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
dhcp6_unittests_LDFLAGS += $(PGSQL_LIBS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
dhcp6_unittests_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
dhcp6_unittests_LDFLAGS += $(GTEST_LDFLAGS)
|
||||
|
||||
dhcp6_unittests_LDADD = $(top_builddir)/src/bin/dhcp6/libdhcp6.la
|
||||
@@ -148,10 +145,6 @@ if HAVE_PGSQL
|
||||
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/pgsql/testutils/libpgsqltest.la
|
||||
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
|
||||
endif
|
||||
if HAVE_CQL
|
||||
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cql/testutils/libcqltest.la
|
||||
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
|
||||
endif
|
||||
|
||||
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/database/testutils/libdatabasetest.la
|
||||
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
|
||||
|
@@ -282,7 +282,6 @@ TEST(ParserTest, file) {
|
||||
configs.push_back("all-keys.json");
|
||||
configs.push_back("all-options.json");
|
||||
configs.push_back("backends.json");
|
||||
configs.push_back("cassandra.json");
|
||||
configs.push_back("classify.json");
|
||||
configs.push_back("classify2.json");
|
||||
configs.push_back("comments.json");
|
||||
|
@@ -54,8 +54,8 @@
|
||||
|
||||
// Use Memfile lease database backend to store leases in a CSV file.
|
||||
// Depending on how Kea was compiled, it may also support SQL databases
|
||||
// (MySQL and/or PostgreSQL) and even Cassandra. Those database backends
|
||||
// require more parameters, like name, host and possibly user and password.
|
||||
// (MySQL and/or PostgreSQL). Those database backends require more
|
||||
// parameters, like name, host and possibly user and password.
|
||||
// There are dedicated examples for each backend. See Section 7.2.2 "Lease
|
||||
// Storage" for details.
|
||||
"lease-database": {
|
||||
|
@@ -48,8 +48,8 @@
|
||||
|
||||
// Use Memfile lease database backend to store leases in a CSV file.
|
||||
// Depending on how Kea was compiled, it may also support SQL databases
|
||||
// (MySQL and/or PostgreSQL) and even Cassandra. Those database backends
|
||||
// require more parameters, like name, host and possibly user and password.
|
||||
// (MySQL and/or PostgreSQL). Those database backends require more
|
||||
// parameters, like name, host and possibly user and password.
|
||||
// There are dedicated examples for each backend. See Section 8.2.2 "Lease
|
||||
// Storage" for details.
|
||||
"lease-database": {
|
||||
|
@@ -43,9 +43,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
kea_lfc_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
|
||||
endif
|
||||
if HAVE_CQL
|
||||
kea_lfc_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
|
||||
endif
|
||||
|
||||
kea_lfc_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
|
||||
|
||||
@@ -66,9 +63,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
kea_lfc_LDFLAGS += $(PGSQL_LIBS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
kea_lfc_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
|
||||
kea_lfcdir = $(pkgdatadir)
|
||||
|
||||
|
@@ -33,9 +33,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
lfc_unittests_LDFLAGS += $(PGSQL_LIBS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
lfc_unittests_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
lfc_unittests_LDFLAGS += $(GTEST_LDFLAGS)
|
||||
|
||||
lfc_unittests_LDADD = $(top_builddir)/src/bin/lfc/liblfc.la
|
||||
@@ -55,9 +52,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
lfc_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
|
||||
endif
|
||||
if HAVE_CQL
|
||||
lfc_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
|
||||
endif
|
||||
|
||||
lfc_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
|
||||
lfc_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
|
||||
|
@@ -32,9 +32,9 @@ interface from control agent), the code receives a JSON command with
|
||||
parameters. Those are parsed and then actual operation commences. This
|
||||
operation always interacts with an instantiation of isc::dhcp::LeaseMgr
|
||||
instance, which is Kea's way of storing leases. At the time of writing this text
|
||||
(Aug. 2017), Kea supports four types of lease managers: memfile, MySQL,
|
||||
PostgreSQL or Cassandra. The lease commands provided by this library
|
||||
provide a unified interface for those backends.
|
||||
(Aug. 2017), Kea supports four types of lease managers: memfile, MySQL or
|
||||
PostgreSQL. The lease commands provided by this library provide a unified
|
||||
interface for those backends.
|
||||
|
||||
As with other hooks, this one also keeps its code in a separate namespace which
|
||||
corresponds to the file name of the library: isc::lease_cmds.
|
||||
@@ -74,8 +74,8 @@ The lease manipulation commands were implemented to provide a convenient interfa
|
||||
for sysadmins. The primary goal was to offer a way to interact with the live
|
||||
lease database in unified way, regardless of the actual backend being used.
|
||||
|
||||
For some backends (MySQL, PostgreSQL and Cassandra) it is possible to interact
|
||||
directly with the backend while Kea is running and possibly change its content. This
|
||||
For some backends (MySQL and PostgreSQL) it is possible to interact directly
|
||||
with the backend while Kea is running and possibly change its content. This
|
||||
ability is both powerful and dangerous. In particular, only rudimentary
|
||||
checks are enforced by the DB schemas (e.g. not possible to have two leases
|
||||
for the same address). However, it does not prevent sysadmins from making
|
||||
|
@@ -57,9 +57,5 @@ lease_cmds_unittests_LDADD += $(CRYPTO_LIBS)
|
||||
lease_cmds_unittests_LDADD += $(BOOST_LIBS)
|
||||
lease_cmds_unittests_LDADD += $(GTEST_LDADD)
|
||||
|
||||
if HAVE_CQL
|
||||
lease_cmds_unittests_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
|
||||
endif
|
||||
noinst_PROGRAMS = $(TESTS)
|
||||
|
@@ -41,9 +41,9 @@ constructed and shipped back to the client.
|
||||
|
||||
This lease statistics commands interact with both the isc::dhcp::StatsMgr
|
||||
and the isc::dhcp::LeaseMgr instance. At the time of writing this text
|
||||
(May, 2018), Kea supports four types of lease managers: memfile, MySQL,
|
||||
PostgreSQL or Cassandra. The lease statistics commands provided by this
|
||||
library provide a unified interface supported by all four of these backends.
|
||||
(May, 2018), Kea supports four types of lease managers: memfile, MySQL or
|
||||
PostgreSQL. The lease statistics commands provided by this library provide a
|
||||
unified interface supported by all four of these backends.
|
||||
|
||||
As with other hooks, this one keeps its code in a separate namespace which
|
||||
corresponds to the file name of the library: isc::stat_cmds.
|
||||
|
@@ -12,10 +12,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
AM_CPPFLAGS += $(CQL_CPPFLAGS)
|
||||
endif
|
||||
|
||||
|
||||
AM_CXXFLAGS = $(KEA_CXXFLAGS)
|
||||
|
||||
@@ -73,9 +69,6 @@ endif
|
||||
if HAVE_PGSQL
|
||||
stat_cmds_unittests_LDFLAGS += $(PGSQL_LIBS)
|
||||
endif
|
||||
if HAVE_CQL
|
||||
stat_cmds_unittests_LDFLAGS += $(CQL_LIBS)
|
||||
endif
|
||||
|
||||
endif
|
||||
noinst_PROGRAMS = $(TESTS)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user