[Kea-users] Hooks - first step
alexis
alzrck at gmail.com
Wed Nov 12 20:21:44 UTC 2014
ok, i’ll try
im reading the src code and i see theres a parser for hook-libraries
so here’s my config related to the lib
"hook-libraries" : [
{
"name" : "lib/example.so"
}
],
2014-11-12 17:16:08.202 ERROR [kea-dhcp4.dhcp4/30551] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/opt/keadevel/etc/kea/kea.conf': unsupported global configuration parameter: hook-libraries (/opt/keadevel/etc/kea/kea.conf:19:23)
is what i get when i try to start dhcp4
> On Nov 12, 2014, at 17:08, Tomek Mrugalski <tomasz at isc.org> wrote:
>
> On 12/11/14 09:40, alexis wrote:
>> Hello, guys, im learning about the hooks, C++ and so on.
>>
>> i made the version hook, compiled it and added this to the kea.conf
>>
>> "hook_libraries" : [
>> {
>> "name" : "/home/administrator/example.so"
>> }
>> ],
>>
>> restarted the dhcp4 and service is up now.
>>
>> how can i test and see if the hook was loaded? So i can move on and add
>> new ones.
> Version is the initial function that is required for the library to be
> loaded, it's not a callout per se.
>
> Also you can enable logging level info and look for various hook related
> messages. You may want to take a look at the list of messages
> http://kea.isc.org/docs/kea-messages.html. Search for hooks. There are
> messages that will report that your library was loaded, that your
> callout was registered, that it was called etc.
>
> The easiest would be for your hook to print out something in your actual
> callout and then send a client packet towards your server. If you don't
> know where to start, pkt4_receive or pkt6_receive are good places to
> start. These are the points where you see the incoming packets in a form
> that is easy to inspect and manipulate.
>
> Tomek
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20141112/09b2408a/attachment.htm>
More information about the Kea-users
mailing list