Kea 2.7.6
|
JSON adaptor for pools between canonical Kea and YANG models. More...
#include <adaptor_pool.h>
Public Member Functions | |
virtual | ~AdaptorPool ()=default |
Destructor. | |
Static Public Member Functions | |
static void | canonizePool (isc::data::ElementPtr pool) |
Canonize pool. | |
static void | fromSubnet (const std::string &model, isc::data::ConstElementPtr subnet, isc::data::ConstElementPtr pools) |
Moves parameters from subnets to pools. | |
static void | toSubnet (const std::string &model, isc::data::ElementPtr subnet, isc::data::ConstElementPtr pools) |
Move parameters from pools to the subnet. | |
Static Protected Member Functions | |
static void | fromSubnetIetf6 (isc::data::ConstElementPtr subnet, isc::data::ConstElementPtr pools) |
From subnets for ietf-dhcpv6-server. | |
static void | toSubnetIetf6 (isc::data::ElementPtr subnet, isc::data::ConstElementPtr pools) |
To subnet for ietf-dhcpv6-server. | |
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 27 of file adaptor_pool.h.
|
virtualdefault |
Destructor.
|
static |
Canonize pool.
Remove spaces and replace "-" by " - " for readability.
pool | The pool. |
Definition at line 21 of file adaptor_pool.cc.
References isc::data::Element::create().
Referenced by isc::yang::AdaptorConfig::sanitizePools().
|
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 43 of file adaptor_pool.cc.
References fromSubnetIetf6(), and 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 55 of file adaptor_pool.cc.
References isc::yang::Adaptor::fromParent().
Referenced by fromSubnet().
|
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 63 of file adaptor_pool.cc.
References isc_throw, and toSubnetIetf6().
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 75 of file adaptor_pool.cc.
References isc::yang::Adaptor::toParent().
Referenced by toSubnet().