<listitem>
<para>
- The development tools "make".
+ The development tools automake, libtool, pkg-config.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The MySQL client and the client development libraries, when using
- the --with-dhcp-mysql configuration flag to build the Kea MySQL
++ the --with-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
+ running the unit tests requires a local MySQL server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The PostgreSQL client and the client development libraries, when
- using the --with-dhcp-pgsql configuration flag to build the Kea
++ using the --with-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
+ required. Note that running the unit tests requires a local
+ PostgreSQL server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ googletest (version 1.6 or later), when using the --with-gtest configuration
+ option to build the unit tests.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>--with-boost-lib-dir</term>
- <term>--with-dhcp-mysql</term>
++ <term>--with-mysql</term>
<listitem>
- <simpara>Specify the path to Boost libraries to link with
- (usually there should be no reason to specify this option).
+ <simpara>
+ Build Kea with code to allow it to store leases (and access
+ host reservations) in a MySQL database.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
- <term>--with-botan-config</term>
- <term>--with-dhcp-pgsql</term>
++ <term>--with-pgsql</term>
<listitem>
- <simpara>Specify the path to the botan-config
- script to build with Botan for the crypto code.
+ <simpara>
+ Build Kea with code to allow it to store leases (and access
+ host reservations) in a PostgreSQL database.
</simpara>
</listitem>
</varlistentry>
<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"/>), do:
- "configure" step (see <xref linkend="configure"/>), the --with-dhcp-mysql switch
++ "configure" step (see <xref linkend="configure"/>), the --with-mysql switch
+ should be specified:
- <screen><userinput>./configure [other-options] --with-dhcp-mysql</userinput></screen>
+ <screen><userinput>./configure [other-options] --with-mysql</userinput></screen>
- Or specify the location of the MySQL configuration program
- "mysql_config" if MySQL was not installed in the default location:
+ 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-dhcp-mysql=<replaceable>path-to-mysql_config</replaceable></userinput></screen>
+ <screen><userinput>./configure [other-options] --with-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"/>), do:
- "configure" step (see <xref linkend="configure"/>), the --with-dhcp-pgsql switch
++ "configure" step (see <xref linkend="configure"/>), the --with-pgsql switch
+ should be specified:
- <screen><userinput>./configure [other-options] --with-dhcp-pgsql</userinput></screen>
+ <screen><userinput>./configure [other-options] --with-pgsql</userinput></screen>
- Or specify the location of the PostgreSQL configuration
- program "pg_config" if PostgreSQL was not installed in
- the default location:
+ 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-dhcp-pgsql=<replaceable>path-to-pg_config</replaceable></userinput></screen>
+ <screen><userinput>./configure [other-options] --with-pgsql=<replaceable>path-to-pg_config</replaceable></userinput></screen>
</para>
<para>
See <xref linkend="pgsql-database-create"/> for details regarding
// address: int
// The address in the Lease structure is an IOAddress object.
// Convert this to an integer for storage.
- addr4_ = static_cast<cass_int32_t>(uint32_t(lease_->addr_));
- addr4_ = lease_->addr_.toUint32();
- data.add(&addr4_);
++ addr4_ = static_cast<cass_int32_t>(lease_->addr_.toUint32());
+ data.add(reinterpret_cast<void*>(&addr4_));
// hwaddr: blob
- HWAddrPtr hwaddr = lease_->hwaddr_;
- if (hwaddr) {
- if (hwaddr->hwaddr_.size() > HWAddr::MAX_HWADDR_LEN) {
- isc_throw(DbOperationError, "Hardware address length " <<
+ if (lease_->hwaddr_) {
+ if (lease_->hwaddr_->hwaddr_.size() > HWAddr::MAX_HWADDR_LEN) {
+ isc_throw(DbOperationError, "hardware address " <<
+ lease_->hwaddr_->toText() << " of length " <<
lease_->hwaddr_->hwaddr_.size() <<
- " exceeds maximum allowed of " <<
+ " exceeds maximum allowed length of " <<
HWAddr::MAX_HWADDR_LEN);
}
- hwaddr_ = hwaddr->hwaddr_;
+ hwaddr_ = lease_->hwaddr_->hwaddr_;
} else {
hwaddr_.clear();
}
// Set up the WHERE clause value
CqlDataArray data;
- cass_int32_t addr4_data = static_cast<cass_int32_t>(uint32_t(addr));
- uint32_t addr4_data = addr.toUint32();
- data.add(&addr4_data);
++ cass_int32_t addr4_data = static_cast<cass_int32_t>(addr.toUint32());
+ data.add(reinterpret_cast<void*>(&addr4_data));
// Get the data
Lease4Ptr result;
data.remove(0);
// Set up the WHERE clause and append it to the SQL_BIND array
- cass_int32_t addr4_data = static_cast<cass_int32_t>(uint32_t(lease->addr_));
- uint32_t addr4_data = lease->addr_.toUint32();
- data.add(&addr4_data);
++ cass_int32_t addr4_data = static_cast<cass_int32_t>(lease->addr_.toUint32());
+ data.add(reinterpret_cast<void*>(&addr4_data));
// Drop to common update code
updateLeaseCommon(stindex, data, lease, *exchange4_);
CqlDataArray data;
if (addr.isV4()) {
- cass_int32_t addr4_data = static_cast<cass_int32_t>(uint32_t(addr));
- uint32_t addr4_data = addr.toUint32();
- data.add(&addr4_data);
++ cass_int32_t addr4_data = static_cast<cass_int32_t>(addr.toUint32());
+ data.add(reinterpret_cast<void*>(&addr4_data));
- return deleteLeaseCommon(DELETE_LEASE4, data, *exchange4_);
+ return (deleteLeaseCommon(DELETE_LEASE4, data, *exchange4_));
} else {
- std::string text_buffer = addr.toText();
- uint32_t addr6_length = text_buffer.size();
- char addr6_buffer[ADDRESS6_TEXT_MAX_LEN + 1];
- if (addr6_length >= sizeof(addr6_buffer)) {
- isc_throw(BadValue, "address value is too large: " << text_buffer);
+ if (addr_data.size() > ADDRESS6_TEXT_MAX_LEN) {
+ isc_throw(BadValue, "deleteLease(): " <<
+ "address " << addr_data << " of length " <<
+ addr_data.size() << " exceeds maximum allowed length of " <<
+ ADDRESS6_TEXT_MAX_LEN);
}
- if (addr6_length) {
- memcpy(addr6_buffer, text_buffer.c_str(), addr6_length);
- }
- addr6_buffer[addr6_length] = '\0';
- data.add(addr6_buffer);
+ data.add(reinterpret_cast<void*>(&addr_data));
- return deleteLeaseCommon(DELETE_LEASE6, data, *exchange6_);
+ return (deleteLeaseCommon(DELETE_LEASE6, data, *exchange6_));
}
}