[Kea-users] DHCP reserved leases (infinite lease)

Tomek Mrugalski tomasz at isc.org
Mon Jun 2 12:32:07 UTC 2014


On 02.06.2014 13:57, Marcin Siodelski wrote:
> Kea currently doesn't have any library to be used to open connections to
> MySQL. The MySQL lease database backend
> (src/lib/dhcpsrv/mysql_lease_mgr.cc) uses API provided by the MySQL dev
> library directly. So, most likely you will need to open your own
> connection to the database from the hook library.
> 
> In order to open connection to the MySQL database being used by the
> lease database backend, you will need credentials. These credentials are
> stored in the Kea configuration. But, hooks don't have a way to access
> the configuration parameters at this point, so you'll probably have to
> hard code credentials in the library or provide some text file with a
> configuration that the hook can read when being loaded.
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.

Tomek



More information about the Kea-users mailing list