[Kea-users] Config line breaking / multiple vendor class identifiers

Andrew Peterson Andrew.Peterson at calix.com
Mon Oct 31 16:44:58 UTC 2022


We’ve got a set of clients that all need the same Option-43 sent, but there’s no single vendor class identifier that can catch them all.
In standard ISC server, we could do:
if ((substring (option vendor-class-identifier, 0, 13) = "model-001.xyz"
        or substring (option vendor-class-identifier, 0, 15) = "mymodel-002.xyz”
        or substring (option vendor-class-identifier, 0, 12) = "model003.zzz"
)) 
.. and define the options here


In Kea it looks like I need to do:
    "client-classes": [
        # Client Class – Many Similar Models
        {
            "name": "ManyModels",
            "test": "(option[vendor-class-identifier].text == 'model-001.xyz') or (option[vendor-class-identifier].text == 'mymodel-002.xyz') or (option[vendor-class-identifier].text == 'model003.zyz')",
.. define options here

Is there a way to make this configuration more readable/editable? Having to put a dozen of these on one line will quickly become a wall of text. I tried escaping with \, breaking with a newline, and a few other things but it appears that the server wants the entire test in one line.

I know I could create multiple client classes, one for each model, and just repeat the options I send, but that turns a horizontal wall of text into a vertical one.




More information about the Kea-users mailing list