Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
62804a4f
Commit
62804a4f
authored
Jan 07, 2017
by
Francis Dupont
Committed by
Tomek Mrugalski
Jan 09, 2017
Browse files
[5044fd] Added DUID type tokens within DUID_TYPE context
parent
7c3349e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp6/dhcp6_lexer.ll
View file @
62804a4f
/
*
Copyright
(
C
)
2016
Internet
Systems
Consortium
,
Inc
.
(
"ISC"
)
/
*
Copyright
(
C
)
2016
-2017
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
...
...
@@ -799,6 +799,33 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
LLT\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DUID_TYPE:
return isc::dhcp::Dhcp6Parser::make_LLT(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("
LLT
", driver.loc_);
}
}
\"
EN\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DUID_TYPE:
return isc::dhcp::Dhcp6Parser::make_EN(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("
EN
", driver.loc_);
}
}
\"
LL\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DUID_TYPE:
return isc::dhcp::Dhcp6Parser::make_LL(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("
LL
", driver.loc_);
}
}
\"
identifier\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::SERVER_ID:
...
...
src/bin/dhcp6/dhcp6_parser.yy
View file @
62804a4f
/* Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
/* Copyright (C) 2016
-2017
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
...
...
@@ -121,6 +121,9 @@ using namespace std;
EXPIRED_LEASES_PROCESSING "expired-leases-processing"
SERVER_ID "server-id"
LLT "LLT"
EN "EN"
LL "LL"
IDENTIFIER "identifier"
HTYPE "htype"
TIME "time"
...
...
@@ -185,6 +188,7 @@ using namespace std;
%token <bool> BOOLEAN "boolean"
%type <ElementPtr> value
%type <ElementPtr> duid_type
%printer { yyoutput << $$; } <*>;
...
...
@@ -454,7 +458,7 @@ database_map_params: database_map_param
| database_map_params COMMA database_map_param
;
database_map_param: type
database_map_param:
database_
type
| user
| password
| host
...
...
@@ -465,7 +469,7 @@ database_map_param: type
| unknown_map_entry
;
type: TYPE {
database_
type: TYPE {
ctx.enter(ctx.NO_KEYWORD);
} COLON STRING {
ElementPtr prf(new StringElement($4, ctx.loc2pos(@4)));
...
...
@@ -870,7 +874,13 @@ code: CODE COLON INTEGER {
option_def_code: code;
option_def_type: type;
option_def_type: TYPE {
ctx.enter(ctx.NO_KEYWORD);
} COLON STRING {
ElementPtr prf(new StringElement($4, ctx.loc2pos(@4)));
ctx.stack_.back()->set("type", prf);
ctx.leave();
};
option_def_record_types: RECORD_TYPES {
ctx.enter(ctx.NO_KEYWORD);
...
...
@@ -1328,7 +1338,7 @@ server_id_params: server_id_param
| server_id_params COMMA server_id_param
;
server_id_param: type
server_id_param:
server_id_
type
| identifier
| time
| htype
...
...
@@ -1337,6 +1347,18 @@ server_id_param: type
| unknown_map_entry
;
server_id_type: TYPE {
ctx.enter(ctx.DUID_TYPE);
} COLON duid_type {
ctx.stack_.back()->set("type", $4);
ctx.leave();
};
duid_type: LLT { $$ = ElementPtr(new StringElement("LLT", ctx.loc2pos(@1))); }
| EN { $$ = ElementPtr(new StringElement("EN", ctx.loc2pos(@1))); }
| LL { $$ = ElementPtr(new StringElement("LL", ctx.loc2pos(@1))); }
;
htype: HTYPE COLON INTEGER {
ElementPtr htype(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("htype", htype);
...
...
src/bin/dhcp6/parser_context.cc
View file @
62804a4f
// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2016
-2017
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
...
...
@@ -147,6 +147,8 @@ Parser6Context::contextName()
return
(
"client-classes"
);
case
SERVER_ID
:
return
(
"server-id"
);
case
DUID_TYPE
:
return
(
"duid-type"
);
case
CONTROL_SOCKET
:
return
(
"control-socket"
);
case
POOLS
:
...
...
src/bin/dhcp6/parser_context.h
View file @
62804a4f
// Copyright (C) 2015-201
6
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2015-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
...
...
@@ -228,6 +228,9 @@ public:
/// Used while parsing Dhcp6/server-id structures.
SERVER_ID
,
/// Used while parsing Dhcp6/server-id/type structures.
DUID_TYPE
,
/// Used while parsing Dhcp6/control-socket structures.
CONTROL_SOCKET
,
...
...
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