[Kea-users] Flex options hook library
Christoph Pleger
Christoph.Pleger at cs.tu-dortmund.de
Wed Jun 4 14:42:58 UTC 2025
Hello,
> If you are handling PXE clients, using the vendor client class would probably be
> best.
> But if you do want to change an option value based on the content of a request, you
> could test the vendor class contents.
> ie.:
> "hooks-libraries": [ {
> "library": "/usr/local/lib/libdhcp_flex_option.so",
> "parameters": {
> "options": [
> {
> "code": 67,
> "supersede": "ifelse(substring(option[60].hex,0,20) == 'PXEClient:Arch:00007', concat('pxe-x00007','.boot'),'')"
> }
> ]
> }
> }
> ],
But what I'd like to have, is (excerpt)
"client-classes": [
{
"name": "bookworm current-amd64 schlick:/linf/bookworm",
"option-data": [
{
"space": "dhcp4",
"name": "root-path",
"code": 17,
"data": "/linf/bookworm/nfsroot/current-amd64",
"user-context": {
"root-path": "/linf/bookworm/nfsroot/current-amd64"
}
},
{
"space": "dhcp4",
"name": "local-nfs-path",
"code": 170,
"data": "schlick:/linf/bookworm"
}
]
}
],
"hooks-libraries": [
{
"library": "/usr/lib/x86_64-linux-
gnu/kea/hooks/libdhcp_flex_option.so",
"parameters": {
"options": [
{
"space": "dhcp4",
"name": "boot-file-name",
"code": 67,
"add": "ifelse(option[client-system].hex == 0x0007 or
option[client-system].hex == 0x0009', '/linf/' + split(option[17], '/',
3) + '/boot/' + split(option[root-path], '/', 5) + '/syslinux.efi',
'/linf/' + split(option[17], '/', 3) + '/boot/' + split(option[root-
path], '/', 5) + '/pxelinux.0"
}
]
}
}
],
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/66118cf9/attachment.sig>
More information about the Kea-users
mailing list