[Kea-users] DHCP reserved leases (infinite lease)
Stephen Morris
stephen at isc.org
Mon Jun 2 14:50:39 UTC 2014
On 02/06/14 13:32, Tomek Mrugalski wrote:
> This is a good point. There should be a way to access current
> configuration from hooks. I've just created ticket #3456 for this
> work. Unfortunately, it is unlikely that we will write any code for
> it in the near future. We're currently spending all our efforts on
> removing unnecessary dependencies that we inherited from Bind10
> days.
>
> It seems that this work should do 2 things: 1. expose current
> configuration, including lease manager configuration (which covers
> MySQL connection details, like hostname, user/password etc.)
>
> 2. the actual database connection (a pointer to MYSQL structure).
>
> The item #2 is a bit tricky, because it will have to expose
> similar connection structure for Postgres, so it will have to be a
> generic mechanism.
We should expose more than just a way to get the database connection.
Although we don't know what hooks need to do here, it is reasonable to
assume that in a number of cases, the hook could make use of some of
the methods of LeaseMgr.
(Access to the lease database is through the (abstract) LeaseMgr class,
which provides a number of methods to add, modify and delete leases
from the database. Concrete classes - one for each backend supported
- are derived from the abstract class. Objects of these classes are
created by the LeaseMgrFactory, which enforces singleton behaviour on
them.)
So we need to:
a) Make (some of) the "dhcpsrv" header files available during
installation to allow hooks to access theLeaseMgr class. (We don't do
this at present.)
b) Implement a getConnection() method in the lease manager. We could
make this a method in LeaseMgr and use boost::any to return the
different types of objects (it is used in the hooks code to pass
parameters of different types to the callouts).
Stephen
More information about the Kea-users
mailing list