From: Marcin Siodelski Date: Wed, 23 Mar 2016 12:51:55 +0000 (+0100) Subject: [master] Merge branch 'trac4212' X-Git-Tag: trac4268a_base X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79481043935789fc6898d4743bede1606f82eb75;p=thirdparty%2Fkea.git [master] Merge branch 'trac4212' --- 79481043935789fc6898d4743bede1606f82eb75 diff --cc src/lib/dhcp/classify.cc index ed499266c0,f7d0d7ad64..95fc5dd08b --- a/src/lib/dhcp/classify.cc +++ b/src/lib/dhcp/classify.cc @@@ -1,8 -1,16 +1,8 @@@ - // Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") + // Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #include #include diff --cc src/lib/dhcp/classify.h index 61911f1047,f717e492d6..174930c348 --- a/src/lib/dhcp/classify.h +++ b/src/lib/dhcp/classify.h @@@ -1,8 -1,16 +1,8 @@@ - // Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") -// Copyright (C) 2014, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") ++// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #ifndef CLASSIFY_H #define CLASSIFY_H diff --cc src/lib/dhcp/tests/classify_unittest.cc index 9de2e284c5,9312d673af..215551eb06 --- a/src/lib/dhcp/tests/classify_unittest.cc +++ b/src/lib/dhcp/tests/classify_unittest.cc @@@ -1,8 -1,16 +1,8 @@@ --// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC") ++// Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #include #include diff --cc src/lib/dhcpsrv/host.cc index be6e8439b6,4ab549fd18..38aa8aa593 --- a/src/lib/dhcpsrv/host.cc +++ b/src/lib/dhcpsrv/host.cc @@@ -78,8 -86,7 +78,8 @@@ Host::Host(const uint8_t* identifier, c ipv6_subnet_id_(ipv6_subnet_id), ipv4_reservation_(asiolink::IOAddress::IPV4_ZERO_ADDRESS()), hostname_(hostname), dhcp4_client_classes_(dhcp4_client_classes), - dhcp6_client_classes_(dhcp6_client_classes), - dhcp6_client_classes_(dhcp6_client_classes), host_id_(0) { ++ dhcp6_client_classes_(dhcp6_client_classes), host_id_(0), + cfg_option4_(), cfg_option6_() { // Initialize HWAddr or DUID setIdentifier(identifier, identifier_len, identifier_type); @@@ -100,8 -107,7 +100,8 @@@ Host::Host(const std::string& identifie ipv6_subnet_id_(ipv6_subnet_id), ipv4_reservation_(asiolink::IOAddress::IPV4_ZERO_ADDRESS()), hostname_(hostname), dhcp4_client_classes_(dhcp4_client_classes), - dhcp6_client_classes_(dhcp6_client_classes), - dhcp6_client_classes_(dhcp6_client_classes), host_id_(0) { ++ dhcp6_client_classes_(dhcp6_client_classes), host_id_(0), + cfg_option4_(new CfgOption()), cfg_option6_(new CfgOption()) { // Initialize HWAddr or DUID setIdentifier(identifier, identifier_name); diff --cc src/lib/dhcpsrv/host.h index b3622a8a56,f04ec847fd..93cd4816fe --- a/src/lib/dhcpsrv/host.h +++ b/src/lib/dhcpsrv/host.h @@@ -482,10 -470,10 +497,15 @@@ private ClientClasses dhcp4_client_classes_; /// @brief Collection of classes associated with a DHCPv6 client. ClientClasses dhcp6_client_classes_; + + /// @brief HostID (a unique identifier assigned when the host is stored in + /// MySQL or Pgsql) + uint64_t host_id_; ++ + /// @brief Pointer to the DHCPv4 option data configuration for this host. + CfgOptionPtr cfg_option4_; + /// @brief Pointer to the DHCPv6 option data configuration for this host. + CfgOptionPtr cfg_option6_; }; /// @brief Pointer to the @c Host object. diff --cc src/lib/dhcpsrv/mysql_connection.cc index 5b114e3069,fbfb345f25..196ecce850 --- a/src/lib/dhcpsrv/mysql_connection.cc +++ b/src/lib/dhcpsrv/mysql_connection.cc @@@ -1,8 -1,16 +1,8 @@@ --// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") ++// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #include diff --cc src/lib/dhcpsrv/mysql_connection.h index 23f3a92f20,8d208234ff..a630529d70 --- a/src/lib/dhcpsrv/mysql_connection.h +++ b/src/lib/dhcpsrv/mysql_connection.h @@@ -1,8 -1,16 +1,8 @@@ --// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") ++// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #ifndef MYSQL_CONNECTION_H #define MYSQL_CONNECTION_H diff --cc src/lib/dhcpsrv/mysql_host_data_source.cc index 17518df8c4,3f1f5ab585..104c0a3c2e --- a/src/lib/dhcpsrv/mysql_host_data_source.cc +++ b/src/lib/dhcpsrv/mysql_host_data_source.cc @@@ -1,8 -1,16 +1,8 @@@ --// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") ++// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #include diff --cc src/lib/dhcpsrv/mysql_host_data_source.h index 890ae72fa0,3f729f8df6..656b7c747b --- a/src/lib/dhcpsrv/mysql_host_data_source.h +++ b/src/lib/dhcpsrv/mysql_host_data_source.h @@@ -1,8 -1,16 +1,8 @@@ --// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") ++// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #ifndef MYSQL_HOST_DATA_SOURCE_H #define MYSQL_HOST_DATA_SOURCE_H @@@ -221,13 -219,14 +211,14 @@@ public /// /// The contents of the enum are indexes into the list of SQL statements enum StatementIndex { - INSERT_HOST, // Insert new host to collection + INSERT_HOST, // Insert new host to collection + INSERT_V6_RESRV, // Insert v6 reservation GET_HOST_HWADDR_DUID, // Gets hosts by DUID and/or HW address - GET_HOST_ADDR, // Gets hosts by IPv4 address - GET_HOST_SUBID4_DHCPID, // Gets host by IPv4 SubnetID, HW address/DUID - GET_HOST_SUBID6_DHCPID, // Gets host by IPv6 SubnetID, HW address/DUID + GET_HOST_ADDR, // Gets hosts by IPv4 address + GET_HOST_SUBID4_DHCPID, // Gets host by IPv4 SubnetID, HW address/DUID + GET_HOST_SUBID6_DHCPID, // Gets host by IPv6 SubnetID, HW address/DUID GET_HOST_SUBID_ADDR, // Gets host by IPv4 SubnetID and IPv4 address - GET_HOST_PREFIX, // Gets host by IPv6 prefix + GET_HOST_PREFIX, // Gets host by IPv6 prefix GET_VERSION, // Obtain version number NUM_STATEMENTS // Number of statements }; diff --cc src/lib/dhcpsrv/tests/generic_host_data_source_unittest.cc index 29e9152f57,a178b63c0d..80ac5934cd --- a/src/lib/dhcpsrv/tests/generic_host_data_source_unittest.cc +++ b/src/lib/dhcpsrv/tests/generic_host_data_source_unittest.cc @@@ -1,8 -1,16 +1,8 @@@ --// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") ++// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #include #include diff --cc src/lib/dhcpsrv/tests/generic_host_data_source_unittest.h index 06173aff1d,ed136c5be0..c40b29a00a --- a/src/lib/dhcpsrv/tests/generic_host_data_source_unittest.h +++ b/src/lib/dhcpsrv/tests/generic_host_data_source_unittest.h @@@ -1,8 -1,16 +1,8 @@@ --// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") ++// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") // -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. +// 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/. #ifndef GENERIC_HOST_DATA_SOURCE_UNITTEST_H #define GENERIC_HOST_DATA_SOURCE_UNITTEST_H