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
cb8fec27
Commit
cb8fec27
authored
Aug 09, 2017
by
Thomas Markwalder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5280] A bit of wordsmithing on lease_cmds.dox
parent
378a8eda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
23 deletions
+22
-23
src/hooks/dhcp/lease_cmds/lease_cmds.dox
src/hooks/dhcp/lease_cmds/lease_cmds.dox
+22
-23
No files found.
src/hooks/dhcp/lease_cmds/lease_cmds.dox
View file @
cb8fec27
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
@mainpage Kea Lease Commands Hooks Library
@mainpage Kea Lease Commands Hooks Library
Welcome to Kea Lease Commands Hooks Library. This documentation is addressed
at
Welcome to Kea Lease Commands Hooks Library. This documentation is addressed
to
developers who are interested in internal operation of the Lease Commands
developers who are interested in
the
internal operation of the Lease Commands
library. This file provides information needed to understand and perhaps extend
library. This file provides information needed to understand and perhaps extend
this library.
this library.
...
@@ -29,22 +29,21 @@ command is issued (be it directly via control channel or indirectly via REST
...
@@ -29,22 +29,21 @@ command is issued (be it directly via control channel or indirectly via REST
interface from control agent), the code receives a JSON command with
interface from control agent), the code receives a JSON command with
parameters. Those are parsed and then actual operation commences. This
parameters. Those are parsed and then actual operation commences. This
operation always interacts with an instantiation of isc::dhcp::LeaseMgr
operation always interacts with an instantiation of isc::dhcp::LeaseMgr
instance, which is Kea's way of storing leases. At time of writing this text
instance, which is Kea's way of storing leases. At t
he t
ime of writing this text
(Aug. 2017), Kea supports four types of lease managers: memfile, MySQL,
(Aug. 2017), Kea supports four types of lease managers: memfile, MySQL,
PostgreSQL or Cassandra. Th
ose commands provide a unified interface for those
PostgreSQL or Cassandra. Th
e lease commands provided by this library
backends.
provide a unified interface for those
backends.
As with other hooks,
also this one keeps its code in separate namespace,
which
As with other hooks,
this one also keeps its code in a separate namespace
which
corresponds to the file name of the library: isc::lease_cmds.
corresponds to the file name of the library: isc::lease_cmds.
@section lease_cmdsCode Lease Commands Code Overview
@section lease_cmdsCode Lease Commands Code Overview
The library operation starts with Kea calling load() function (file
The library operation starts with Kea calling the load() function (file
load_unload.cc). It instantiates isc::lease_cmds::LeaseCmds object. Constructor
load_unload.cc). It instantiates an isc::lease_cmds::LeaseCmds object.
of that object registers all commands. For a list, see @ref
The constructor of that object registers all of the lease commands. For a list,
isc::lease_cmds::LeaseCmds class documentation. This class uses Pimpl design
see @ref isc::lease_cmds::LeaseCmds class documentation. This class uses Pimpl
pattern, thus the real implementation is hidden in
design pattern, thus the real implementation is hidden in isc::lease_cmds::LeaseCmdsImpl.
isc::lease_cmds::LeaseCmdsImpl.
Almost every command has its own handler, except few that share the same handler
Almost every command has its own handler, except few that share the same handler
between v4 and v6 due to its similarity. For example
between v4 and v6 due to its similarity. For example
...
@@ -69,29 +68,29 @@ For details see documentation and code of the following handlers:
...
@@ -69,29 +68,29 @@ For details see documentation and code of the following handlers:
@section lease_cmdsDesigns Lease Commands Design choices
@section lease_cmdsDesigns Lease Commands Design choices
The lease manipulation commands were implemented to provide convenient interface
The lease manipulation commands were implemented to provide
a
convenient interface
for sysadmins. The primary goal was to offer a way to interact with the live
for sysadmins. The primary goal was to offer a way to interact with the live
lease database in unified way, regardless of the actual backend being used.
lease database in unified way, regardless of the actual backend being used.
For some backends (MySQL, PostgreSQL and Cassandra) it is possible to interact
For some backends (MySQL, PostgreSQL and Cassandra) it is possible to interact
with the backend while Kea is running and possibly change its content. This
directly
with the backend while Kea is running and possibly change its content. This
is both powerful and dangerous ability
. In particular, only rudimentary
ability is both powerful and dangerous
. In particular, only rudimentary
checks are enforced by the DB schemas (e.g. not possible to have two leases
checks are enforced by the DB schemas (e.g. not possible to have two leases
for the same address). However, it does not prevent sysadmins from making
for the same address). However, it does not prevent sysadmins from making
more obscure errors, like inserting leases for subnets that do not exist
more obscure errors, like inserting leases for subnets that do not exist
or config
ing an address that is topologically outside of the subnet it was
or config
uring an address that is topologically outside of the subnet to which
supposed to belong to. This kind of checks is
only possible by DHCP-aware
it should belong. These kind of checks are
only possible by DHCP-aware
code, which this library provides.
code, which this library provides.
Some of the queries may require a seemingly odd set of parameters. For example,
Some of the queries may require a seemingly odd set of parameters. For example,
lease6-get query requires at least
duid, subnet-id and iaid
to retrieve a lease
lease6-get query requires at least
DUID, subnet-id and IAID
to retrieve a lease
by DUID. The need for a sysadmin to know and specify an
iaid
is troublesome.
by DUID. The need for a sysadmin to know and specify an
IAID
is troublesome.
However, the guiding principle here was to use whatever queries were already
However, the guiding principle here was to use whatever queries were already
exposed by lease manager and not introduce new indexes, unless absolutely
exposed by
the
lease manager and not introduce new indexes, unless absolutely
necessary. This ensures that there is no performance degradation when the
necessary. This ensures that there is no performance degradation when the
library is loaded. The only exception for that was lease4-wipe and lease6-wipe
library is loaded. The only exception for that was lease4-wipe and lease6-wipe
commands that remove all leases from specifi
e
c subnet. As there were no
commands that remove all leases from specific subnet. As there were no
queries that could retrieve or otherwise enumerate leases f
rom
specific subnet,
queries that could retrieve or otherwise enumerate leases f
or a
specific subnet,
a new query type
(and a new index) had to be develop
ed.
a new query type
and a new index had to be add
ed.
*/
*/
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