[Kea-users] AllocationEngine instance from Hooks

Rajdip Patel raj.rajdip89 at gmail.com
Wed May 1 14:32:14 UTC 2019


Thanks you so much Francis,

My requirement is as below.

Once Kea assigns a IPv4 lease, I want to confirm it operating system's MAC
Table and if it is already present in Mac table I want Kea AllocationEngine
to assign new lease. So for requesting new lease I need AllocationEngine's
instance from hook callback which is not available.
I want this validation in case users assigned static IP to their devices
and I want to prevent IP conflicts in enterprise network.

Also, I tried to use *ControlledDhcpv4Srv::getInstance()*
but ControlledDhcpv4Srv class doesn't seems part of any exported header
file.

Any alternative workaround would be highly appreciated.

Thanks

On Wed, May 1, 2019 at 7:25 PM Francis Dupont <fdupont at isc.org> wrote:

> Rajdip Patel writes:
> > I want to write custom Kea hook as per hook developer guide.
> >
> > How can I get access AllocationEngine instance from hooks callback
> function
> > ?
>
> => I do not believe you can: it is a private member of the exchange context
> which is not passed to hooks. It is a protected member of the Dhcpv4Srv
> which is derived into the ControlledDhcpv4Srv singleton so if it is changed
> to be public using ControlledDhcpv4Srv::getInstance() will give an access
> to it.
> Now why do you need AllocationEngine instance? I can't see obvious reason
> to ask for this...
>
> Regards
>
> Francis Dupont <fdupont at isc.org>
>


-- 
Thanks,
Rajdip Patel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20190501/b1e69a17/attachment.html>


More information about the Kea-users mailing list