// list of parameters supported by Kea DHCPv4 server along with the brief
// description of each parameter.
//
-// This stable version is used for YANG as we do not want to update code
-// and models each time a keyword is added to the syntax.
+// This current version should be up to date, i.e. new keywords should be
+// added in this file at the same time than in the syntax.
{
// Kea DHCPv4 server configuration begins here.
"Dhcp4": {
// User name to be used to access the database.
"user": "kea"
+ },
+ {
+ // Name of the database to connect to.
+ "name": "kea",
+
+ // Host on which the database resides.
+ "host": "localhost",
+
+ // Database password.
+ "password": "kea",
+
+ // Port on which the database is available.
+ "port": 5432,
+
+ // Type of the database, e.g. "mysql", "postgresql", "cql".
+ "type": "postgresql",
+
+ // User name to be used to access the database.
+ "user": "kea"
+ },
+ {
+ // Name of the database to connect to.
+ "keyspace": "kea",
+
+ // Host on which the database resides.
+ "contact-points": "127.0.0.1",
+
+ // Database password.
+ "password": "kea",
+
+ // Port on which the database is available.
+ "port": 9042,
+
+ // Type of the database, e.g. "mysql", "postgresql", "cql".
+ "type": "cql",
+
+ // User name to be used to access the database.
+ "user": "kea",
+
+ // Consistency level for all queries.
+ // Supported values: any, one, two, three, quorum, all,
+ // local-quorum, each-quorum, serial, local-serial, local-one.
+ "consistency": "quorum",
+
+ // Serial consistency level for all queries.
+ // Supported values: any, one, two, three, quorum, all,
+ // local-quorum, each-quorum, serial, local-serial, local-one.
+ "serial-consistency": "serial",
+
+ // Connection reconnect wait time.
+ "reconnect-wait-time": 100,
+
+ // Connection connect timeout.
+ "connect-timeout": 100,
+
+ // Connection request timeout.
+ "request-timeout": 100,
+
+ // Connection tcp keepalive.
+ "tcp-keepalive": 100,
+
+ // Connection tcp nodelay.
+ "tcp-nodelay": true
}
],
// Shared network level renew timer.
"renew-timer": 31,
+ // Shared network level compute T1 and T2 timers.
+ "calculate-tee-times": true,
+
+ // T1 = valid lifetime * .5.
+ "t1-percent": .5,
+
+ // T2 = valid lifetime * .75.
+ "t2-percent": .75,
+
// Enumeration specifying server's mode of operation when it
// fetches host reservations.
"reservation-mode": "all",
// fetches host reservations.
"reservation-mode": "all",
+ // Subnet-level compute T1 and T2 timers.
+ "calculate-tee-times": true,
+
+ // T1 = valid lifetime * .5.
+ "t1-percent": .5,
+
+ // T2 = valid lifetime * .75.
+ "t2-percent": .75,
+
// List of static IPv4 reservations assigned to the clients belonging
// to this subnet. For detailed example see reservations.json.
"reservations": [
// Subnet prefix.
"subnet": "192.0.0.0/8",
- // Subnet level valid lifetime.
- "valid-lifetime": 6000
+ // Subnet level (default) valid lifetime.
+ "valid-lifetime": 6000,
+
+ // Subnet level min valid lifetime.
+ "min-valid-lifetime": 4000,
+
+ // Subnet level max valid lifetime.
+ "max-valid-lifetime": 8000
}
],
- // Shared network level valid lifetime.
- "valid-lifetime": 6001
+ // Shared network level (default) valid lifetime.
+ "valid-lifetime": 6001,
+
+ // Subnet level min valid lifetime.
+ "min-valid-lifetime": 4001,
+
+ // Subnet level max valid lifetime.
+ "max-valid-lifetime": 8001
}
],
// List of IPv4 subnets which don't belong to any shared network.
"subnet4": [],
- // Global valid lifetime value.
+ // Global valid (default) lifetime value.
"valid-lifetime": 6000,
+ // Global min valid lifetime value.
+ "min-valid-lifetime": 4000,
+
+ // Global max valid lifetime value.
+ "max-valid-lifetime": 8000,
+
+ // Reservations (examples are in other files).
+ "reservations": [],
+
// Configuration control (currently not used, i.e. this syntax
// is already defined but corresponding feature is not implemented).
"config-control":
// Type of the database, e.g. "mysql", "postgresql", "cql".
"type": "mysql"
}
- ]
+ ],
+ // Intervals between attempts to fetch configuration updates
+ // via the configuration backends used.
+ "config-fetch-wait-time": 30
},
// Server tag.
// Queue type was mandatory.
"queue-type": "kea-ring4"
},
- // Missing: calculate-tee-times, t1-percent, t2-percent
+
+ // Fetches host reservations.
+ "reservation-mode": "all",
+
+ // Global compute T1 and T2 timers.
+ "calculate-tee-times": true,
+
+ // T1 = valid lifetime * .5.
+ "t1-percent": .5,
+
+ // T2 = valid lifetime * .75.
+ "t2-percent": .75,
+
+ // String of zero or more characters with which to replace each
+ // invalid character in the hostname or Client FQDN. The default
+ // value is an empty string which will cause invalid characters
+ // to be omitted rather than replaced.
+ "hostname-char-replacement": "x",
+
+ // Regular expression describing the invalid character set in
+ // the hostname or Client FQDN.
+ "hostname-char-set": "[^A-Za-z0-9.-]",
// List of loggers used by the servers using this configuration file.
"loggers": [
// list of parameters supported by Kea DHCPv6 server along with the brief
// description of each parameter.
//
-// This stable version is used for YANG as we do not want to update code
-// and models each time a keyword is added to the syntax.
+// This current version should be up to date, i.e. new keywords should be
+// added in this file at the same time than in the syntax.
{
// Kea DHCPv6 server configuration begins here.
"Dhcp6": {
// User name to be used to access the database.
"user": "kea"
+ },
+ {
+ // Name of the database to connect to.
+ "name": "kea",
+
+ // Host on which the database resides.
+ "host": "localhost",
+
+ // Database password.
+ "password": "kea",
+
+ // Port on which the database is available.
+ "port": 5432,
+
+ // Type of the database, e.g. "mysql", "postgresql", "cql".
+ "type": "postgresql",
+
+ // User name to be used to access the database.
+ "user": "kea"
+ },
+ {
+ // Name of the database to connect to.
+ "keyspace": "kea",
+
+ // Host on which the database resides.
+ "contact-points": "127.0.0.1",
+
+ // Database password.
+ "password": "kea",
+
+ // Port on which the database is available.
+ "port": 9042,
+
+ // Type of the database, e.g. "mysql", "postgresql", "cql".
+ "type": "cql",
+
+ // User name to be used to access the database.
+ "user": "kea",
+
+ // Consistency level for all queries.
+ // Supported values: any, one, two, three, quorum, all,
+ // local-quorum, each-quorum, serial, local-serial, local-one.
+ "consistency": "quorum",
+
+ // Serial consistency level for all queries.
+ // Supported values: any, one, two, three, quorum, all,
+ // local-quorum, each-quorum, serial, local-serial, local-one.
+ "serial-consistency": "serial",
+
+ // Connection reconnect wait time.
+ "reconnect-wait-time": 100,
+
+ // Connection connect timeout.
+ "connect-timeout": 100,
+
+ // Connection request timeout.
+ "request-timeout": 100,
+
+ // Connection tcp keepalive.
+ "tcp-keepalive": 100,
+
+ // Connection tcp nodelay.
+ "tcp-nodelay": true
}
],
}
],
- // Global value of the preferred lifetime.
+ // Global (default) value of the preferred lifetime.
"preferred-lifetime": 50,
+ // Global min value of the preferred lifetime.
+ "min-preferred-lifetime": 40,
+
+ // Global max value of the preferred lifetime.
+ "max-preferred-lifetime": 60,
+
// Global value for the rebind timer, i.e. the time after which the
// DHCP client enters rebind state if it fails to renew the lease.
"rebind-timer": 40,
// List of shared network specific DHCP options.
"option-data": [],
- // Shared network specific preferred lifetime.
+ // Shared network specific (default) preferred lifetime.
"preferred-lifetime": 2000,
+ // Shared network specific min preferred lifetime.
+ "min-preferred-lifetime": 1500,
+
+ // Shared network specific ma xpreferred lifetime.
+ "max-preferred-lifetime": 2500,
+
// Boolen flag indicating if the server can respond to
// a Solicit message including a Rapid Commit option with
// the Reply message (See DHCPv6 rapid commit).
// Shared network level renew timer.
"renew-timer": 31,
+ // Shared network level compute T1 and T2 timers.
+ "calculate-tee-times": true,
+
+ // T1 = valid lifetime * .5.
+ "t1-percent": .5,
+
+ // T2 = valid lifetime * .75.
+ "t2-percent": .75,
+
// Enumeration specifying server's mode of operation when it
// fetches host reservations.
"reservation-mode": "all",
// clients.
"pd-pools": [
{
+ // Restricts this prefix pool to be used only for the client
+ // requests belonging to a particular client class.
"client-class": "phones_server1",
+
+ // Length of prefixes delegated to clients.
"delegated-len": 64,
+
+ // Excluded prefix (address) from client assignments.
"excluded-prefix": "2001:db8::",
+
+ // Excluded prefix (length) from client assignments.
"excluded-prefix-len": 48,
+
+ // Prefix pool level list of DHCP options.
"option-data": [],
+
+ // Prefix range (address) used for client assignments.
"prefix": "2001:db8::",
+
+ // Prefix range (length) used for client assignments.
"prefix-len": 40,
+
+ // List of client classes which must be evaluated
+ // when this prefix pool is selected for client assignments.
"require-client-classes": []
}
],
}
],
- // Subnet specific preferred lifetime.
+ // Subnet specific (default) preferred lifetime.
"preferred-lifetime": 2000,
+ // Subnet specific min preferred lifetime.
+ "min-preferred-lifetime": 1500,
+
+ // Subnet specific max referred lifetime.
+ "max-preferred-lifetime": 2500,
+
// Boolen flag indicating if the server can respond to
// a Solicit message including a Rapid Commit option with
// the Reply message (See DHCPv6 rapid commit).
// fetches host reservations.
"reservation-mode": "all",
+ // Subnet level compute T1 and T2 timers.
+ "calculate-tee-times": true,
+
+ // T1 = valid lifetime * .5.
+ "t1-percent": .5,
+
+ // T2 = valid lifetime * .75.
+ "t2-percent": .75,
+
// List of static IPv6 reservations assigned to the clients belonging
// to this subnet. For detailed example see reservations.json.
"reservations": [
// Subnet prefix.
"subnet": "2001:db8::/32",
- // Subnet level valid lifetime.
- "valid-lifetime": 6000
+ // Subnet level (default) valid lifetime.
+ "valid-lifetime": 6000,
+
+ // Subnet level min valid lifetime.
+ "min-valid-lifetime": 4000,
+
+ // Subnet level max valid lifetime.
+ "max-valid-lifetime": 8000
}
],
- // Shared network level valid lifetime.
- "valid-lifetime": 6001
+ // Shared network level (default) valid lifetime.
+ "valid-lifetime": 6001,
+
+ // Shared network level min valid lifetime.
+ "min-valid-lifetime": 4001,
+
+ // Shared network level max valid lifetime.
+ "max-valid-lifetime": 8001
}
],
// List of IPv6 subnets which don't belong to any shared network.
"subnet6": [],
- // Global valid lifetime value.
+ // Global (default) valid lifetime value.
"valid-lifetime": 6000,
+ // Global min valid lifetime value.
+ "min-valid-lifetime": 4000,
+
+ // Global max valid lifetime value.
+ "max-valid-lifetime": 8000,
+
+ // Reservations (examples are in other files).
+ "reservations": [],
+
// Configuration control (currently not used, i.e. this syntax
// is already defined but corresponding feature is not implemented).
"config-control":
// Type of the database, e.g. "mysql", "postgresql", "cql".
"type": "mysql"
}
- ]
+ ],
+ // Intervals between attempts to fetch configuration updates
+ // via the configuration backends used.
+ "config-fetch-wait-time": 30
},
// Server tag.
"queue-type": "kea-ring6"
},
+ // Fetches host reservations.
+ "reservation-mode": "all",
+
+ // Data directory.
+ "data-directory": "/tmp",
+
+ // Global compute T1 and T2 timers.
+ "calculate-tee-times": true,
+
+ // T1 = valid lifetime * .5.
+ "t1-percent": .5,
+
+ // T2 = valid lifetime * .75.
+ "t2-percent": .75,
+
+ // String of zero or more characters with which to replace each
+ // invalid character in the hostname or Client FQDN. The default
+ // value is an empty string which will cause invalid characters
+ // to be omitted rather than replaced.
+ "hostname-char-replacement": "x",
+
+ // Regular expression describing the invalid character set in
+ // the hostname or Client FQDN.
+ "hostname-char-set": "[^A-Za-z0-9.-]",
+
// List of loggers used by the servers using this configuration file.
"loggers": [
{
EXPECT_EQ("foobar", elem->stringValue());
elem.reset();
- // Unknown / unsupported.
+ // Decimal 64.
double d64(.1234);
s_val.reset(new Val(d64));
- EXPECT_THROW(TranslatorBasic::value(s_val), NotImplemented);
+ EXPECT_NO_THROW(elem = TranslatorBasic::value(s_val));
+ ASSERT_TRUE(elem);
+ ASSERT_EQ(Element::real, elem->getType());
+ EXPECT_DOUBLE_EQ(d64, elem->doubleValue());
}
// Test basic yang value to JSON using sysrepo test models.
xpath = "/keatest-module:main/dec64";
s_val.reset(new Val(9.85));
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
- EXPECT_THROW(elem = t_obj->getItem(xpath), NotImplemented);
+ EXPECT_NO_THROW(elem = t_obj->getItem(xpath));
+ ASSERT_TRUE(elem);
+ ASSERT_EQ(Element::real, elem->getType());
+ EXPECT_EQ("9.85", elem->str());
elem.reset();
// Not found.
EXPECT_EQ("Zm9vYmFy", string(s_val->data()->get_binary()));
s_val.reset();
- // Unknown / unsupported.
- elem = Element::create(.1234);
- EXPECT_THROW(TranslatorBasic::value(elem, SR_DECIMAL64_T), NotImplemented);
+ // Decimal 64.
+ double d64(.1234);
+ elem = Element::create(d64);
+ EXPECT_NO_THROW(s_val = TranslatorBasic::value(elem, SR_DECIMAL64_T));
+ ASSERT_TRUE(s_val);
+ EXPECT_DOUBLE_EQ(d64, s_val->data()->get_decimal64());
+ s_val.reset();
}
// Test JSON to basic yang value using sysrepo test models.
EXPECT_EQ("Zm9vYmFy", string(s_val->data()->get_binary()));
s_val.reset();
+ // Decimal 64.
+ xpath = "/keatest-module:main/dec64";
+ double d64(9.85);
+ elem = Element::create(d64);
+ EXPECT_NO_THROW(t_obj->setItem(xpath, elem, SR_DECIMAL64_T));
+ EXPECT_NO_THROW(s_val = sess->get_item(xpath.c_str()));
+ ASSERT_TRUE(s_val);
+ ASSERT_EQ(SR_DECIMAL64_T, s_val->type());
+ EXPECT_DOUBLE_EQ(d64, s_val->data()->get_decimal64());
+ s_val.reset();
+
// Leaf-list.
xpath = "/keatest-module:main/numbers";
S_Vals s_vals;
EXPECT_FALSE(s_vals);
s_vals.reset();
- // Unknown / unsupported.
- xpath = "/keatest-module:main/dec64";
- elem = Element::create(9.85);
- EXPECT_THROW(t_obj->setItem(xpath, elem, SR_DECIMAL64_T), NotImplemented);
-
// Bad xpath.
xpath = "/keatest-module:main/no_such_string";
elem = Element::create(string("str"));
}
ElementPtr
-
#ifndef HAVE_PRE_0_7_6_SYSREPO
- TranslatorBasic::value(sysrepo::S_Val s_val) {
+TranslatorBasic::value(sysrepo::S_Val s_val) {
#else
- TranslatorBasic::value(S_Val s_val) {
+TranslatorBasic::value(S_Val s_val) {
#endif
if (!s_val) {
isc_throw(BadValue, "value called with null");
case SR_INT32_T:
return (Element::create(static_cast<long long>(s_val->data()->get_int32())));
+ case SR_DECIMAL64_T:
+ return (Element::create(s_val->data()->get_decimal64()));
+
case SR_IDENTITYREF_T:
return (Element::create(string(s_val->data()->get_identityref())));
#endif
break;
+ case SR_DECIMAL64_T:
+ if (elem->getType() != Element::real) {
+ isc_throw(BadValue, "value for a real called with not a real");
+ }
+ s_val.reset(new Val(elem->doubleValue()));
+ break;
+
case SR_BINARY_T:
if (elem->getType() != Element::string) {
isc_throw(BadValue,
ElementPtr
TranslatorConfig::getConfigControlKea(const string& xpath) {
ElementPtr config_ctrl = Element::createMap();
+ getParam(config_ctrl, xpath, "config-fetch-wait-time");
ConstElementPtr databases = getDatabases(xpath + "/config-database");
if (databases && !databases->empty()) {
config_ctrl->set("config-databases", databases);
ElementPtr result = Element::createMap();
getParam(result, xpath, "valid-lifetime");
+ getParam(result, xpath, "min-valid-lifetime");
+ getParam(result, xpath, "max-valid-lifetime");
getParam(result, xpath, "renew-timer");
getParam(result, xpath, "rebind-timer");
+ getParam(result, xpath, "calculate-tee-times");
+ getParam(result, xpath, "t1-percent");
+ getParam(result, xpath, "t2-percent");
getParam(result, xpath, "decline-probation-period");
+ getParam(result, xpath, "hostname-char-set");
+ getParam(result, xpath, "hostname-char-replacement");
ConstElementPtr networks = getSharedNetworks(xpath);
if (networks && !networks->empty()) {
string xpath = "/kea-dhcp6-server:config";
ElementPtr result = getServerKeaDhcpCommon(xpath);
// Handle DHCPv6 specific global parameters.
+ getParam(result, xpath, "data-directory");
getParam(result, xpath, "preferred-lifetime");
+ getParam(result, xpath, "min-preferred-lifetime");
+ getParam(result, xpath, "max-preferred-lifetime");
// Handle subnets.
ConstElementPtr subnets = getSubnets(xpath);
if (subnets && !subnets->empty()) {
if (valid) {
setItem(xpath + "/valid-lifetime", valid, SR_UINT32_T);
}
+ ConstElementPtr min_valid = elem->get("min-valid-lifetime");
+ if (min_valid) {
+ setItem(xpath + "/min-valid-lifetime", min_valid, SR_UINT32_T);
+ }
+ ConstElementPtr max_valid = elem->get("max-valid-lifetime");
+ if (max_valid) {
+ setItem(xpath + "/max-valid-lifetime", max_valid, SR_UINT32_T);
+ }
ConstElementPtr renew = elem->get("renew-timer");
if (renew) {
setItem(xpath + "/renew-timer", renew, SR_UINT32_T);
if (rebind) {
setItem(xpath + "/rebind-timer", rebind, SR_UINT32_T);
}
+ ConstElementPtr calculate = elem->get("calculate-tee-times");
+ if (calculate) {
+ setItem(xpath + "/calculate-tee-times", calculate, SR_BOOL_T);
+ }
+ ConstElementPtr t1_percent = elem->get("t1-percent");
+ if (t1_percent) {
+ setItem(xpath + "/t1-percent", t1_percent, SR_DECIMAL64_T);
+ }
+ ConstElementPtr t2_percent = elem->get("t2-percent");
+ if (t2_percent) {
+ setItem(xpath + "/t2-percent", t2_percent, SR_DECIMAL64_T);
+ }
ConstElementPtr period = elem->get("decline-probation-period");
if (period) {
setItem(xpath + "/decline-probation-period", period, SR_UINT32_T);
if (socket) {
setControlSocket(xpath + "/control-socket", socket);
}
+ ConstElementPtr char_set = elem->get("hostname-char-set");
+ if (char_set) {
+ setItem(xpath + "/hostname-char-set", char_set, SR_STRING_T);
+ }
+ ConstElementPtr char_repl = elem->get("hostname-char-replacement");
+ if (char_repl) {
+ setItem(xpath + "/hostname-char-replacement", char_repl, SR_STRING_T);
+ }
ConstElementPtr ddns = elem->get("dhcp-ddns");
if (ddns) {
ConstElementPtr enable = ddns->get("enable-updates");
}
ConstElementPtr config_ctrl = elem->get("config-control");
if (config_ctrl && !config_ctrl->empty()) {
+ ConstElementPtr cfwt = config_ctrl->get("config-fetch-wait-time");
+ if (cfwt) {
+ setItem(xpath + "/config-control/config-fetch-wait-time", cfwt,
+ SR_UINT32_T);
+ }
databases = config_ctrl->get("config-databases");
if (databases && !databases->empty()) {
setDatabases(xpath + "/config-control/config-database", databases);
TranslatorConfig::setServerKeaDhcp6(ConstElementPtr elem) {
string xpath = "/kea-dhcp6-server:config";
setServerKeaDhcpCommon(xpath, elem);
+ ConstElementPtr data_dir = elem->get("data-directory");
+ if (data_dir) {
+ setItem(xpath + "/data-directory", data_dir, SR_STRING_T);
+ }
ConstElementPtr preferred = elem->get("preferred-lifetime");
if (preferred) {
setItem(xpath + "/preferred-lifetime", preferred, SR_UINT32_T);
}
+ ConstElementPtr min_pref = elem->get("min-preferred-lifetime");
+ if (min_pref) {
+ setItem(xpath + "/min-preferred-lifetime", min_pref, SR_UINT32_T);
+ }
+ ConstElementPtr max_pref = elem->get("max-preferred-lifetime");
+ if (max_pref) {
+ setItem(xpath + "/max-preferred-lifetime", max_pref, SR_UINT32_T);
+ }
ConstElementPtr subnets = elem->get("subnet6");
if (subnets) {
setSubnets(xpath, subnets);
/// @code
/// "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>,
/// <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>,
/// YANG syntax for kea-dhcp4-server:config is:
/// @code
/// +--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 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 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
/// JSON syntax for kea-dhcp6 is:
/// @code
/// "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>,
/// <server-id>,
/// <dhcp4o6-port>,
/// <control-socket>,
+/// <hostname-char-set": <hostname character set>,
+/// <hostname-char-replacement": <hostname character replacement>,
/// <dhcp-ddns>,
/// <user-context>,
/// <comment>
///
/// YANG syntax for kea-dhcp6-server:config is:
/// @code
+/// +--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 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 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
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// Supports the following models:
/// - kea-dhcp4-server
/// - kea-dhcp6-server
-/// - kea-dhcp-ddns (not yet supported by the server itself)
+/// - kea-dhcp-ddns
/// - kea-ctrl-agent
class TranslatorControlSocket : virtual public TranslatorBasic {
public:
if (nodelay) {
result->set("tcp-nodelay", nodelay);
}
+ ConstElementPtr consistency = getItem(xpath + "/consistency");
+ if (consistency) {
+ result->set("consistency", consistency);
+ }
+ ConstElementPtr serial_consistency = getItem(xpath + "/serial-consistency");
+ if (serial_consistency) {
+ result->set("serial-consistency", serial_consistency);
+ }
ConstElementPtr context = getItem(xpath + "/user-context");
if (context) {
result->set("user-context", Element::fromJSON(context->stringValue()));
if (nodelay) {
setItem(xpath + "/tcp-nodelay", nodelay, SR_BOOL_T);
}
+ ConstElementPtr consistency = elem->get("consistency");
+ if (consistency) {
+ setItem(xpath + "/consistency", consistency, SR_STRING_T);
+ }
+ ConstElementPtr serial_consistency = elem->get("serial-consistency");
+ if (serial_consistency) {
+ setItem(xpath + "/serial-consistency", serial_consistency, SR_STRING_T);
+ }
ConstElementPtr context = Adaptor::getContext(elem);
if (context) {
setItem(xpath + "/user-context", Element::create(context->str()),
/// "request-timeout": <request timeout>,
/// "tcp-keepalive": <TCP keepalive>,
/// "tcp-nodelay": <TCP nodelay flag>,
+/// "consistency": <consistency level>,
+/// "serial-consistency": <serial consistency level>,
/// "user-context": { <json map> },
/// "comment": <comment>
/// }
/// +--rw request-timeout? uint32
/// +--rw tcp-keepalive? uint32
/// +--rw tcp-nodelay? boolean
+/// +--rw consistency? string
+/// +--rw serial-consistency? string
/// +--rw user-context? string
/// @endcode
///
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// }
/// @endcode
///
-/// YANG syntax for kea-logging is with name as the logger list key and
-/// output as the output option list key.
+/// YANG syntax for loggers is:
/// @code
/// +--rw logger (list)
/// |
void setOutputOptions(const std::string& xpath,
isc::data::ConstElementPtr elem);
- /// @brief getLogger JSON for kea-logging.
+ /// @brief getLogger JSON for loggers.
///
/// @param xpath The xpath of the logger.
/// @return JSON representation of the logger.
/// @throw SysrepoError when sysrepo raises an error.
isc::data::ElementPtr getLoggerKea(const std::string& xpath);
- /// @brief setLogger for kea-logging.
+ /// @brief setLogger for loggers.
///
/// @param xpath The xpath of the logger.
/// @param elem The JSON element.
isc::data::ConstElementPtr elem);
protected:
- /// @brief getLoggers JSON for kea-logging.
+ /// @brief getLoggers JSON for loggers.
///
/// @param xpath The xpath of loggers.
/// @return JSON representation of loggers.
/// @throw SysrepoError when sysrepo raises an error.
isc::data::ElementPtr getLoggersKea(const std::string& xpath);
- /// @brief setLoggers for kea-logging.
+ /// @brief setLoggers for loggers.
///
/// @param xpath The xpath of loggers.
/// @param elem The JSON element.
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
if (preferred) {
result->set("preferred-lifetime", preferred);
}
+ ConstElementPtr min_pref = getItem(xpath + "/min-preferred-lifetime");
+ if (min_pref) {
+ result->set("min-preferred-lifetime", min_pref);
+ }
+ ConstElementPtr max_pref = getItem(xpath + "/max-preferred-lifetime");
+ if (max_pref) {
+ result->set("max-preferred-lifetime", max_pref);
+ }
}
ConstElementPtr valid = getItem(xpath + "/valid-lifetime");
if (valid) {
result->set("valid-lifetime", valid);
}
+ ConstElementPtr min_valid = getItem(xpath + "/min-valid-lifetime");
+ if (min_valid) {
+ result->set("min-valid-lifetime", min_valid);
+ }
+ ConstElementPtr max_valid = getItem(xpath + "/max-valid-lifetime");
+ if (max_valid) {
+ result->set("max-valid-lifetime", max_valid);
+ }
ConstElementPtr renew = getItem(xpath + "/renew-timer");
if (renew) {
result->set("renew-timer", renew);
if (rebind) {
result->set("rebind-timer", rebind);
}
+ ConstElementPtr calculate = getItem(xpath + "/calculate-tee-times");
+ if (calculate) {
+ result->set("calculate-tee-times", calculate);
+ }
+ ConstElementPtr t1_percent = getItem(xpath + "/t1-percent");
+ if (t1_percent) {
+ result->set("t1-percent", t1_percent);
+ }
+ ConstElementPtr t2_percent = getItem(xpath + "/t2-percent");
+ if (t2_percent) {
+ result->set("t2-percent", t2_percent);
+ }
ConstElementPtr options = getOptionDataList(xpath);
if (options && (options->size() > 0)) {
result->set("option-data", options);
if (preferred) {
setItem(xpath + "/preferred-lifetime", preferred, SR_UINT32_T);
}
+ ConstElementPtr min_pref = elem->get("min-preferred-lifetime");
+ if (min_pref) {
+ setItem(xpath + "/min-preferred-lifetime", min_pref, SR_UINT32_T);
+ }
+ ConstElementPtr max_pref = elem->get("max-preferred-lifetime");
+ if (max_pref) {
+ setItem(xpath + "/max-preferred-lifetime", max_pref, SR_UINT32_T);
+ }
}
ConstElementPtr valid = elem->get("valid-lifetime");
if (valid) {
setItem(xpath + "/valid-lifetime", valid, SR_UINT32_T);
}
+ ConstElementPtr min_valid = elem->get("min-valid-lifetime");
+ if (min_valid) {
+ setItem(xpath + "/min-valid-lifetime", min_valid, SR_UINT32_T);
+ }
+ ConstElementPtr max_valid = elem->get("max-valid-lifetime");
+ if (max_valid) {
+ setItem(xpath + "/max-valid-lifetime", max_valid, SR_UINT32_T);
+ }
ConstElementPtr renew = elem->get("renew-timer");
if (renew) {
setItem(xpath + "/renew-timer", renew, SR_UINT32_T);
if (rebind) {
setItem(xpath + "/rebind-timer", rebind, SR_UINT32_T);
}
+ ConstElementPtr calculate = elem->get("calculate-tee-times");
+ if (calculate) {
+ setItem(xpath + "/calculate-tee-times", calculate, SR_BOOL_T);
+ }
+ ConstElementPtr t1_percent = elem->get("t1-percent");
+ if (t1_percent) {
+ setItem(xpath + "/t1-percent", t1_percent, SR_DECIMAL64_T);
+ }
+ ConstElementPtr t2_percent = elem->get("t2-percent");
+ if (t2_percent) {
+ setItem(xpath + "/t2-percent", t2_percent, SR_DECIMAL64_T);
+ }
ConstElementPtr options = elem->get("option-data");
if (options && (options->size() > 0)) {
setOptionDataList(xpath, options);
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// "name": <name>,
/// "subnet4": <subnet list>,
/// "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>,
/// "option-data": [ <list of option data> ],
/// "interface": "<interface>",
/// "client-class": "<guard class name>",
/// "name": <name>,
/// "subnet6": <subnet list>,
/// "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>,
/// "option-data": [ <list of option data> ],
/// "interface": "<interface>",
/// "interface-id": "<interface id>",
/// @code
/// +--rw name string
/// +--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 option-data*
/// +--rw interface? string
/// +--rw client-class? string
/// (DHCPv6 only)
/// +--rw subnet6*
/// +--rw preferred-lifetime? uint32
+/// +--rw min-preferred-lifetime? uint32
+/// +--rw max-preferred-lifetime? uint32
/// +--rw interface-id? string
/// +--rw rapid-commit? boolean
/// @endcode
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
if (preferred) {
result->set("preferred-lifetime", preferred);
}
+ ConstElementPtr min_pref = getItem(xpath + "/min-preferred-lifetime");
+ if (min_pref) {
+ result->set("min-preferred-lifetime", min_pref);
+ }
+ ConstElementPtr max_pref = getItem(xpath + "/max-preferred-lifetime");
+ if (max_pref) {
+ result->set("max-preferred-lifetime", max_pref);
+ }
}
ConstElementPtr valid = getItem(xpath + "/valid-lifetime");
if (valid) {
result->set("valid-lifetime", valid);
}
+ ConstElementPtr min_valid = getItem(xpath + "/min-valid-lifetime");
+ if (min_valid) {
+ result->set("min-valid-lifetime", min_valid);
+ }
+ ConstElementPtr max_valid = getItem(xpath + "/max-valid-lifetime");
+ if (max_valid) {
+ result->set("max-valid-lifetime", max_valid);
+ }
ConstElementPtr renew = getItem(xpath + "/renew-timer");
+
if (renew) {
result->set("renew-timer", renew);
}
if (rebind) {
result->set("rebind-timer", rebind);
}
+ ConstElementPtr calculate = getItem(xpath + "/calculate-tee-times");
+ if (calculate) {
+ result->set("calculate-tee-times", calculate);
+ }
+ ConstElementPtr t1_percent = getItem(xpath + "/t1-percent");
+ if (t1_percent) {
+ result->set("t1-percent", t1_percent);
+ }
+ ConstElementPtr t2_percent = getItem(xpath + "/t2-percent");
+ if (t2_percent) {
+ result->set("t2-percent", t2_percent);
+ }
ConstElementPtr options = getOptionDataList(xpath);
if (options && (options->size() > 0)) {
result->set("option-data", options);
if (preferred) {
setItem(xpath + "/preferred-lifetime", preferred, SR_UINT32_T);
}
+ ConstElementPtr min_pref = elem->get("min-preferred-lifetime");
+ if (min_pref) {
+ setItem(xpath + "/min-preferred-lifetime", min_pref, SR_UINT32_T);
+ }
+ ConstElementPtr max_pref = elem->get("max-preferred-lifetime");
+ if (max_pref) {
+ setItem(xpath + "/max-preferred-lifetime", max_pref, SR_UINT32_T);
+ }
}
ConstElementPtr valid = elem->get("valid-lifetime");
if (valid) {
setItem(xpath + "/valid-lifetime", valid, SR_UINT32_T);
}
+ ConstElementPtr min_valid = elem->get("min-valid-lifetime");
+ if (min_valid) {
+ setItem(xpath + "/min-valid-lifetime", min_valid, SR_UINT32_T);
+ }
+ ConstElementPtr max_valid = elem->get("max-valid-lifetime");
+ if (max_valid) {
+ setItem(xpath + "/max-valid-lifetime", max_valid, SR_UINT32_T);
+ }
ConstElementPtr renew = elem->get("renew-timer");
if (renew) {
setItem(xpath + "/renew-timer", renew, SR_UINT32_T);
if (rebind) {
setItem(xpath + "/rebind-timer", rebind, SR_UINT32_T);
}
+ ConstElementPtr calculate = elem->get("calculate-tee-times");
+ if (calculate) {
+ setItem(xpath + "/calculate-tee-times", calculate, SR_BOOL_T);
+ }
+ ConstElementPtr t1_percent = elem->get("t1-percent");
+ if (t1_percent) {
+ setItem(xpath + "/t1-percent", t1_percent, SR_DECIMAL64_T);
+ }
+ ConstElementPtr t2_percent = elem->get("t2-percent");
+ if (t2_percent) {
+ setItem(xpath + "/t2-percent", t2_percent, SR_DECIMAL64_T);
+ }
ConstElementPtr options = elem->get("option-data");
if (options && (options->size() > 0)) {
setOptionDataList(xpath, options);
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @code
/// {
/// "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>,
/// "option-data": [ <list of option data> ],
/// "pools": [ <list of pools> ],
/// "subnet": "<subnet prefix>",
/// @code
/// {
/// "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>,
/// "option-data": [ <list of option data> ],
/// "pools": [ <list of pools> ],
/// "pd-pools": [ <list of prefix delegation pools> ],
/// YANG syntax for kea-dhcp[46]-server is with id as the key:
/// @code
/// +--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 option-data*
/// +--rw pool*
/// +--rw subnet inet:ip-prefix
/// +--rw authoritative? boolean
/// (DHCPv6 only)
/// +--rw preferred-lifetime? uint32
+/// +--rw min-preferred-lifetime? uint32
+/// +--rw max-preferred-lifetime? uint32
/// +--rw pd-pool*
/// +--rw interface-id? string
/// +--rw rapid-commit? boolean
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
- ietf-yang-types
- ietf-interfaces
- kea-types
- - kea-logging
- kea-dhcp-types
Those modules are extracted from the IETF DHCPv6 YANG draft too:
{ "ietf-dhcpv6-types", "2018-09-04" },
{ "ietf-dhcpv6-options", "2018-09-04" },
{ "ietf-dhcpv6-server", "2018-09-04" },
- { "kea-types", "2018-11-20" },
- { "kea-logging", "2018-11-20" },
- { "kea-dhcp-types", "2018-11-20" },
- { "kea-dhcp4-server", "2018-11-20" },
- { "kea-dhcp6-server", "2018-11-20" },
- { "kea-ctrl-agent", "2018-11-20" },
- { "kea-dhcp-ddns", "2018-11-20" }
+ { "kea-types", "2019-08-09" },
+ { "kea-dhcp-types", "2019-08-09" },
+ { "kea-dhcp4-server", "2019-08-09" },
+ { "kea-dhcp6-server", "2019-08-09" },
+ { "kea-ctrl-agent", "2019-08-09" },
+ { "kea-dhcp-ddns", "2019-08-09" }
};
}; // end of namespace isc::yang
yangmodulesdir = ${datarootdir}/${PACKAGE_NAME}/yang/modules
yangmodules_list = ietf-dhcpv6-client@2018-09-04.yang
-yangmodules_list += ietf-interfaces@2014-05-08.yang
+yangmodules_list += ietf-interfaces@2018-02-20.yang
yangmodules_list += ietf-dhcpv6-options@2018-09-04.yang
yangmodules_list += ietf-dhcpv6-relay@2018-09-04.yang
yangmodules_list += ietf-dhcpv6-server@2018-09-04.yang
yangmodules_list += ietf-dhcpv6-types@2018-09-04.yang
yangmodules_list += ietf-inet-types@2013-07-15.yang
yangmodules_list += ietf-yang-types@2013-07-15.yang
-yangmodules_list += kea-ctrl-agent@2018-11-20.yang
-yangmodules_list += kea-dhcp-ddns@2018-11-20.yang
-yangmodules_list += kea-dhcp-types@2018-11-20.yang
-yangmodules_list += kea-dhcp4-server@2018-11-20.yang
-yangmodules_list += kea-dhcp6-server@2018-11-20.yang
-yangmodules_list += kea-types@2018-11-20.yang
+yangmodules_list += kea-ctrl-agent@2019-08-09.yang
+yangmodules_list += kea-dhcp-ddns@2019-08-09.yang
+yangmodules_list += kea-dhcp-types@2019-08-09.yang
+yangmodules_list += kea-dhcp4-server@2019-08-09.yang
+yangmodules_list += kea-dhcp6-server@2019-08-09.yang
+yangmodules_list += kea-types@2019-08-09.yang
yangmodules_list += keatest-module@2018-11-20.yang
if HAVE_SYSREPO
-bd90f2b341a0f5502231dff061f2c2fc0a52558ad8d9375533c4195719c206fd
+d405e7acd13d6ac6f8acc3192e3462b9c550bd90ea73506a27bb133f91667edb
uses dhcp:max-valid-lifetime;
uses dhcp:renew-timer;
uses dhcp:rebind-timer;
- uses dhcp:decline-probation-period;
uses dhcp:calculate-tee-times;
uses dhcp:t1-percent;
uses dhcp:t2-percent;
+ uses dhcp:decline-probation-period;
uses subnet4-list;
list shared-network {