[Kea-users] Hooks - first step

Tomek Mrugalski tomasz at isc.org
Wed Nov 12 20:08:28 UTC 2014


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





More information about the Kea-users mailing list