mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 15:35:17 +00:00
[5425] Extended syntax
This commit is contained in:
@@ -586,6 +586,31 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\"known-clients\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser4Context::POOLS:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_KNOWN_CLIENTS(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_STRING("known-clients", driver.loc_);
|
||||||
|
}
|
||||||
|
|
||||||
|
\"only\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser4Context::KNOWN_CLIENTS:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_ONLY(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_STRING("only", driver.loc_);
|
||||||
|
}
|
||||||
|
|
||||||
|
\"never\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser4Context::KNOWN_CLIENTS:
|
||||||
|
case isc::dhcp::Parser4Context::REPLACE_CLIENT_NAME:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_NEVER(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_STRING("never", driver.loc_);
|
||||||
|
}
|
||||||
|
|
||||||
\"subnet\" {
|
\"subnet\" {
|
||||||
switch(driver.ctx_) {
|
switch(driver.ctx_) {
|
||||||
case isc::dhcp::Parser4Context::SUBNET4:
|
case isc::dhcp::Parser4Context::SUBNET4:
|
||||||
|
@@ -109,6 +109,9 @@ using namespace std;
|
|||||||
POOLS "pools"
|
POOLS "pools"
|
||||||
POOL "pool"
|
POOL "pool"
|
||||||
USER_CONTEXT "user-context"
|
USER_CONTEXT "user-context"
|
||||||
|
KNOWN_CLIENTS "known-clients"
|
||||||
|
ONLY "only"
|
||||||
|
NEVER "never"
|
||||||
|
|
||||||
SUBNET "subnet"
|
SUBNET "subnet"
|
||||||
INTERFACE "interface"
|
INTERFACE "interface"
|
||||||
@@ -173,7 +176,6 @@ using namespace std;
|
|||||||
TCP "tcp"
|
TCP "tcp"
|
||||||
JSON "JSON"
|
JSON "JSON"
|
||||||
WHEN_PRESENT "when-present"
|
WHEN_PRESENT "when-present"
|
||||||
NEVER "never"
|
|
||||||
ALWAYS "always"
|
ALWAYS "always"
|
||||||
WHEN_NOT_PRESENT "when-not-present"
|
WHEN_NOT_PRESENT "when-not-present"
|
||||||
|
|
||||||
@@ -1331,6 +1333,7 @@ pool_param: pool_entry
|
|||||||
| option_data_list
|
| option_data_list
|
||||||
| client_class
|
| client_class
|
||||||
| user_context
|
| user_context
|
||||||
|
| known_clients
|
||||||
| unknown_map_entry
|
| unknown_map_entry
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -1349,6 +1352,18 @@ user_context: USER_CONTEXT {
|
|||||||
ctx.leave();
|
ctx.leave();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
known_clients: KNOWN_CLIENTS {
|
||||||
|
ctx.enter(ctx.KNOWN_CLIENTS);
|
||||||
|
} COLON known_clients_value {
|
||||||
|
ctx.stack_.back()->set("known-clients", $4);
|
||||||
|
ctx.leave();
|
||||||
|
}
|
||||||
|
|
||||||
|
known_clients_value:
|
||||||
|
ONLY { $$ = ElementPtr(new StringElement("only", ctx.loc2pos(@1))); }
|
||||||
|
| NEVER { $$ = ElementPtr(new StringElement("never", ctx.loc2pos(@1))); }
|
||||||
|
;
|
||||||
|
|
||||||
// --- end of pools definition -------------------------------
|
// --- end of pools definition -------------------------------
|
||||||
|
|
||||||
// --- reservations ------------------------------------------
|
// --- reservations ------------------------------------------
|
||||||
|
@@ -174,6 +174,8 @@ Parser4Context::contextName()
|
|||||||
return ("control-socket");
|
return ("control-socket");
|
||||||
case POOLS:
|
case POOLS:
|
||||||
return ("pools");
|
return ("pools");
|
||||||
|
case KNOWN_CLIENTS:
|
||||||
|
return ("known-clients");
|
||||||
case RESERVATIONS:
|
case RESERVATIONS:
|
||||||
return ("reservations");
|
return ("reservations");
|
||||||
case RELAY:
|
case RELAY:
|
||||||
|
@@ -264,6 +264,9 @@ public:
|
|||||||
/// Used while parsing Dhcp4/subnet4/pools structures.
|
/// Used while parsing Dhcp4/subnet4/pools structures.
|
||||||
POOLS,
|
POOLS,
|
||||||
|
|
||||||
|
/// Used while parsing Dhcp4/subnet4/pools/known_client structures.
|
||||||
|
KNOWN_CLIENTS,
|
||||||
|
|
||||||
/// Used while parsing Dhcp4/reservations structures.
|
/// Used while parsing Dhcp4/reservations structures.
|
||||||
RESERVATIONS,
|
RESERVATIONS,
|
||||||
|
|
||||||
|
@@ -361,6 +361,15 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
|
|||||||
return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
|
return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\"never\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser6Context::KNOWN_CLIENTS:
|
||||||
|
case isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_NEVER(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_STRING("never", driver.loc_);
|
||||||
|
}
|
||||||
|
|
||||||
(?i:\"never\") {
|
(?i:\"never\") {
|
||||||
/* dhcp-ddns value keywords are case insensitive */
|
/* dhcp-ddns value keywords are case insensitive */
|
||||||
if (driver.ctx_ == isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME) {
|
if (driver.ctx_ == isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME) {
|
||||||
@@ -817,6 +826,22 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\"known-clients\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser6Context::POOLS:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_KNOWN_CLIENTS(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_STRING("known-clients", driver.loc_);
|
||||||
|
}
|
||||||
|
|
||||||
|
\"only\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser6Context::KNOWN_CLIENTS:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_ONLY(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_STRING("only", driver.loc_);
|
||||||
|
}
|
||||||
|
|
||||||
\"subnet\" {
|
\"subnet\" {
|
||||||
switch(driver.ctx_) {
|
switch(driver.ctx_) {
|
||||||
case isc::dhcp::Parser6Context::SUBNET6:
|
case isc::dhcp::Parser6Context::SUBNET6:
|
||||||
|
@@ -99,6 +99,9 @@ using namespace std;
|
|||||||
EXCLUDED_PREFIX_LEN "excluded-prefix-len"
|
EXCLUDED_PREFIX_LEN "excluded-prefix-len"
|
||||||
DELEGATED_LEN "delegated-len"
|
DELEGATED_LEN "delegated-len"
|
||||||
USER_CONTEXT "user-context"
|
USER_CONTEXT "user-context"
|
||||||
|
KNOWN_CLIENTS "known-clients"
|
||||||
|
ONLY "only"
|
||||||
|
NEVER "never"
|
||||||
|
|
||||||
SUBNET "subnet"
|
SUBNET "subnet"
|
||||||
INTERFACE "interface"
|
INTERFACE "interface"
|
||||||
@@ -176,7 +179,6 @@ using namespace std;
|
|||||||
TCP "TCP"
|
TCP "TCP"
|
||||||
JSON "JSON"
|
JSON "JSON"
|
||||||
WHEN_PRESENT "when-present"
|
WHEN_PRESENT "when-present"
|
||||||
NEVER "never"
|
|
||||||
ALWAYS "always"
|
ALWAYS "always"
|
||||||
WHEN_NOT_PRESENT "when-not-present"
|
WHEN_NOT_PRESENT "when-not-present"
|
||||||
|
|
||||||
@@ -1294,6 +1296,7 @@ pool_param: pool_entry
|
|||||||
| option_data_list
|
| option_data_list
|
||||||
| client_class
|
| client_class
|
||||||
| user_context
|
| user_context
|
||||||
|
| known_clients
|
||||||
| unknown_map_entry
|
| unknown_map_entry
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -1312,6 +1315,18 @@ user_context: USER_CONTEXT {
|
|||||||
ctx.leave();
|
ctx.leave();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
known_clients: KNOWN_CLIENTS {
|
||||||
|
ctx.enter(ctx.KNOWN_CLIENTS);
|
||||||
|
} COLON known_clients_value {
|
||||||
|
ctx.stack_.back()->set("known-clients", $4);
|
||||||
|
ctx.leave();
|
||||||
|
}
|
||||||
|
|
||||||
|
known_clients_value:
|
||||||
|
ONLY { $$ = ElementPtr(new StringElement("only", ctx.loc2pos(@1))); }
|
||||||
|
| NEVER { $$ = ElementPtr(new StringElement("never", ctx.loc2pos(@1))); }
|
||||||
|
;
|
||||||
|
|
||||||
// --- end of pools definition -------------------------------
|
// --- end of pools definition -------------------------------
|
||||||
|
|
||||||
// --- pd-pools ----------------------------------------------
|
// --- pd-pools ----------------------------------------------
|
||||||
@@ -1371,6 +1386,7 @@ pd_pool_param: pd_prefix
|
|||||||
| excluded_prefix
|
| excluded_prefix
|
||||||
| excluded_prefix_len
|
| excluded_prefix_len
|
||||||
| user_context
|
| user_context
|
||||||
|
| known_clients
|
||||||
| unknown_map_entry
|
| unknown_map_entry
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@@ -176,6 +176,8 @@ Parser6Context::contextName()
|
|||||||
return ("pools");
|
return ("pools");
|
||||||
case PD_POOLS:
|
case PD_POOLS:
|
||||||
return ("pd-pools");
|
return ("pd-pools");
|
||||||
|
case KNOWN_CLIENTS:
|
||||||
|
return ("known-clients");
|
||||||
case RESERVATIONS:
|
case RESERVATIONS:
|
||||||
return ("reservations");
|
return ("reservations");
|
||||||
case RELAY:
|
case RELAY:
|
||||||
|
@@ -270,6 +270,9 @@ public:
|
|||||||
/// Used while parsing Dhcp6/subnet6/pd-pools structures.
|
/// Used while parsing Dhcp6/subnet6/pd-pools structures.
|
||||||
PD_POOLS,
|
PD_POOLS,
|
||||||
|
|
||||||
|
/// Used while parsing Dhcp4/subnet6/pools/known_client structures.
|
||||||
|
KNOWN_CLIENTS,
|
||||||
|
|
||||||
/// Used while parsing Dhcp6/reservations structures.
|
/// Used while parsing Dhcp6/reservations structures.
|
||||||
RESERVATIONS,
|
RESERVATIONS,
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user