Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos {
      2  1.1  christos   # concat data expression
      3  1.1  christos   # empty configs are not accepted by Kea
      4  1.1  christos   "Dhcp4": {
      5  1.1  christos     "valid-lifetime": 1800,
      6  1.1  christos     "client-classes": [
      7  1.1  christos       # use substring in a reductible match
      8  1.1  christos       /// match: concat('domain=', suffix(option dhcp.host-name, 3))
      9  1.1  christos       {
     10  1.1  christos         "name": "reductible"
     11  1.1  christos       },
     12  1.1  christos       /// subclass selector 'domain=com'
     13  1.1  christos       {
     14  1.1  christos         "name": "sub#reductible#0",
     15  1.1  christos         /// from: match concat('domain=', suffix(option dhcp.host-name, 3))
     16  1.1  christos         /// data: 'domain=com'
     17  1.1  christos         "test": "concat('domain=', substring(option[12].hex,-3,all)) == 'domain=com'"
     18  1.1  christos       },
     19  1.1  christos       # reduce literals too
     20  1.1  christos       {
     21  1.1  christos         "name": "literal",
     22  1.1  christos         /// from: match if (option dhcp.host-name) = (concat('www.', concat('example.', 'com')))
     23  1.1  christos         "test": "option[12].hex == 'www.example.com'"
     24  1.1  christos       }
     25  1.1  christos     ],
     26  1.1  christos     "option-data": [
     27  1.1  christos //    # raw
     28  1.1  christos //    {
     29  1.1  christos //      "space": "dhcp4",
     30  1.1  christos //      "name": "host-name",
     31  1.1  christos //      "code": 12,
     32  1.1  christos //      "csv-format": false,
     33  1.1  christos //      "expression": {
     34  1.1  christos //        "concat": {
     35  1.1  christos //          "left": "www.",
     36  1.1  christos //          "right": {
     37  1.1  christos //            "option": {
     38  1.1  christos //              "universe": "dhcp",
     39  1.1  christos //              "name": "domain-name",
     40  1.1  christos //              "code": 15
     41  1.1  christos //            }
     42  1.1  christos //          }
     43  1.1  christos //        }
     44  1.1  christos //      }
     45  1.1  christos //    }
     46  1.1  christos     ]
     47  1.1  christos   }
     48  1.1  christos }
     49