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

Igor Smitran sigor at blic.net
Wed Jun 4 06:39:23 UTC 2014


Until pointer to mysql is implemented i have a question:

Do i have to make mysql connection pool for hook calls or kea can have 
more than one active hook at the time?
If there is more than one hook active then i don't have to make sql 
connection pools because every hook will make his own connection to 
database?

Please advise.

Thank you,
Igor

On 06/02/2014 04:50 PM, Stephen Morris wrote:
> 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
> _______________________________________________
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
>




More information about the Kea-users mailing list