]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Merge remote-tracking branch 'isc-kea/master' into isc-kea-cassandra-update
authorRazvan Becheriu <razvan.becheriu@qualitance.com>
Tue, 6 Dec 2016 09:41:25 +0000 (11:41 +0200)
committerRazvan Becheriu <razvan.becheriu@qualitance.com>
Tue, 6 Dec 2016 09:41:25 +0000 (11:41 +0200)
12 files changed:
1  2 
configure.ac
doc/devel/contribute.dox
doc/examples/kea4/backends.json
doc/examples/kea6/backends.json
doc/guide/install.xml
src/bin/dhcp4/json_config_parser.cc
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/cql_lease_mgr.cc
src/lib/dhcpsrv/database_backends.dox
src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/dhcpsrv/parsers/dbaccess_parser.cc
src/lib/dhcpsrv/pgsql_lease_mgr.cc

diff --cc configure.ac
Simple merge
Simple merge
Simple merge
Simple merge
index 023b563e262fdb037b8f28cbe62ce53fc25bc42d,96fc40c54e9800926c329f6e1a86e5d32c3228cc..a578964812f59150cd33ebe7f3cad7a880b39f63
@@@ -144,7 -150,37 +150,37 @@@ Debian and Ubuntu
  
          <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
Simple merge
Simple merge
index 2b6119c74cf7a1634b89c3a353e9d4a7696a74c7,f7486c6054cfead2769a0502f00026332f3d86d4..9f47231208eaf10210175f735e46d9fcb23c6e99
@@@ -451,19 -563,19 +451,19 @@@ public
              // 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();
              }
@@@ -1123,8 -1387,8 +1123,8 @@@ CqlLeaseMgr::getLease4(const isc::asiol
      // 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;
@@@ -1426,8 -1707,8 +1426,8 @@@ CqlLeaseMgr::updateLease4(const Lease4P
      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_);
@@@ -1506,18 -1805,22 +1506,18 @@@ CqlLeaseMgr::deleteLease(const isc::asi
      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_));
      }
  }
  
Simple merge
Simple merge
Simple merge