[Kea-users] Extracting vendor-specific suboptions in hooks

Dave M 2wheelsyyz at gmail.com
Wed May 29 20:32:29 UTC 2019

 I am new to Kea so excuse my lack of knowledge here.

I have been running a ISC DHCP server to handle cable modems (and
associated CPE and MTA) IP assignment. I needed some more advanced logic
with the assignment of configuration file and Kea with the customizable
hooks seemed like the logical choice.

I migrated my configuration to Kea and I'm now able to perform basic
provisioning of CM and CPEs. I'm relying on a subset of the vendor class
identifier (because it can be docsis3.0 or docsis3.1) and all is good with
the following resulting class configuration

  "client-classes": [
           "name": "CM",
           "test": "substring(option[vendor-class-identifier].text, 0, 6)
== 'docsis'"

           "name": "MTA",
           "test": "substring(option[vendor-class-identifier].text, 0, 4)
== 'pktc'"
           "name": "CPE",
           "test": "not (member('CM')) and not (member('MTA'))"

My problem is with the hook. I want to dynamically assign the boot-file and
server based on MAC address and model information (option 43, suboption 9)
and potentially software version (option 43, suboption 6).

I will therefore need to extract these in pkt4_receive and then replace the
boot-file and server according to my logic in pkt4_send.

I just don't know how to retrieve and parse the suboptions in option 43.
Would anybody have sample code showing how I can extract these?


Dave M.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20190529/e5647e97/attachment.htm>

More information about the Kea-users mailing list