From: Razvan Becheriu Date: Thu, 31 Aug 2017 12:50:45 +0000 (+0300) Subject: fixed pull request X-Git-Tag: trac5494_base~11^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a85cff7ab6268202a12dc0801e1c8ccd2b652567;p=thirdparty%2Fkea.git fixed pull request --- diff --git a/doc/guide/dhcp4-srv.xml b/doc/guide/dhcp4-srv.xml index b73a816799..341742374f 100644 --- a/doc/guide/dhcp4-srv.xml +++ b/doc/guide/dhcp4-srv.xml @@ -461,7 +461,7 @@ be followed by a comma and another object definition. For Cassandra, multiple contact points can be provided: -"Dhcp4": { "lease-database": { "contact_points": "remote-host-name[, ...] ", ... }, ... } +"Dhcp4": { "lease-database": { "contact-points": "remote-host-name[, ...] ", ... }, ... } The usual state of affairs will be to have the database on the same machine as the DHCPv4 server. In this case, set the value to the empty string: @@ -470,7 +470,7 @@ be followed by a comma and another object definition. For Cassandra: -"Dhcp4": { "lease-database": { "contact_points": "", ... }, ... } +"Dhcp4": { "lease-database": { "contact-points": "", ... }, ... } Should the database use a port different than default, it may be specified as well: diff --git a/doc/guide/dhcp6-srv.xml b/doc/guide/dhcp6-srv.xml index c6bf0dc804..723b4a7f66 100644 --- a/doc/guide/dhcp6-srv.xml +++ b/doc/guide/dhcp6-srv.xml @@ -456,7 +456,7 @@ be followed by a comma and another object definition. For Cassandra, multiple contact points can be provided: -"Dhcp6": { "lease-database": { "contact_points": "remote-host-name[, ...]" , ... }, ... } +"Dhcp6": { "lease-database": { "contact-points": "remote-host-name[, ...]" , ... }, ... } The usual state of affairs will be to have the database on the same machine as the DHCPv6 server. In this case, set the value to the empty string: @@ -465,7 +465,7 @@ be followed by a comma and another object definition. For Cassandra: -"Dhcp6": { "lease-database": { "contact_points": "", ... }, ... } +"Dhcp6": { "lease-database": { "contact-points": "", ... }, ... } Should the database use a port different than default, it may be specified as well: diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc b/src/bin/dhcp6/tests/get_config_unittest.cc index 901e954336..a5bbb142b2 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc +++ b/src/bin/dhcp6/tests/get_config_unittest.cc @@ -3204,7 +3204,7 @@ const char* UNPARSED_CONFIGS[] = { " {\n" " \"always-send\": false,\n" " \"code\": 7,\n" -" \"csv-format\": false,\n" +" \"csv-format\": true,\n" " \"data\": \"01\",\n" " \"name\": \"preference\",\n" " \"space\": \"dhcp6\"\n" diff --git a/src/lib/dhcpsrv/cfg_db_access.cc b/src/lib/dhcpsrv/cfg_db_access.cc index e93631dc7b..366cdf4be2 100644 --- a/src/lib/dhcpsrv/cfg_db_access.cc +++ b/src/lib/dhcpsrv/cfg_db_access.cc @@ -108,7 +108,7 @@ CfgDbAccess::toElementDbAccessString(const std::string& dbaccess) { (keyword == "password") || (keyword == "host") || (keyword == "name") || - (keyword == "contact_points") || + (keyword == "contact-points") || (keyword == "keyspace")) { result->set(keyword, Element::create(value)); } else { diff --git a/src/lib/dhcpsrv/cfg_option.cc b/src/lib/dhcpsrv/cfg_option.cc index 5d6c153918..f59d78ae26 100644 --- a/src/lib/dhcpsrv/cfg_option.cc +++ b/src/lib/dhcpsrv/cfg_option.cc @@ -169,9 +169,9 @@ CfgOption::mergeInternal(const OptionSpaceContaineroption_, - src_opt->persistent_), - *it); + dest_container.addItem(OptionDescriptor( + src_opt->option_, src_opt->persistent_, + src_opt->formatted_value_), *it); } } } diff --git a/src/lib/dhcpsrv/cql_exchange.cc b/src/lib/dhcpsrv/cql_exchange.cc index ee43993caa..c6d72bca12 100644 --- a/src/lib/dhcpsrv/cql_exchange.cc +++ b/src/lib/dhcpsrv/cql_exchange.cc @@ -704,11 +704,12 @@ CqlExchange::~CqlExchange() { void CqlExchange::convertToDatabaseTime(const time_t& cltt, - const cass_int64_t& valid_lifetime, + const uint32_t& valid_lifetime, cass_int64_t& expire) { - // Calculate expiry time. Store it in the 64-bit value so as we can + // Calculate expire time. Store it in the 64-bit value so as we can // detect overflows. - cass_int64_t expire_time = static_cast(cltt) + valid_lifetime; + cass_int64_t expire_time = static_cast(cltt) + + static_cast(valid_lifetime); if (expire_time > DatabaseConnection::MAX_DB_TIME) { isc_throw(BadValue, diff --git a/src/lib/dhcpsrv/cql_exchange.h b/src/lib/dhcpsrv/cql_exchange.h index 2f4f86ee24..837fb01593 100644 --- a/src/lib/dhcpsrv/cql_exchange.h +++ b/src/lib/dhcpsrv/cql_exchange.h @@ -139,7 +139,7 @@ public: /// @name Time conversion: /// @{ static void convertToDatabaseTime(const time_t& cltt, - const cass_int64_t& valid_lifetime, + const uint32_t& valid_lifetime, cass_int64_t& expire); static void convertFromDatabaseTime(const cass_int64_t& expire, const cass_int64_t& valid_lifetime, diff --git a/src/lib/dhcpsrv/cql_lease_mgr.cc b/src/lib/dhcpsrv/cql_lease_mgr.cc index 9b4314cc9e..d35184acba 100644 --- a/src/lib/dhcpsrv/cql_lease_mgr.cc +++ b/src/lib/dhcpsrv/cql_lease_mgr.cc @@ -33,10 +33,6 @@ namespace dhcp { static constexpr size_t HOSTNAME_MAX_LEN = 255u; static constexpr size_t ADDRESS6_TEXT_MAX_LEN = 39u; -static const CassBlob NULL_HWADDR({0x00, 0x00, 0x00, 0x00, 0x00, 0x00}); -static const CassBlob NULL_CLIENTID({0x00, 0x00, 0x00, 0x00, 0x00, 0x00}); -static const CassBlob NULL_PRIVACY_HASH({0x00, 0x00, 0x00, 0x00, 0x00, 0x00}); - /// @brief Common CQL and Lease Data Methods /// /// The CqlLease4Exchange and CqlLease6Exchange classes provide the @@ -343,7 +339,7 @@ CqlLease4Exchange::createBindForInsert(const Lease4Ptr &lease, AnyArray &data) { } // valid lifetime: bigint - valid_lifetime_ = static_cast(lease_->valid_lft_); + valid_lifetime_ = static_cast(lease_->valid_lft_); // expire: bigint // The lease structure holds the client last transmission time @@ -442,7 +438,7 @@ CqlLease4Exchange::createBindForUpdate( } // valid lifetime: bigint - valid_lifetime_ = static_cast(lease_->valid_lft_); + valid_lifetime_ = static_cast(lease_->valid_lft_); // expire: bigint // The lease structure holds the client last transmission time @@ -600,14 +596,6 @@ CqlLease4Exchange::retrieve() { uint32_t addr4 = static_cast(address_); - if (hwaddr->hwaddr_ == NULL_HWADDR) { - hwaddr->hwaddr_.clear(); - } - - if (client_id_ == NULL_CLIENTID) { - client_id_.clear(); - } - Lease4Ptr result(new Lease4(addr4, hwaddr, client_id_.data(), client_id_.size(), valid_lifetime_, 0, 0, cltt, subnet_id_, fqdn_fwd_, fqdn_rev_, @@ -1202,7 +1190,7 @@ CqlLease6Exchange::createBindForDelete( // Set up the structures for the various components of the lease4 // structure. try { - // address: int + // address: varchar // The address in the Lease structure is an IOAddress object. // Convert this to an integer for storage. address_ = address.toText(); @@ -1326,10 +1314,6 @@ CqlLease6Exchange::retrieve() { hwaddr->source_ = hwaddr_source_; } - if (hwaddr && hwaddr->hwaddr_ == NULL_HWADDR) { - hwaddr.reset(); - } - // Create the lease and set the cltt (after converting from the // expire time retrieved from the database). Lease6Ptr result( diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index bb24bf495f..42e15fa0a1 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -198,42 +198,12 @@ the Cassandra database. The connection is closed as part of normal server shutdown. This error is most likely a programmatic issue that is highly unlikely to occur or negatively impact server operation. -% DHCPSRV_CQL_TRANSACTION_MGR_TRANSACTION_START starting transaction %1. -The server has issued a begin transaction call. - -% DHCPSRV_CQL_TRANSACTION_MGR_REGISTER_TRANSACTION registering action on opened transaction %1. -The server has issued a begin transaction call on an opened transaction. - -% DHCPSRV_CQL_TRANSACTION_MGR_TRANSACTION_COMMIT applying commit on transaction %1. -The server has issued a commit transaction call. - -% DHCPSRV_CQL_TRANSACTION_MGR_REGISTER_TRANSACTION_COMMIT registering commit on opened transaction %1. -The server has issued a commit transaction call on an opened transaction. - -% DHCPSRV_CQL_TRANSACTION_MGR_TRANSACTION_ROLLBACK applying rollback on transaction %1. -The server has issued a rollback transaction call. - -% DHCPSRV_CQL_TRANSACTION_MGR_REGISTER_TRANSACTION_ROLLBACK registering rollback on opened transaction %1. -The server has issued a rollback transaction call on an opened transaction. - -% DHCPSRV_CQL_TRANSACTION_MGR_TRANSACTION_NOT_FOUND failed to select a transaction. -The server failed to select a transaction to operate on. - % DHCPSRV_CQL_BEGIN_TRANSACTION begin transaction. The server has issued a begin transaction call. % DHCPSRV_CQL_CONNECTION_BEGIN_TRANSACTION begin transaction on current connection. The server has issued a begin transaction call. -% DHCPSRV_CQL_TRANSACTION_MGR_START_TRANSACTION start transaction action has been initiated. -The server has issued a start transaction call. - -% DHCPSRV_CQL_TRANSACTION_MGR_COMMIT_TRANSACTION commit transaction action has been initiated. -The server has issued a commit transaction call. - -% DHCPSRV_CQL_TRANSACTION_MGR_ROLLBACK_TRANSACTION rollback transaction action has been initiated. -The server has issued a rollback transaction call. - % DHCPSRV_CQL_DB opening Cassandra lease database: %1 This informational message is logged when a DHCP server (either V4 or V6) is about to open a Cassandra lease database. The parameters of @@ -327,104 +297,6 @@ lease from the Cassandra database for the specified address. A debug message issued when the server is attempting to update IPv6 lease from the Cassandra database for the specified address. -% DHCPSRV_CQL_INSERT_SRV_CONFIG4 Inserting a new DHCPv4 server configuration with id %1 -A debug message issued when there is no existing DHCPv4 server configuration in -database and a configuration will be inserted. - -% DHCPSRV_CQL_INSERT_SRV_CONFIG6 Inserting a new DHCPv6 server configuration with id %1 -A debug message issued when there is no existing DHCPv6 server configuration in -database and a configuration will be inserted. - -% DHCPSRV_CQL_UPDATE_SRV_CONFIG4 Updating the DHCPv4 server configuration with id %1. -A debug message issued when there already exists a DHCPv4 server configuration -in database and this configuration is going to be updated. - -% DHCPSRV_CQL_UPDATE_SRV_CONFIG6 Updating the DHCPv6 server configuration with id %1. -A debug message issued when there already exists a DHCPv6 server configuration -in database and this configuration is going to be updated. - -% DHCPSRV_CQL_REQUEST_UPDATE_SRV_CONFIG4 Received request to update the DHCPv4 database server configuration -A debug message issued when a DHCPv4 server configuration database update request is received. -If there already exists a configuration in the database then the configuration will be updated. -Otherwise a new configuration will be inserted. - -% DHCPSRV_CQL_REQUEST_UPDATE_SRV_CONFIG6 Received request to update the DHCPv6 database server configuration -A debug message issued when a DHCPv6 server configuration database update request is received. -If there already exists a configuration in the database then the configuration will be updated. -Otherwise a new configuration will be inserted. - -% DHCPSRV_CQL_UPDATE_SRV_CONFIG4_TIMESTAMP_CHANGED Cannot update the DHCPv4 database server configuration (old timestamp is %1, new timestamp is %2) -A warning message issued when DHCPv4 database server configuration cannot be updated. -On a database server configuration update the actual timestamp of the configuration is also provided to the server. -If in the meanwhile the database timestamp has been changed by somebody else then the update operation fails. - -% DHCPSRV_CQL_UPDATE_SRV_CONFIG6_TIMESTAMP_CHANGED Cannot update the DHCPv6 database server configuration (old timestamp is %1, new timestamp is %2) -A warning message issued when DHCPv6 database server configuration cannot be updated. -On a database server configuration update the actual timestamp of the configuration is also provided to the server. -If in the meanwhile the database timestamp has been changed by somebody else then the update operation fails. - -% DHCPSRV_CQL_GET_SRV_CONFIG4_TIMESTAMP Obtaining the DHCPv4 server configuration's version from database -Obtains the DHCPv4 server configuration's version from database. - -% DHCPSRV_CQL_GET_SRV_CONFIG6_TIMESTAMP Obtaining the DHCPv6 server configuration's version from database -Obtains the DHCPv6 server configuration's version from database. - -% DHCPSRV_CQL_GET_SRV_CONFIG4_JSON Obtaining the DHCPv4 server JSON configuration from database -Obtains the DHCPv4 server JSON configuration from database. - -% DHCPSRV_CQL_GET_SRV_CONFIG6_JSON Obtaining the DHCPv6 server JSON configuration from database -Obtains the DHCPv6 server JSON configuration from database. - -% DHCPSRV_CQL_GET_SRV_CONFIG4_GENERIC Obtaining the DHCPv4 server GENERIC configuration from database -Obtains the DHCPv4 server GENERIC configuration from database. - -% DHCPSRV_CQL_GET_SRV_CONFIG6_GENERIC Obtaining the DHCPv6 server GENERIC configuration from database -Obtains the DHCPv6 server GENERIC configuration from database. - -% DHCPSRV_CQL_GET_SRV_MASTER_CONFIG4 Obtaining the DHCPv4 server configuration from the master database id %1 -Obtains the DHCPv4 server configuration from the master database. - -% DHCPSRV_CQL_GET_SRV_MASTER_CONFIG6 Obtaining the DHCPv6 server configuration from the master database id %1 -Obtains the DHCPv6 server configuration from the master database. - -% DHCPSRV_CQL_GET_SRV_MASTER_CONFIG4_SHARD_DB Obtaining the DHCPv6 server configuration from the master database for '%1' shard database -Obtains the DHCPv4 server configuration from the master database for the specified shard database. - -% DHCPSRV_CQL_GET_SRV_MASTER_CONFIG6_SHARD_DB Obtaining the DHCPv6 server configuration from the master database for '%1' shard database -Obtains the DHCPv6 server configuration from the master database for the specified shard database. - -% DHCPSRV_CQL_GET_SRV_MASTER_CONFIG4_SHARDS_NAME Obtaining the DHCPv4 shards name from the master database -Obtains the DHCPv4 shards name from the master database - -% DHCPSRV_CQL_GET_SRV_MASTER_CONFIG6_SHARDS_NAME Obtaining the DHCPv6 shards name from the master database -Obtains the DHCPv6 shards name from the master database - -% DHCPSRV_CQL_CLEAR_SRV_MASTER_CONFIG4 Clearing the DHCPv4 master configuration from database -Clears the DHCPv4 master configuration from database - -% DHCPSRV_CQL_CLEAR_SRV_MASTER_CONFIG6 Clearing the DHCPv6 master configuration from database -Clears the DHCPv6 master configuration from database - -% DHCPSRV_CQL_DELETE_SRV_MASTER_CONFIG4 Deleting the DHCPv4 master configuration from database id %1 -Clears the DHCPv4 master configuration from database - -% DHCPSRV_CQL_DELETE_SRV_MASTER_CONFIG6 Deleting the DHCPv6 master configuration from database id %1 -Clears the DHCPv6 master configuration from database - -% DHCPSRV_CQL_INSERT_SRV_MASTER_CONFIG4 Inserting a new DHCPv4 master server configuration with id %1 and shard database %2 -A debug message issued when there is no existing DHCPv4 master server configuration in -database and a configuration will be inserted. - -% DHCPSRV_CQL_INSERT_SRV_MASTER_CONFIG6 Inserting a new DHCPv6 master server configuration with id %1 and shard database %2 -A debug message issued when there is no existing DHCPv6 master server configuration in -database and a configuration will be inserted. - -% DHCPSRV_CQL_GET_SRV_MASTER_CONFIG4_TIMESTAMP Obtaining the DHCPv4 master server configuration's version from database id %1 -Obtains the DHCPv4 master server configuration's version from database. - -% DHCPSRV_CQL_GET_SRV_MASTER_CONFIG6_TIMESTAMP Obtaining the DHCPv6 master server configuration's version from database id %1 -Obtains the DHCPv6 master server configuration's version from database. - % DHCPSRV_CQL_HOST_DB Connecting to CQL hosts database: %1 An informational message logged when the CQL hosts database is about to be connected to. The parameters of the connection including database name and @@ -924,96 +796,6 @@ lease from the MySQL database for the specified address. A debug message issued when the server is attempting to update IPv6 lease from the MySQL database for the specified address. -% DHCPSRV_MYSQL_INSERT_SRV_CONFIG4 Inserting a new DHCPv4 configuration with id %1 -A debug message issued when there is no existing DHCPv4 server configuration in database and a configuration will be inserted. - -% DHCPSRV_MYSQL_INSERT_SRV_CONFIG6 Inserting a new DHCPv6 configuration with id %1 -A debug message issued when there is no existing DHCPv6 server configuration in database and a configuration will be inserted. - -% DHCPSRV_MYSQL_UPDATE_SRV_CONFIG4 Updating the DHCPv4 server configuration with id %1. -A debug message issued when there already exists a DHCPv4 server configuration in database -and this configuration is going to be updated. - -% DHCPSRV_MYSQL_UPDATE_SRV_CONFIG6 Updating the DHCPv6 server configuration with id %1. -A debug message issued when there already exists a DHCPv6 server configuration in database -and this configuration is going to be updated. - -% DHCPSRV_MYSQL_REQUEST_UPDATE_SRV_CONFIG4 Received request to update the DHCPv4 database server configuration -A debug message issued when a DHCPv4 configuration database update request is received. -If there already exists a configuration in the database then the configuration will be updated. -Otherwise a new configuration will be inserted. - -% DHCPSRV_MYSQL_REQUEST_UPDATE_SRV_CONFIG6 Received request to update the DHCPv6 database server configuration -A debug message issued when a DHCPv6 configuration database update request is received. -If there already exists a configuration in the database then the configuration will be updated. -Otherwise a new configuration will be inserted. - -% DHCPSRV_MYSQL_UPDATE_SRV_CONFIG4_TIMESTAMP_CHANGED Cannot update the DHCP4 database server configuration (old timestamp is %1, new timestamp is %2) -A warning message issued when DHCP4 database server configuration cannot be updated. -On a database server configuration update the actual timestamp of the configuration is also provided to the server. -If in the meanwhile the database timestamp has been changed by somebody else then the update operation fails. - -% DHCPSRV_MYSQL_UPDATE_SRV_CONFIG6_TIMESTAMP_CHANGED Cannot update the DHCPv6 database server configuration (old timestamp is %1, new timestamp is %2) -A warning message issued when DHCPv6 database server configuration cannot be updated. -On a database server configuration update the actual timestamp of the configuration is also provided to the server. -If in the meanwhile the database timestamp has been changed by somebody else then the update operation fails. - -% DHCPSRV_MYSQL_GET_SRV_CONFIG4_TIMESTAMP Obtaining the DHCPv4 server configuration's timestamp from database -Obtains the DHCPv4 server configuration's timestamp from database. - -% DHCPSRV_MYSQL_GET_SRV_CONFIG6_TIMESTAMP Obtaining the DHCPv6 server configuration's timestamp from database -Obtains the DHCPv6 server configuration's timestamp from database. - -% DHCPSRV_MYSQL_GET_SRV_CONFIG4_JSON Obtaining the DHCPv4 server JSON configuration from database -Obtains the DHCPv4 server JSON configuration from database. - -% DHCPSRV_MYSQL_GET_SRV_CONFIG6_JSON Obtaining the DHCPv6 server JSON configuration from database -Obtains the DHCPv6 server JSON configuration from database. - -% DHCPSRV_MYSQL_GET_SRV_CONFIG4_GENERIC Obtaining the DCHPv4 server GENERIC configuration from database -Obtains the DCHPv4 server GENERIC configuration from database. - -% DHCPSRV_MYSQL_GET_SRV_CONFIG6_GENERIC Obtaining the DCHPv6 server GENERIC configuration from database -Obtains the DCHPv6 server GENERIC configuration from database. - -% DHCPSRV_MYSQL_GET_SRV_MASTER_CONFIG4 Obtaining the DHCPv4 server configuration from the master database id %1 -Obtains the DHCPv4 server configuration from the master database. - -% DHCPSRV_MYSQL_GET_SRV_MASTER_CONFIG6 Obtaining the DHCPv6 server configuration from the master database id %1 -Obtains the DHCPv6 server configuration from the master database. - -% DHCPSRV_MYSQL_GET_SRV_MASTER_CONFIG4_SHARD_DB Obtaining the DHCPv6 server configuration from the master database for '%1' shard database -Obtains the DHCPv4 server configuration from the master database for the specified shard database. - -% DHCPSRV_MYSQL_GET_SRV_MASTER_CONFIG6_SHARD_DB Obtaining the DHCPv6 server configuration from the master database for '%1' shard database -Obtains the DHCPv6 server configuration from the master database for the specified shard database. - -% DHCPSRV_MYSQL_GET_SRV_MASTER_CONFIG4_SHARDS_NAME Obtaining the DHCPv4 shards name from the master database -Obtains the DHCPv4 shards name from the master database - -% DHCPSRV_MYSQL_GET_SRV_MASTER_CONFIG6_SHARDS_NAME Obtaining the DHCPv6 shards name from the master database -Obtains the DHCPv6 shards name from the master database - -% DHCPSRV_MYSQL_CLEAR_SRV_MASTER_CONFIG4 Clearing the DHCPv4 master configuration from database -Clears the DHCPv4 master configuration from database - -% DHCPSRV_MYSQL_CLEAR_SRV_MASTER_CONFIG6 Clearing the DHCPv6 master configuration from database -Clears the DHCPv6 master configuration from database - -% DHCPSRV_MYSQL_INSERT_SRV_MASTER_CONFIG4 Inserting a new DHCPv4 master server configuration with id %1 and shard database %2 -A debug message issued when there is no existing DHCPv4 master server configuration in -database and a configuration will be inserted. - -% DHCPSRV_MYSQL_INSERT_SRV_MASTER_CONFIG6 Inserting a new DHCPv6 master server configuration with id %1 and shard database %2 -A debug message issued when there is no existing DHCPv6 master server configuration in -database and a configuration will be inserted. - -% DHCPSRV_MYSQL_GET_SRV_MASTER_CONFIG4_TIMESTAMP Obtaining the DHCPv4 master server configuration's version from database id %1 -Obtains the DHCPv4 master server configuration's version from database. - -% DHCPSRV_MYSQL_GET_SRV_MASTER_CONFIG6_TIMESTAMP Obtaining the DHCPv6 master server configuration's version from database id %1 -Obtains the DHCPv6 master server configuration's version from database. - % DHCPSRV_NOTYPE_DB no 'type' keyword to determine database backend: %1 This is an error message, logged when an attempt has been made to access a database backend, but where no 'type' keyword has been included in @@ -1168,96 +950,6 @@ lease from the PostgreSQL database for the specified address. A debug message issued when the server is attempting to update IPv6 lease from the PostgreSQL database for the specified address. -% DHCPSRV_PGSQL_INSERT_SRV_CONFIG4 Inserting a new DHCPv4 server configuration with id %1 -A debug message issued when there is no existing DHCPv4 server configuration in database and a configuration will be inserted. - -% DHCPSRV_PGSQL_INSERT_SRV_CONFIG6 Inserting a new DHCPv6 server configuration with id %1 -A debug message issued when there is no existing DHCPv6 server configuration in database and a configuration will be inserted. - -% DHCPSRV_PGSQL_UPDATE_SRV_CONFIG4 Updating the DHCPv4 server configuration with id %1. -A debug message issued when there already exists a DHCPv4 server configuration in database -and this configuration is going to be updated. - -% DHCPSRV_PGSQL_UPDATE_SRV_CONFIG6 Updating the DHCPv6 server configuration with id %1. -A debug message issued when there already exists a DHCPv6 server configuration in database -and this configuration is going to be updated. - -% DHCPSRV_PGSQL_REQUEST_UPDATE_SRV_CONFIG4 Received request to update the IPv4 database server configuration -A debug message issued when a IPv4 server configuration database update request is received. -If there already exists a configuration in the database then the configuration will be updated. -Otherwise a new configuration will be inserted. - -% DHCPSRV_PGSQL_REQUEST_UPDATE_SRV_CONFIG6 Received request to update the IPv6 database server configuration -A debug message issued when a IPv6 server configuration database update request is received. -If there already exists a configuration in the database then the configuration will be updated. -Otherwise a new configuration will be inserted. - -% DHCPSRV_PGSQL_UPDATE_SRV_CONFIG4_TIMESTAMP_CHANGED Cannot update the IPv4 database server configuration (old timestamp is %1, new timestamp is %2) -A warning message issued when IPv4 database server configuration cannot be updated. -On a database server configuration update the actual timestamp of the configuration is also provided to the server. -If in the meanwhile the database timestamp has been changed by somebody else then the update operation fails. - -% DHCPSRV_PGSQL_UPDATE_SRV_CONFIG6_TIMESTAMP_CHANGED Cannot update the IPv6 database server configuration (old timestamp is %1, new timestamp is %2) -A warning message issued when IPv6 database server configuration cannot be updated. -On a database server configuration update the actual timestamp of the configuration is also provided to the server. -If in the meanwhile the database timestamp has been changed by somebody else then the update operation fails. - -% DHCPSRV_PGSQL_GET_SRV_CONFIG4_TIMESTAMP Obtaining the DHCPv4 server configuration's version from database -Obtains the DHCPv4 server configuration's version from database. - -% DHCPSRV_PGSQL_GET_SRV_CONFIG6_TIMESTAMP Obtaining the DHCPv6 server configuration's version from database -Obtains the DHCPv6 server configuration's version from database. - -% DHCPSRV_PGSQL_GET_SRV_CONFIG4_JSON Obtaining the DHCPv4 server JSON configuration from database -Obtains the DHCPv4 server JSON configuration from database. - -% DHCPSRV_PGSQL_GET_SRV_CONFIG6_JSON Obtaining the DHCPv6 server JSON configuration from database -Obtains the DHCPv6 server JSON configuration from database. - -% DHCPSRV_PGSQL_GET_SRV_CONFIG4_GENERIC Obtaining the DHCPv4 server GENERIC configuration from database -Obtains the DHCPv4 server GENERIC configuration from database. - -% DHCPSRV_PGSQL_GET_SRV_CONFIG6_GENERIC Obtaining the DHCPv6 server GENERIC configuration from database -Obtains the DHCPv6 server GENERIC configuration from database. - -% DHCPSRV_PGSQL_GET_SRV_MASTER_CONFIG4 Obtaining the DHCPv4 server configuration from the master database id %1 -Obtains the DHCPv4 server configuration from the master database. - -% DHCPSRV_PGSQL_GET_SRV_MASTER_CONFIG6 Obtaining the DHCPv6 server configuration from the master database id %1 -Obtains the DHCPv6 server configuration from the master database. - -% DHCPSRV_PGSQL_GET_SRV_MASTER_CONFIG4_SHARD_DB Obtaining the DHCPv6 server configuration from the master database for '%1' shard database -Obtains the DHCPv4 server configuration from the master database for the specified shard database. - -% DHCPSRV_PGSQL_GET_SRV_MASTER_CONFIG6_SHARD_DB Obtaining the DHCPv6 server configuration from the master database for '%1' shard database -Obtains the DHCPv6 server configuration from the master database for the specified shard database. - -% DHCPSRV_PGSQL_GET_SRV_MASTER_CONFIG4_SHARDS_NAME Obtaining the DHCPv4 shards name from the master database -Obtains the DHCPv4 shards name from the master database - -% DHCPSRV_PGSQL_GET_SRV_MASTER_CONFIG6_SHARDS_NAME Obtaining the DHCPv6 shards name from the master database -Obtains the DHCPv6 shards name from the master database - -% DHCPSRV_PGSQL_CLEAR_SRV_MASTER_CONFIG4 Clearing the DHCPv4 master configuration from database -Clears the DHCPv4 master configuration from database - -% DHCPSRV_PGSQL_CLEAR_SRV_MASTER_CONFIG6 Clearing the DHCPv6 master configuration from database -Clears the DHCPv6 master configuration from database - -% DHCPSRV_PGSQL_INSERT_SRV_MASTER_CONFIG4 Inserting a new DHCPv4 master server configuration with id %1 and shard database %2 -A debug message issued when there is no existing DHCPv4 master server configuration in -database and a configuration will be inserted. - -% DHCPSRV_PGSQL_INSERT_SRV_MASTER_CONFIG6 Inserting a new DHCPv6 master server configuration with id %1 and shard database %2 -A debug message issued when there is no existing DHCPv6 master server configuration in -database and a configuration will be inserted. - -% DHCPSRV_PGSQL_GET_SRV_MASTER_CONFIG4_TIMESTAMP Obtaining the DHCPv4 master server configuration's version from database id %1 -Obtains the DHCPv4 master server configuration's version from database. - -% DHCPSRV_PGSQL_GET_SRV_MASTER_CONFIG6_TIMESTAMP Obtaining the DHCPv6 master server configuration's version from database id %1 -Obtains the DHCPv6 master server configuration's version from database. - % DHCPSRV_QUEUE_NCR %1: name change request to %2 DNS entry queued: %3 A debug message which is logged when the NameChangeRequest to add or remove a DNS entries for a particular lease has been queued. The first argument diff --git a/src/lib/dhcpsrv/lease_mgr.h b/src/lib/dhcpsrv/lease_mgr.h index 8dd78f8f60..cfeffa0783 100644 --- a/src/lib/dhcpsrv/lease_mgr.h +++ b/src/lib/dhcpsrv/lease_mgr.h @@ -64,7 +64,6 @@ namespace dhcp { /// @brief Pair containing major and minor versions typedef std::pair VersionPair; - /// @brief Contains a single row of lease statistical data /// /// The contents of the row consist of a subnet ID, a lease diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.cc b/src/lib/dhcpsrv/memfile_lease_mgr.cc index f02f5e45e7..8f2267906a 100644 --- a/src/lib/dhcpsrv/memfile_lease_mgr.cc +++ b/src/lib/dhcpsrv/memfile_lease_mgr.cc @@ -1047,12 +1047,6 @@ Memfile_LeaseMgr::getDescription() const { return (std::string("In memory database with leases stored in a CSV file.")); } -bool Memfile_LeaseMgr::startTransaction() { - LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, - DHCPSRV_MEMFILE_BEGIN_TRANSACTION); - return true; -} - void Memfile_LeaseMgr::commit() { LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_COMMIT); diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.h b/src/lib/dhcpsrv/memfile_lease_mgr.h index 1a7897d4ff..3d76f94468 100644 --- a/src/lib/dhcpsrv/memfile_lease_mgr.h +++ b/src/lib/dhcpsrv/memfile_lease_mgr.h @@ -420,12 +420,6 @@ public: return (std::make_pair(MAJOR_VERSION, MINOR_VERSION)); } - /// @brief Start Transaction - /// - /// Start transaction for database operations. On databases that don't - /// support transactions, this is a no-op. - virtual bool startTransaction(); - /// @brief Commit Transactions /// /// Commits all pending database operations. On databases that don't diff --git a/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc index 1af7503677..ba358ba6ce 100644 --- a/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc @@ -430,7 +430,7 @@ TEST_F(CqlLeaseMgrTest, getType) { /// This test checks that the conversion is correct. TEST_F(CqlLeaseMgrTest, checkTimeConversion) { const time_t cltt = time(NULL); - const cass_int64_t valid_lft = 86400; // 1 day + const uint32_t valid_lft = 86400; // 1 day cass_int64_t cql_expire; // Convert to the database time. diff --git a/src/lib/dhcpsrv/tests/lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/lease_mgr_unittest.cc index 9b385cb1e4..05dccca6bc 100644 --- a/src/lib/dhcpsrv/tests/lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/lease_mgr_unittest.cc @@ -268,12 +268,6 @@ public: return (make_pair(uint32_t(0), uint32_t(0))); } - /// @brief Start Transaction - /// - /// Start transaction for database operations. On databases that don't - /// support transactions, this is a no-op. - virtual bool startTransaction() { return true; }; - /// @brief Commit transactions virtual void commit() { }