Kea  1.9.9-git
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::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...
 

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> },
"reservation-mode": <host reservation mode>,
"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*
+--rw shared-network*
+--rw interfaces-config
+--rw interfaces* string
+--rw dhcp-socket-type? enumeration
+--rw outbound-interface? enumeration
+--rw re-detect? boolean
+--rw user-context? string
+--rw lease-database! <database>
+--rw hosts-database*
+--rw host-reservation-identifiers* enumeration
+--rw client-class*
+--rw option-def*
+--rw option-data*
+--rw hook-library*
+--rw library string
+--rw parameters? string
+--rw expired-leases-processing <expired-leases-processing>
+--rw dhcp4o6-port? uint16
+--rw control-socket! <control-socket>
+--rw hostname-char-set? string
+--rw hostname-char-replacement? string
+--rw dhcp-ddns <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? string
+--rw sanity-checks
+--rw lease-checks? enumeration
+--rw reservation-mode? enumeration
+--rw host*
+--rw config-control
+--rw config-fetch-wait-time? uint32
+--rw config-database*
+--rw server-tag string
+--rw dhcp-queue-control string
+--rw logger*

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> },
"reservation-mode": <host reservation mode>,
"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*
+--rw shared-network*
+--rw interfaces-config
+--rw interfaces* string
+--rw re-detect? boolean
+--rw user-context? string
+--rw lease-database! <database>
+--rw hosts-database*
+--rw relay-supplied-options* string
+--rw mac-sources* string
+--rw host-reservation-identifiers* enumeration
+--rw client-class*
+--rw option-def*
+--rw option-data*
+--rw hook-library*
+--rw library string
+--rw parameters? string
+--rw expired-leases-processing <expired-leases-processing>
+--rw server-id <server-id>
+--rw dhcp4o6-port? uint16
+--rw control-socket! <control-socket>
+--rw hostname-char-set? string
+--rw hostname-char-replacement? string
+--rw dhcp-ddns <dhcp-ddns>
+--rw echo-client-id? boolean
+--rw user-context? string
+--rw sanity-checks
+--rw lease-checks? enumeration
+--rw reservation-mode? enumeration
+--rw host*
+--rw config-control
+--rw config-fetch-wait-time? uint32
+--rw config-database*
+--rw server-tag string
+--rw dhcp-queue-control string
+--rw logger*

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 380 of file translator_config.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
sessionSysrepo session.
modelModel name.

Definition at line 23 of file translator_config.cc.

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

Destructor.

Definition at line 48 of file translator_config.cc.

Member Function Documentation

void isc::yang::TranslatorConfig::delConfigIetf6 ( )
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().

+ Here is the call graph for this function:

void isc::yang::TranslatorConfig::delConfigKea ( )
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().

+ Here is the call graph for this function:

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

Get and translate the whole DHCP server configuration from YANG to JSON.

Returns
JSON representation of the config.
Exceptions
SysrepoErrorwhen 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().

+ Here is the call graph for this function:

ElementPtr isc::yang::TranslatorConfig::getConfigControlKea ( const std::string &  xpath)
protected

Retrieves configuration control from sysrepo.

Parameters
xpathpath to configuration control.
Returns
ElementMap with configuration control.

Definition at line 192 of file translator_config.cc.

References isc::yang::TranslatorDatabases::getDatabases(), and getParam().

Referenced by getServerKeaDhcpCommon().

+ Here is the call graph for this function:

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
SysrepoErrorwhen 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().

+ Here is the call graph for this function:

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

getConfig for kea-dhcp4-server.

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

Definition at line 84 of file translator_config.cc.

References getServerKeaDhcp4().

Referenced by getConfig().

+ Here is the call graph for this function:

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

getConfig for kea-dhcp6-server.

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

Definition at line 92 of file translator_config.cc.

References getServerKeaDhcp6().

Referenced by getConfig().

+ Here is the call graph for this function:

isc::data::ElementPtr isc::yang::TranslatorConfig::getDdnsKea ( const std::string &  xpath)
protected

Retrieves DDNS configuration from sysrepo.

Parameters
xpathpath to dhcp-ddns configuration.
Returns
ElementList with dhcp-ddns configuration.

Definition at line 159 of file translator_config.cc.

References isc::yang::TranslatorBasic::getItem(), and getParam().

Referenced by getServerKeaDhcpCommon().

+ Here is the call graph for this function:

isc::data::ElementPtr isc::yang::TranslatorConfig::getExpiredKea ( const std::string &  xpath)
protected

Retrieves expired leases processing parameters from sysrepo.

Parameters
xpathpath to expired leases configuration.
Returns
ElementList with expired leases configuration.

Definition at line 141 of file translator_config.cc.

References getParam().

Referenced by getServerKeaDhcpCommon().

+ Here is the call graph for this function:

ElementPtr isc::yang::TranslatorConfig::getHooksKea ( const std::string &  xpath)
protected

Retrieves hooks configuration from sysrepo.

Parameters
xpathpath to hooks configuration.
Returns
ElementList with 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().

+ Here is the call graph for this function:

void isc::yang::TranslatorConfig::getParam ( isc::data::ElementPtr storage,
const std::string &  xpath,
const std::string &  name 
)
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.

Parameters
storageElementMap (result will be stored here)
xpathxpath location (data will be extracted from sysrepo)
namename 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().

+ Here is the call graph for this function:

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

getServer for kea-dhcp4-server:config.

Returns
JSON representation of the config.
Exceptions
SysrepoErrorwhen 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().

+ Here is the call graph for this function:

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

getServer for kea-dhcp6-server:config.

Returns
JSON representation of the config.
Exceptions
SysrepoErrorwhen 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().

+ Here is the call graph for this function:

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.

Parameters
elemThe 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().

+ Here is the call graph for this function:

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 441 of file translator_config.cc.

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

Referenced by setConfig().

+ Here is the call graph for this function:

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

setConfig for kea-dhcp[46]-server.

Parameters
elemThe JSON element.

Definition at line 460 of file translator_config.cc.

References setServerKeaDhcp4().

Referenced by setConfig().

+ Here is the call graph for this function:

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

setConfig for kea-dhcp6-server.

Parameters
elemThe JSON element.

Definition at line 468 of file translator_config.cc.

References setServerKeaDhcp6().

Referenced by setConfig().

+ Here is the call graph for this function:

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

setServer for kea-dhcp4-server:config.

Parameters
elemThe 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().

+ Here is the call graph for this function:

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

setServer for kea-dhcp6-server:config.

Parameters
elemThe 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().

+ Here is the call graph for this function:


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