@@ -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
@@ -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
@@ -265,6 +265,14 @@ Memfile_LeaseMgr::~Memfile_LeaseMgr() {
+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,
@@ -134,6 +134,9 @@ public:
/// @brief Destructor (closes file)
virtual ~Memfile_LeaseMgr();
+ /// @brief Local version of getDBVersion() class method
@@ -1265,6 +1265,15 @@ MySqlLeaseMgr::~MySqlLeaseMgr() {
// closed in the destructor of the mysql_ member variable.
+MySqlLeaseMgr::getDBVersion() {
+ tmp << "MySQL backend " << CURRENT_VERSION_VERSION;
+ tmp << "." << CURRENT_VERSION_MINOR;
+ tmp << " library " << mysql_get_client_info();
// Time conversion methods.
//
@@ -122,6 +122,9 @@ public:
/// @brief Destructor (closes database)
virtual ~MySqlLeaseMgr();
/// @brief Adds an IPv4 lease
@@ -965,6 +965,15 @@ PgSqlLeaseMgr::~PgSqlLeaseMgr() {
+PgSqlLeaseMgr::getDBVersion() {
+ tmp << "PostgreSQL backend " << PG_CURRENT_VERSION;
+ tmp << "." << PG_CURRENT_MINOR;
+ tmp << " library " << PQlibVersion();
void
PgSqlLeaseMgr::prepareStatements() {
for(int i = 0; tagged_statements[i].text != NULL; ++ i) {
@@ -151,6 +151,9 @@ public:
virtual ~PgSqlLeaseMgr();