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