}
}
+\"disabled\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser4Context::RESERVATION_MODE:
+ return isc::dhcp::Dhcp4Parser::make_DISABLED(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp4Parser::make_STRING("disabled", driver.loc_);
+ }
+}
+
+\"off\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser4Context::RESERVATION_MODE:
+ return isc::dhcp::Dhcp4Parser::make_DISABLED(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp4Parser::make_STRING("off", driver.loc_);
+ }
+}
+
+\"out-of-pool\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser4Context::RESERVATION_MODE:
+ return isc::dhcp::Dhcp4Parser::make_OUT_OF_POOL(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp4Parser::make_STRING("out-of-pool", driver.loc_);
+ }
+}
+
+\"all\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser4Context::RESERVATION_MODE:
+ return isc::dhcp::Dhcp4Parser::make_ALL(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp4Parser::make_STRING("all", driver.loc_);
+ }
+}
+
\"code\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::OPTION_DEF:
ID "id"
RAPID_COMMIT "rapid-commit"
RESERVATION_MODE "reservation-mode"
+ DISABLED "disabled"
+ OUT_OF_POOL "out-of-pool"
+ ALL "all"
HOST_RESERVATION_IDENTIFIERS "host-reservation-identifiers"
%type <ElementPtr> map_value
%type <ElementPtr> socket_type
%type <ElementPtr> db_type
+%type <ElementPtr> hr_mode
%type <ElementPtr> ncr_protocol_value
%type <ElementPtr> replace_client_name_value
};
reservation_mode: RESERVATION_MODE {
- ctx.enter(ctx.NO_KEYWORD);
-} COLON STRING {
- ElementPtr rm(new StringElement($4, ctx.loc2pos(@4)));
- ctx.stack_.back()->set("reservation-mode", rm);
+ ctx.enter(ctx.RESERVATION_MODE);
+} COLON hr_mode {
+ ctx.stack_.back()->set("reservation-mode", $4);
ctx.leave();
};
+hr_mode: DISABLED { $$ = ElementPtr(new StringElement("disabled", ctx.loc2pos(@1))); }
+ | OUT_OF_POOL { $$ = ElementPtr(new StringElement("out-of-pool", ctx.loc2pos(@1))); }
+ | ALL { $$ = ElementPtr(new StringElement("all", ctx.loc2pos(@1))); }
+ ;
+
id: ID COLON INTEGER {
ElementPtr id(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("id", id);
return ("hooks-librairies");
case SUBNET4:
return ("subnet4");
+ case RESERVATION_MODE:
+ return ("reservation-mode");
case OPTION_DEF:
return ("option-def");
case OPTION_DATA:
/// Used while parsing Dhcp4/Subnet4 structures.
SUBNET4,
+ /// Used while parsing Dhcp4/Subnet4/reservation-mode.
+ RESERVATION_MODE,
+
/// Used while parsing Dhcp4/option-def structures.
OPTION_DEF,
}
}
+\"disabled\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser6Context::RESERVATION_MODE:
+ return isc::dhcp::Dhcp6Parser::make_DISABLED(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp6Parser::make_STRING("disabled", driver.loc_);
+ }
+}
+
+\"off\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser6Context::RESERVATION_MODE:
+ return isc::dhcp::Dhcp6Parser::make_DISABLED(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp6Parser::make_STRING("off", driver.loc_);
+ }
+}
+
+\"out-of-pool\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser6Context::RESERVATION_MODE:
+ return isc::dhcp::Dhcp6Parser::make_OUT_OF_POOL(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp6Parser::make_STRING("out-of-pool", driver.loc_);
+ }
+}
+
+\"all\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser6Context::RESERVATION_MODE:
+ return isc::dhcp::Dhcp6Parser::make_ALL(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp6Parser::make_STRING("all", driver.loc_);
+ }
+}
+
\"code\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::OPTION_DEF:
ID "id"
RAPID_COMMIT "rapid-commit"
RESERVATION_MODE "reservation-mode"
+ DISABLED "disabled"
+ OUT_OF_POOL "out-of-pool"
+ ALL "all"
MAC_SOURCES "mac-sources"
RELAY_SUPPLIED_OPTIONS "relay-supplied-options"
%type <ElementPtr> value
%type <ElementPtr> map_value
%type <ElementPtr> db_type
+%type <ElementPtr> hr_mode
%type <ElementPtr> duid_type
%type <ElementPtr> ncr_protocol_value
%type <ElementPtr> replace_client_name_value
};
reservation_mode: RESERVATION_MODE {
- ctx.enter(ctx.NO_KEYWORD);
-} COLON STRING {
- ElementPtr rm(new StringElement($4, ctx.loc2pos(@4)));
- ctx.stack_.back()->set("reservation-mode", rm);
+ ctx.enter(ctx.RESERVATION_MODE);
+} COLON hr_mode {
+ ctx.stack_.back()->set("reservation-mode", $4);
ctx.leave();
};
+hr_mode: DISABLED { $$ = ElementPtr(new StringElement("disabled", ctx.loc2pos(@1))); }
+ | OUT_OF_POOL { $$ = ElementPtr(new StringElement("out-of-pool", ctx.loc2pos(@1))); }
+ | ALL { $$ = ElementPtr(new StringElement("all", ctx.loc2pos(@1))); }
+ ;
+
id: ID COLON INTEGER {
ElementPtr id(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("id", id);
return ("hooks-librairies");
case SUBNET6:
return ("subnet6");
+ case RESERVATION_MODE:
+ return ("reservation-mode");
case OPTION_DEF:
return ("option-def");
case OPTION_DATA:
/// Used while parsing Dhcp6/Subnet6 structures.
SUBNET6,
+ /// Used while parsing Dhcp6/Subnet6/reservation-mode.
+ RESERVATION_MODE,
+
/// Used while parsing Dhcp6/option-def structures.
OPTION_DEF,