Commit dfac5a62 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[5036] excluded-prefix{-len} implemented in the bison parser

parent 0d97d2c0
......@@ -66,6 +66,16 @@
"subnet6": [
{
"pools": [ { "pool": "2001:db8:1::/80" } ],
"pd-pools": [
{
"prefix": "2001:db8:abcd::",
"prefix-len": 48,
"delegated-len": 64,
"excluded-prefix": "2001:db8:abcd:1234::",
"excluded-prefix-len": 62
}
],
"subnet": "2001:db8:1::/64",
"interface": "ethX"
}
......
......@@ -81,7 +81,8 @@
{
"name": "nis-servers",
"data": "3000:1::234"
}]
}],
"client-classes": [ "special_snowflake", "office" ]
},
# This is a bit more advanced reservation. The client with the specified
# DUID will get a reserved address, a reserved prefix and a hostname.
......
......@@ -430,6 +430,24 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"excluded-prefix\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::PD_POOLS:
return isc::dhcp::Dhcp6Parser::make_EXCLUDED_PREFIX(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("excluded-prefix", driver.loc_);
}
}
\"excluded-prefix-len\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::PD_POOLS:
return isc::dhcp::Dhcp6Parser::make_EXCLUDED_PREFIX_LEN(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("excluded-prefix-len", driver.loc_);
}
}
\"delegated-len\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::PD_POOLS:
......
......@@ -86,6 +86,8 @@ using namespace std;
PD_POOLS "pd-pools"
PREFIX "prefix"
PREFIX_LEN "prefix-len"
EXCLUDED_PREFIX "excluded-prefix"
EXCLUDED_PREFIX_LEN "excluded-prefix-len"
DELEGATED_LEN "delegated-len"
SUBNET "subnet"
......@@ -1070,6 +1072,8 @@ pd_pool_param: pd_prefix
| pd_prefix_len
| pd_delegated_len
| option_data_list
| excluded_prefix
| excluded_prefix_len
| unknown_map_entry
;
......@@ -1086,6 +1090,19 @@ pd_prefix_len: PREFIX_LEN COLON INTEGER {
ctx.stack_.back()->set("prefix-len", prf);
}
excluded_prefix: EXCLUDED_PREFIX {
ctx.enter(ctx.NO_KEYWORD);
} COLON STRING {
ElementPtr prf(new StringElement($4, ctx.loc2pos(@4)));
ctx.stack_.back()->set("excluded-prefix", prf);
ctx.leave();
}
excluded_prefix_len: EXCLUDED_PREFIX_LEN COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("excluded-prefix-len", prf);
}
pd_delegated_len: DELEGATED_LEN COLON INTEGER {
ElementPtr deleg(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("delegated-len", deleg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment