Kea 2.6.0
isc::yang::TranslatorConfig Class Reference

DHCP configuration translation between YANG and JSON. More...

#include <translator_config.h>

+ Inheritance diagram for isc::yang::TranslatorConfig:

Public Member Functions

 TranslatorConfig (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorConfig ()=default
 Destructor.
 
isc::data::ElementPtr getConfig ()
 Translate the whole DHCP server configuration from YANG to JSON.
 
void setConfig (isc::data::ElementPtr elem)
 Translate and set the DHCP server configuration from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorControlSocket
 TranslatorControlSocket (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorControlSocket ()=default
 Destructor.
 
isc::data::ElementPtr getControlSocket (libyang::DataNode const &data_node)
 Translate a control socket from YANG to JSON.
 
isc::data::ElementPtr getControlSocketFromAbsoluteXpath (std::string const &xpath)
 Translate a control socket from YANG to JSON.
 
void setControlSocket (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set control socket from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::Translator
 Translator (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~Translator ()=default
 Destructor.
 
template<typename T >
void checkAndGet (isc::data::ElementPtr const &storage, libyang::DataNode const &data_node, std::string const &xpath, T translate) const
 Calls {translate} for the element found at {xpath} relative to {data_node} and sets the result in {storage} with the {xpath} key.
 
void checkAndGetAndJsonifyLeaf (isc::data::ElementPtr &storage, libyang::DataNode const &data_node, const std::string &name) const
 Retrieves a child YANG data node identified by name from the given parent YANG container node, converts it from string to JSON and stores it in the specified storage.
 
template<typename T >
void checkAndGetDiverging (isc::data::ElementPtr const &storage, libyang::DataNode const &data_node, std::string const &key, std::string const &xpath, T translate) const
 Calls {translate} for the element found at {xpath} relative to {data_node} and sets the result in {storage} with the {key} key.
 
void checkAndGetDivergingLeaf (isc::data::ElementPtr &storage, libyang::DataNode const &data_node, std::string const &name, std::string const &yang_name) const
 Retrieves a child YANG data node identified by name from the given parent YANG container node and stores it in the specified storage.
 
void checkAndGetLeaf (isc::data::ElementPtr &storage, libyang::DataNode const &data_node, std::string const &name) const
 Retrieves a child YANG data node identified by name from the given parent YANG container node and stores it in the specified storage.
 
void checkAndSetDivergingLeaf (isc::data::ConstElementPtr const &from, std::string const &xpath, std::string const &name, std::string const &yang_name, libyang::LeafBaseType const type)
 Get an element from given ElementPtr node and set it in sysrepo at given xpath.
 
void checkAndSetLeaf (isc::data::ConstElementPtr const &from, std::string const &xpath, std::string const &name, libyang::LeafBaseType const type)
 Get an element from given ElementPtr node and set it in sysrepo at given xpath.
 
void checkAndSetLeafList (isc::data::ConstElementPtr const &from, std::string const &xpath, std::string const &name, libyang::LeafBaseType const type)
 Get an element from given ElementPtr node and set it in sysrepo at given xpath as a leaf-list.
 
void checkAndSetUserContext (isc::data::ConstElementPtr const &from, std::string const &xpath)
 Get an element from given ElementPtr node and set it in sysrepo at given xpath.
 
void checkAndStringifyAndSetLeaf (isc::data::ConstElementPtr const &from, std::string const &xpath, std::string const &name)
 Get an element from given ElementPtr node and set it in sysrepo at given xpath.
 
void deleteItem (const std::string &xpath)
 Delete basic value from YANG.
 
libyang::DataNode findXPath (std::string const &xpath) const
 Retrieves a YANG data node by xpath.
 
template<typename functor_t >
void forAll (std::string const &xpath, functor_t f) const
 Run a function for a node and all its children.
 
std::optional< libyang::DataNode > getData (std::string const &xpath) const
 Get a YANG data node found at the given absolute xpath.
 
isc::data::ElementPtr getItem (libyang::DataNode const &data_node, std::string const &xpath) const
 Translate a basic value from YANG to JSON for a given xpath that is relative to the given source node.
 
isc::data::ElementPtr getItemFromAbsoluteXpath (std::string const &xpath) const
 Translate a basic value from YANG to JSON for a given absolute xpath.
 
template<typename T >
isc::data::ElementPtr getList (libyang::DataNode const &data_node, std::string const &xpath, T &t, isc::data::ElementPtr(T::*f)(libyang::DataNode const &)) const
 Retrieve a list as ElementPtr from sysrepo from a certain xpath.
 
void getMandatoryDivergingLeaf (isc::data::ElementPtr &storage, libyang::DataNode const &data_node, std::string const &name, std::string const &yang_name) const
 Retrieves a child YANG data node identified by one name from the given parent YANG container node and stores it in the specified storage under a different name.
 
void getMandatoryLeaf (isc::data::ElementPtr &storage, libyang::DataNode const &data_node, std::string const &name) const
 Retrieves a child YANG data node identified by name from the given parent YANG container node and stores it in the specified storage.
 
bool schemaNodeExists (std::string const &xpath) const
 Checks whether a YANG node exists in the schema.
 
void setItem (const std::string &xpath, isc::data::ConstElementPtr const elem, libyang::LeafBaseType const type)
 Translate and set basic value from JSON to YANG.
 
void setMandatoryDivergingLeaf (isc::data::ConstElementPtr const &from, std::string const &xpath, std::string const &name, std::string const &yang_name, libyang::LeafBaseType const type)
 Get an element from given ElementPtr node and set it in sysrepo at given xpath.
 
void setMandatoryLeaf (isc::data::ConstElementPtr const &from, std::string const &xpath, std::string const &name, libyang::LeafBaseType const type)
 Get an element from given ElementPtr node and set it in sysrepo at given xpath.
 
- Public Member Functions inherited from isc::yang::TranslatorDatabases
 TranslatorDatabases (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorDatabases ()=default
 Destructor.
 
isc::data::ElementPtr getDatabases (libyang::DataNode const &data_node, std::string const &xpath)
 Translate database accesses from YANG to JSON.
 
isc::data::ElementPtr getDatabasesFromAbsoluteXpath (std::string const &xpath)
 Translate database accesses from YANG to JSON.
 
void setDatabases (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set database accesses from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorDatabase
 TranslatorDatabase (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorDatabase ()=default
 Destructor.
 
isc::data::ElementPtr getDatabase (libyang::DataNode const &data_node)
 Translate a database access from YANG to JSON.
 
isc::data::ElementPtr getDatabaseFromAbsoluteXpath (std::string const &xpath)
 Translate a database access from YANG to JSON.
 
void setDatabase (const std::string &xpath, isc::data::ConstElementPtr elem, bool skip=false)
 Translate and set database access from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorClasses
 TranslatorClasses (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorClasses ()=default
 Destructor.
 
isc::data::ElementPtr getClasses (libyang::DataNode const &data_node)
 Translate client classes from YANG to JSON.
 
isc::data::ElementPtr getClassesFromAbsoluteXpath (std::string const &xpath)
 Translate client classes from YANG to JSON.
 
void setClasses (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set client classes from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorClass
 TranslatorClass (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorClass ()=default
 Destructor.
 
isc::data::ElementPtr getClass (libyang::DataNode const &data_node)
 Translate a client class from YANG to JSON.
 
isc::data::ElementPtr getClassFromAbsoluteXpath (std::string const &xpath)
 Translate a client class from YANG to JSON.
 
void setClass (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set client class from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorOptionDataList
 TranslatorOptionDataList (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorOptionDataList ()=default
 Destructor.
 
isc::data::ConstElementPtr getOptionDataList (libyang::DataNode const &data_node)
 Translate option data list from YANG to JSON.
 
isc::data::ConstElementPtr getOptionDataListFromAbsoluteXpath (std::string const &xpath)
 Translate option data list from YANG to JSON.
 
void setOptionDataList (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set option data list from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorOptionData
 TranslatorOptionData (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorOptionData ()=default
 Destructor.
 
isc::data::ElementPtr getOptionData (libyang::DataNode const &data_node)
 Translate an option data from YANG to JSON.
 
isc::data::ElementPtr getOptionDataFromAbsoluteXpath (std::string const &xpath)
 Translate an option data from YANG to JSON.
 
void setOptionData (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set option data from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorOptionDefList
 TranslatorOptionDefList (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorOptionDefList ()=default
 Destructor.
 
isc::data::ConstElementPtr getOptionDefList (libyang::DataNode const &data_node)
 Translate option definition list from YANG to JSON.
 
isc::data::ConstElementPtr getOptionDefListFromAbsoluteXpath (std::string const &xpath)
 Translate option definition list from YANG to JSON.
 
void setOptionDefList (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set option definition list from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorOptionDef
 TranslatorOptionDef (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorOptionDef ()=default
 Destructor.
 
isc::data::ElementPtr getOptionDef (libyang::DataNode const &data_node)
 Translate an option definition from YANG to JSON.
 
isc::data::ElementPtr getOptionDefFromAbsoluteXpath (std::string const &xpath)
 Translate an option definition from YANG to JSON.
 
void setOptionDef (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set option definition from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorSharedNetworks
 TranslatorSharedNetworks (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorSharedNetworks ()=default
 Destructor.
 
isc::data::ElementPtr getSharedNetworks (libyang::DataNode const &data_node)
 Translate shared networks from YANG to JSON.
 
isc::data::ElementPtr getSharedNetworksFromAbsoluteXpath (std::string const &xpath)
 Translate shared networks from YANG to JSON.
 
void setSharedNetworks (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set shared networks from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorSharedNetwork
 TranslatorSharedNetwork (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorSharedNetwork ()=default
 Destructor.
 
isc::data::ElementPtr getSharedNetwork (libyang::DataNode const &data_node)
 Translate a shared network from YANG to JSON.
 
isc::data::ElementPtr getSharedNetworkFromAbsoluteXpath (std::string const &xpath)
 Translate a shared network from YANG to JSON.
 
void setSharedNetwork (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set shared network from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorSubnets
 TranslatorSubnets (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorSubnets ()=default
 Destructor.
 
isc::data::ElementPtr getSubnets (libyang::DataNode const &data_node)
 Get and translate subnets from YANG to JSON.
 
isc::data::ElementPtr getSubnetsFromAbsoluteXpath (std::string const &xpath)
 Get and translate subnets from YANG to JSON.
 
void setSubnets (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set subnets from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorSubnet
 TranslatorSubnet (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorSubnet ()=default
 Destructor.
 
isc::data::ElementPtr getSubnet (libyang::DataNode const &data_node)
 Get and translate a subnet from YANG to JSON.
 
isc::data::ElementPtr getSubnetFromAbsoluteXpath (std::string const &xpath)
 Get and translate a subnet from YANG to JSON.
 
void setSubnet (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set subnet from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorPools
 TranslatorPools (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorPools ()=default
 Destructor.
 
isc::data::ElementPtr getPools (libyang::DataNode const &data_node)
 Translate pools from YANG to JSON.
 
isc::data::ElementPtr getPoolsFromAbsoluteXpath (std::string const &xpath)
 Translate pools from YANG to JSON.
 
void setPools (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set (address) pools from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorPool
 TranslatorPool (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorPool ()=default
 Destructor.
 
isc::data::ElementPtr getPool (libyang::DataNode const &data_node)
 Translate a pool from YANG to JSON.
 
isc::data::ElementPtr getPoolFromAbsoluteXpath (std::string const &xpath)
 Translate a pool from YANG to JSON.
 
void setPool (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set (address) pool from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorPdPools
 TranslatorPdPools (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorPdPools ()=default
 Destructor.
 
isc::data::ElementPtr getPdPools (libyang::DataNode const &data_node)
 Translate pd-pools from YANG to JSON.
 
isc::data::ElementPtr getPdPoolsFromAbsoluteXpath (std::string const &xpath)
 Translate pd-pools from YANG to JSON.
 
void setPdPools (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set pd-pools from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorPdPool
 TranslatorPdPool (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorPdPool ()=default
 Destructor.
 
isc::data::ElementPtr getPdPool (libyang::DataNode const &data_node)
 Translate a pd-pool from YANG to JSON.
 
isc::data::ElementPtr getPdPoolFromAbsoluteXpath (std::string const &xpath)
 Translate a pd-pool from YANG to JSON.
 
void setPdPool (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set pd-pool from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorHosts
 TranslatorHosts (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorHosts ()=default
 Destructor.
 
isc::data::ElementPtr getHosts (libyang::DataNode const &data_node)
 Translate host reservations from YANG to JSON.
 
isc::data::ElementPtr getHostsFromAbsoluteXpath (std::string const &xpath)
 Translate host reservations from YANG to JSON.
 
void setHosts (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set (address) host reservations from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorHost
 TranslatorHost (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorHost ()=default
 Destructor.
 
isc::data::ElementPtr getHost (libyang::DataNode const &data_node)
 Translate a host reservation from YANG to JSON.
 
isc::data::ElementPtr getHostFromAbsoluteXpath (std::string const &xpath)
 Translate a host reservation from YANG to JSON.
 
void setHost (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set host reservation from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorLoggers
 TranslatorLoggers (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorLoggers ()=default
 Destructor.
 
isc::data::ConstElementPtr getLoggers (libyang::DataNode const &data_node)
 Translate loggers from YANG to JSON.
 
isc::data::ConstElementPtr getLoggersFromAbsoluteXpath (std::string const &xpath)
 Translate loggers from YANG to JSON.
 
void setLoggers (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set loggers from JSON to YANG.
 
- Public Member Functions inherited from isc::yang::TranslatorLogger
 TranslatorLogger (sysrepo::Session session, const std::string &model)
 Constructor.
 
virtual ~TranslatorLogger ()=default
 Destructor.
 
isc::data::ElementPtr getLogger (libyang::DataNode const &data_node)
 Translate a logger from YANG to JSON.
 
void setLogger (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set logger from JSON to YANG.
 

Protected Member Functions

void delConfigIetf6 ()
 delConfig for ietf-dhcpv6-server.
 
void delConfigKea ()
 delConfig for kea-dhcp[46]-server.
 
isc::data::ElementPtr getConfigControlKea (libyang::DataNode const &data_node)
 Retrieves configuration control from sysrepo.
 
isc::data::ElementPtr getConfigIetf6 ()
 getConfig for ietf-dhcpv6-server.
 
isc::data::ElementPtr getConfigKea4 ()
 getConfig for kea-dhcp4-server.
 
isc::data::ElementPtr getConfigKea6 ()
 getConfig for kea-dhcp6-server.
 
isc::data::ElementPtr getDdnsKea (libyang::DataNode const &data_node)
 Retrieves DDNS configuration from sysrepo.
 
isc::data::ElementPtr getExpiredKea (libyang::DataNode const &data_node)
 Retrieves expired leases processing parameters from sysrepo.
 
isc::data::ElementPtr getHook (libyang::DataNode const &data_node)
 
isc::data::ElementPtr getHooksKea (libyang::DataNode const &data_node)
 Retrieves hooks configuration from sysrepo.
 
isc::data::ElementPtr getInterfacesKea (libyang::DataNode const &data_node)
 Retrieves interfaces configuration from sysrepo.
 
isc::data::ElementPtr getServerKeaDhcp4 ()
 getServer for kea-dhcp4-server:config.
 
isc::data::ElementPtr getServerKeaDhcp6 ()
 getServer for kea-dhcp6-server:config.
 
isc::data::ElementPtr getServerKeaDhcpCommon (libyang::DataNode const &data_node)
 getServer common part for kea-dhcp[46]-server:config.
 
void setConfigIetf6 (isc::data::ConstElementPtr elem)
 setConfig for ietf-dhcpv6-server.
 
void setConfigKea4 (isc::data::ConstElementPtr elem)
 setConfig for kea-dhcp[46]-server.
 
void setConfigKea6 (isc::data::ConstElementPtr elem)
 setConfig for kea-dhcp6-server.
 
void setServerKeaDhcp4 (isc::data::ConstElementPtr elem)
 setServer for kea-dhcp4-server:config.
 
void setServerKeaDhcp6 (isc::data::ConstElementPtr elem)
 setServer for kea-dhcp6-server:config.
 
void setServerKeaDhcpCommon (const std::string &xpath, isc::data::ConstElementPtr elem)
 setServer common part for kea-dhcp[46]-server:config.
 
- Protected Member Functions inherited from isc::yang::TranslatorControlSocket
isc::data::ElementPtr getControlSocketKea (libyang::DataNode const &data_node)
 getControlSocket JSON for kea models.
 
void setControlSocketKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setControlSocket for kea models.
 
- Protected Member Functions inherited from isc::yang::TranslatorDatabases
isc::data::ElementPtr getDatabasesKea (libyang::DataNode const &data_node, std::string const &xpath)
 getDatabases JSON for kea-dhcp[46]-server models.
 
void setDatabasesKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setDatabases for kea-dhcp[46]-server models.
 
- Protected Member Functions inherited from isc::yang::TranslatorDatabase
isc::data::ElementPtr getDatabaseKea (libyang::DataNode const &data_node)
 getDatabase JSON for kea-dhcp[46]-server models.
 
void setDatabaseKea (const std::string &xpath, isc::data::ConstElementPtr elem, bool skip)
 setDatabase for kea-dhcp[46]-server models.
 
- Protected Member Functions inherited from isc::yang::TranslatorClasses
isc::data::ElementPtr getClassesKea (libyang::DataNode const &data_node)
 getClasses JSON for kea-dhcp[46].
 
void setClassesKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setClasses for kea-dhcp[46].
 
- Protected Member Functions inherited from isc::yang::TranslatorClass
isc::data::ElementPtr getClassKea (libyang::DataNode const &data_node)
 getClass JSON for kea-dhcp[46].
 
void setClassKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setClass for kea-dhcp[46].
 
- Protected Member Functions inherited from isc::yang::TranslatorOptionDataList
isc::data::ConstElementPtr getOptionDataListKea (libyang::DataNode const &data_node)
 getOptionDataList for kea-dhcp[46].
 
void setOptionDataListKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setOptionDataList for kea-dhcp[46].
 
- Protected Member Functions inherited from isc::yang::TranslatorOptionData
isc::data::ElementPtr getOptionDataKea (libyang::DataNode const &data_node)
 getOptionData JSON for kea-dhcp[46].
 
void setOptionDataKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setOptionData for kea-dhcp[46].
 
- Protected Member Functions inherited from isc::yang::TranslatorOptionDefList
isc::data::ConstElementPtr getOptionDefListKea (libyang::DataNode const &data_node)
 getOptionDefList implementation specific to kea-dhcp[46]-server models.
 
void setOptionDefListKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setOptionDefList implementation specific to kea-dhcp[46]-server models.
 
- Protected Member Functions inherited from isc::yang::TranslatorOptionDef
isc::data::ElementPtr getOptionDefKea (libyang::DataNode const &data_node)
 getOptionDef implementation specific to kea-dhcp[46]-server models.
 
void setOptionDefKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setOptionDef implementation specific to kea-dhcp[46]-server models.
 
- 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
 
- Protected Member Functions inherited from isc::yang::TranslatorSharedNetwork
isc::data::ElementPtr getSharedNetworkKea (libyang::DataNode const &data_node, const std::string &subsel)
 getSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
 
void setSharedNetworkKea (const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
 setSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
 
- Protected Member Functions inherited from isc::yang::TranslatorSubnets
isc::data::ElementPtr getSubnetsCommon (libyang::DataNode const &data_node, const std::string &subsel)
 getSubnets common part.
 
void setSubnetsIetf6 (const std::string &xpath, isc::data::ConstElementPtr elem)
 setSubnets for ietf-dhcpv6-server.
 
void setSubnetsKea (const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
 setSubnets for kea-dhcp[46]-server.
 
- Protected Member Functions inherited from isc::yang::TranslatorSubnet
isc::data::ElementPtr getSubnetIetf6 (libyang::DataNode const &data_node)
 getSubnet for ietf-dhcpv6-server.
 
isc::data::ElementPtr getSubnetKea (libyang::DataNode const &data_node)
 getSubnet for kea-dhcp[46]-server.
 
void setSubnetIetf6 (const std::string &xpath, isc::data::ConstElementPtr elem)
 setSubnet for ietf-dhcpv6-server.
 
void setSubnetKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setSubnet for kea-dhcp[46]-server.
 
- Protected Member Functions inherited from isc::yang::TranslatorPools
isc::data::ElementPtr getPoolsIetf (libyang::DataNode const &data_node)
 getPools for ietf-dhcpv6-server.
 
isc::data::ElementPtr getPoolsKea (libyang::DataNode const &data_node)
 getPools for kea-dhcp[46]-server.
 
void setPoolsByAddresses (const std::string &xpath, isc::data::ConstElementPtr elem)
 setPools using address pair.
 
void setPoolsById (const std::string &xpath, isc::data::ConstElementPtr elem)
 setPools using pool-id.
 
- Protected Member Functions inherited from isc::yang::TranslatorPool
isc::data::ElementPtr getPoolIetf6 (libyang::DataNode const &data_node)
 getPool for ietf-dhcpv6-server.
 
isc::data::ElementPtr getPoolKea (libyang::DataNode const &data_node)
 getPool for kea-dhcp[46]-server.
 
void setPoolIetf6 (const std::string &xpath, isc::data::ConstElementPtr elem)
 setPool for ietf-dhcpv6-server.
 
void setPoolKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setPool for kea-dhcp[46]-server.
 
- Protected Member Functions inherited from isc::yang::TranslatorPdPools
isc::data::ElementPtr getPdPoolsCommon (libyang::DataNode const &data_node)
 getPdPools common part.
 
void setPdPoolsId (const std::string &xpath, isc::data::ConstElementPtr elem)
 setPdPools using pool-id.
 
void setPdPoolsPrefix (const std::string &xpath, isc::data::ConstElementPtr elem)
 setPdPools using prefix.
 
- Protected Member Functions inherited from isc::yang::TranslatorPdPool
isc::data::ElementPtr getPdPoolIetf6 (libyang::DataNode const &data_node)
 getPdPool for ietf-dhcpv6-server.
 
isc::data::ElementPtr getPdPoolKea (libyang::DataNode const &data_node)
 getPdPool for kea-dhcp6-server.
 
void setPdPoolIetf6 (const std::string &xpath, isc::data::ConstElementPtr elem)
 setPdPool for ietf-dhcpv6-server.
 
void setPdPoolKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setPdPool for kea-dhcp6-server.
 
- Protected Member Functions inherited from isc::yang::TranslatorHosts
void setHostsKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setHosts for kea-dhcp[46].
 
- Protected Member Functions inherited from isc::yang::TranslatorHost
isc::data::ElementPtr getHostKea (libyang::DataNode const &data_node)
 getHost for kea-dhcp[46]-server models.
 
void setHostKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setHost for kea-dhcp[46]-server models.
 
- Protected Member Functions inherited from isc::yang::TranslatorLoggers
isc::data::ElementPtr getLoggersKea (libyang::DataNode const &data_node)
 getLoggers JSON for loggers.
 
void setLoggersKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setLoggers for loggers.
 
- Protected Member Functions inherited from isc::yang::TranslatorLogger
isc::data::ElementPtr getLoggerKea (libyang::DataNode const &data_node)
 getLogger JSON for loggers.
 
isc::data::ElementPtr getOutputOption (libyang::DataNode const &data_node)
 Translate an output option from YANG to JSON.
 
isc::data::ElementPtr getOutputOptions (libyang::DataNode const &data_node)
 Translate output options from YANG to JSON.
 
void setLoggerKea (const std::string &xpath, isc::data::ConstElementPtr elem)
 setLogger for loggers.
 
void setOutputOption (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set an output option from JSON to YANG.
 
void setOutputOptions (const std::string &xpath, isc::data::ConstElementPtr elem)
 Translate and set output options from JSON to YANG.
 

Additional Inherited Members

- Static Public Member Functions inherited from isc::yang::Translator
static isc::data::ElementPtr translateFromYang (std::optional< libyang::DataNode > data_node)
 Translate basic value from the given YANG data node to JSON element.
 
static std::optional< std::string > translateToYang (isc::data::ConstElementPtr const &elem, libyang::LeafBaseType const type)
 Translate basic value from JSON to YANG.
 
- 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.
 
- Protected Types inherited from isc::yang::Translator
using Deserializer = std::unordered_map< libyang::LeafBaseType, std::function< isc::data::ElementPtr const (std::string const &)> >
 Maps YANG types to functions that transform a YANG type into an ElementPtr.
 
using Serializer = std::unordered_map< libyang::LeafBaseType, std::function< std::string const (std::string const &)> >
 Maps YANG types to functions that transform the string representation of an Element into a string that can be passed into Session::setItem().
 
- Static Protected Member Functions inherited from isc::yang::Translator
static std::string decode64 (std::string const &input)
 Decode a YANG element of binary type to a string that can be stored in an Element::string JSON.
 
static std::string encode64 (std::string const &input)
 Encode a string such that it can be stored in a YANG element of binary type.
 
static Deserializer initializeDeserializer ()
 Initializes the deserializer which is used to translate a YANG node to an ElementPtr.
 
static Serializer initializeSerializer ()
 Initializes the serializer which is used to translate the string value of an Element to a string that can be passed into Session::setItem().
 
- Protected Attributes inherited from isc::yang::Translator
std::string model_
 The model.
 
sysrepo::Session session_
 The sysrepo session.
 

Detailed Description

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:

"Dhcp4": {
"valid-lifetime": <valid lifetime>,
"min-valid-lifetime": <minimum valid lifetime>,
"max-valid-lifetime": <maximum valid lifetime>,
"renew-timer": <renew timer>,
"rebind-timer": <rebind timer>,
"calculate-tee-times": <calculate T1/T2 times>,
"t1-percent": <T1 percent>,
"t2-percent": <T2 percent>,
"decline-probation-period": <decline probation period>,
"subnet4": [ <list of subnet4> ],
<shared-networks>,
"interfaces-config": {
"interfaces" [ <list of interface names / specs> ],
...
},
<databases>,
<host-reservation-identifiers>,
<client-classes>,
<option-def>,
<option-data>,
<hooks-libraries>,
<expired-leases-processing>,
<dhcp4o6-port>,
<control-socket>,
<hostname-char-set": <hostname character set>,
<hostname-char-replacement": <hostname character replacement>,
<dhcp-ddns>,
"echo-client-id": <echo client id flag>,
"match-client-id": <match client id flag>,
"next-server": <next server address>,
"server-hostname": <server hostname>,
"boot-file-name": <boot file name>,
"authoritative": <authoritative flag>,
<user-context>,
<comment>,
"sanity-checks": { <sanity checks> },
"reservations": [ <list of host reservations> ],
<config-control>,
"server-tag": <server tag>,
"dhcp-queue-control": { <DHCP queue control> },
"loggers": [ <list of loggers> ]
},

YANG syntax for kea-dhcp4-server:config is:

+--rw valid-lifetime? uint32
+--rw min-valid-lifetime? uint32
+--rw max-valid-lifetime? uint32
+--rw renew-timer? uint32
+--rw rebind-timer? uint32
+--rw calculate-tee-times? boolean
+--rw t1-percent? decimal64
+--rw t2-percent? decimal64
+--rw decline-probation-period? uint32
+--rw subnet4* [id]
+--rw shared-network* [name]
+--rw interfaces-config
+--rw lease-database!
+--rw hosts-database* [database-type]
+--rw host-reservation-identifiers* host-identifier-type
+--rw client-class* [name]
+--rw option-def* [code space]
+--rw option-data* [code space]
+--rw hook-library* [library]
+--rw expired-leases-processing
+--rw dhcp4o6-port? uint16
+--rw control-socket!
+--rw hostname-char-set? string
+--rw hostname-char-replacement? string
+--rw dhcp-ddns
+--rw echo-client-id? boolean
+--rw match-client-id? boolean
+--rw next-server? inet:ipv4-address
+--rw server-hostname? string
+--rw boot-file-name? string
+--rw authoritative? boolean
+--rw user-context? user-context
+--rw sanity-checks
+--rw host* [identifier-type identifier]
+--rw config-control
+--rw server-tag? string
+--rw dhcp-queue-control? string
+--rw logger* [name]
+--rw cache-max-age? uint32
+--rw cache-threshold? decimal64
+--rw compatibility
+--rw ddns-generated-prefix? string
+--rw ddns-override-client-update? boolean
+--rw ddns-override-no-update? boolean
+--rw ddns-qualifying-suffix? string
+--rw ddns-replace-client-name? string
+--rw ddns-send-updates? boolean
+--rw ddns-update-on-renew? boolean
+--rw ddns-use-conflict-resolution? boolean
+--rw ddns-conflict-resolution-mode? conflict-resolution-mode
+--rw ip-reservations-unique? boolean
+--rw early-global-reservations-lookup? boolean
+--rw reservations-lookup-first? boolean
+--rw multi-threading
+--rw parked-packet-limit? uint32
+--rw reservations-global? boolean
+--rw reservations-in-subnet? boolean
+--rw reservations-out-of-pool? boolean
+--rw statistic-default-sample-age? uint32
+--rw statistic-default-sample-count? uint32
+--rw store-extended-info? boolean

Example of kea-dhcp6 simple configuration:

{
"Dhcp4": {
"interfaces-config":
{
"interfaces": [ "eth1" ]
},
"control-socket": {
"socket-type": "unix",
"socket-name": "/tmp/kea4-sock"
},
"subnet4":
[
{
"subnet": "10.0.35.0/24",
"pools":
[
{
"pool": "10.0.35.64/27"
}
]
}
]
}
}

The same configuration wrote into YANG datastore using setConfig() with the kea-dhcp4-model and exported to XML format:

<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp4-server">
<subnet4>
<id>1</id>
<pool>
<start-address>10.0.35.64</start-address>
<end-address>10.0.35.95</end-address>
<prefix>10.0.35.64/27</prefix>
</pool>
<subnet>10.0.35.0/24</subnet>
</subnet4>
<interfaces-config>
<interfaces>eth1</interfaces>
</interfaces-config>
<control-socket>
<socket-name>/tmp/kea4-sock</socket-name>
<socket-type>unix</socket-type>
</control-socket>
</config>

JSON syntax for kea-dhcp6 is:

"Dhcp6": {
"data-directory": <data directory>,
"preferred-lifetime": <preferred lifetime>,
"min-preferred-lifetime": <minimum preferred lifetime>,
"max-preferred-lifetime": <maximum preferred lifetime>,
"valid-lifetime": <valid lifetime>,
"min-valid-lifetime": <minimum valid lifetime>,
"max-valid-lifetime": <maximum valid lifetime>,
"renew-timer": <renew timer>,
"rebind-timer": <rebind timer>,
"calculate-tee-times": <calculate T1/T2 times>,
"t1-percent": <T1 percent>,
"t2-percent": <T2 percent>,
"decline-probation-period": <decline probation period>,
"subnet6": [ <list of subnet6> ],
<shared-networks>,
"interfaces-config": {
"interfaces" [ <list of interface names / specs> ],
...
},
<databases>,
<mac-sources>,
<relay-supplied-options>,
<host-reservation-identifiers>,
<client-classes>,
<option-def>,
<option-data>,
<hooks-libraries>,
<expired-leases-processing>,
<server-id>,
<dhcp4o6-port>,
<control-socket>,
<hostname-char-set": <hostname character set>,
<hostname-char-replacement": <hostname character replacement>,
<dhcp-ddns>,
<user-context>,
<comment>
"sanity-checks": { <sanity checks> },
"reservations": [ <list of host reservations> ],
<config-control>,
"server-tag": <server tag>,
"dhcp-queue-control": { <DHCP queue control> },
"loggers": [ <list of loggers> ]
},

YANG syntax for kea-dhcp6-server:config is:

+--rw data-directory? string
+--rw preferred-lifetime? uint32
+--rw min-preferred-lifetime? uint32
+--rw max-preferred-lifetime? uint32
+--rw valid-lifetime? uint32
+--rw min-valid-lifetime? uint32
+--rw max-valid-lifetime? uint32
+--rw renew-timer? uint32
+--rw rebind-timer? uint32
+--rw calculate-tee-times? boolean
+--rw t1-percent? decimal64
+--rw t2-percent? decimal64
+--rw decline-probation-period? uint32
+--rw subnet6* [id]
+--rw shared-network* [name]
+--rw interfaces-config
+--rw lease-database!
+--rw hosts-database* [database-type]
+--rw relay-supplied-options* string
+--rw mac-sources* string
+--rw host-reservation-identifiers* host-identifier-type
+--rw client-class* [name]
+--rw option-def* [code space]
+--rw option-data* [code space]
+--rw hook-library* [library]
+--rw expired-leases-processing
+--rw server-id!
+--rw dhcp4o6-port? uint16
+--rw control-socket!
+--rw hostname-char-set? string
+--rw hostname-char-replacement? string
+--rw dhcp-ddns
+--rw user-context? user-context
+--rw sanity-checks
+--rw host* [identifier-type identifier]
+--rw config-control
+--rw server-tag? string
+--rw dhcp-queue-control? string
+--rw logger* [name]
+--rw cache-max-age? uint32
+--rw cache-threshold? decimal64
+--rw compatibility
+--rw ddns-generated-prefix? string
+--rw ddns-override-client-update? boolean
+--rw ddns-override-no-update? boolean
+--rw ddns-qualifying-suffix? string
+--rw ddns-replace-client-name? string
+--rw ddns-send-updates? boolean
+--rw ddns-update-on-renew? boolean
+--rw ddns-use-conflict-resolution? boolean
+--rw ddns-conflict-resolution-mode? conflict-resolution-mode
+--rw ip-reservations-unique? boolean
+--rw early-global-reservations-lookup? boolean
+--rw reservations-lookup-first? boolean
+--rw multi-threading
+--rw parked-packet-limit? uint32
+--rw reservations-global? boolean
+--rw reservations-in-subnet? boolean
+--rw reservations-out-of-pool? boolean
+--rw statistic-default-sample-age? uint32
+--rw statistic-default-sample-count? uint32
+--rw store-extended-info? boolean

Example of kea-dhcp6 simple configuration:

{
"Dhcp6": {
"interfaces-config":
{
"interfaces": [ "eth1" ]
},
"control-socket": {
"socket-type": "unix",
"socket-name": "/tmp/kea6-sock"
},
"subnet6":
[
{
"subnet": "2001:db8::/64",
"pools":
[
{
"pool": "2001:db8::1:0/112"
}
]
}
]
}
}

The same configuration wrote into YANG datastore using setConfig() with the kea-dhcp6-model and exported to XML format:

<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
<subnet6>
<id>1</id>
<pool>
<start-address>2001:db8::1:0</start-address>
<end-address>2001:db8::1:ffff</end-address>
<prefix>2001:db8::1:0/112</prefix>
</pool>
<subnet>2001:db8::/64</subnet>
</subnet6>
<interfaces-config>
<interfaces>eth1</interfaces>
</interfaces-config>
<control-socket>
<socket-name>/tmp/kea6-sock</socket-name>
<socket-type>unix</socket-type>
</control-socket>
</config>

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) | +------—+ | | |

  • control -----------------------------—+ | socket | | | +---------—+ | | | | +- database -+- database --------------—+ | list | | | +- logger -----------------------------—+ (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:

  • kea-dhcp4-server
  • kea-dhcp6-server
  • ietf-dhcpv6-server (partial)

Definition at line 402 of file translator_config.h.

Constructor & Destructor Documentation

◆ TranslatorConfig()

isc::yang::TranslatorConfig::TranslatorConfig ( sysrepo::Session  session,
const std::string &  model 
)

Constructor.

Parameters
sessionSysrepo session.
modelModel name.

Definition at line 23 of file translator_config.cc.

◆ ~TranslatorConfig()

virtual isc::yang::TranslatorConfig::~TranslatorConfig ( )
virtualdefault

Destructor.

Member Function Documentation

◆ delConfigIetf6()

void isc::yang::TranslatorConfig::delConfigIetf6 ( )
protected

delConfig for ietf-dhcpv6-server.

Definition at line 459 of file translator_config.cc.

References isc::yang::Translator::deleteItem(), and isc::yang::Translator::model_.

Referenced by setConfig().

+ Here is the call graph for this function:

◆ delConfigKea()

void isc::yang::TranslatorConfig::delConfigKea ( )
protected

delConfig for kea-dhcp[46]-server.

Definition at line 480 of file translator_config.cc.

References isc::yang::Translator::deleteItem(), and isc::yang::Translator::model_.

Referenced by setConfig().

+ Here is the call graph for this function:

◆ getConfig()

ElementPtr isc::yang::TranslatorConfig::getConfig ( )

Translate the whole DHCP server configuration from YANG to JSON.

Returns
JSON representation of the config.
Exceptions
NetconfErrorwhen sysrepo raises an error.

Definition at line 49 of file translator_config.cc.

References getConfigIetf6(), getConfigKea4(), getConfigKea6(), isc_throw, isc::yang::Translator::model_, and isc::Exception::what().

Referenced by isc::netconf::NetconfAgent::change(), isc::netconf::NetconfAgent::done(), and isc::netconf::NetconfAgent::yangConfig().

+ Here is the call graph for this function:

◆ getConfigControlKea()

ElementPtr isc::yang::TranslatorConfig::getConfigControlKea ( libyang::DataNode const &  data_node)
protected

Retrieves configuration control from sysrepo.

Parameters
data_nodethe YANG node representing configuration control
Returns
ElementMap with configuration control.

Definition at line 148 of file translator_config.cc.

References isc::yang::Translator::checkAndGetLeaf(), isc::data::Element::createMap(), and isc::yang::TranslatorDatabases::getDatabases().

Referenced by getServerKeaDhcpCommon().

+ Here is the call graph for this function:

◆ getConfigIetf6()

ElementPtr isc::yang::TranslatorConfig::getConfigIetf6 ( )
protected

getConfig for ietf-dhcpv6-server.

This implementation is very preliminary. It handles network-ranges only partially and nothing else.

Returns
JSON representation of the config.
Exceptions
NetconfErrorwhen sysrepo raises an error.

Definition at line 66 of file translator_config.cc.

References isc::yang::Translator::checkAndGetDiverging(), isc::data::Element::createMap(), isc::yang::Translator::findXPath(), and isc::yang::TranslatorSubnets::getSubnets().

Referenced by getConfig().

+ Here is the call graph for this function:

◆ getConfigKea4()

ElementPtr isc::yang::TranslatorConfig::getConfigKea4 ( )
protected

getConfig for kea-dhcp4-server.

Returns
JSON representation of the config.
Exceptions
NetconfErrorwhen sysrepo raises an error.

Definition at line 88 of file translator_config.cc.

References isc::data::Element::createMap(), and getServerKeaDhcp4().

Referenced by getConfig().

+ Here is the call graph for this function:

◆ getConfigKea6()

ElementPtr isc::yang::TranslatorConfig::getConfigKea6 ( )
protected

getConfig for kea-dhcp6-server.

Returns
JSON representation of the config.
Exceptions
NetconfErrorwhen sysrepo raises an error.

Definition at line 96 of file translator_config.cc.

References isc::data::Element::createMap(), and getServerKeaDhcp6().

Referenced by getConfig().

+ Here is the call graph for this function:

◆ getDdnsKea()

isc::data::ElementPtr isc::yang::TranslatorConfig::getDdnsKea ( libyang::DataNode const &  data_node)
protected

Retrieves DDNS configuration from sysrepo.

Parameters
data_nodethe YANG node representing dhcp-ddns configuration
Returns
ElementList with dhcp-ddns configuration.

Definition at line 130 of file translator_config.cc.

References isc::yang::Translator::checkAndGetAndJsonifyLeaf(), isc::yang::Translator::checkAndGetLeaf(), and isc::data::Element::createMap().

Referenced by getServerKeaDhcpCommon().

+ Here is the call graph for this function:

◆ getExpiredKea()

isc::data::ElementPtr isc::yang::TranslatorConfig::getExpiredKea ( libyang::DataNode const &  data_node)
protected

Retrieves expired leases processing parameters from sysrepo.

Parameters
data_nodethe YANG node representing the configuration for expired lease processing
Returns
ElementList with expired leases configuration.

Definition at line 116 of file translator_config.cc.

References isc::yang::Translator::checkAndGetLeaf(), and isc::data::Element::createMap().

Referenced by getServerKeaDhcpCommon().

+ Here is the call graph for this function:

◆ getHook()

ElementPtr isc::yang::TranslatorConfig::getHook ( libyang::DataNode const &  data_node)
protected

Definition at line 103 of file translator_config.cc.

References isc::yang::Translator::checkAndGetAndJsonifyLeaf(), isc::yang::Translator::checkAndGetLeaf(), and isc::data::Element::createMap().

Referenced by getHooksKea().

+ Here is the call graph for this function:

◆ getHooksKea()

ElementPtr isc::yang::TranslatorConfig::getHooksKea ( libyang::DataNode const &  data_node)
protected

Retrieves hooks configuration from sysrepo.

Parameters
data_nodethe YANG node representing the hook libraries
Returns
ElementList with hooks configuration.

Definition at line 111 of file translator_config.cc.

References getHook(), and isc::yang::Translator::getList().

Referenced by getServerKeaDhcpCommon().

+ Here is the call graph for this function:

◆ getInterfacesKea()

ElementPtr isc::yang::TranslatorConfig::getInterfacesKea ( libyang::DataNode const &  data_node)
protected

Retrieves interfaces configuration from sysrepo.

Parameters
data_nodethe YANG node representing the interfaces configuration
Returns
ElementMap with configuration control.

Definition at line 159 of file translator_config.cc.

References isc::yang::Translator::checkAndGetAndJsonifyLeaf(), isc::yang::Translator::checkAndGetLeaf(), and isc::data::Element::createMap().

Referenced by getServerKeaDhcp4(), and getServerKeaDhcp6().

+ Here is the call graph for this function:

◆ getServerKeaDhcp4()

ElementPtr isc::yang::TranslatorConfig::getServerKeaDhcp4 ( )
protected

getServer for kea-dhcp4-server:config.

Returns
JSON representation of the config.
Exceptions
NetconfErrorwhen sysrepo raises an error.

Definition at line 318 of file translator_config.cc.

References isc::yang::Translator::checkAndGet(), isc::yang::Translator::checkAndGetLeaf(), isc::data::copy(), isc::data::Element::createMap(), isc::yang::Translator::findXPath(), getInterfacesKea(), getServerKeaDhcpCommon(), and isc::yang::TranslatorSubnets::getSubnets().

Referenced by getConfigKea4().

+ Here is the call graph for this function:

◆ getServerKeaDhcp6()

ElementPtr isc::yang::TranslatorConfig::getServerKeaDhcp6 ( )
protected

getServer for kea-dhcp6-server:config.

Returns
JSON representation of the config.
Exceptions
NetconfErrorwhen sysrepo raises an error.

Definition at line 371 of file translator_config.cc.

References isc::yang::Translator::checkAndGetAndJsonifyLeaf(), isc::yang::Translator::checkAndGetLeaf(), isc::data::Element::createMap(), isc::yang::Translator::findXPath(), getInterfacesKea(), getServerKeaDhcpCommon(), and isc::yang::TranslatorSubnets::getSubnets().

Referenced by getConfigKea6().

+ Here is the call graph for this function:

◆ getServerKeaDhcpCommon()

◆ setConfig()

void isc::yang::TranslatorConfig::setConfig ( isc::data::ElementPtr  elem)

Translate and set the DHCP server configuration from JSON to YANG.

Null elem argument removes the config containers.

Parameters
elemThe JSON element.

Definition at line 424 of file translator_config.cc.

References delConfigIetf6(), delConfigKea(), isc_throw, isc::yang::Translator::model_, isc::yang::AdaptorConfig::preProcess4(), isc::yang::AdaptorConfig::preProcess6(), setConfigIetf6(), setConfigKea4(), setConfigKea6(), and isc::Exception::what().

+ Here is the call graph for this function:

◆ setConfigIetf6()

void isc::yang::TranslatorConfig::setConfigIetf6 ( isc::data::ConstElementPtr  elem)
protected

setConfig for ietf-dhcpv6-server.

This implementation is very preliminary. It handles network-ranges only partially and nothing else.

Parameters
elemThe JSON element.
Exceptions
BadValueon config without Dhcp6.

Definition at line 464 of file translator_config.cc.

References isc_throw, isc::yang::Translator::model_, and isc::yang::TranslatorSubnets::setSubnets().

Referenced by setConfig().

+ Here is the call graph for this function:

◆ setConfigKea4()

void isc::yang::TranslatorConfig::setConfigKea4 ( isc::data::ConstElementPtr  elem)
protected

setConfig for kea-dhcp[46]-server.

Parameters
elemThe JSON element.

Definition at line 485 of file translator_config.cc.

References setServerKeaDhcp4().

Referenced by setConfig().

+ Here is the call graph for this function:

◆ setConfigKea6()

void isc::yang::TranslatorConfig::setConfigKea6 ( isc::data::ConstElementPtr  elem)
protected

setConfig for kea-dhcp6-server.

Parameters
elemThe JSON element.

Definition at line 493 of file translator_config.cc.

References setServerKeaDhcp6().

Referenced by setConfig().

+ Here is the call graph for this function:

◆ setServerKeaDhcp4()

void isc::yang::TranslatorConfig::setServerKeaDhcp4 ( isc::data::ConstElementPtr  elem)
protected

setServer for kea-dhcp4-server:config.

Parameters
elemThe JSON element.

Definition at line 663 of file translator_config.cc.

References isc::yang::Translator::checkAndSetLeaf(), isc::yang::Translator::checkAndSetLeafList(), isc::yang::Translator::checkAndSetUserContext(), setServerKeaDhcpCommon(), and isc::yang::TranslatorSubnets::setSubnets().

Referenced by setConfigKea4().

+ Here is the call graph for this function:

◆ setServerKeaDhcp6()

void isc::yang::TranslatorConfig::setServerKeaDhcp6 ( isc::data::ConstElementPtr  elem)
protected

setServer for kea-dhcp6-server:config.

Parameters
elemThe JSON element.

Definition at line 703 of file translator_config.cc.

References isc::yang::Translator::checkAndSetLeaf(), isc::yang::Translator::checkAndSetLeafList(), isc::yang::Translator::checkAndSetUserContext(), setServerKeaDhcpCommon(), and isc::yang::TranslatorSubnets::setSubnets().

Referenced by setConfigKea6().

+ Here is the call graph for this function:

◆ setServerKeaDhcpCommon()


The documentation for this class was generated from the following files: