better document logic statements are unsupported
This is best shown with example.
Partial ISC DHCP configuration
if exists agent.circuit-id
{
log ( error, concat( "Lease for ", binary-to-ascii (10, 8, ".", leased-address), " is connected to ", option agent.circuit-id));
}
option space CALIXGC;
option CALIXGC.acs-url code 1 = text;
if (substring(option vendor-class-identifier, 0, 21) = "844G.ONT.dslforum.org") {
vendor-option-space CALIXGC;
option CALIXGC.acs-url "http://example.com:8080/user/pass";
}
get migrated to:
{
"Dhcp4": {
// "statement": {
// "if": {
// "condition": {
// "exists": {
// "universe": "agent",
// "name": "circuit-id",
// "code": 1
// }
// },
// "then": [
// {
// /// Kea does not support yet log statements
// /// Reference Kea #234
// "log": {
// "priority": "error",
// "message": {
// "concat": {
// "left": "Lease for ",
// "right": {
// "concat": {
// "left": {
// "binary-to-ascii": {
// "base": 10,
// "width": 8,
// "separator": ".",
// "buffer": {
// "leased-address": null
// }
// }
// },
// "right": {
// "concat": {
// "left": " is connected to ",
// "right": {
// "option": {
// "universe": "agent",
// "name": "circuit-id",
// "code": 1
// }
// }
// }
// }
// }
// }
// }
// }
// }
// }
// ]
// }
// },
"option-def": [
{
"space": "CALIXGC",
"name": "acs-url",
"code": 1,
"type": "string"
}
]
// "statement": {
// "if": {
// "condition": {
// "equal": {
// "left": {
// "substring": {
// "expression": {
// "option": {
// "universe": "dhcp",
// "name": "vendor-class-identifier",
// "code": 60
// }
// },
// "offset": 0,
// "length": 21
// }
// },
// "right": "844G.ONT.dslforum.org"
// }
// },
// "then": [
// {
// "config": {
// "name": "vendor-option-space",
// "code": 19,
// "value": "CALIXGC"
// }
// },
// {
// "option": {
// "space": "CALIXGC",
// "name": "acs-url",
// "code": 1,
// "data": "http://example.com:8080/user/pass"
// }
// }
// ]
// }
// }
}
}
Perhaps just print the original unsupported logic statement from the ISC DHCP configuration with a comment about how these are not supported but there is probably another method to accomplish the intent.