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
Adam Osuchowski
Kea
Commits
b10ec649
Commit
b10ec649
authored
Oct 05, 2016
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5022] Options can only be specified for DHCPv6 pools.
parent
0a602468
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
6 deletions
+21
-6
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp4/json_config_parser.cc
+2
-1
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/json_config_parser.cc
+2
-1
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
+11
-3
src/lib/dhcpsrv/parsers/dhcp_parsers.h
src/lib/dhcpsrv/parsers/dhcp_parsers.h
+6
-1
No files found.
src/bin/dhcp4/json_config_parser.cc
View file @
b10ec649
...
...
@@ -32,6 +32,7 @@
#include <limits>
#include <iostream>
#include <netinet/in.h>
#include <vector>
#include <map>
...
...
@@ -61,7 +62,7 @@ public:
/// @param pools storage container in which to store the parsed pool
/// upon "commit"
Pool4Parser
(
const
std
::
string
&
param_name
,
PoolStoragePtr
pools
)
:
PoolParser
(
param_name
,
pools
)
{
:
PoolParser
(
param_name
,
pools
,
AF_INET
)
{
}
protected:
...
...
src/bin/dhcp6/json_config_parser.cc
View file @
b10ec649
...
...
@@ -43,6 +43,7 @@
#include <iostream>
#include <limits>
#include <map>
#include <netinet/in.h>
#include <vector>
#include <stdint.h>
...
...
@@ -78,7 +79,7 @@ public:
/// @param pools storage container in which to store the parsed pool
/// upon "commit"
Pool6Parser
(
const
std
::
string
&
param_name
,
PoolStoragePtr
pools
)
:
PoolParser
(
param_name
,
pools
)
{
:
PoolParser
(
param_name
,
pools
,
AF_INET6
)
{
}
protected:
...
...
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
View file @
b10ec649
...
...
@@ -1039,8 +1039,10 @@ void PoolsListParser::commit() {
}
//****************************** PoolParser ********************************
PoolParser
::
PoolParser
(
const
std
::
string
&
,
PoolStoragePtr
pools
)
:
pools_
(
pools
),
options_
(
new
CfgOption
())
{
PoolParser
::
PoolParser
(
const
std
::
string
&
,
PoolStoragePtr
pools
,
const
uint16_t
address_family
)
:
pools_
(
pools
),
options_
(
new
CfgOption
()),
address_family_
(
address_family
)
{
if
(
!
pools_
)
{
isc_throw
(
isc
::
dhcp
::
DhcpConfigError
,
"parser logic error: "
...
...
@@ -1124,9 +1126,15 @@ PoolParser::build(ConstElementPtr pool_structure) {
ConstElementPtr
option_data
=
pool_structure
->
get
(
"option-data"
);
if
(
option_data
)
{
try
{
// Currently we don't support specifying options for the DHCPv4 server.
if
(
address_family_
==
AF_INET
)
{
isc_throw
(
DhcpConfigError
,
"option-data is not supported for DHCPv4"
" address pools"
);
}
OptionDataListParserPtr
option_parser
(
new
OptionDataListParser
(
"option-data"
,
options_
,
AF_INET6
));
address_family_
));
option_parser
->
build
(
option_data
);
option_parser
->
commit
();
options_
->
copyTo
(
*
pool
->
getCfgOption
());;
...
...
src/lib/dhcpsrv/parsers/dhcp_parsers.h
View file @
b10ec649
...
...
@@ -835,8 +835,10 @@ public:
/// accept string as first argument.
/// @param pools is the storage in which to store the parsed pool
/// upon "commit".
/// @param address_family AF_INET (for DHCPv4) or AF_INET6 (for DHCPv6).
/// @throw isc::dhcp::DhcpConfigError if storage is null.
PoolParser
(
const
std
::
string
&
dummy
,
PoolStoragePtr
pools
);
PoolParser
(
const
std
::
string
&
dummy
,
PoolStoragePtr
pools
,
const
uint16_t
address_family
);
/// @brief parses the actual structure
///
...
...
@@ -882,6 +884,9 @@ protected:
/// A storage for pool specific option values.
CfgOptionPtr
options_
;
/// @brief Address family: AF_INET (for DHCPv4) or AF_INET6 for DHCPv6.
uint16_t
address_family_
;
};
/// @brief Parser for a list of pools
...
...
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