mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 15:35:17 +00:00
[#2688] Updated DHCP server parsers
This commit is contained in:
@@ -375,7 +375,10 @@
|
|||||||
"type": "postgresql",
|
"type": "postgresql",
|
||||||
|
|
||||||
// User name to be used to access the database.
|
// User name to be used to access the database.
|
||||||
"user": "keatest"
|
"user": "keatest",
|
||||||
|
|
||||||
|
// TCP user timeout while communicating with the database.
|
||||||
|
"tcp-user-timeout": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Name of the database to connect to.
|
// Name of the database to connect to.
|
||||||
@@ -408,7 +411,13 @@
|
|||||||
"on-fail": "stop-retry-exit",
|
"on-fail": "stop-retry-exit",
|
||||||
|
|
||||||
// Connection connect timeout.
|
// Connection connect timeout.
|
||||||
"connect-timeout": 100
|
"connect-timeout": 100,
|
||||||
|
|
||||||
|
// Data read from the database timeout.
|
||||||
|
"read-timeout": 120,
|
||||||
|
|
||||||
|
// Data write to the database timeout.
|
||||||
|
"write-timeout": 180
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@@ -332,7 +332,10 @@
|
|||||||
"type": "postgresql",
|
"type": "postgresql",
|
||||||
|
|
||||||
// User name to be used to access the database.
|
// User name to be used to access the database.
|
||||||
"user": "keatest"
|
"user": "keatest",
|
||||||
|
|
||||||
|
// TCP user timeout while communicating with the database.
|
||||||
|
"tcp-user-timeout": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Name of the database to connect to.
|
// Name of the database to connect to.
|
||||||
@@ -365,7 +368,13 @@
|
|||||||
"on-fail": "stop-retry-exit",
|
"on-fail": "stop-retry-exit",
|
||||||
|
|
||||||
// Connection connect timeout.
|
// Connection connect timeout.
|
||||||
"connect-timeout": 100
|
"connect-timeout": 100,
|
||||||
|
|
||||||
|
// Data read from the database timeout.
|
||||||
|
"read-timeout": 120,
|
||||||
|
|
||||||
|
// Data write to the database timeout.
|
||||||
|
"write-timeout": 180
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -510,6 +510,39 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\"read-timeout\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||||
|
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||||
|
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_READ_TIMEOUT(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_STRING("read-timeout", driver.loc_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\"write-timeout\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||||
|
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||||
|
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_WRITE_TIMEOUT(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_STRING("write-timeout", driver.loc_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\"tcp-user-timeout\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||||
|
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
|
||||||
|
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_TCP_USER_TIMEOUT(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp4Parser::make_STRING("tcp-user-timeout", driver.loc_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
\"reconnect-wait-time\" {
|
\"reconnect-wait-time\" {
|
||||||
switch(driver.ctx_) {
|
switch(driver.ctx_) {
|
||||||
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
case isc::dhcp::Parser4Context::LEASE_DATABASE:
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -94,6 +94,9 @@ using namespace std;
|
|||||||
LFC_INTERVAL "lfc-interval"
|
LFC_INTERVAL "lfc-interval"
|
||||||
READONLY "readonly"
|
READONLY "readonly"
|
||||||
CONNECT_TIMEOUT "connect-timeout"
|
CONNECT_TIMEOUT "connect-timeout"
|
||||||
|
READ_TIMEOUT "read-timeout"
|
||||||
|
WRITE_TIMEOUT "write-timeout"
|
||||||
|
TCP_USER_TIMEOUT "tcp-user-timeout"
|
||||||
MAX_RECONNECT_TRIES "max-reconnect-tries"
|
MAX_RECONNECT_TRIES "max-reconnect-tries"
|
||||||
RECONNECT_WAIT_TIME "reconnect-wait-time"
|
RECONNECT_WAIT_TIME "reconnect-wait-time"
|
||||||
ON_FAIL "on-fail"
|
ON_FAIL "on-fail"
|
||||||
@@ -1022,6 +1025,9 @@ database_map_param: database_type
|
|||||||
| lfc_interval
|
| lfc_interval
|
||||||
| readonly
|
| readonly
|
||||||
| connect_timeout
|
| connect_timeout
|
||||||
|
| read_timeout
|
||||||
|
| write_timeout
|
||||||
|
| tcp_user_timeout
|
||||||
| max_reconnect_tries
|
| max_reconnect_tries
|
||||||
| reconnect_wait_time
|
| reconnect_wait_time
|
||||||
| on_fail
|
| on_fail
|
||||||
@@ -1112,6 +1118,24 @@ connect_timeout: CONNECT_TIMEOUT COLON INTEGER {
|
|||||||
ctx.stack_.back()->set("connect-timeout", n);
|
ctx.stack_.back()->set("connect-timeout", n);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
read_timeout: READ_TIMEOUT COLON INTEGER {
|
||||||
|
ctx.unique("read-timeout", ctx.loc2pos(@1));
|
||||||
|
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||||
|
ctx.stack_.back()->set("read-timeout", n);
|
||||||
|
};
|
||||||
|
|
||||||
|
write_timeout: WRITE_TIMEOUT COLON INTEGER {
|
||||||
|
ctx.unique("write-timeout", ctx.loc2pos(@1));
|
||||||
|
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||||
|
ctx.stack_.back()->set("write-timeout", n);
|
||||||
|
};
|
||||||
|
|
||||||
|
tcp_user_timeout: TCP_USER_TIMEOUT COLON INTEGER {
|
||||||
|
ctx.unique("tcp-user-timeout", ctx.loc2pos(@1));
|
||||||
|
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||||
|
ctx.stack_.back()->set("tcp-user-timeout", n);
|
||||||
|
};
|
||||||
|
|
||||||
max_reconnect_tries: MAX_RECONNECT_TRIES COLON INTEGER {
|
max_reconnect_tries: MAX_RECONNECT_TRIES COLON INTEGER {
|
||||||
ctx.unique("max-reconnect-tries", ctx.loc2pos(@1));
|
ctx.unique("max-reconnect-tries", ctx.loc2pos(@1));
|
||||||
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -708,6 +708,39 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\"read-timeout\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||||
|
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||||
|
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_READ_TIMEOUT(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_STRING("read-timeout", driver.loc_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\"write-timeout\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||||
|
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||||
|
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_WRITE_TIMEOUT(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_STRING("write-timeout", driver.loc_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\"tcp-user-timeout\" {
|
||||||
|
switch(driver.ctx_) {
|
||||||
|
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||||
|
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
|
||||||
|
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_TCP_USER_TIMEOUT(driver.loc_);
|
||||||
|
default:
|
||||||
|
return isc::dhcp::Dhcp6Parser::make_STRING("tcp-user-timeout", driver.loc_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
\"reconnect-wait-time\" {
|
\"reconnect-wait-time\" {
|
||||||
switch(driver.ctx_) {
|
switch(driver.ctx_) {
|
||||||
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
case isc::dhcp::Parser6Context::LEASE_DATABASE:
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -78,6 +78,9 @@ using namespace std;
|
|||||||
LFC_INTERVAL "lfc-interval"
|
LFC_INTERVAL "lfc-interval"
|
||||||
READONLY "readonly"
|
READONLY "readonly"
|
||||||
CONNECT_TIMEOUT "connect-timeout"
|
CONNECT_TIMEOUT "connect-timeout"
|
||||||
|
READ_TIMEOUT "read-timeout"
|
||||||
|
WRITE_TIMEOUT "write-timeout"
|
||||||
|
TCP_USER_TIMEOUT "tcp-user-timeout"
|
||||||
MAX_RECONNECT_TRIES "max-reconnect-tries"
|
MAX_RECONNECT_TRIES "max-reconnect-tries"
|
||||||
RECONNECT_WAIT_TIME "reconnect-wait-time"
|
RECONNECT_WAIT_TIME "reconnect-wait-time"
|
||||||
ON_FAIL "on-fail"
|
ON_FAIL "on-fail"
|
||||||
@@ -963,6 +966,9 @@ database_map_param: database_type
|
|||||||
| lfc_interval
|
| lfc_interval
|
||||||
| readonly
|
| readonly
|
||||||
| connect_timeout
|
| connect_timeout
|
||||||
|
| read_timeout
|
||||||
|
| write_timeout
|
||||||
|
| tcp_user_timeout
|
||||||
| max_reconnect_tries
|
| max_reconnect_tries
|
||||||
| reconnect_wait_time
|
| reconnect_wait_time
|
||||||
| on_fail
|
| on_fail
|
||||||
@@ -1053,6 +1059,25 @@ connect_timeout: CONNECT_TIMEOUT COLON INTEGER {
|
|||||||
ctx.stack_.back()->set("connect-timeout", n);
|
ctx.stack_.back()->set("connect-timeout", n);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
read_timeout: READ_TIMEOUT COLON INTEGER {
|
||||||
|
ctx.unique("read-timeout", ctx.loc2pos(@1));
|
||||||
|
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||||
|
ctx.stack_.back()->set("connect-timeout", n);
|
||||||
|
};
|
||||||
|
|
||||||
|
write_timeout: WRITE_TIMEOUT COLON INTEGER {
|
||||||
|
ctx.unique("write-timeout", ctx.loc2pos(@1));
|
||||||
|
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||||
|
ctx.stack_.back()->set("write-timeout", n);
|
||||||
|
};
|
||||||
|
|
||||||
|
tcp_user_timeout: TCP_USER_TIMEOUT COLON INTEGER {
|
||||||
|
ctx.unique("tcp-user-timeout", ctx.loc2pos(@1));
|
||||||
|
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||||
|
ctx.stack_.back()->set("tcp-user-timeout", n);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
reconnect_wait_time: RECONNECT_WAIT_TIME COLON INTEGER {
|
reconnect_wait_time: RECONNECT_WAIT_TIME COLON INTEGER {
|
||||||
ctx.unique("reconnect-wait-time", ctx.loc2pos(@1));
|
ctx.unique("reconnect-wait-time", ctx.loc2pos(@1));
|
||||||
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
ElementPtr n(new IntElement($3, ctx.loc2pos(@3)));
|
||||||
|
Reference in New Issue
Block a user