Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
a0f0141e
Commit
a0f0141e
authored
Oct 29, 2012
by
Stephen Morris
Browse files
[2342] Address comments in second review.
parent
89c80762
Changes
7
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
a0f0141e
...
...
@@ -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
...
...
src/lib/dhcp/lease_mgr.cc
View file @
a0f0141e
...
...
@@ -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
;
...
...
src/lib/dhcp/lease_mgr.h
View file @
a0f0141e
...
...
@@ -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
src/lib/dhcp/lease_mgr_factory.h
View file @
a0f0141e
...
...
@@ -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
src/lib/dhcp/mysql_lease_mgr.cc
View file @
a0f0141e
...
...
@@ -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
...
...
src/lib/dhcp/mysql_lease_mgr.h
View file @
a0f0141e
...
...
@@ -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
src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc
View file @
a0f0141e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment