# the --with-mysql-config (default to /usr/bin/mysql-config). By default,
# the software is not built with MySQL support enabled.
mysql_config="no"
-AC_ARG_WITH([mysql],
- AC_HELP_STRING([--with-mysql=PATH],
+AC_ARG_WITH([dhcp-mysql],
+ AC_HELP_STRING([--with-dhcp-mysql=PATH],
[path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
[mysql_config="$withval"])
if test "$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
MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`
AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
pg_config="no"
-AC_ARG_WITH([pgsql],
- AC_HELP_STRING([--with-pgsql=PATH],
+AC_ARG_WITH([dhcp-pgsql],
+ AC_HELP_STRING([--with-dhcp-pgsql=PATH],
[path to the PostgreSQL 'pg_config' script]),
[pg_config="$withval"])
if test "$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
PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
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 \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:
@code
<listitem>
<para>
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
running locally or on a machine reachable over a network
is required. Note that
<listitem>
<para>
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 server running locally or on some other machine,
reachable over the network from the machine running Kea, is
</varlistentry>
<varlistentry>
- <term>--with-mysql</term>
+ <term>--with-dhcp-mysql</term>
<listitem>
<simpara>
Build Kea with code to allow it to store leases (and access
</varlistentry>
<varlistentry>
- <term>--with-pgsql</term>
+ <term>--with-dhcp-pgsql</term>
<listitem>
<simpara>
Build Kea with code to allow it to store leases (and access
<screen>$ <userinput>./configure \
--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>
</para>
<para>
Build and install Kea as described in <xref linkend="installation"/>, with
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:
- <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
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>
See <xref linkend="mysql-database-create"/> for details regarding
<para>
Build and install Kea as described in <xref linkend="installation"/>, with
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:
- <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
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>
See <xref linkend="pgsql-database-create"/> for details regarding
// Starting tests which require MySQL backend availability. Those tests
// will not be executed if Kea has been compiled without the
-// --with-mysql.
+// --with-dhcp-mysql.
#ifdef HAVE_MYSQL
/// @brief Test fixture class for the tests utilizing MySQL database
return (answer);
}
} catch (const std::exception& ex) {
- return (isc::config::createAnswer(1, "Failed to process configuration:" +
- string(ex.what())));
+ return (isc::config::createAnswer(1, "Failed to process configuration:"
+ + string(ex.what())));
}
// Re-open lease and host database with new parameters.
cfg_db->createManagers();
} catch (const std::exception& ex) {
- return (isc::config::createAnswer(1, "Unable to open database: " +
- std::string(ex.what())));
+ return (isc::config::createAnswer(1, "Unable to open database: "
+ + std::string(ex.what())));
}
// Regenerate server identifier if needed.
// Starting tests which require MySQL backend availability. Those tests
// will not be executed if Kea has been compiled without the
-// --with-mysql.
+// --with-dhcp-mysql.
#ifdef HAVE_MYSQL
/// @brief Test fixture class for the tests utilizing MySQL database
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_ADDR, data, result);
- return result;
+ return (result);
}
Lease4Collection
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
exchange4->getLeaseCollection(CqlLease4Exchange::GET_LEASE4_HWADDR, data, result);
- return result;
+ return (result);
}
Lease4Ptr
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_HWADDR_SUBID, data, result);
- return result;
+ return (result);
}
Lease4Collection
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
exchange4->getLeaseCollection(CqlLease4Exchange::GET_LEASE4_CLIENTID, data, result);
- return result;
+ return (result);
}
Lease4Ptr
std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
exchange4->getLease(CqlLease4Exchange::GET_LEASE4_CLIENTID_SUBID, data, result);
- return result;
+ return (result);
}
Lease4Collection
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
exchange6->getLease(CqlLease6Exchange::GET_LEASE6_ADDR, data, result);
- return result;
+ return (result);
}
Lease6Collection
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_DUID_IAID, data, result);
- return result;
+ return (result);
}
Lease6Collection
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_DUID_IAID_SUBID, data, result);
- return result;
+ return (result);
}
void
- The MySQL lease manager uses the freely available MySQL as its backend
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.
- The PostgreSQL lease manager uses the freely available PostgreSQL as its
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.
@section dhcpdb-instantiation Instantiation of Lease Managers