Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
52fe5e23
Commit
52fe5e23
authored
Jun 19, 2015
by
Francis Dupont
Browse files
[3882a] Added new getDBVersion() class method
parent
07dcd39f
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/lease_mgr.cc
View file @
52fe5e23
...
...
@@ -61,5 +61,10 @@ LeaseMgr::getLease6(Lease::Type type, const DUID& duid,
return
(
*
col
.
begin
());
}
std
::
string
LeaseMgr
::
getDBVersion
()
{
isc_throw
(
NotImplemented
,
"LeaseMgr::getDBVersion() called"
);
}
}
// namespace isc::dhcp
}
// namespace isc
src/lib/dhcpsrv/lease_mgr.h
View file @
52fe5e23
...
...
@@ -152,6 +152,10 @@ public:
virtual
~
LeaseMgr
()
{}
/// @brief Class method to return extended version info
/// This class method must be redeclared and redefined in derived classes
static
std
::
string
getDBVersion
();
/// @brief Adds an IPv4 lease.
///
/// @param lease lease to be added
...
...
src/lib/dhcpsrv/memfile_lease_mgr.cc
View file @
52fe5e23
...
...
@@ -265,6 +265,14 @@ Memfile_LeaseMgr::~Memfile_LeaseMgr() {
}
}
std
::
string
Memfile_LeaseMgr
::
getDBVersion
()
{
std
::
stringstream
tmp
;
tmp
<<
"Memfile backend "
<<
MAJOR_VERSION
;
tmp
<<
"."
<<
MINOR_VERSION
;
return
(
tmp
.
str
());
}
bool
Memfile_LeaseMgr
::
addLease
(
const
Lease4Ptr
&
lease
)
{
LOG_DEBUG
(
dhcpsrv_logger
,
DHCPSRV_DBG_TRACE_DETAIL
,
...
...
src/lib/dhcpsrv/memfile_lease_mgr.h
View file @
52fe5e23
...
...
@@ -134,6 +134,9 @@ public:
/// @brief Destructor (closes file)
virtual
~
Memfile_LeaseMgr
();
/// @brief Local version of getDBVersion() class method
static
std
::
string
getDBVersion
();
/// @brief Adds an IPv4 lease.
///
/// @param lease lease to be added
...
...
src/lib/dhcpsrv/mysql_lease_mgr.cc
View file @
52fe5e23
...
...
@@ -1265,6 +1265,15 @@ MySqlLeaseMgr::~MySqlLeaseMgr() {
// closed in the destructor of the mysql_ member variable.
}
std
::
string
MySqlLeaseMgr
::
getDBVersion
()
{
std
::
stringstream
tmp
;
tmp
<<
"MySQL backend "
<<
CURRENT_VERSION_VERSION
;
tmp
<<
"."
<<
CURRENT_VERSION_MINOR
;
tmp
<<
" library "
<<
mysql_get_client_info
();
return
(
tmp
.
str
());
}
// Time conversion methods.
//
...
...
src/lib/dhcpsrv/mysql_lease_mgr.h
View file @
52fe5e23
...
...
@@ -122,6 +122,9 @@ public:
/// @brief Destructor (closes database)
virtual
~
MySqlLeaseMgr
();
/// @brief Local version of getDBVersion() class method
static
std
::
string
getDBVersion
();
/// @brief Adds an IPv4 lease
///
/// @param lease lease to be added
...
...
src/lib/dhcpsrv/pgsql_lease_mgr.cc
View file @
52fe5e23
...
...
@@ -965,6 +965,15 @@ PgSqlLeaseMgr::~PgSqlLeaseMgr() {
}
}
std
::
string
PgSqlLeaseMgr
::
getDBVersion
()
{
std
::
stringstream
tmp
;
tmp
<<
"PostgreSQL backend "
<<
PG_CURRENT_VERSION
;
tmp
<<
"."
<<
PG_CURRENT_MINOR
;
tmp
<<
" library "
<<
PQlibVersion
();
return
(
tmp
.
str
());
}
void
PgSqlLeaseMgr
::
prepareStatements
()
{
for
(
int
i
=
0
;
tagged_statements
[
i
].
text
!=
NULL
;
++
i
)
{
...
...
src/lib/dhcpsrv/pgsql_lease_mgr.h
View file @
52fe5e23
...
...
@@ -151,6 +151,9 @@ public:
/// @brief Destructor (closes database)
virtual
~
PgSqlLeaseMgr
();
/// @brief Local version of getDBVersion() class method
static
std
::
string
getDBVersion
();
/// @brief Adds an IPv4 lease
///
/// @param lease lease to be added
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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