Kea
1.9.9-git
|
DHCP configuration translation between YANG and JSON. More...
#include <translator_config.h>
Public Member Functions | |
TranslatorConfig (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorConfig () |
Destructor. More... | |
isc::data::ElementPtr | getConfig () |
Get and translate the whole DHCP server configuration from YANG to JSON. More... | |
void | setConfig (isc::data::ConstElementPtr elem) |
Translate and sets the DHCP server configuration from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorControlSocket | |
TranslatorControlSocket (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorControlSocket () |
Destructor. More... | |
isc::data::ConstElementPtr | getControlSocket (const std::string &xpath) |
Get and translate a control socket from YANG to JSON. More... | |
void | setControlSocket (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set control socket from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorBasic | |
TranslatorBasic (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorBasic () |
Destructor. More... | |
void | delItem (const std::string &xpath) |
Delete basic value from YANG. More... | |
isc::data::ElementPtr | getItem (const std::string &xpath) |
Get and translate basic value from YANG to JSON. More... | |
isc::data::ElementPtr | getItems (const std::string &xpath) |
Get and translate a list of basic values from YANG to JSON. More... | |
sysrepo::S_Iter_Value | getIter (const std::string &xpath) |
List iterator methods keeping the session private. More... | |
std::string | getNext (sysrepo::S_Iter_Value iter) |
Get xpath of the next YANG list item. More... | |
void | setItem (const std::string &xpath, isc::data::ConstElementPtr elem, sr_type_t type) |
Translate and set basic value from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorDatabases | |
TranslatorDatabases (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorDatabases () |
Destructor. More... | |
isc::data::ConstElementPtr | getDatabases (const std::string &xpath) |
Get and translate database accesses from YANG to JSON. More... | |
void | setDatabases (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set database accesses from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorDatabase | |
TranslatorDatabase (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorDatabase () |
Destructor. More... | |
isc::data::ElementPtr | getDatabase (const std::string &xpath) |
Get and translate a database access from YANG to JSON. More... | |
void | setDatabase (const std::string &xpath, isc::data::ConstElementPtr elem, bool skip=false) |
Translate and set database access from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorClasses | |
TranslatorClasses (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorClasses () |
Destructor. More... | |
isc::data::ConstElementPtr | getClasses (const std::string &xpath) |
Get and translate client classes from YANG to JSON. More... | |
void | setClasses (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set client classes from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorClass | |
TranslatorClass (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorClass () |
Destructor. More... | |
isc::data::ElementPtr | getClass (const std::string &xpath) |
Get and translate a client class from YANG to JSON. More... | |
void | setClass (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set client class from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorOptionDataList | |
TranslatorOptionDataList (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorOptionDataList () |
Destructor. More... | |
isc::data::ConstElementPtr | getOptionDataList (const std::string &xpath) |
Get and translate option data list from YANG to JSON. More... | |
void | setOptionDataList (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set option data list from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorOptionData | |
TranslatorOptionData (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorOptionData () |
Destructor. More... | |
isc::data::ElementPtr | getOptionData (const std::string &xpath) |
Get and translate an option data from YANG to JSON. More... | |
void | setOptionData (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set option data from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorOptionDefList | |
TranslatorOptionDefList (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorOptionDefList () |
Destructor. More... | |
isc::data::ConstElementPtr | getOptionDefList (const std::string &xpath) |
Get and translate option definition list from YANG to JSON. More... | |
void | setOptionDefList (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set option definition list from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorOptionDef | |
TranslatorOptionDef (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorOptionDef () |
Destructor. More... | |
isc::data::ElementPtr | getOptionDef (const std::string &xpath) |
Get and translate an option definition from YANG to JSON. More... | |
void | setOptionDef (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set option definition from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorSharedNetworks | |
TranslatorSharedNetworks (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorSharedNetworks () |
Destructor. More... | |
isc::data::ElementPtr | getSharedNetworks (const std::string &xpath) |
Get and translate shared networks from YANG to JSON. More... | |
void | setSharedNetworks (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set shared networks from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorSharedNetwork | |
TranslatorSharedNetwork (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorSharedNetwork () |
Destructor. More... | |
isc::data::ElementPtr | getSharedNetwork (const std::string &xpath) |
Get and translate a shared network from YANG to JSON. More... | |
void | setSharedNetwork (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set shared network from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorSubnets | |
TranslatorSubnets (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorSubnets () |
Destructor. More... | |
isc::data::ElementPtr | getSubnets (const std::string &xpath) |
Get and translate subnets from YANG to JSON. More... | |
void | setSubnets (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set subnets from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorSubnet | |
TranslatorSubnet (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorSubnet () |
Destructor. More... | |
isc::data::ElementPtr | getSubnet (const std::string &xpath) |
Get and translate a subnet from YANG to JSON. More... | |
void | setSubnet (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set subnet from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorPools | |
TranslatorPools (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorPools () |
Destructor. More... | |
isc::data::ElementPtr | getPools (const std::string &xpath) |
Get and translate pools from YANG to JSON. More... | |
void | setPools (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set (address) pools from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorPool | |
TranslatorPool (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorPool () |
Destructor. More... | |
isc::data::ElementPtr | getPool (const std::string &xpath) |
Get and translate a pool from YANG to JSON. More... | |
void | setPool (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set (address) pool from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorPdPools | |
TranslatorPdPools (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorPdPools () |
Destructor. More... | |
isc::data::ElementPtr | getPdPools (const std::string &xpath) |
Get and translate pd-pools from YANG to JSON. More... | |
void | setPdPools (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set pd-pools from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorPdPool | |
TranslatorPdPool (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorPdPool () |
Destructor. More... | |
isc::data::ElementPtr | getPdPool (const std::string &xpath) |
Get and translate a pd-pool from YANG to JSON. More... | |
void | setPdPool (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set pd-pool from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorHosts | |
TranslatorHosts (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorHosts () |
Destructor. More... | |
isc::data::ElementPtr | getHosts (const std::string &xpath) |
Get and translate host reservations from YANG to JSON. More... | |
void | setHosts (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set (address) host reservations from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorHost | |
TranslatorHost (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorHost () |
Destructor. More... | |
isc::data::ElementPtr | getHost (const std::string &xpath) |
Get and translate a host reservation from YANG to JSON. More... | |
void | setHost (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set host reservation from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorLoggers | |
TranslatorLoggers (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorLoggers () |
Destructor. More... | |
isc::data::ConstElementPtr | getLoggers (const std::string &xpath) |
Get and translate loggeres from YANG to JSON. More... | |
void | setLoggers (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set loggeres from JSON to YANG. More... | |
Public Member Functions inherited from isc::yang::TranslatorLogger | |
TranslatorLogger (sysrepo::S_Session session, const std::string &model) | |
Constructor. More... | |
virtual | ~TranslatorLogger () |
Destructor. More... | |
isc::data::ElementPtr | getLogger (const std::string &xpath) |
Get and translate a logger from YANG to JSON. More... | |
void | setLogger (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set logger from JSON to YANG. More... | |
Protected Member Functions | |
void | delConfigIetf6 () |
delConfig for ietf-dhcpv6-server. More... | |
void | delConfigKea () |
delConfig for kea-dhcp[46]-server. More... | |
isc::data::ElementPtr | getConfigControlKea (const std::string &xpath) |
Retrieves configuration control from sysrepo. More... | |
isc::data::ElementPtr | getConfigIetf6 () |
getConfig for ietf-dhcpv6-server. More... | |
isc::data::ElementPtr | getConfigKea4 () |
getConfig for kea-dhcp4-server. More... | |
isc::data::ElementPtr | getConfigKea6 () |
getConfig for kea-dhcp6-server. More... | |
isc::data::ElementPtr | getDdnsKea (const std::string &xpath) |
Retrieves DDNS configuration from sysrepo. More... | |
isc::data::ElementPtr | getExpiredKea (const std::string &xpath) |
Retrieves expired leases processing parameters from sysrepo. More... | |
isc::data::ElementPtr | getHooksKea (const std::string &xpath) |
Retrieves hooks configuration from sysrepo. More... | |
void | getParam (isc::data::ElementPtr &storage, const std::string &xpath, const std::string &name) |
Retrieves an item and stores in the specified storage. More... | |
isc::data::ElementPtr | getServerKeaDhcp4 () |
getServer for kea-dhcp4-server:config. More... | |
isc::data::ElementPtr | getServerKeaDhcp6 () |
getServer for kea-dhcp6-server:config. More... | |
isc::data::ElementPtr | getServerKeaDhcpCommon (const std::string &xpath) |
getServer common part for kea-dhcp[46]-server:config. More... | |
void | setConfigIetf6 (isc::data::ConstElementPtr elem) |
setConfig for ietf-dhcpv6-server. More... | |
void | setConfigKea4 (isc::data::ConstElementPtr elem) |
setConfig for kea-dhcp[46]-server. More... | |
void | setConfigKea6 (isc::data::ConstElementPtr elem) |
setConfig for kea-dhcp6-server. More... | |
void | setServerKeaDhcp4 (isc::data::ConstElementPtr elem) |
setServer for kea-dhcp4-server:config. More... | |
void | setServerKeaDhcp6 (isc::data::ConstElementPtr elem) |
setServer for kea-dhcp6-server:config. More... | |
void | setServerKeaDhcpCommon (const std::string &xpath, isc::data::ConstElementPtr elem) |
setServer common part for kea-dhcp[46]-server:config. More... | |
Protected Member Functions inherited from isc::yang::TranslatorControlSocket | |
isc::data::ElementPtr | getControlSocketKea (const std::string &xpath) |
getControlSocket JSON for kea models. More... | |
void | setControlSocketKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setControlSocket for kea models. More... | |
Protected Member Functions inherited from isc::yang::TranslatorDatabases | |
isc::data::ElementPtr | getDatabasesKea (const std::string &xpath) |
getDatabases JSON for kea-dhcp[46]-server models. More... | |
void | setDatabasesKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setDatabases for kea-dhcp[46]-server models. More... | |
Protected Member Functions inherited from isc::yang::TranslatorDatabase | |
isc::data::ElementPtr | getDatabaseKea (const std::string &xpath) |
getDatabase JSON for kea-dhcp[46]-server models. More... | |
void | setDatabaseKea (const std::string &xpath, isc::data::ConstElementPtr elem, bool skip) |
setDatabase for kea-dhcp[46]-server models. More... | |
Protected Member Functions inherited from isc::yang::TranslatorClasses | |
isc::data::ElementPtr | getClassesKea (const std::string &xpath) |
getClasses JSON for kea-dhcp[46]. More... | |
void | setClassesKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setClasses for kea-dhcp[46]. More... | |
Protected Member Functions inherited from isc::yang::TranslatorClass | |
isc::data::ElementPtr | getClassKea (const std::string &xpath) |
getClass JSON for kea-dhcp[46]. More... | |
void | setClassKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setClass for kea-dhcp[46]. More... | |
Protected Member Functions inherited from isc::yang::TranslatorOptionDataList | |
isc::data::ConstElementPtr | getOptionDataListKea (const std::string &xpath) |
getOptionDataList for kea-dhcp[46]. More... | |
void | setOptionDataListKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setOptionDataList for kea-dhcp[46]. More... | |
Protected Member Functions inherited from isc::yang::TranslatorOptionData | |
isc::data::ElementPtr | getOptionDataKea (const std::string &xpath) |
getOptionData JSON for kea-dhcp[46]. More... | |
void | setOptionDataKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setOptionData for kea-dhcp[46]. More... | |
Protected Member Functions inherited from isc::yang::TranslatorOptionDefList | |
isc::data::ConstElementPtr | getOptionDefListKea (const std::string &xpath) |
getOptionDefList implementation specific to kea-dhcp[46]-server models. More... | |
void | setOptionDefListKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setOptionDefList implementation specific to kea-dhcp[46]-server models. More... | |
Protected Member Functions inherited from isc::yang::TranslatorOptionDef | |
isc::data::ElementPtr | getOptionDefKea (const std::string &xpath) |
getOptionDef implementation specific to kea-dhcp[46]-server models. More... | |
void | setOptionDefKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setOptionDef implementation specific to kea-dhcp[46]-server models. More... | |
Protected Member Functions inherited from isc::yang::TranslatorSharedNetworks | |
void | setSharedNetworksKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setSharedNetworks for kea-dhcp4-server and kea-dhcp6-server More... | |
Protected Member Functions inherited from isc::yang::TranslatorSharedNetwork | |
isc::data::ElementPtr | getSharedNetworkKea (const std::string &xpath, const std::string &subsel) |
getSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models More... | |
void | setSharedNetworkKea (const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel) |
setSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models More... | |
Protected Member Functions inherited from isc::yang::TranslatorSubnets | |
isc::data::ElementPtr | getSubnetsCommon (const std::string &xpath, const std::string &subsel) |
getSubnets common part. More... | |
void | setSubnetsIetf6 (const std::string &xpath, isc::data::ConstElementPtr elem) |
setSubnets for ietf-dhcpv6-server. More... | |
void | setSubnetsKea (const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel) |
setSubnets for kea-dhcp[46]-server. More... | |
Protected Member Functions inherited from isc::yang::TranslatorSubnet | |
isc::data::ElementPtr | getSubnetIetf6 (const std::string &xpath) |
getSubnet for ietf-dhcpv6-server. More... | |
isc::data::ElementPtr | getSubnetKea (const std::string &xpath) |
getSubnet for kea-dhcp[46]-server. More... | |
void | setSubnetIetf6 (const std::string &xpath, isc::data::ConstElementPtr elem) |
setSubnet for ietf-dhcpv6-server. More... | |
void | setSubnetKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setSubnet for kea-dhcp[46]-server. More... | |
Protected Member Functions inherited from isc::yang::TranslatorPools | |
isc::data::ElementPtr | getPoolsIetf (const std::string &xpath) |
getPools for ietf-dhcpv6-server. More... | |
isc::data::ElementPtr | getPoolsKea (const std::string &xpath) |
getPools for kea-dhcp[46]-server. More... | |
void | setPoolsByAddresses (const std::string &xpath, isc::data::ConstElementPtr elem) |
setPools using address pair. More... | |
void | setPoolsById (const std::string &xpath, isc::data::ConstElementPtr elem) |
setPools using pool-id. More... | |
Protected Member Functions inherited from isc::yang::TranslatorPool | |
isc::data::ElementPtr | getPoolIetf6 (const std::string &xpath) |
getPool for ietf-dhcpv6-server. More... | |
isc::data::ElementPtr | getPoolKea (const std::string &xpath) |
getPool for kea-dhcp[46]-server. More... | |
void | setPoolIetf6 (const std::string &xpath, isc::data::ConstElementPtr elem) |
setPool for ietf-dhcpv6-server. More... | |
void | setPoolKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setPool for kea-dhcp[46]-server. More... | |
Protected Member Functions inherited from isc::yang::TranslatorPdPools | |
isc::data::ElementPtr | getPdPoolsCommon (const std::string &xpath) |
getPdPools common part. More... | |
void | setPdPoolsId (const std::string &xpath, isc::data::ConstElementPtr elem) |
setPdPools using pool-id. More... | |
void | setPdPoolsPrefix (const std::string &xpath, isc::data::ConstElementPtr elem) |
setPdPools using prefix. More... | |
Protected Member Functions inherited from isc::yang::TranslatorPdPool | |
isc::data::ElementPtr | getPdPoolIetf6 (const std::string &xpath) |
getPdPool for ietf-dhcpv6-server. More... | |
isc::data::ElementPtr | getPdPoolKea (const std::string &xpath) |
getPdPool for kea-dhcp6-server. More... | |
void | setPdPoolIetf6 (const std::string &xpath, isc::data::ConstElementPtr elem) |
setPdPool for ietf-dhcpv6-server. More... | |
void | setPdPoolKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setPdPool for kea-dhcp6-server. More... | |
Protected Member Functions inherited from isc::yang::TranslatorHosts | |
void | setHostsKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setHosts for kea-dhcp[46]. More... | |
Protected Member Functions inherited from isc::yang::TranslatorHost | |
isc::data::ElementPtr | getHostKea (const std::string &xpath) |
getHost for kea-dhcp[46]-server models. More... | |
void | setHostKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setHost for kea-dhcp[46]-server models. More... | |
Protected Member Functions inherited from isc::yang::TranslatorLoggers | |
isc::data::ElementPtr | getLoggersKea (const std::string &xpath) |
getLoggers JSON for loggers. More... | |
void | setLoggersKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setLoggers for loggers. More... | |
Protected Member Functions inherited from isc::yang::TranslatorLogger | |
isc::data::ElementPtr | getLoggerKea (const std::string &xpath) |
getLogger JSON for loggers. More... | |
isc::data::ElementPtr | getOutputOption (const std::string &xpath) |
Get and translate an output option from YANG to JSON. More... | |
isc::data::ElementPtr | getOutputOptions (const std::string &xpath) |
Get and translate output options from YANG to JSON. More... | |
void | setLoggerKea (const std::string &xpath, isc::data::ConstElementPtr elem) |
setLogger for loggers. More... | |
void | setOutputOption (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set an output option from JSON to YANG. More... | |
void | setOutputOptions (const std::string &xpath, isc::data::ConstElementPtr elem) |
Translate and set output options from JSON to YANG. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from isc::yang::TranslatorBasic | |
static isc::data::ElementPtr | value (sysrepo::S_Val s_val) |
Translate basic value from YANG to JSON. More... | |
static sysrepo::S_Val | value (isc::data::ConstElementPtr elem, sr_type_t type) |
Translate basic value from JSON to YANG. More... | |
Static Public Member Functions inherited from isc::yang::TranslatorPool | |
static void | getAddresses (const std::string &prefix, std::string &start_address, std::string &end_address) |
Get start and end addresses from prefix. More... | |
Protected Attributes inherited from isc::yang::TranslatorBasic | |
std::string | model_ |
The model. More... | |
sysrepo::S_Session | session_ |
The sysrepo session. More... | |
DHCP configuration translation between YANG and JSON.
This translator supports kea-dhcp4-server, kea-dhcp6-server and partially ietf-dhcpv6-server. JSON syntax for kea-dhcp4 is:
YANG syntax for kea-dhcp4-server:config is:
Example of kea-dhcp6 simple configuration:
The same configuration wrote into YANG datastore using setConfig()
with the kea-dhcp4-model and exported to XML format:
JSON syntax for kea-dhcp6 is:
YANG syntax for kea-dhcp6-server:config is:
Example of kea-dhcp6 simple configuration:
The same configuration wrote into YANG datastore using setConfig()
with the kea-dhcp6-model and exported to XML format:
Inheritance graph between translators is:
+-----------------------------------------+ | | +------------------------------+ | | | | +----------+-------------------+----------+ | | | | | | +---------+----------+ | | | | |
config +- shared +- subnet +- pool –+- option -+ basic | network (list) | (list) | data | | (list) | | (list) | | | | | | +- pd -—+ | | | pool | | | | (list) | | | | | | +--------------——+- host –+ | | (liat) | | | | | | +--------------——+----——+ | | | +- class -+- option ----------------——+ | (list) | def | | | (list) | +---——+ | | |
'XXX (list)' stands for 'XXX list — XXX' which is a common motif (only database shows direct dependencies on both the list and the element) A translator class for converting the config between YANG and JSON.
Currently supports the following models:
Definition at line 380 of file translator_config.h.
isc::yang::TranslatorConfig::TranslatorConfig | ( | sysrepo::S_Session | session, |
const std::string & | model | ||
) |
Constructor.
session | Sysrepo session. |
model | Model name. |
Definition at line 23 of file translator_config.cc.
|
virtual |
Destructor.
Definition at line 48 of file translator_config.cc.
|
protected |
delConfig for ietf-dhcpv6-server.
Definition at line 436 of file translator_config.cc.
References isc::yang::TranslatorBasic::delItem(), and isc::yang::TranslatorBasic::model_.
Referenced by setConfig().
|
protected |
delConfig for kea-dhcp[46]-server.
Definition at line 455 of file translator_config.cc.
References isc::yang::TranslatorBasic::delItem(), and isc::yang::TranslatorBasic::model_.
Referenced by setConfig().
ElementPtr isc::yang::TranslatorConfig::getConfig | ( | ) |
Get and translate the whole DHCP server configuration from YANG to JSON.
SysrepoError | when sysrepo raises an error. |
Definition at line 52 of file translator_config.cc.
References getConfigIetf6(), getConfigKea4(), getConfigKea6(), isc_throw, isc::yang::TranslatorBasic::model_, and isc::Exception::what().
Referenced by isc::netconf::NetconfAgent::update(), isc::netconf::NetconfAgent::validate(), and isc::netconf::NetconfAgent::yangConfig().
|
protected |
Retrieves configuration control from sysrepo.
xpath | path to configuration control. |
Definition at line 192 of file translator_config.cc.
References isc::yang::TranslatorDatabases::getDatabases(), and getParam().
Referenced by getServerKeaDhcpCommon().
|
protected |
getConfig for ietf-dhcpv6-server.
This implementation is very preliminary. It handles network-ranges only partially and nothing else.
SysrepoError | when sysrepo raises an error. |
Definition at line 69 of file translator_config.cc.
References isc::yang::TranslatorSubnets::getSubnets(), and isc::yang::TranslatorBasic::model_.
Referenced by getConfig().
|
protected |
getConfig for kea-dhcp4-server.
SysrepoError | when sysrepo raises an error. |
Definition at line 84 of file translator_config.cc.
References getServerKeaDhcp4().
Referenced by getConfig().
|
protected |
getConfig for kea-dhcp6-server.
SysrepoError | when sysrepo raises an error. |
Definition at line 92 of file translator_config.cc.
References getServerKeaDhcp6().
Referenced by getConfig().
|
protected |
Retrieves DDNS configuration from sysrepo.
xpath | path to dhcp-ddns configuration. |
Definition at line 159 of file translator_config.cc.
References isc::yang::TranslatorBasic::getItem(), and getParam().
Referenced by getServerKeaDhcpCommon().
|
protected |
Retrieves expired leases processing parameters from sysrepo.
xpath | path to expired leases configuration. |
Definition at line 141 of file translator_config.cc.
References getParam().
Referenced by getServerKeaDhcpCommon().
|
protected |
Retrieves hooks configuration from sysrepo.
xpath | path to hooks configuration. |
Definition at line 109 of file translator_config.cc.
References isc::yang::TranslatorBasic::getItem(), isc::yang::TranslatorBasic::getIter(), and isc::yang::TranslatorBasic::getNext().
Referenced by getServerKeaDhcpCommon().
|
protected |
Retrieves an item and stores in the specified storage.
This will attempt to retrieve an item and, if exists, will store it in the storage.
storage | ElementMap (result will be stored here) |
xpath | xpath location (data will be extracted from sysrepo) |
name | name of the parameter |
Definition at line 100 of file translator_config.cc.
References isc::yang::TranslatorBasic::getItem().
Referenced by getConfigControlKea(), getDdnsKea(), getExpiredKea(), getServerKeaDhcp4(), getServerKeaDhcp6(), and getServerKeaDhcpCommon().
|
protected |
getServer for kea-dhcp4-server:config.
SysrepoError | when sysrepo raises an error. |
Definition at line 305 of file translator_config.cc.
References isc::yang::TranslatorBasic::getItem(), isc::yang::TranslatorBasic::getItems(), getParam(), getServerKeaDhcpCommon(), and isc::yang::TranslatorSubnets::getSubnets().
Referenced by getConfigKea4().
|
protected |
getServer for kea-dhcp6-server:config.
SysrepoError | when sysrepo raises an error. |
Definition at line 342 of file translator_config.cc.
References isc::yang::TranslatorBasic::getItem(), isc::yang::TranslatorBasic::getItems(), getParam(), getServerKeaDhcpCommon(), and isc::yang::TranslatorSubnets::getSubnets().
Referenced by getConfigKea6().
|
protected |
getServer common part for kea-dhcp[46]-server:config.
xpath | The xpath of the server. |
Definition at line 209 of file translator_config.cc.
References isc::yang::TranslatorClasses::getClasses(), getConfigControlKea(), isc::yang::TranslatorControlSocket::getControlSocket(), isc::yang::TranslatorDatabase::getDatabase(), isc::yang::TranslatorDatabases::getDatabases(), getDdnsKea(), getExpiredKea(), getHooksKea(), isc::yang::TranslatorHosts::getHosts(), isc::yang::TranslatorBasic::getItem(), isc::yang::TranslatorBasic::getItems(), isc::yang::TranslatorLoggers::getLoggers(), isc::yang::TranslatorOptionDataList::getOptionDataList(), isc::yang::TranslatorOptionDefList::getOptionDefList(), getParam(), and isc::yang::TranslatorSharedNetworks::getSharedNetworks().
Referenced by getServerKeaDhcp4(), and getServerKeaDhcp6().
void isc::yang::TranslatorConfig::setConfig | ( | isc::data::ConstElementPtr | elem | ) |
Translate and sets the DHCP server configuration from JSON to YANG.
Null elem argument removes the config containers.
elem | The JSON element. |
Definition at line 401 of file translator_config.cc.
References delConfigIetf6(), delConfigKea(), isc_throw, isc::yang::TranslatorBasic::model_, isc::yang::AdaptorConfig::preProcess4(), isc::yang::AdaptorConfig::preProcess6(), setConfigIetf6(), setConfigKea4(), setConfigKea6(), and isc::Exception::what().
|
protected |
setConfig for ietf-dhcpv6-server.
This implementation is very preliminary. It handles network-ranges only partially and nothing else.
elem | The JSON element. |
BadValue | on config without Dhcp6. |
Definition at line 441 of file translator_config.cc.
References isc_throw, isc::yang::TranslatorBasic::model_, and isc::yang::TranslatorSubnets::setSubnets().
Referenced by setConfig().
|
protected |
setConfig for kea-dhcp[46]-server.
elem | The JSON element. |
Definition at line 460 of file translator_config.cc.
References setServerKeaDhcp4().
Referenced by setConfig().
|
protected |
setConfig for kea-dhcp6-server.
elem | The JSON element. |
Definition at line 468 of file translator_config.cc.
References setServerKeaDhcp6().
Referenced by setConfig().
|
protected |
setServer for kea-dhcp4-server:config.
elem | The JSON element. |
Definition at line 747 of file translator_config.cc.
References isc::yang::Adaptor::getContext(), isc::yang::TranslatorBasic::setItem(), setServerKeaDhcpCommon(), and isc::yang::TranslatorSubnets::setSubnets().
Referenced by setConfigKea4().
|
protected |
setServer for kea-dhcp6-server:config.
elem | The JSON element. |
Definition at line 811 of file translator_config.cc.
References isc::yang::Adaptor::getContext(), isc::yang::TranslatorBasic::setItem(), setServerKeaDhcpCommon(), and isc::yang::TranslatorSubnets::setSubnets().
Referenced by setConfigKea6().
|
protected |
setServer common part for kea-dhcp[46]-server:config.
xpath | The xpath of the server. |
elem | The JSON element. |
Definition at line 476 of file translator_config.cc.
References isc::data::copy(), isc::util::str::format(), isc::yang::Adaptor::getContext(), isc::yang::TranslatorClasses::setClasses(), isc::yang::TranslatorControlSocket::setControlSocket(), isc::yang::TranslatorDatabase::setDatabase(), isc::yang::TranslatorDatabases::setDatabases(), isc::yang::TranslatorHosts::setHosts(), isc::yang::TranslatorBasic::setItem(), isc::yang::TranslatorLoggers::setLoggers(), isc::yang::TranslatorOptionDataList::setOptionDataList(), isc::yang::TranslatorOptionDefList::setOptionDefList(), and isc::yang::TranslatorSharedNetworks::setSharedNetworks().
Referenced by setServerKeaDhcp4(), and setServerKeaDhcp6().