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