keama/tests/substringdx4.in4
raw| 1 | # substring data expression |
| 2 | |
| 3 | # empty configs are not accepted by Kea |
| 4 | default-lease-time 1800; |
| 5 | |
| 6 | # use substring in a reductible match |
| 7 | class "reductible" { |
| 8 | match substring(option host-name, 0, 3); |
| 9 | } |
| 10 | |
| 11 | subclass "reductible" "www" { } |
| 12 | |
| 13 | # reduce literals too |
| 14 | class "literal" { |
| 15 | match if option host-name = substring("www.example.com", 0, 3); |
| 16 | } |
| 17 | |
| 18 | # raw |
| 19 | option domain-name = substring(option domain-name, 4, 1000); |
| 20 | |
| 21 |