[Kea-users] Flex options hook library
Christoph Pleger
Christoph.Pleger at cs.tu-dortmund.de
Wed Jun 4 13:44:52 UTC 2025
>
Hello,
> > In fact you have two cases:
> > - the option gets a static value -> use a standard config to
> > assign
> > this value to the option in responses
> > - the option gets a dynamic value i.e. a value based on a dynamic
> > field
> > in requests -> use the flex-option hook
> > In both cases it is often easier to use a client class to summarize
> > a condition (easier to configure and even more important easier to
> > debug).
>
> But the question still remains:
>
> Is it somehow possible to use someting like
>
> {
> "Dhcp4": {https://kea.readthedocs.io/en/kea-1.8.0/arm/config.html
> "hooks-libraries": [
> {
> "library": "/usr/local/lib/libdhcp_flex_option.so",
> "parameters": {
> "options": [
> {
> "code": 67,
> "add": "ifelse(option[host-
> name].exists,concat(option[host-name].text,'.boot'),'')"
> }
> ]
> }
> }
> ]
> }
> }
>
> with an add: component that uses an option string that has not been
> already set in the client request, but only in the server reply.
If not with option values, maybe with values from user-context?
https://kea.readthedocs.io/en/kea-1.8.0/arm/config.html says that user
contexts are exposed to hooks, but I did not find documentation about
how to reference their data.
Regards
Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20250604/190f36a1/attachment.sig>
More information about the Kea-users
mailing list