Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian Schrader
Kea
Commits
313cdfdd
Commit
313cdfdd
authored
Dec 20, 2016
by
Tomek Mrugalski
🛰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5017] version parameter removed from both Dhcp4 and Dhcp6 parsers
parent
e357f559
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1 addition
and
85 deletions
+1
-85
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_lexer.ll
+0
-9
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/dhcp4_parser.yy
+0
-17
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp4/json_config_parser.cc
+1
-2
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp4/tests/config_parser_unittest.cc
+0
-14
src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_lexer.ll
+0
-9
src/bin/dhcp6/dhcp6_parser.yy
src/bin/dhcp6/dhcp6_parser.yy
+0
-17
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/json_config_parser.cc
+0
-3
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
+0
-14
No files found.
src/bin/dhcp4/dhcp4_lexer.ll
View file @
313cdfdd
...
...
@@ -779,15 +779,6 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
version\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
return isc::dhcp::Dhcp4Parser::make_VERSION(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("
version
", driver.loc_);
}
}
\"
control-socket\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
...
...
src/bin/dhcp4/dhcp4_parser.yy
View file @
313cdfdd
...
...
@@ -128,7 +128,6 @@ using namespace std;
ENTERPRISE_ID "enterprise-id"
DHCP4O6_PORT "dhcp4o6-port"
VERSION "version"
CONTROL_SOCKET "control-socket"
SOCKET_TYPE "socket-type"
...
...
@@ -186,7 +185,6 @@ using namespace std;
%token <bool> BOOLEAN "boolean"
%type <ElementPtr> value
%type <ElementPtr> version_value
%printer { yyoutput << $$; } <*>;
...
...
@@ -370,7 +368,6 @@ global_param: valid_lifetime
| expired_leases_processing
| server_id
| dhcp4o6_port
| version
| control_socket
| dhcp_ddns
| echo_client_id
...
...
@@ -1350,20 +1347,6 @@ dhcp4o6_port: DHCP4O6_PORT COLON INTEGER {
ctx.stack_.back()->set("dhcp4o6-port", time);
};
// code says it is a string, unit test a number
version: VERSION {
ctx.enter(ctx.NO_KEYWORD);
} COLON version_value {
ctx.stack_.back()->set("version", $4);
ctx.leave();
};
version_value:
INTEGER { $$ = ElementPtr(new IntElement($1, ctx.loc2pos(@1))); }
| FLOAT { $$ = ElementPtr(new DoubleElement($1, ctx.loc2pos(@1))); }
| STRING { $$ = ElementPtr(new StringElement($1, ctx.loc2pos(@1))); }
;
// --- control socket ----------------------------------------
control_socket: CONTROL_SOCKET {
...
...
src/bin/dhcp4/json_config_parser.cc
View file @
313cdfdd
...
...
@@ -428,8 +428,7 @@ DhcpConfigParser* createGlobalDhcp4ConfigParser(const std::string& config_id,
parser
=
new
OptionDataListParser
(
config_id
,
CfgOptionPtr
(),
AF_INET
);
}
else
if
(
config_id
.
compare
(
"option-def"
)
==
0
)
{
parser
=
new
OptionDefListParser
(
config_id
,
globalContext
());
}
else
if
((
config_id
.
compare
(
"version"
)
==
0
)
||
(
config_id
.
compare
(
"next-server"
)
==
0
))
{
}
else
if
((
config_id
.
compare
(
"next-server"
)
==
0
))
{
parser
=
new
StringParser
(
config_id
,
globalContext
()
->
string_values_
);
}
else
if
(
config_id
.
compare
(
"lease-database"
)
==
0
)
{
...
...
src/bin/dhcp4/tests/config_parser_unittest.cc
View file @
313cdfdd
...
...
@@ -598,20 +598,6 @@ public:
isc
::
dhcp
::
ClientClasses
classify_
;
///< used in client classification
};
// Goal of this test is a verification if a very simple config update
// with just a bumped version number. That's the simplest possible
// config update.
TEST_F
(
Dhcp4ParserTest
,
version
)
{
ConstElementPtr
json
;
ASSERT_NO_THROW
(
json
=
parseDHCP4
(
"{
\"
version
\"
: 0}"
));
ConstElementPtr
x
;
EXPECT_NO_THROW
(
x
=
configureDhcp4Server
(
*
srv_
,
json
));
// returned value must be 0 (configuration accepted)
checkResult
(
x
,
0
);
}
/// The goal of this test is to verify that the code accepts only
/// valid commands and malformed or unsupported parameters are rejected.
TEST_F
(
Dhcp4ParserTest
,
bogusCommand
)
{
...
...
src/bin/dhcp6/dhcp6_lexer.ll
View file @
313cdfdd
...
...
@@ -853,15 +853,6 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
version\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
return isc::dhcp::Dhcp6Parser::make_VERSION(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("
version
", driver.loc_);
}
}
\"
control-socket\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
...
...
src/bin/dhcp6/dhcp6_parser.yy
View file @
313cdfdd
...
...
@@ -127,7 +127,6 @@ using namespace std;
ENTERPRISE_ID "enterprise-id"
DHCP4O6_PORT "dhcp4o6-port"
VERSION "version"
CONTROL_SOCKET "control-socket"
SOCKET_TYPE "socket-type"
...
...
@@ -186,7 +185,6 @@ using namespace std;
%token <bool> BOOLEAN "boolean"
%type <ElementPtr> value
%type <ElementPtr> version_value
%printer { yyoutput << $$; } <*>;
...
...
@@ -374,7 +372,6 @@ global_param: preferred_lifetime
| expired_leases_processing
| server_id
| dhcp4o6_port
| version
| control_socket
| dhcp_ddns
| unknown_map_entry
...
...
@@ -1370,20 +1367,6 @@ dhcp4o6_port: DHCP4O6_PORT COLON INTEGER {
ctx.stack_.back()->set("dhcp4o6-port", time);
};
// code says it is a string, unit test a number
version: VERSION {
ctx.enter(ctx.NO_KEYWORD);
} COLON version_value {
ctx.stack_.back()->set("version", $4);
ctx.leave();
};
version_value:
INTEGER { $$ = ElementPtr(new IntElement($1, ctx.loc2pos(@1))); }
| FLOAT { $$ = ElementPtr(new DoubleElement($1, ctx.loc2pos(@1))); }
| STRING { $$ = ElementPtr(new StringElement($1, ctx.loc2pos(@1))); }
;
// --- control socket ----------------------------------------
control_socket: CONTROL_SOCKET {
...
...
src/bin/dhcp6/json_config_parser.cc
View file @
313cdfdd
...
...
@@ -707,9 +707,6 @@ DhcpConfigParser* createGlobal6DhcpConfigParser(const std::string& config_id,
parser
=
new
OptionDataListParser
(
config_id
,
CfgOptionPtr
(),
AF_INET6
);
}
else
if
(
config_id
.
compare
(
"option-def"
)
==
0
)
{
parser
=
new
OptionDefListParser
(
config_id
,
globalContext
());
}
else
if
(
config_id
.
compare
(
"version"
)
==
0
)
{
parser
=
new
StringParser
(
config_id
,
globalContext
()
->
string_values_
);
}
else
if
(
config_id
.
compare
(
"lease-database"
)
==
0
)
{
parser
=
new
DbAccessParser
(
config_id
,
DbAccessParser
::
LEASE_DB
);
}
else
if
(
config_id
.
compare
(
"hosts-database"
)
==
0
)
{
...
...
src/bin/dhcp6/tests/config_parser_unittest.cc
View file @
313cdfdd
...
...
@@ -732,20 +732,6 @@ public:
isc
::
dhcp
::
ClientClasses
classify_
;
///< used in client classification
};
// Goal of this test is a verification if a very simple config update
// with just a bumped version number. That's the simplest possible
// config update.
TEST_F
(
Dhcp6ParserTest
,
version
)
{
ConstElementPtr
json
;
ASSERT_NO_THROW
(
json
=
parseDHCP6
(
"{
\"
version
\"
: 0}"
));
ConstElementPtr
x
;
EXPECT_NO_THROW
(
x
=
configureDhcp6Server
(
srv_
,
json
));
// returned value must be 0 (configuration accepted)
checkResult
(
x
,
0
);
}
/// The goal of this test is to verify that the code accepts only
/// valid commands and malformed or unsupported parameters are rejected.
TEST_F
(
Dhcp6ParserTest
,
bogusCommand
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment