mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 14:35:29 +00:00
sync with isc kea master
This commit is contained in:
12
configure.ac
12
configure.ac
@@ -609,8 +609,8 @@ AX_CRYPTO
|
|||||||
# the --with-mysql-config (default to /usr/bin/mysql-config). By default,
|
# the --with-mysql-config (default to /usr/bin/mysql-config). By default,
|
||||||
# the software is not built with MySQL support enabled.
|
# the software is not built with MySQL support enabled.
|
||||||
mysql_config="no"
|
mysql_config="no"
|
||||||
AC_ARG_WITH([mysql],
|
AC_ARG_WITH([dhcp-mysql],
|
||||||
AC_HELP_STRING([--with-mysql=PATH],
|
AC_HELP_STRING([--with-dhcp-mysql=PATH],
|
||||||
[path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
|
[path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
|
||||||
[mysql_config="$withval"])
|
[mysql_config="$withval"])
|
||||||
|
|
||||||
@@ -622,7 +622,7 @@ fi
|
|||||||
|
|
||||||
if test "$MYSQL_CONFIG" != "" ; then
|
if test "$MYSQL_CONFIG" != "" ; then
|
||||||
if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
|
if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
|
||||||
AC_MSG_ERROR([--with-mysql should point to a mysql_config program])
|
AC_MSG_ERROR([--with-dhcp-mysql should point to a mysql_config program])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`
|
MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`
|
||||||
@@ -663,8 +663,8 @@ AC_CHECK_HEADERS(sys/filio.h,,,)
|
|||||||
AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
|
AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
|
||||||
|
|
||||||
pg_config="no"
|
pg_config="no"
|
||||||
AC_ARG_WITH([pgsql],
|
AC_ARG_WITH([dhcp-pgsql],
|
||||||
AC_HELP_STRING([--with-pgsql=PATH],
|
AC_HELP_STRING([--with-dhcp-pgsql=PATH],
|
||||||
[path to the PostgreSQL 'pg_config' script]),
|
[path to the PostgreSQL 'pg_config' script]),
|
||||||
[pg_config="$withval"])
|
[pg_config="$withval"])
|
||||||
|
|
||||||
@@ -676,7 +676,7 @@ fi
|
|||||||
|
|
||||||
if test "$PG_CONFIG" != "" ; then
|
if test "$PG_CONFIG" != "" ; then
|
||||||
if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then
|
if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then
|
||||||
AC_MSG_ERROR([--with-pgsql should point to a pg_config program])
|
AC_MSG_ERROR([--with-dhcp-pgsql should point to a pg_config program])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
|
PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
|
||||||
|
@@ -122,7 +122,7 @@ documentation, use \c --enable-generate-docs. If you are modifying DHCP
|
|||||||
code, you are likely to be interested in enabling a non-default database
|
code, you are likely to be interested in enabling a non-default database
|
||||||
backends for DHCP. Note that if the backend is not enabled,
|
backends for DHCP. Note that if the backend is not enabled,
|
||||||
the database-specific unit-tests are skipped. To enable the MySQL backend,
|
the database-specific unit-tests are skipped. To enable the MySQL backend,
|
||||||
use the switch \c --with-mysql; for PostgreSQL, use \c --with-pgsql.
|
use the switch \c --with-dhcp-mysql; for PostgreSQL, use \c --with-dhcp-pgsql.
|
||||||
A complete list of all switches can be obtained with the command:
|
A complete list of all switches can be obtained with the command:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
|
@@ -157,7 +157,7 @@ Debian and Ubuntu:
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The MySQL client and the client development libraries, when using
|
The MySQL client and the client development libraries, when using
|
||||||
the --with-mysql configuration flag to build the Kea MySQL
|
the --with-dhcp-mysql configuration flag to build the Kea MySQL
|
||||||
database backend. In this case an instance of the MySQL server
|
database backend. In this case an instance of the MySQL server
|
||||||
running locally or on a machine reachable over a network
|
running locally or on a machine reachable over a network
|
||||||
is required. Note that
|
is required. Note that
|
||||||
@@ -168,7 +168,7 @@ Debian and Ubuntu:
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The PostgreSQL client and the client development libraries, when
|
The PostgreSQL client and the client development libraries, when
|
||||||
using the --with-pgsql configuration flag to build the Kea
|
using the --with-dhcp-pgsql configuration flag to build the Kea
|
||||||
PostgreSQL database backend. In this case an instance of the
|
PostgreSQL database backend. In this case an instance of the
|
||||||
PostgreSQL server running locally or on some other machine,
|
PostgreSQL server running locally or on some other machine,
|
||||||
reachable over the network from the machine running Kea, is
|
reachable over the network from the machine running Kea, is
|
||||||
@@ -315,7 +315,7 @@ Debian and Ubuntu:
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>--with-mysql</term>
|
<term>--with-dhcp-mysql</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<simpara>
|
<simpara>
|
||||||
Build Kea with code to allow it to store leases (and access
|
Build Kea with code to allow it to store leases (and access
|
||||||
@@ -325,7 +325,7 @@ Debian and Ubuntu:
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>--with-pgsql</term>
|
<term>--with-dhcp-pgsql</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<simpara>
|
<simpara>
|
||||||
Build Kea with code to allow it to store leases (and access
|
Build Kea with code to allow it to store leases (and access
|
||||||
@@ -386,7 +386,7 @@ Debian and Ubuntu:
|
|||||||
|
|
||||||
<screen>$ <userinput>./configure \
|
<screen>$ <userinput>./configure \
|
||||||
--with-boost-include=/usr/pkg/include \
|
--with-boost-include=/usr/pkg/include \
|
||||||
--with-pgsql=/usr/local/bin/pg_config \
|
--with-dhcp-pgsql=/usr/local/bin/pg_config \
|
||||||
--prefix=/opt/kea</userinput></screen>
|
--prefix=/opt/kea</userinput></screen>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@@ -518,12 +518,12 @@ Debian and Ubuntu:
|
|||||||
<para>
|
<para>
|
||||||
Build and install Kea as described in <xref linkend="installation"/>, with
|
Build and install Kea as described in <xref linkend="installation"/>, with
|
||||||
the following modification. To enable the MySQL database code, at the
|
the following modification. To enable the MySQL database code, at the
|
||||||
"configure" step (see <xref linkend="configure"/>), the --with-mysql switch
|
"configure" step (see <xref linkend="configure"/>), the --with-dhcp-mysql switch
|
||||||
should be specified:
|
should be specified:
|
||||||
<screen><userinput>./configure [other-options] --with-mysql</userinput></screen>
|
<screen><userinput>./configure [other-options] --with-dhcp-mysql</userinput></screen>
|
||||||
If MySQL was not installed in the default location, the location of the MySQL
|
If MySQL was not installed in the default location, the location of the MySQL
|
||||||
configuration program "mysql_config" should be included with the switch, i.e.
|
configuration program "mysql_config" should be included with the switch, i.e.
|
||||||
<screen><userinput>./configure [other-options] --with-mysql=<replaceable>path-to-mysql_config</replaceable></userinput></screen>
|
<screen><userinput>./configure [other-options] --with-dhcp-mysql=<replaceable>path-to-mysql_config</replaceable></userinput></screen>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
See <xref linkend="mysql-database-create"/> for details regarding
|
See <xref linkend="mysql-database-create"/> for details regarding
|
||||||
@@ -540,12 +540,12 @@ Debian and Ubuntu:
|
|||||||
<para>
|
<para>
|
||||||
Build and install Kea as described in <xref linkend="installation"/>, with
|
Build and install Kea as described in <xref linkend="installation"/>, with
|
||||||
the following modification. To enable the PostgreSQL database code, at the
|
the following modification. To enable the PostgreSQL database code, at the
|
||||||
"configure" step (see <xref linkend="configure"/>), the --with-pgsql switch
|
"configure" step (see <xref linkend="configure"/>), the --with-dhcp-pgsql switch
|
||||||
should be specified:
|
should be specified:
|
||||||
<screen><userinput>./configure [other-options] --with-pgsql</userinput></screen>
|
<screen><userinput>./configure [other-options] --with-dhcp-pgsql</userinput></screen>
|
||||||
If PostgreSQL was not installed in the default location, the location of the PostgreSQL
|
If PostgreSQL was not installed in the default location, the location of the PostgreSQL
|
||||||
configuration program "pg_config" should be included with the switch, i.e.
|
configuration program "pg_config" should be included with the switch, i.e.
|
||||||
<screen><userinput>./configure [other-options] --with-pgsql=<replaceable>path-to-pg_config</replaceable></userinput></screen>
|
<screen><userinput>./configure [other-options] --with-dhcp-pgsql=<replaceable>path-to-pg_config</replaceable></userinput></screen>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
See <xref linkend="pgsql-database-create"/> for details regarding
|
See <xref linkend="pgsql-database-create"/> for details regarding
|
||||||
|
@@ -641,7 +641,7 @@ TEST_F(JSONFileBackendTest, defaultLeaseDbBackend) {
|
|||||||
|
|
||||||
// Starting tests which require MySQL backend availability. Those tests
|
// Starting tests which require MySQL backend availability. Those tests
|
||||||
// will not be executed if Kea has been compiled without the
|
// will not be executed if Kea has been compiled without the
|
||||||
// --with-mysql.
|
// --with-dhcp-mysql.
|
||||||
#ifdef HAVE_MYSQL
|
#ifdef HAVE_MYSQL
|
||||||
|
|
||||||
/// @brief Test fixture class for the tests utilizing MySQL database
|
/// @brief Test fixture class for the tests utilizing MySQL database
|
||||||
|
@@ -571,8 +571,8 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
|
|||||||
return (answer);
|
return (answer);
|
||||||
}
|
}
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
return (isc::config::createAnswer(1, "Failed to process configuration:" +
|
return (isc::config::createAnswer(1, "Failed to process configuration:"
|
||||||
string(ex.what())));
|
+ string(ex.what())));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-open lease and host database with new parameters.
|
// Re-open lease and host database with new parameters.
|
||||||
@@ -582,8 +582,8 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
|
|||||||
cfg_db->createManagers();
|
cfg_db->createManagers();
|
||||||
|
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
return (isc::config::createAnswer(1, "Unable to open database: " +
|
return (isc::config::createAnswer(1, "Unable to open database: "
|
||||||
std::string(ex.what())));
|
+ std::string(ex.what())));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regenerate server identifier if needed.
|
// Regenerate server identifier if needed.
|
||||||
|
@@ -628,7 +628,7 @@ TEST_F(JSONFileBackendTest, defaultLeaseDbBackend) {
|
|||||||
|
|
||||||
// Starting tests which require MySQL backend availability. Those tests
|
// Starting tests which require MySQL backend availability. Those tests
|
||||||
// will not be executed if Kea has been compiled without the
|
// will not be executed if Kea has been compiled without the
|
||||||
// --with-mysql.
|
// --with-dhcp-mysql.
|
||||||
#ifdef HAVE_MYSQL
|
#ifdef HAVE_MYSQL
|
||||||
|
|
||||||
/// @brief Test fixture class for the tests utilizing MySQL database
|
/// @brief Test fixture class for the tests utilizing MySQL database
|
||||||
|
@@ -1512,7 +1512,7 @@ CqlLeaseMgr::getLease4(const IOAddress &addr) const {
|
|||||||
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
||||||
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_ADDR, data, result);
|
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_ADDR, data, result);
|
||||||
|
|
||||||
return result;
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lease4Collection
|
Lease4Collection
|
||||||
@@ -1531,7 +1531,7 @@ CqlLeaseMgr::getLease4(const HWAddr &hwaddr) const {
|
|||||||
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
||||||
exchange4->getLeaseCollection(CqlLease4Exchange::GET_LEASE4_HWADDR, data, result);
|
exchange4->getLeaseCollection(CqlLease4Exchange::GET_LEASE4_HWADDR, data, result);
|
||||||
|
|
||||||
return result;
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lease4Ptr
|
Lease4Ptr
|
||||||
@@ -1555,7 +1555,7 @@ CqlLeaseMgr::getLease4(const HWAddr &hwaddr, SubnetID subnet_id) const {
|
|||||||
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
||||||
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_HWADDR_SUBID, data, result);
|
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_HWADDR_SUBID, data, result);
|
||||||
|
|
||||||
return result;
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lease4Collection
|
Lease4Collection
|
||||||
@@ -1574,7 +1574,7 @@ CqlLeaseMgr::getLease4(const ClientId &clientid) const {
|
|||||||
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
||||||
exchange4->getLeaseCollection(CqlLease4Exchange::GET_LEASE4_CLIENTID, data, result);
|
exchange4->getLeaseCollection(CqlLease4Exchange::GET_LEASE4_CLIENTID, data, result);
|
||||||
|
|
||||||
return result;
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lease4Ptr
|
Lease4Ptr
|
||||||
@@ -1613,7 +1613,7 @@ CqlLeaseMgr::getLease4(const ClientId &clientid, SubnetID subnet_id) const {
|
|||||||
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
|
||||||
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_CLIENTID_SUBID, data, result);
|
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_CLIENTID_SUBID, data, result);
|
||||||
|
|
||||||
return result;
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lease4Collection
|
Lease4Collection
|
||||||
@@ -1653,7 +1653,7 @@ CqlLeaseMgr::getLease6(Lease::Type lease_type, const IOAddress &addr) const {
|
|||||||
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
|
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
|
||||||
exchange6->getLease(CqlLease6Exchange::GET_LEASE6_ADDR, data, result);
|
exchange6->getLease(CqlLease6Exchange::GET_LEASE6_ADDR, data, result);
|
||||||
|
|
||||||
return result;
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lease6Collection
|
Lease6Collection
|
||||||
@@ -1680,7 +1680,7 @@ CqlLeaseMgr::getLeases6(Lease::Type lease_type, const DUID &duid, uint32_t iaid)
|
|||||||
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
|
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
|
||||||
exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_DUID_IAID, data, result);
|
exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_DUID_IAID, data, result);
|
||||||
|
|
||||||
return result;
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lease6Collection
|
Lease6Collection
|
||||||
@@ -1712,7 +1712,7 @@ CqlLeaseMgr::getLeases6(Lease::Type lease_type, const DUID &duid, uint32_t iaid,
|
|||||||
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
|
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
|
||||||
exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_DUID_IAID_SUBID, data, result);
|
exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_DUID_IAID_SUBID, data, result);
|
||||||
|
|
||||||
return result;
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -23,12 +23,12 @@
|
|||||||
|
|
||||||
- The MySQL lease manager uses the freely available MySQL as its backend
|
- The MySQL lease manager uses the freely available MySQL as its backend
|
||||||
database. This is not included in Kea DHCP by default:
|
database. This is not included in Kea DHCP by default:
|
||||||
the \--with-mysql switch must be supplied to "configure" for support
|
the \--with-dhcp-mysql switch must be supplied to "configure" for support
|
||||||
to be compiled into the software.
|
to be compiled into the software.
|
||||||
|
|
||||||
- The PostgreSQL lease manager uses the freely available PostgreSQL as its
|
- The PostgreSQL lease manager uses the freely available PostgreSQL as its
|
||||||
backend database. This is not included in Kea DHCP by default:
|
backend database. This is not included in Kea DHCP by default:
|
||||||
the \--with-pgsql switch must be supplied to "configure" for
|
the \--with-dhcp-pgsql switch must be supplied to "configure" for
|
||||||
support to be compiled into the software.
|
support to be compiled into the software.
|
||||||
|
|
||||||
@section dhcpdb-instantiation Instantiation of Lease Managers
|
@section dhcpdb-instantiation Instantiation of Lease Managers
|
||||||
|
Reference in New Issue
Block a user