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
46303ccf
Commit
46303ccf
authored
Jan 12, 2017
by
Francis Dupont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5097] Added missing user-context map in flex/bison
parent
3e674fda
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
3 deletions
+49
-3
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_lexer.ll
+9
-0
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/dhcp4_parser.yy
+12
-0
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp4/tests/config_parser_unittest.cc
+3
-2
src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_lexer.ll
+10
-0
src/bin/dhcp6/dhcp6_parser.yy
src/bin/dhcp6/dhcp6_parser.yy
+13
-0
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
+2
-1
No files found.
src/bin/dhcp4/dhcp4_lexer.ll
View file @
46303ccf
...
...
@@ -426,6 +426,15 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
user-context\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::POOLS:
return isc::dhcp::Dhcp4Parser::make_USER_CONTEXT(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("
user-context
", driver.loc_);
}
}
\"
subnet\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::SUBNET4:
...
...
src/bin/dhcp4/dhcp4_parser.yy
View file @
46303ccf
...
...
@@ -93,6 +93,7 @@ using namespace std;
POOLS "pools"
POOL "pool"
USER_CONTEXT "user-context"
SUBNET "subnet"
INTERFACE "interface"
...
...
@@ -193,6 +194,7 @@ using namespace std;
%token <bool> BOOLEAN "boolean"
%type <ElementPtr> value
%type <ElementPtr> map_value
%type <ElementPtr> socket_type
%printer { yyoutput << $$; } <*>;
...
...
@@ -246,6 +248,8 @@ map2: LCURLY_BRACKET {
// for it.
};
map_value: map2 { $$ = ctx.stack_.back(); ctx.stack_.pop_back(); };
// Assignments rule
map_content: %empty // empty map
| not_empty_map
...
...
@@ -1106,6 +1110,7 @@ pool_params: pool_param
pool_param: pool_entry
| option_data_list
| user_context
| unknown_map_entry
;
...
...
@@ -1117,6 +1122,13 @@ pool_entry: POOL {
ctx.leave();
};
user_context: USER_CONTEXT {
ctx.enter(ctx.NO_KEYWORD);
} COLON map_value {
ctx.stack_.back()->set("user-context", $4);
ctx.leave();
};
// --- end of pools definition -------------------------------
// --- reservations ------------------------------------------
...
...
src/bin/dhcp4/tests/config_parser_unittest.cc
View file @
46303ccf
// Copyright (C) 2012-201
6
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-201
7
Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
...
...
@@ -572,8 +572,9 @@ public:
void
getPool
(
const
std
::
string
&
config
,
size_t
subnet_index
,
size_t
pool_index
,
PoolPtr
&
pool
)
{
ConstElementPtr
status
;
ElementPtr
json
=
Element
::
fromJSON
(
config
)
;
ConstElementPtr
json
;
EXPECT_NO_THROW
(
json
=
parseDHCP4
(
config
,
true
));
EXPECT_NO_THROW
(
status
=
configureDhcp4Server
(
*
srv_
,
json
));
ASSERT_TRUE
(
status
);
checkResult
(
status
,
0
);
...
...
src/bin/dhcp6/dhcp6_lexer.ll
View file @
46303ccf
...
...
@@ -466,6 +466,16 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
user-context\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::POOLS:
case isc::dhcp::Parser6Context::PD_POOLS:
return isc::dhcp::Dhcp6Parser::make_USER_CONTEXT(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("
user-context
", driver.loc_);
}
}
\"
subnet\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::SUBNET6:
...
...
src/bin/dhcp6/dhcp6_parser.yy
View file @
46303ccf
...
...
@@ -88,6 +88,7 @@ using namespace std;
EXCLUDED_PREFIX "excluded-prefix"
EXCLUDED_PREFIX_LEN "excluded-prefix-len"
DELEGATED_LEN "delegated-len"
USER_CONTEXT "user-context"
SUBNET "subnet"
INTERFACE "interface"
...
...
@@ -194,6 +195,7 @@ using namespace std;
%token <bool> BOOLEAN "boolean"
%type <ElementPtr> value
%type <ElementPtr> map_value
%type <ElementPtr> duid_type
%printer { yyoutput << $$; } <*>;
...
...
@@ -248,6 +250,8 @@ map2: LCURLY_BRACKET {
// for it.
};
map_value: map2 { $$ = ctx.stack_.back(); ctx.stack_.pop_back(); };
// Assignments rule
map_content: %empty // empty map
| not_empty_map
...
...
@@ -1083,6 +1087,7 @@ pool_params: pool_param
pool_param: pool_entry
| option_data_list
| user_context
| unknown_map_entry
;
...
...
@@ -1094,6 +1099,13 @@ pool_entry: POOL {
ctx.leave();
};
user_context: USER_CONTEXT {
ctx.enter(ctx.NO_KEYWORD);
} COLON map_value {
ctx.stack_.back()->set("user-context", $4);
ctx.leave();
};
// --- end of pools definition -------------------------------
// --- pd-pools ----------------------------------------------
...
...
@@ -1143,6 +1155,7 @@ pd_pool_param: pd_prefix
| option_data_list
| excluded_prefix
| excluded_prefix_len
| user_context
| unknown_map_entry
;
...
...
src/bin/dhcp6/tests/config_parser_unittest.cc
View file @
46303ccf
...
...
@@ -707,8 +707,9 @@ public:
void
getPool
(
const
std
::
string
&
config
,
size_t
subnet_index
,
size_t
pool_index
,
Lease
::
Type
type
,
PoolPtr
&
pool
)
{
ConstElementPtr
status
;
ElementPtr
json
=
Element
::
fromJSON
(
config
)
;
ConstElementPtr
json
;
EXPECT_NO_THROW
(
json
=
parseDHCP6
(
config
,
true
));
EXPECT_NO_THROW
(
status
=
configureDhcp6Server
(
srv_
,
json
));
ASSERT_TRUE
(
status
);
checkResult
(
status
,
0
);
...
...
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