2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[2342] Address comments in second review.

This commit is contained in:
Stephen Morris
2012-10-29 13:43:31 +00:00
parent 89c8076272
commit a0f0141e8e
7 changed files with 29 additions and 23 deletions

View File

@@ -1463,6 +1463,18 @@ dnl includes too
${LOG4CPLUS_LIBS}
SQLite: $SQLITE_CFLAGS
$SQLITE_LIBS
END
# Avoid confusion on DNS/DHCP and only mention MySQL if it
# were specified on the command line.
if test "$MYSQL_CPPFLAGS" != "" ; then
cat >> config.report << END
MySQL: $MYSQL_CPPFLAGS
$MYSQL_LIBS
END
fi
cat >> config.report << END
Features:
$enable_features

View File

@@ -12,18 +12,6 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <algorithm>
#include <iostream>
#include <iterator>
#include <map>
#include <sstream>
#include <string>
#include <utility>
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <exceptions/exceptions.h>
#include <dhcp/lease_mgr.h>
using namespace std;

View File

@@ -12,8 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#ifndef __LEASE_MGR_H
#define __LEASE_MGR_H
#ifndef LEASE_MGR_H
#define LEASE_MGR_H
#include <fstream>
#include <map>
@@ -556,4 +556,4 @@ protected:
}; // end of isc::dhcp namespace
}; // end of isc namespace
#endif // __LEASE_MGR_H
#endif // LEASE_MGR_H

View File

@@ -12,8 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#ifndef __LEASE_MGR_FACTORY_H
#define __LEASE_MGR_FACTORY_H
#ifndef LEASE_MGR_FACTORY_H
#define LEASE_MGR_FACTORY_H
#include <string>
#include <dhcp/lease_mgr.h>
@@ -120,4 +120,4 @@ private:
}; // end of isc::dhcp namespace
}; // end of isc namespace
#endif // __LEASE_MGR_FACTORY_H
#endif // LEASE_MGR_FACTORY_H

View File

@@ -375,6 +375,7 @@ MySqlLeaseMgr::convertToDatabaseTime(time_t cltt, uint32_t valid_lifetime,
MYSQL_TIME& expire) {
// Calculate expiry time and convert to various date/time fields.
// @TODO: handle overflows
time_t expire_time = cltt + valid_lifetime;
// Convert to broken-out time

View File

@@ -12,8 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#ifndef __MYSQL_LEASE_MGR_H
#define __MYSQL_LEASE_MGR_H
#ifndef MYSQL_LEASE_MGR_H
#define MYSQL_LEASE_MGR_H
#include <time.h>
#include <mysql.h>
@@ -402,4 +402,4 @@ private:
}; // end of isc::dhcp namespace
}; // end of isc namespace
#endif // __MYSQL_LEASE_MGR_H
#endif // MYSQL_LEASE_MGR_H

View File

@@ -331,8 +331,13 @@ TEST_F(MySqlLeaseMgrTest, BasicLease6) {
duid.push_back(i + 5);
}
l3->duid_ = boost::shared_ptr<DUID>(new DUID(duid));
l3->preferred_lft_ = 0xfffffffc; // Preferred lifetime
l3->valid_lft_ = 0xfffffffd; // Actual lifetime
// The times used in the next tests are deliberately restricted - we should
// be avle to cope with valid lifetimes up to 0xffffffff. However, this
// will lead to overflows.
// @TODO: test overflow conditions when code has been fixed
l3->preferred_lft_ = 7200; // Preferred lifetime
l3->valid_lft_ = 7000; // Actual lifetime
l3->cltt_ = 234567; // Current time of day
l3->subnet_id_ = l1->subnet_id_; // Same as l1