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
f14f5223
Commit
f14f5223
authored
Feb 23, 2017
by
Francis Dupont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[1205a] Rebased trac1205 into trac1205a (more things to add anyway)
parent
21bfe739
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
1 deletion
+87
-1
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/Makefile.am
+2
-0
src/lib/dhcpsrv/cfg_to_element.h
src/lib/dhcpsrv/cfg_to_element.h
+75
-0
src/lib/dhcpsrv/libdhcpsrv.dox
src/lib/dhcpsrv/libdhcpsrv.dox
+10
-1
No files found.
src/lib/dhcpsrv/Makefile.am
View file @
f14f5223
...
...
@@ -85,6 +85,7 @@ libkea_dhcpsrv_la_SOURCES += alloc_engine.cc alloc_engine.h
libkea_dhcpsrv_la_SOURCES
+=
alloc_engine_log.cc alloc_engine_log.h
libkea_dhcpsrv_la_SOURCES
+=
base_host_data_source.h
libkea_dhcpsrv_la_SOURCES
+=
callout_handle_store.h
libkea_dhcpsrv_la_SOURCES
+=
cfg_to_element.h
libkea_dhcpsrv_la_SOURCES
+=
cfg_4o6.h
libkea_dhcpsrv_la_SOURCES
+=
cfg_db_access.cc cfg_db_access.h
libkea_dhcpsrv_la_SOURCES
+=
cfg_duid.cc cfg_duid.h
...
...
@@ -222,6 +223,7 @@ EXTRA_DIST += logging.spec
# following headers are anticipated to be useful for the user libraries.
libkea_dhcpsrv_includedir
=
$(pkgincludedir)
/dhcpsrv
libkea_dhcpsrv_include_HEADERS
=
\
cfg_to_element.h
\
cfg_option.h
\
cfg_4o6.h
\
d2_client_cfg.h
\
...
...
src/lib/dhcpsrv/cfg_to_element.h
0 → 100644
View file @
f14f5223
// Copyright (C) 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
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef CFG_TO_ELEMENT_H
#define CFG_TO_ELEMENT_H
#include <exceptions/exceptions.h>
#include <cc/data.h>
#include <stdint.h>
namespace
isc
{
/// @brief Cannot unparse error
///
/// This exception is expected to be thrown when toElement fails
/// and to skip flawed elements is not wanted.
class
ToElementError
:
public
isc
::
Exception
{
public:
ToElementError
(
const
char
*
file
,
size_t
line
,
const
char
*
what
)
:
isc
::
Exception
(
file
,
line
,
what
)
{
};
};
namespace
dhcp
{
/// @name Constants for unparsing styles
///
//@{
/// Default
static
const
uint32_t
TO_ELEMENT_DEFAULT
=
0x00000000
;
/// Add default values
static
const
uint32_t
TO_ELEMENT_ADD_DEFAULTS
=
0x00000001
;
/// Ignore disables
static
const
uint32_t
TO_ELEMENT_IGNORE_DISABLE
=
0x00000002
;
/// Don't copy
static
const
uint32_t
TO_ELEMENT_DO_NOT_COPY
=
0x00000004
;
/// Get option names
static
const
uint32_t
TO_ELEMENT_OPTION_NAMES
=
0x00000100
;
/// Get ranges as prefixs
static
const
uint32_t
TO_ELEMENT_TRY_PREFIXES
=
0x00000200
;
/// Skip (vs throw) on errors
static
const
uint32_t
TO_ELEMENT_SKIP_ERRORS
=
0x80000000
;
//@}
/// @brief Abstract class for configuration Cfg_* classes
///
template
<
typename
...
Args
>
struct
CfgToElement
{
/// Destructor
virtual
~
CfgToElement
()
{
}
/// @brief Unparse a configuration objet
///
/// Returns an element which must parse into the same objet, i.e.
/// @code
/// for all valid config C parse(toElement(parse(C)) == parse(C)
/// @endcode
///
/// @param extras extra arguments
/// @param flags a bitfield which can be used to modify the result
/// @return a pointer to a configuration which can be parsed into
/// the initial configuration object
virtual
isc
::
data
::
ElementPtr
toElement
(
Args
...
extras
,
const
uint32_t
flags
)
const
=
0
;
};
};
// namespace isc::dhcp
};
// namespace isc
#endif // CFG_TO_ELEMENT_H
src/lib/dhcpsrv/libdhcpsrv.dox
View file @
f14f5223
// 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
...
...
@@ -79,6 +79,15 @@ configuration. For example: the value of 1 identifies an immediate
predecessor of the current configuration, the value of 2 identifies the
one that occurred before it etc.
All configuration classes are derived from the abstract base class
\ref isc::dhcp::CfgBase and define the unparse virtual method
which returns a \ref isc::data::ConstElementPtr which must be
parsed into the same object, i.e. fullfil this property:
@code
for all valid C: parse(unparse(parse(C))) == parse(C)
@endcode
@section hostmgr Host Manager
Host Manager implemented by the \ref isc::dhcp::HostMgr is a singleton object
...
...
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