Kea
1.9.9-git
|
JSON adaptor for pools between canonical Kea and YANG models. More...
#include <adaptor_pool.h>
Public Member Functions | |
AdaptorPool () | |
Constructor. More... | |
virtual | ~AdaptorPool () |
Destructor. More... | |
Static Public Member Functions | |
static void | canonizePool (isc::data::ElementPtr pool) |
Canonize pool. More... | |
static void | fromSubnet (const std::string &model, isc::data::ConstElementPtr subnet, isc::data::ConstElementPtr pools) |
Moves parameters from subnets to pools. More... | |
static void | toSubnet (const std::string &model, isc::data::ElementPtr subnet, isc::data::ConstElementPtr pools) |
Move parameters from pools to the subnet. More... | |
Static Protected Member Functions | |
static void | fromSubnetIetf6 (isc::data::ConstElementPtr subnet, isc::data::ConstElementPtr pools) |
From subnets for ietf-dhcpv6-server. More... | |
static void | toSubnetIetf6 (isc::data::ElementPtr subnet, isc::data::ConstElementPtr pools) |
To subnet for ietf-dhcpv6-server. More... | |
JSON adaptor for pools between canonical Kea and YANG models.
First adaptor canonizePool checks and fixes if needed the pool entry to a canonical form which is no space for prefix and one space each side of the minus character for ranges.
Second adaptor is specific to the IETF DHCPv6 model (and does nothing with a Kea DHCP model): it moves timer definitions from the subnet scope, i.e. the scope where they are in Kea, to the pool scope, i.e. the scope where they are in the IETF model, and back. The from way leaves timers in the subnet scope as they are ignored by the translator, the to way removes timers from pools as they are not expected by Kea at this scope.
Definition at line 28 of file adaptor_pool.h.
isc::yang::AdaptorPool::AdaptorPool | ( | ) |
Constructor.
Definition at line 18 of file adaptor_pool.cc.
|
virtual |
Destructor.
Definition at line 21 of file adaptor_pool.cc.
|
static |
Canonize pool.
Remove spaces and replace "-" by " - " for readability.
pool | The pool. |
Definition at line 25 of file adaptor_pool.cc.
|
static |
Moves parameters from subnets to pools.
Move parameters from the subnet to each pool. Currently the only supported model is ietf-dhcpv6-server. The parameters moved are valid-lifetime, preferred-lifetime, renew-timer, rebind-timer.
model | Model name. |
subnet | The subnet element. |
pools | The children pools. |
NotImplemented | on unexpected model. |
Definition at line 47 of file adaptor_pool.cc.
References isc_throw.
Referenced by isc::yang::TranslatorSubnet::setSubnetIetf6().
|
staticprotected |
From subnets for ietf-dhcpv6-server.
Use common and move valid-lifetime and preferred-lifetime.
subnet | The subnet element. |
pools | The children pools. |
Definition at line 59 of file adaptor_pool.cc.
|
static |
Move parameters from pools to the subnet.
Move parameters from pool to its parent subnet. Currently the only supported model is ietf-dhcpv6-server. The parameters moved are valid-lifetime, preferred-lifetime, renew-timer, rebind-timer.
model | Model name. |
subnet | The subnet element. |
pools | The children pools. |
NotImplemented | on unexpected model. |
BadValue | on inconsistent (different timer values) pools. |
Definition at line 67 of file adaptor_pool.cc.
References isc_throw.
Referenced by isc::yang::TranslatorSubnet::getSubnetIetf6().
|
staticprotected |
To subnet for ietf-dhcpv6-server.
Use common and move valid-lifetime and preferred-lifetime.
subnet | The subnet element. |
pools | The children pools. |
Definition at line 79 of file adaptor_pool.cc.