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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
{
# suffix data expression
# in fact ISC DHCP suffix can be reduced into Kea substring
# authoritative is mandatory
"Dhcp4": {
"valid-lifetime": 1800,
"client-classes": [
# use suffix in a reductible match
/// match: suffix(option dhcp.host-name, 3)
{
"name": "reductible"
},
/// subclass selector 'com'
{
"name": "sub#reductible#0",
"option-data": [
{
"space": "dhcp4",
"name": "domain-search",
"code": 119,
// "original-data": "\"example.com\"",
"data": "example.com"
}
],
/// from: match suffix(option dhcp.host-name, 3)
/// data: 'com'
"test": "substring(option[12].hex,-3,all) == 'com'"
},
/// subclass selector 'org'
{
"name": "sub#reductible#1",
"option-data": [
{
"space": "dhcp4",
"name": "domain-search",
"code": 119,
// "original-data": "\"example.org\"",
"data": "example.org"
}
],
/// from: match suffix(option dhcp.host-name, 3)
/// data: 'org'
"test": "substring(option[12].hex,-3,all) == 'org'"
},
# reduce literals too
{
"name": "literal",
/// from: match if (option dhcp.domain-name) = (suffix('www.example.com', 3))
"test": "option[15].hex == '.example.com'"
}
],
"option-data": [
// # raw
// {
// "space": "dhcp4",
// "name": "domain-name",
// "code": 15,
// "csv-format": false,
// "expression": {
// "suffix": {
// "expression": {
// "option": {
// "universe": "dhcp",
// "name": "domain-name",
// "code": 15
// }
// },
// "length": 3
// }
// }
// }
]
}
}
|