[Kea-users] Hooks - first step

Marcin Siodelski marcin at isc.org
Wed Nov 12 20:46:35 UTC 2014


I think you have a typo. It should be "hooks-libraries" instead of
"hook-libraries".

Marcin

On 12/11/14 10:21, alexis wrote:
> 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
>> <mailto: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
>>
>>
> 
> 
> 
> _______________________________________________
> 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