Commit 9bf1986a authored by Francis Dupont's avatar Francis Dupont Committed by Tomek Mrugalski

[274-possible-improvements-to-dhcp-queue-control-member-parsing] Extended syntax

parent df8e28ba
......@@ -1443,6 +1443,15 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"capacity\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP_QUEUE_CONTROL:
return isc::dhcp::Dhcp4Parser::make_CAPACITY(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("capacity", driver.loc_);
}
}
\"dhcp-ddns\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
......
......@@ -191,6 +191,7 @@ using namespace std;
DHCP_QUEUE_CONTROL "dhcp-queue-control"
ENABLE_QUEUE "enable-queue"
QUEUE_TYPE "queue-type"
CAPACITY "capacity"
DHCP_DDNS "dhcp-ddns"
ENABLE_UPDATES "enable-updates"
......@@ -2038,9 +2039,10 @@ queue_control_params: queue_control_param
queue_control_param: enable_queue
| queue_type
| capacity
| user_context
| comment
| unknown_map_entry
| arbitrary_map_entry
;
enable_queue: ENABLE_QUEUE COLON BOOLEAN {
......@@ -2056,6 +2058,18 @@ queue_type: QUEUE_TYPE {
ctx.leave();
};
capacity: CAPACITY COLON INTEGER {
ElementPtr c(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("capacity", c);
};
arbitrary_map_entry: STRING {
ctx.enter(ctx.NO_KEYWORD);
} COLON value {
ctx.stack_.back()->set($1, $4);
ctx.leave();
};
// --- dhcp ddns ---------------------------------------------
dhcp_ddns: DHCP_DDNS {
......
......@@ -1835,6 +1835,15 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"capacity\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP_QUEUE_CONTROL:
return isc::dhcp::Dhcp6Parser::make_CAPACITY(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("capacity", driver.loc_);
}
}
\"dhcp-ddns\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
......
......@@ -195,6 +195,7 @@ using namespace std;
DHCP_QUEUE_CONTROL "dhcp-queue-control"
ENABLE_QUEUE "enable-queue"
QUEUE_TYPE "queue-type"
CAPACITY "capacity"
DHCP_DDNS "dhcp-ddns"
ENABLE_UPDATES "enable-updates"
......@@ -2154,9 +2155,10 @@ queue_control_params: queue_control_param
queue_control_param: enable_queue
| queue_type
| capacity
| user_context
| comment
| unknown_map_entry
| arbitrary_map_entry
;
enable_queue: ENABLE_QUEUE COLON BOOLEAN {
......@@ -2172,6 +2174,18 @@ queue_type: QUEUE_TYPE {
ctx.leave();
};
capacity: CAPACITY COLON INTEGER {
ElementPtr c(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("capacity", c);
};
arbitrary_map_entry: STRING {
ctx.enter(ctx.NO_KEYWORD);
} COLON value {
ctx.stack_.back()->set($1, $4);
ctx.leave();
};
// --- dhcp ddns ---------------------------------------------
dhcp_ddns: DHCP_DDNS {
......
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