[kea-dev] Suggestion for new hooks: server startup, shutdown, reload

Chaigneau, Nicolas nicolas.chaigneau at capgemini.com
Thu Nov 20 15:37:24 UTC 2014


Woops... I've just realized that there are already "load" and "unload" functions for hook libraries!
My bad.


Still, I've got some questions:

I'm not sure what can be done with the "LibraryHandle" argument ? (apart from registering and deregistering callouts)

Would it possible in the "load" function to access the subnets, leases, etc, managed by the server ?




Regards,
Nicolas.


-----Message d'origine-----
De : kea-dev-bounces at lists.isc.org [mailto:kea-dev-bounces at lists.isc.org] De la part de Chaigneau, Nicolas
Envoyé : mercredi 19 novembre 2014 17:05
À : kea-dev at lists.isc.org
Objet : [kea-dev] Suggestion for new hooks: server startup, shutdown, reload

Hello again,


The hook mechanism provided within Kea looks very handy.
I think it could be extended with new hook points. What do you think of the following proposal ?


- "server startup" hook:
Triggered after server has been started, configuration read, subnets initialized, leases loaded from backend; and just before the server actually starts processing DHCP packets.
This would allow a hook library to:
- Read its configuration (if it has one)
- Perform the initialization steps it requires
- If something wrong happens it could report through an output error code, which would cause the server to stop (as when the main configuration is incorrect, for instance).

The hook should provide access to anything the hook library needs.
For my needs, I can think of the subnets collection and the leases collection. The list is open though.


- "server shutdown" hook:
Triggered just before the server is about to be shut down.
This would give a hook library a chance to perform some termination steps, if need be. Close handles, etc.
(although on Linux it's not strictly needed, it's still cleaner to do so).


- "library reload" hook:
Triggered after the hook library is reloaded (after the server has processed the "libreload" command) I think the same possibilities as in "server startup" should be provided.




Regards,
Nicolas.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.



More information about the kea-dev mailing list