From 79d0d45ec0c791560e297ca77fc88842b0a33868 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Mon, 12 Aug 2019 17:08:15 +0200 Subject: [823-last-update-yang-models] Updated yang models & code for logger and database syntax updates to come --- src/lib/yang/translator_database.cc | 8 + src/lib/yang/translator_database.h | 2 + src/lib/yang/translator_logger.cc | 11 +- src/lib/yang/translator_logger.h | 4 +- src/lib/yang/yang_revisions.h | 12 +- src/share/yang/modules/Makefile.am | 12 +- .../modules/hashes/kea-ctrl-agent@2019-08-09.hash | 1 - .../modules/hashes/kea-ctrl-agent@2019-08-12.hash | 1 + .../modules/hashes/kea-dhcp-ddns@2019-08-09.hash | 1 - .../modules/hashes/kea-dhcp-ddns@2019-08-12.hash | 1 + .../modules/hashes/kea-dhcp-types@2019-08-09.hash | 1 - .../modules/hashes/kea-dhcp-types@2019-08-12.hash | 1 + .../hashes/kea-dhcp4-server@2019-08-09.hash | 1 - .../hashes/kea-dhcp4-server@2019-08-12.hash | 1 + .../hashes/kea-dhcp6-server@2019-08-09.hash | 1 - .../hashes/kea-dhcp6-server@2019-08-12.hash | 1 + .../yang/modules/hashes/kea-types@2019-08-09.hash | 1 - .../yang/modules/hashes/kea-types@2019-08-12.hash | 1 + .../yang/modules/kea-ctrl-agent@2019-08-09.yang | 78 -- .../yang/modules/kea-ctrl-agent@2019-08-12.yang | 78 ++ .../yang/modules/kea-dhcp-ddns@2019-08-09.yang | 174 ----- .../yang/modules/kea-dhcp-ddns@2019-08-12.yang | 174 +++++ .../yang/modules/kea-dhcp-types@2019-08-09.yang | 833 -------------------- .../yang/modules/kea-dhcp-types@2019-08-12.yang | 837 +++++++++++++++++++++ .../yang/modules/kea-dhcp4-server@2019-08-09.yang | 519 ------------- .../yang/modules/kea-dhcp4-server@2019-08-12.yang | 519 +++++++++++++ .../yang/modules/kea-dhcp6-server@2019-08-09.yang | 622 --------------- .../yang/modules/kea-dhcp6-server@2019-08-12.yang | 622 +++++++++++++++ src/share/yang/modules/kea-types@2019-08-09.yang | 156 ---- src/share/yang/modules/kea-types@2019-08-12.yang | 160 ++++ 30 files changed, 2431 insertions(+), 2402 deletions(-) delete mode 100644 src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-09.hash create mode 100644 src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-12.hash delete mode 100644 src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-09.hash create mode 100644 src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-12.hash delete mode 100644 src/share/yang/modules/hashes/kea-dhcp-types@2019-08-09.hash create mode 100644 src/share/yang/modules/hashes/kea-dhcp-types@2019-08-12.hash delete mode 100644 src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash create mode 100644 src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-12.hash delete mode 100644 src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-09.hash create mode 100644 src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-12.hash delete mode 100644 src/share/yang/modules/hashes/kea-types@2019-08-09.hash create mode 100644 src/share/yang/modules/hashes/kea-types@2019-08-12.hash delete mode 100644 src/share/yang/modules/kea-ctrl-agent@2019-08-09.yang create mode 100644 src/share/yang/modules/kea-ctrl-agent@2019-08-12.yang delete mode 100644 src/share/yang/modules/kea-dhcp-ddns@2019-08-09.yang create mode 100644 src/share/yang/modules/kea-dhcp-ddns@2019-08-12.yang delete mode 100644 src/share/yang/modules/kea-dhcp-types@2019-08-09.yang create mode 100644 src/share/yang/modules/kea-dhcp-types@2019-08-12.yang delete mode 100644 src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang create mode 100644 src/share/yang/modules/kea-dhcp4-server@2019-08-12.yang delete mode 100644 src/share/yang/modules/kea-dhcp6-server@2019-08-09.yang create mode 100644 src/share/yang/modules/kea-dhcp6-server@2019-08-12.yang delete mode 100644 src/share/yang/modules/kea-types@2019-08-09.yang create mode 100644 src/share/yang/modules/kea-types@2019-08-12.yang diff --git a/src/lib/yang/translator_database.cc b/src/lib/yang/translator_database.cc index b12bec4280..3527a79fba 100644 --- a/src/lib/yang/translator_database.cc +++ b/src/lib/yang/translator_database.cc @@ -123,6 +123,10 @@ TranslatorDatabase::getDatabaseKea(const string& xpath) { if (serial_consistency) { result->set("serial-consistency", serial_consistency); } + ConstElementPtr max_row_errors = getItem(xpath + "/max-row-errors"); + if (max_row_errors) { + result->set("max-row-errors", max_row_errors); + } ConstElementPtr context = getItem(xpath + "/user-context"); if (context) { result->set("user-context", Element::fromJSON(context->stringValue())); @@ -237,6 +241,10 @@ TranslatorDatabase::setDatabaseKea(const string& xpath, if (serial_consistency) { setItem(xpath + "/serial-consistency", serial_consistency, SR_STRING_T); } + ConstElementPtr max_row_errors = elem->get("max-row-errors"); + if (max_row_errors) { + setItem(xpath + "/max-row-errors", max_row_errors, SR_UINT32_T); + } ConstElementPtr context = Adaptor::getContext(elem); if (context) { setItem(xpath + "/user-context", Element::create(context->str()), diff --git a/src/lib/yang/translator_database.h b/src/lib/yang/translator_database.h index aa6442c390..5354d77c76 100644 --- a/src/lib/yang/translator_database.h +++ b/src/lib/yang/translator_database.h @@ -37,6 +37,7 @@ namespace yang { /// "tcp-nodelay": , /// "consistency": , /// "serial-consistency": , +/// "max-row-errors": , /// "user-context": { }, /// "comment": /// } @@ -65,6 +66,7 @@ namespace yang { /// +--rw tcp-nodelay? boolean /// +--rw consistency? string /// +--rw serial-consistency? string +/// +--rw max-row-errors? uint32 /// +--rw user-context? string /// @endcode /// diff --git a/src/lib/yang/translator_logger.cc b/src/lib/yang/translator_logger.cc index c0855e9e7f..e4a21d244e 100644 --- a/src/lib/yang/translator_logger.cc +++ b/src/lib/yang/translator_logger.cc @@ -1,4 +1,4 @@ -// 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 @@ -94,6 +94,10 @@ TranslatorLogger::getOutputOption(const string& xpath) { if (flush) { result->set("flush", flush); } + ConstElementPtr pattern = getItem(xpath + "/pattern"); + if (pattern) { + result->set("pattern", pattern); + } return (result); } @@ -176,6 +180,11 @@ TranslatorLogger::setOutputOption(const string& xpath, ConstElementPtr elem) { setItem(xpath + "/flush", flush, SR_BOOL_T); created = true; } + ConstElementPtr pattern = elem->get("pattern"); + if (pattern) { + setItem(xpath + "/pattern", pattern, SR_STRING_T); + created = true; + } // There is no mandatory fields outside the key so force creation. if (!created) { ConstElementPtr list = Element::createList(); diff --git a/src/lib/yang/translator_logger.h b/src/lib/yang/translator_logger.h index fe9fc71c23..a820b1dbdd 100644 --- a/src/lib/yang/translator_logger.h +++ b/src/lib/yang/translator_logger.h @@ -33,7 +33,8 @@ namespace yang { /// "output": , /// "maxver": , /// "maxsize": , -/// "flush": +/// "flush": , +/// "pattern": /// } /// @endcode /// @@ -47,6 +48,7 @@ namespace yang { /// | +--rw maxver? uint32 /// | +--rw maxsize? uint32 /// | +--rw flush? boolean +/// | +--rw pattern? string /// +--rw debuglevel? uint8 /// +--rw severity? enumeration /// +--rw user-context? string diff --git a/src/lib/yang/yang_revisions.h b/src/lib/yang/yang_revisions.h index 2aa6b5d3cf..24526c5ccd 100644 --- a/src/lib/yang/yang_revisions.h +++ b/src/lib/yang/yang_revisions.h @@ -21,12 +21,12 @@ static const std::map YANG_REVISIONS = { { "ietf-dhcpv6-types", "2018-09-04" }, { "ietf-dhcpv6-options", "2018-09-04" }, { "ietf-dhcpv6-server", "2018-09-04" }, - { "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" } + { "kea-types", "2019-08-12" }, + { "kea-dhcp-types", "2019-08-12" }, + { "kea-dhcp4-server", "2019-08-12" }, + { "kea-dhcp6-server", "2019-08-12" }, + { "kea-ctrl-agent", "2019-08-12" }, + { "kea-dhcp-ddns", "2019-08-12" } }; }; // end of namespace isc::yang diff --git a/src/share/yang/modules/Makefile.am b/src/share/yang/modules/Makefile.am index 5ae20063ef..23f000c5d8 100644 --- a/src/share/yang/modules/Makefile.am +++ b/src/share/yang/modules/Makefile.am @@ -10,12 +10,12 @@ 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@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 += kea-ctrl-agent@2019-08-12.yang +yangmodules_list += kea-dhcp-ddns@2019-08-12.yang +yangmodules_list += kea-dhcp-types@2019-08-12.yang +yangmodules_list += kea-dhcp4-server@2019-08-12.yang +yangmodules_list += kea-dhcp6-server@2019-08-12.yang +yangmodules_list += kea-types@2019-08-12.yang yangmodules_list += keatest-module@2018-11-20.yang if HAVE_SYSREPO diff --git a/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-09.hash b/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-09.hash deleted file mode 100644 index 462dd3625d..0000000000 --- a/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-09.hash +++ /dev/null @@ -1 +0,0 @@ -e29c0b34abc0a747e258a30a636b2b53b41bdaaecfc199801221acbddc303ce4 diff --git a/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-12.hash b/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-12.hash new file mode 100644 index 0000000000..bf142b8bb3 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-12.hash @@ -0,0 +1 @@ +5d11568b445edc65a4783f53fe5e8571af9a79b759272d4a3e4bfba994f71087 diff --git a/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-09.hash b/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-09.hash deleted file mode 100644 index c7b557eaa1..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-09.hash +++ /dev/null @@ -1 +0,0 @@ -8aef84678c3520ed4bb4025c5be2053ced2b58bf4d47b21a3e2bf35c40c1e9b9 diff --git a/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-12.hash b/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-12.hash new file mode 100644 index 0000000000..537b73cbf0 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-12.hash @@ -0,0 +1 @@ +230145eb977108912d0015b8fb0d77bd4f53df0f4dfc317329ea5892569a7ba8 diff --git a/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-09.hash b/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-09.hash deleted file mode 100644 index c5a96d0b97..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-09.hash +++ /dev/null @@ -1 +0,0 @@ -d9a216058f557cb379da3022f74fee56fbd1fb60828e8c5791fbbf8b5ed9cb57 diff --git a/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-12.hash b/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-12.hash new file mode 100644 index 0000000000..fdea156205 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-12.hash @@ -0,0 +1 @@ +96c6a37dc93701ddd5a41ab0196fdbefeafba8c2d2a0503a05f34dcfd9accc3a diff --git a/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash b/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash deleted file mode 100644 index 29d94830ff..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash +++ /dev/null @@ -1 +0,0 @@ -d405e7acd13d6ac6f8acc3192e3462b9c550bd90ea73506a27bb133f91667edb diff --git a/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-12.hash b/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-12.hash new file mode 100644 index 0000000000..3a5f1318f1 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-12.hash @@ -0,0 +1 @@ +23762bc4dbd25cbd49b8c5e9c27c0eb4a627327b26d1a339ed0022d9708dc8c8 diff --git a/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-09.hash b/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-09.hash deleted file mode 100644 index f6be616a0d..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-09.hash +++ /dev/null @@ -1 +0,0 @@ -e73af99c9b7e6bb865bc9b3df4f04ae3de5d472c8bba8dbc1b9bbda90e1383b1 diff --git a/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-12.hash b/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-12.hash new file mode 100644 index 0000000000..6e3ca75aa2 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-12.hash @@ -0,0 +1 @@ +cae7d4516cb6485c76ebce01dcfdb846f4b7470d932615df7e1f2eae8fa9d4f7 diff --git a/src/share/yang/modules/hashes/kea-types@2019-08-09.hash b/src/share/yang/modules/hashes/kea-types@2019-08-09.hash deleted file mode 100644 index f7dad34528..0000000000 --- a/src/share/yang/modules/hashes/kea-types@2019-08-09.hash +++ /dev/null @@ -1 +0,0 @@ -04a8d8a75027d109ae85fd6bea368d15056dc4a64fb75cb4da9be62c1dca1d98 diff --git a/src/share/yang/modules/hashes/kea-types@2019-08-12.hash b/src/share/yang/modules/hashes/kea-types@2019-08-12.hash new file mode 100644 index 0000000000..546d6701d7 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-types@2019-08-12.hash @@ -0,0 +1 @@ +a2c7883852f3649b8d1df213f19a0d007d1652a8bc1b7262d98095905e1ae1e9 diff --git a/src/share/yang/modules/kea-ctrl-agent@2019-08-09.yang b/src/share/yang/modules/kea-ctrl-agent@2019-08-09.yang deleted file mode 100644 index f6e2e9e5e0..0000000000 --- a/src/share/yang/modules/kea-ctrl-agent@2019-08-09.yang +++ /dev/null @@ -1,78 +0,0 @@ -module kea-ctrl-agent { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:kea-ctrl-agent"; - prefix "kea-ctrl-agent"; - - import ietf-inet-types { - prefix inet; - } - import kea-types { - prefix kea; - revision-date 2019-08-09; - } - - organization "Internet Systems Consortium"; - contact "kea-dev@lists.isc.org"; - description "This model defines a YANG data model that can be - used to configure and manage a Kea control agent."; - - revision 2019-08-09 { - description "Initial revision"; - reference ""; - } - - /* - * Data Nodes - */ - - container config { - // config true; - description "Contains control agent configuration."; - - leaf http-host { - type inet:ip-address; - description "IP address to which HTTP service will be bound."; - } - - leaf http-port { - type uint16; - description "Port to which HTTP service will be bound."; - } - - container control-sockets { - description "Control sockets."; - list socket { - key server-type; - description "List of server control socket."; - leaf server-type { - type enumeration { - enum "dhcp4" { - description "kea-dhcp4 server"; - } - enum "dhcp6" { - description "kea-dhcp6 server"; - } - enum "d2" { - description "kea-dhcp-ddns server"; - } - } - mandatory true; - description "Server type."; - } - container control-socket { - description "Control socket information."; - uses kea:control-socket-info; - } - } - } - - uses kea:hooks-libraries; - - leaf user-context { - type kea:user-context; - description "Control agent user context."; - } - - uses kea:loggers; - } -} diff --git a/src/share/yang/modules/kea-ctrl-agent@2019-08-12.yang b/src/share/yang/modules/kea-ctrl-agent@2019-08-12.yang new file mode 100644 index 0000000000..ff25896d07 --- /dev/null +++ b/src/share/yang/modules/kea-ctrl-agent@2019-08-12.yang @@ -0,0 +1,78 @@ +module kea-ctrl-agent { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:kea-ctrl-agent"; + prefix "kea-ctrl-agent"; + + import ietf-inet-types { + prefix inet; + } + import kea-types { + prefix kea; + revision-date 2019-08-12; + } + + organization "Internet Systems Consortium"; + contact "kea-dev@lists.isc.org"; + description "This model defines a YANG data model that can be + used to configure and manage a Kea control agent."; + + revision 2019-08-12 { + description "Initial revision"; + reference ""; + } + + /* + * Data Nodes + */ + + container config { + // config true; + description "Contains control agent configuration."; + + leaf http-host { + type inet:ip-address; + description "IP address to which HTTP service will be bound."; + } + + leaf http-port { + type uint16; + description "Port to which HTTP service will be bound."; + } + + container control-sockets { + description "Control sockets."; + list socket { + key server-type; + description "List of server control socket."; + leaf server-type { + type enumeration { + enum "dhcp4" { + description "kea-dhcp4 server"; + } + enum "dhcp6" { + description "kea-dhcp6 server"; + } + enum "d2" { + description "kea-dhcp-ddns server"; + } + } + mandatory true; + description "Server type."; + } + container control-socket { + description "Control socket information."; + uses kea:control-socket-info; + } + } + } + + uses kea:hooks-libraries; + + leaf user-context { + type kea:user-context; + description "Control agent user context."; + } + + uses kea:loggers; + } +} diff --git a/src/share/yang/modules/kea-dhcp-ddns@2019-08-09.yang b/src/share/yang/modules/kea-dhcp-ddns@2019-08-09.yang deleted file mode 100644 index 6749972d32..0000000000 --- a/src/share/yang/modules/kea-dhcp-ddns@2019-08-09.yang +++ /dev/null @@ -1,174 +0,0 @@ -module kea-dhcp-ddns { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:kea-dhcp-ddns"; - prefix "kea-dhcp-ddns"; - - import ietf-inet-types { - prefix inet; - } - import kea-types { - prefix kea; - revision-date 2019-08-09; - } - - organization "Internet Systems Consortium"; - contact "kea-dev@lists.isc.org"; - description "This model defines a YANG data model that can be - used to configure and manage a Kea DHCP-DDNS server."; - - revision 2019-08-09 { - description "Initial revision"; - reference ""; - } - - /* - * Groupings - */ - - grouping managed-domains { - description "Contains parameters for forward or reverse DDNS managed - domains."; - - container ddns-domains { - description "DDNS domains."; - list ddns-domain { - key name; - description "List of DDNS domains."; - leaf name { - type string; - mandatory true; - description "DDNS domain name."; - } - leaf key-name { - type string; - description "TSIG key to use. Blank means no TSIG."; - } - container dns-servers { - description "DNS servers."; - list server { - key ip-address; - description "List of DNS servers."; - leaf hostname { - type string; - description "DNS server hostname."; - } - leaf ip-address { - type inet:ip-address; - mandatory true; - description "DNS server IP address."; - } - leaf port { - type uint16; - description "DNS server port."; - } - leaf user-context { - type kea:user-context; - description "DNS server user context."; - } - } - } - leaf user-context { - type kea:user-context; - description "DDNS domain user context."; - } - } - } - } - - /* - * Data Nodes - */ - - container config { - // config true; - description "Contains DHCP-DDNS server configuration."; - - leaf ip-address { - type inet:ip-address; - description "IP address on which the server listens for requests."; - } - - leaf port { - type uint16; - description "Port on which the server listens for requests."; - } - - leaf dns-server-timeout { - type uint32; - units "milliseconds"; - description "Maximum amount of time that the server will wait for - a response from a DNS server to a single DNS update message."; - } - - leaf ncr-protocol { - type enumeration { - enum "UDP" { - description "UDP transport"; - } - enum "TCP" { - description "TCP transport"; - } - } - description "Protocol to use when sending requests to the server."; - } - - leaf ncr-format { - type enumeration { - enum "JSON" { - description "JSON format"; - } - } - description "Packet format to use when sending requests to the server."; - } - - uses kea:control-socket; - - container forward-ddns { - description "Forward DNS zones."; - uses managed-domains; - } - - container reverse-ddns { - description "Reverse DNS zones."; - uses managed-domains; - } - - container tsig-keys { - description "Keys to use with TSIG."; - list key { - key name; - description "List of TSIG keys."; - leaf name { - type string; - mandatory true; - description "Key name."; - } - leaf algorithm { - type string; - mandatory true; - description "Hashing algorithm to use with the key."; - } - leaf digest-bits { - type uint16; - units "bits"; - description "Minimum truncated length. 0 means no truncation."; - } - leaf secret { - type string; - mandatory true; - description "Shared secret for the key."; - } - leaf user-context { - type kea:user-context; - description "Key user context."; - } - } - } - leaf user-context { - type kea:user-context; - description "DHCP-DDNS server user context."; - } - - uses kea:loggers; - } -} diff --git a/src/share/yang/modules/kea-dhcp-ddns@2019-08-12.yang b/src/share/yang/modules/kea-dhcp-ddns@2019-08-12.yang new file mode 100644 index 0000000000..fdffc1560f --- /dev/null +++ b/src/share/yang/modules/kea-dhcp-ddns@2019-08-12.yang @@ -0,0 +1,174 @@ +module kea-dhcp-ddns { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:kea-dhcp-ddns"; + prefix "kea-dhcp-ddns"; + + import ietf-inet-types { + prefix inet; + } + import kea-types { + prefix kea; + revision-date 2019-08-12; + } + + organization "Internet Systems Consortium"; + contact "kea-dev@lists.isc.org"; + description "This model defines a YANG data model that can be + used to configure and manage a Kea DHCP-DDNS server."; + + revision 2019-08-12 { + description "Initial revision"; + reference ""; + } + + /* + * Groupings + */ + + grouping managed-domains { + description "Contains parameters for forward or reverse DDNS managed + domains."; + + container ddns-domains { + description "DDNS domains."; + list ddns-domain { + key name; + description "List of DDNS domains."; + leaf name { + type string; + mandatory true; + description "DDNS domain name."; + } + leaf key-name { + type string; + description "TSIG key to use. Blank means no TSIG."; + } + container dns-servers { + description "DNS servers."; + list server { + key ip-address; + description "List of DNS servers."; + leaf hostname { + type string; + description "DNS server hostname."; + } + leaf ip-address { + type inet:ip-address; + mandatory true; + description "DNS server IP address."; + } + leaf port { + type uint16; + description "DNS server port."; + } + leaf user-context { + type kea:user-context; + description "DNS server user context."; + } + } + } + leaf user-context { + type kea:user-context; + description "DDNS domain user context."; + } + } + } + } + + /* + * Data Nodes + */ + + container config { + // config true; + description "Contains DHCP-DDNS server configuration."; + + leaf ip-address { + type inet:ip-address; + description "IP address on which the server listens for requests."; + } + + leaf port { + type uint16; + description "Port on which the server listens for requests."; + } + + leaf dns-server-timeout { + type uint32; + units "milliseconds"; + description "Maximum amount of time that the server will wait for + a response from a DNS server to a single DNS update message."; + } + + leaf ncr-protocol { + type enumeration { + enum "UDP" { + description "UDP transport"; + } + enum "TCP" { + description "TCP transport"; + } + } + description "Protocol to use when sending requests to the server."; + } + + leaf ncr-format { + type enumeration { + enum "JSON" { + description "JSON format"; + } + } + description "Packet format to use when sending requests to the server."; + } + + uses kea:control-socket; + + container forward-ddns { + description "Forward DNS zones."; + uses managed-domains; + } + + container reverse-ddns { + description "Reverse DNS zones."; + uses managed-domains; + } + + container tsig-keys { + description "Keys to use with TSIG."; + list key { + key name; + description "List of TSIG keys."; + leaf name { + type string; + mandatory true; + description "Key name."; + } + leaf algorithm { + type string; + mandatory true; + description "Hashing algorithm to use with the key."; + } + leaf digest-bits { + type uint16; + units "bits"; + description "Minimum truncated length. 0 means no truncation."; + } + leaf secret { + type string; + mandatory true; + description "Shared secret for the key."; + } + leaf user-context { + type kea:user-context; + description "Key user context."; + } + } + } + leaf user-context { + type kea:user-context; + description "DHCP-DDNS server user context."; + } + + uses kea:loggers; + } +} diff --git a/src/share/yang/modules/kea-dhcp-types@2019-08-09.yang b/src/share/yang/modules/kea-dhcp-types@2019-08-09.yang deleted file mode 100644 index 5fc5afa363..0000000000 --- a/src/share/yang/modules/kea-dhcp-types@2019-08-09.yang +++ /dev/null @@ -1,833 +0,0 @@ -module kea-dhcp-types { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:kea-dhcp-types"; - prefix "kea-dhcp-types"; - - import ietf-inet-types { - prefix inet; - } - import kea-types { - prefix kea; - revision-date 2019-08-09; - } - - organization "Internet Systems Consortium"; - contact "kea-dev@lists.isc.org"; - description "This file defines some commonly used Kea DHCP types and - groupings."; - revision 2019-08-09 { - description "Initial revision"; - reference ""; - } - - /* - * Typedef - */ - typedef host-reservation-mode { - type enumeration { - enum "disabled" { - description "Host reservation support is disabled."; - } - enum "out-of-pool" { - description "Allows only out of pool host reservations."; - } - enum "all" { - description "Allows both in pool and out of pool host reservations."; - } - enum "global" { - description "Allows only global host reservations."; - } - } - description "Host reservation mode."; - } - - typedef lease-state { - type enumeration { - enum "default" { - description "Active/default"; - } - enum "declined" { - description "Declined"; - } - enum "expired-reclaimed" { - description "Expired-reclaimed"; - } - } - description "Defines state of the lease."; - } - - /* - * Grouping - */ - grouping valid-lifetime { - description "Valid lifetime grouping."; - leaf valid-lifetime { - type uint32; - units "seconds"; - description "Valid lifetime entry."; - } - } - - grouping min-valid-lifetime { - description "Minimum valid lifetime grouping."; - leaf min-valid-lifetime { - type uint32; - units "seconds"; - description "Minimum valid lifetime entry."; - } - } - - grouping max-valid-lifetime { - description "Maximum valid lifetime grouping."; - leaf max-valid-lifetime { - type uint32; - units "seconds"; - description "Maximum valid lifetime entry."; - } - } - - grouping renew-timer { - description "Renew timer grouping."; - leaf renew-timer { - type uint32; - units "seconds"; - description "Renew timer entry."; - } - } - - grouping rebind-timer { - description "Rebind timer grouping."; - leaf rebind-timer { - type uint32; - units "seconds"; - description "Rebind timer entry."; - } - } - - grouping calculate-tee-times { - description "Calculate T1/T2 grouping."; - leaf calculate-tee-times { - type boolean; - description "Calculate T1/T2 entry."; - } - } - - grouping t1-percent { - description "T1 timer grouping."; - leaf t1-percent { - type decimal64 { - fraction-digits 18; - range "0 .. 1"; - } - description "T1 timer entry."; - } - } - - grouping t2-percent { - description "T2 timer grouping."; - leaf t2-percent { - type decimal64 { - fraction-digits 18; - range "0 .. 1"; - } - description "T2 timer entry."; - } - } - - grouping database { - description "Database grouping."; - leaf database-type { - type string; - mandatory true; - description "Database type (e.g. mysql)."; - } - leaf user { - type string; - description "Database user name."; - } - leaf password { - type string; - description "Database user password."; - } - leaf host { - type string; - description "Database host."; - } - leaf name { - type string; - description "Database name."; - } - leaf persist { - type boolean; - description "Write lease to disk file. This parameter applies only to - memfile backend."; - } - leaf port { - type uint16; - description "Database port."; - } - leaf lfc-interval { - type uint32; - units "seconds"; - description "Interval between two lease file cleanups."; - } - leaf readonly { - type boolean; - description "If set to true, the database will be connected in - read-only mode. This does not make sense for lease - databases, only for host reservations and possibly - for upcoming config backend."; - } - leaf connect-timeout { - type uint32; - units "milliseconds"; - description "Database connection timeout."; - } - leaf contact-points { - type string; - description "Cassandra database contact points, a coma separated list of - IP addresses."; - } - leaf keyspace { - type string; - description "Cassandra database keyspace (this is Cassandra's equivalent - of a database name)."; - } - leaf max-reconnect-tries { - type uint32; - description "Maximum of recovery attempts before exit."; - } - leaf reconnect-wait-time { - type uint32; - units "milliseconds"; - description "Waiting delay between two recovery attempts."; - } - leaf request-timeout { - type uint32; - units "milliseconds"; - description "Timeout waiting for a response."; - } - leaf tcp-keepalive { - type uint32; - units "seconds"; - description "TCP keepalive for the database connection."; - } - leaf tcp-nodelay { - type boolean; - description "TCP nodelay for the database connection."; - } - leaf consistency { - type string; - description "Consistency level."; - } - leaf serial-consistency { - type string; - description "Serial consistency level."; - } - uses kea:user-context { - refine user-context { - description "Database user context. Arbitrary JSON data can be - stored here."; - } - } - } - - grouping databases { - description "Databases grouping."; - container lease-database { - presence "Have lease database."; - description "Lease database."; - uses database; - } - list hosts-database { - key database-type; - description "List of databases."; - uses database; - } - } - - grouping expired-leases-processing { - description "Expired leases processing grouping."; - container expired-leases-processing { - description "Expired leases processing setup."; - leaf reclaim-timer-wait-time { - type uint32; - units "seconds"; - description "Interval between reclamation cycles."; - } - leaf flush-reclaimed-timer-wait-time { - type uint32; - units "seconds"; - description "Interval between reclaimed leases collection."; - } - leaf hold-reclaimed-time { - type uint32; - units "seconds"; - description "Hold timer for re-assignment."; - } - leaf max-reclaim-leases { - type uint32; - description "Maximum number of reclaimed leases per cycle."; - } - leaf max-reclaim-time { - type uint32; - units "milliseconds"; - description "Maximum duration of a reclamation cycle."; - } - leaf unwarned-reclaim-cycles { - type uint32; - description "Maximum numbers of uncomplete cycles before warning."; - } - } - } - - grouping hostname-char-set { - description "Hostname character set grouping."; - leaf hostname-char-set { - type string; - description "A regex defining invalid characters. If detected, those - will be replaced by hostname-char-replacement."; - } - } - - grouping hostname-char-replacement { - description "Hostname character replacement grouping."; - leaf hostname-char-replacement { - type string; - description "Replacement for invalid charaters. See - hostname-char-set."; - } - } - - grouping dhcp-ddns { - description "DHCP-DDNS grouping."; - container dhcp-ddns { - description "DHCP-DDNS client setup."; - leaf enable-updates { - type boolean; - description "Enable DHCP-DDNS updates."; - } - leaf qualifying-suffix { - type string; - description "DHCP-DDNS qualifying suffix."; - } - leaf server-ip { - type inet:ip-address; - description "DHCP-DDNS server IP address."; - } - leaf server-port { - type uint16; - description "DHCP-DDNS server port."; - } - leaf sender-ip { - type inet:ip-address; - description "DHCP-DDNS sender IP address."; - } - leaf sender-port { - type uint16; - description "DHCP-DDNS sender port."; - } - leaf max-queue-size { - type uint32; - description "Maximum DHCP-DDNS queue size."; - } - leaf ncr-protocol { - type enumeration { - enum "UDP" { - description "UDP transport"; - } - enum "TCP" { - description "TCP transport"; - } - } - description "Protocol to use for DHCP-DDNS communication. - Currently only UDP is supported."; - } - leaf ncr-format { - type enumeration { - enum "JSON" { - description "JSON format"; - } - } - description "Packet format to use for DHCP-DDNS."; - } - leaf override-no-update { - type boolean; - description "Ignore client request and send update."; - } - leaf override-client-update { - type boolean; - description "Ignore client delegation."; - } - leaf replace-client-name { - type enumeration { - enum "when-present" { - description "When the client sent a name."; - } - enum "never" { - description "Never replace or generate a name."; - } - enum "always" { - description "Always replace or generate a name."; - } - enum "when-not-present" { - description "When the client did not send a name."; - } - } - description "Replace the name provided by the client."; - } - leaf generated-prefix { - type string; - description "DHCP-DDNS generated prefix."; - } - uses hostname-char-set; - uses hostname-char-replacement; - uses kea:user-context { - refine user-context { - description "DHCP-DDNS user context. Arbitrary JSON data can - be stored here."; - } - } - } - } - - grouping sanity-checks { - description "Sanity checks grouping."; - container sanity-checks { - description "Sanity checks container."; - leaf lease-checks { - type enumeration { - enum "none" { - description "No checks."; - } - enum "warn" { - description "When a check fails print a warning and accept the - lease."; - } - enum "fix" { - description "When a check fails try to fix it and accept the - lease."; - } - enum "fix-del" { - description "When a check fails try to fix it and reject the - lease if still bad."; - } - enum "del" { - description "When a check fails reject the lease."; - } - } - description "Lease checks: verify subnet-id consistency on memfile - loading."; - } - } - } - - grouping client-class { - description "Client class grouping."; - leaf client-class { - type string; - description "Client class entry."; - } - } - - grouping pool-client-class { - description "Client class grouping for a pool."; - uses client-class { - refine client-class { - description "Pool client class guard (only clients belonging - to this class will be allowed in this pool)."; - } - } - } - - grouping subnet-client-class { - description "Client class grouping for a subnet."; - uses client-class { - refine client-class { - description "Subnet client class guard (only clients belonging to this - class will be allowed in this subnet)."; - } - } - } - - grouping network-client-class { - description "Client class grouping for a shared network."; - uses client-class { - refine client-class { - description "Shared network client class guard (only clients - belonging to this class will be allowed in this - shared network)."; - } - } - } - - grouping require-client-classes { - description "Require client classes grouping."; - leaf-list require-client-classes { - type string; - description "List of client classes."; - } - } - - grouping pool-require-client-classes { - description "Require client classes grouping for a pool."; - uses require-client-classes { - refine require-client-classes { - description "Pool require client classes."; - } - } - } - - grouping subnet-require-client-classes { - description "Require client classes grouping for a subnet."; - uses require-client-classes { - refine require-client-classes { - description "Subnet require client classes."; - } - } - } - - grouping network-require-client-classes { - description "Require client classes grouping for a shared network."; - uses require-client-classes { - refine require-client-classes { - description "Shared network require client classes."; - } - } - } - - grouping interface { - description "Interface grouping."; - leaf interface { - type string; - description "Interface entry."; - } - } - - grouping subnet-interface { - description "Interface grouping for a subnet."; - uses interface { - refine interface { - description "Name of the network interface this subnet is directly - accessible with (optional)."; - } - } - } - - grouping network-interface { - description "Interface grouping for a shared network."; - uses interface { - refine interface { - description "Specifies the network interface this shared network is - directly accessible with. (optional)"; - } - } - } - - grouping subnet-id { - description "Subnet ID grouping."; - leaf id { - type uint32 { - range 1..max; - } - mandatory true; - description "Subnet ID, a unique identifier used to locate or reference - a subnet."; - } - } - - grouping host-identifier { - description "Host identifier grouping."; - leaf identifier { - type string; - description "Host identifier."; - } - } - - grouping host-hostname { - description "Host DNS name grouping."; - leaf hostname { - type string; - description "Host DNS name."; - } - } - - grouping host-client-classes { - description "Host client classes grouping."; - leaf-list client-classes { - type string; - description "Host client classes (if host identifier matches, a - client's packet will be added to the classes liste - here.)"; - } - } - - grouping host-subnet-id { - description "Host subnet ID grouping."; - leaf subnet-id { - type uint32; - mandatory true; - description "Host subnet ID."; - } - } - - grouping reservation-mode { - description "Reservation mode grouping."; - leaf reservation-mode { - type host-reservation-mode; - description "Reservation mode entry."; - } - } - - grouping interfaces-re-detect { - description "Interfaces re-detect grouping."; - leaf re-detect { - type boolean; - description "Re-detect interfaces at each reconfiguration."; - } - } - - grouping class-name { - description "Client class name grouping."; - leaf name { - type string; - mandatory true; - description "Name of the client class."; - } - } - - grouping class-test { - description "Client class test grouping."; - leaf test { - type string; - description "Defines an expression that evaluates every incoming - packet."; - } - } - - grouping class-only-if-required { - description "Client class only-if-required grouping."; - leaf only-if-required { - type boolean; - description "Client class only if required flag."; - } - } - - grouping option-def-name { - description "Option definition name grouping."; - leaf name { - type string; - mandatory true; - description "Name of the new option being defined."; - } - } - - grouping option-def-type { - description "Option definition type grouping."; - leaf type { - type string; - mandatory true; - description "Type of the new option being defined (such as - string, record or uint8)."; - } - } - - grouping option-def-record-types { - description "Option definition record types grouping."; - leaf record-types { - type string; - description "Option definition record types."; - } - } - - grouping option-def-encapsulate { - description "Option definition encapsulate grouping."; - leaf encapsulate { - type string; - description "Defines option space this new option encapsulates. - Usually empty."; - } - } - - grouping option-data-name { - description "Option data name grouping."; - leaf name { - type string; - description "Option name."; - } - } - - grouping option-data-data { - description "Option data data grouping."; - leaf data { - type string; - description "Option data."; - } - } - - grouping option-data-csv-format { - description "Option data csv-format grouping."; - leaf csv-format { - type boolean; - description "If true, the option is specified as comma separated - values. If false, it is expected as a hex string."; - } - } - - grouping option-data-always-send { - description "Option data always-send grouping."; - leaf always-send { - type boolean; - description "Defines whether to always send the option, - regardless if the client requested it or not."; - } - } - - grouping option-def-array { - description "Option data array grouping."; - leaf array { - type boolean; - description "Option definition array flag."; - } - } - - grouping decline-probation-period { - description "Decline probation period grouping."; - leaf decline-probation-period { - type uint32; - units "seconds"; - description "Decline probabation period."; - } - } - - grouping network-name { - description "Shared network name grouping."; - leaf name { - type string; - mandatory true; - description "Shared network name."; - } - } - - grouping dhcp4o6-port { - description "DHCPv4-over-DHCPv6 port grouping."; - leaf dhcp4o6-port { - type uint16; - description "DHCPv4-over-DHCPv6 interserver port."; - } - } - - grouping pool-user-context { - description "User context grouping for a pool."; - uses kea:user-context { - refine user-context { - description "Pool user context. Arbitrary JSON data can be - stored here."; - } - } - } - - grouping host-user-context { - description "User context grouping for a host reservation."; - uses kea:user-context { - refine user-context { - description "Host user context. Arbitrary JSON data can be - stored here."; - } - } - } - - grouping subnet-user-context { - description "User context grouping for a subnet."; - uses kea:user-context { - refine user-context { - description "Subnet user context. Arbitrary JSON data can be - stored here."; - } - } - } - - grouping network-user-context { - description "User context grouping for a shared network."; - uses kea:user-context { - refine user-context { - description "Shared network user context. Arbitrary JSON data can be - stored here."; - } - } - } - - grouping interfaces-user-context { - description "User context grouping for interfaces."; - uses kea:user-context { - refine user-context { - description "Interfaces user context. Arbitrary JSON data can - be stored here."; - } - } - } - - grouping class-user-context { - description "User context grouping for a client class."; - uses kea:user-context { - refine user-context { - description "Client class user context. Arbitrary JSON data can - be stored here."; - } - } - } - - grouping option-def-user-context { - description "User context grouping for an option definition."; - uses kea:user-context { - refine user-context { - description "Option definition user context. Arbitrary JSON data - can be stored here."; - } - } - } - - grouping option-data-user-context { - description "User context grouping for an option data."; - uses kea:user-context { - refine user-context { - description "Option user context. Arbitrary JSON data can be - stored here."; - } - } - } - - grouping config-control { - description "Config control grouping."; - container config-control { - description "Config control."; - leaf config-fetch-wait-time { - type uint32; - units "seconds"; - description "Configuration fetch wait time entry."; - } - list config-database { - key database-type; - description "List of databases."; - uses database; - } - } - } - - grouping server-tag { - description "Server tag grouping."; - leaf server-tag { - type string; - description "Server tag."; - } - } - - grouping dhcp-queue-control { - description "DHCP queue control grouping."; - leaf dhcp-queue-control { - type string; - description "DHCP queue control (JSON map)."; - } - } - -} diff --git a/src/share/yang/modules/kea-dhcp-types@2019-08-12.yang b/src/share/yang/modules/kea-dhcp-types@2019-08-12.yang new file mode 100644 index 0000000000..9b86ced2a8 --- /dev/null +++ b/src/share/yang/modules/kea-dhcp-types@2019-08-12.yang @@ -0,0 +1,837 @@ +module kea-dhcp-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:kea-dhcp-types"; + prefix "kea-dhcp-types"; + + import ietf-inet-types { + prefix inet; + } + import kea-types { + prefix kea; + revision-date 2019-08-12; + } + + organization "Internet Systems Consortium"; + contact "kea-dev@lists.isc.org"; + description "This file defines some commonly used Kea DHCP types and + groupings."; + revision 2019-08-12 { + description "Initial revision"; + reference ""; + } + + /* + * Typedef + */ + typedef host-reservation-mode { + type enumeration { + enum "disabled" { + description "Host reservation support is disabled."; + } + enum "out-of-pool" { + description "Allows only out of pool host reservations."; + } + enum "all" { + description "Allows both in pool and out of pool host reservations."; + } + enum "global" { + description "Allows only global host reservations."; + } + } + description "Host reservation mode."; + } + + typedef lease-state { + type enumeration { + enum "default" { + description "Active/default"; + } + enum "declined" { + description "Declined"; + } + enum "expired-reclaimed" { + description "Expired-reclaimed"; + } + } + description "Defines state of the lease."; + } + + /* + * Grouping + */ + grouping valid-lifetime { + description "Valid lifetime grouping."; + leaf valid-lifetime { + type uint32; + units "seconds"; + description "Valid lifetime entry."; + } + } + + grouping min-valid-lifetime { + description "Minimum valid lifetime grouping."; + leaf min-valid-lifetime { + type uint32; + units "seconds"; + description "Minimum valid lifetime entry."; + } + } + + grouping max-valid-lifetime { + description "Maximum valid lifetime grouping."; + leaf max-valid-lifetime { + type uint32; + units "seconds"; + description "Maximum valid lifetime entry."; + } + } + + grouping renew-timer { + description "Renew timer grouping."; + leaf renew-timer { + type uint32; + units "seconds"; + description "Renew timer entry."; + } + } + + grouping rebind-timer { + description "Rebind timer grouping."; + leaf rebind-timer { + type uint32; + units "seconds"; + description "Rebind timer entry."; + } + } + + grouping calculate-tee-times { + description "Calculate T1/T2 grouping."; + leaf calculate-tee-times { + type boolean; + description "Calculate T1/T2 entry."; + } + } + + grouping t1-percent { + description "T1 timer grouping."; + leaf t1-percent { + type decimal64 { + fraction-digits 18; + range "0 .. 1"; + } + description "T1 timer entry."; + } + } + + grouping t2-percent { + description "T2 timer grouping."; + leaf t2-percent { + type decimal64 { + fraction-digits 18; + range "0 .. 1"; + } + description "T2 timer entry."; + } + } + + grouping database { + description "Database grouping."; + leaf database-type { + type string; + mandatory true; + description "Database type (e.g. mysql)."; + } + leaf user { + type string; + description "Database user name."; + } + leaf password { + type string; + description "Database user password."; + } + leaf host { + type string; + description "Database host."; + } + leaf name { + type string; + description "Database name."; + } + leaf persist { + type boolean; + description "Write lease to disk file. This parameter applies only to + memfile backend."; + } + leaf port { + type uint16; + description "Database port."; + } + leaf lfc-interval { + type uint32; + units "seconds"; + description "Interval between two lease file cleanups."; + } + leaf readonly { + type boolean; + description "If set to true, the database will be connected in + read-only mode. This does not make sense for lease + databases, only for host reservations and possibly + for upcoming config backend."; + } + leaf connect-timeout { + type uint32; + units "milliseconds"; + description "Database connection timeout."; + } + leaf contact-points { + type string; + description "Cassandra database contact points, a coma separated list of + IP addresses."; + } + leaf keyspace { + type string; + description "Cassandra database keyspace (this is Cassandra's equivalent + of a database name)."; + } + leaf max-reconnect-tries { + type uint32; + description "Maximum of recovery attempts before exit."; + } + leaf reconnect-wait-time { + type uint32; + units "milliseconds"; + description "Waiting delay between two recovery attempts."; + } + leaf request-timeout { + type uint32; + units "milliseconds"; + description "Timeout waiting for a response."; + } + leaf tcp-keepalive { + type uint32; + units "seconds"; + description "TCP keepalive for the database connection."; + } + leaf tcp-nodelay { + type boolean; + description "TCP nodelay for the database connection."; + } + leaf consistency { + type string; + description "Consistency level."; + } + leaf serial-consistency { + type string; + description "Serial consistency level."; + } + leaf max-row-errors { + type uint32; + description "Maximum row errors (0 means unlimited)."; + } + uses kea:user-context { + refine user-context { + description "Database user context. Arbitrary JSON data can be + stored here."; + } + } + } + + grouping databases { + description "Databases grouping."; + container lease-database { + presence "Have lease database."; + description "Lease database."; + uses database; + } + list hosts-database { + key database-type; + description "List of databases."; + uses database; + } + } + + grouping expired-leases-processing { + description "Expired leases processing grouping."; + container expired-leases-processing { + description "Expired leases processing setup."; + leaf reclaim-timer-wait-time { + type uint32; + units "seconds"; + description "Interval between reclamation cycles."; + } + leaf flush-reclaimed-timer-wait-time { + type uint32; + units "seconds"; + description "Interval between reclaimed leases collection."; + } + leaf hold-reclaimed-time { + type uint32; + units "seconds"; + description "Hold timer for re-assignment."; + } + leaf max-reclaim-leases { + type uint32; + description "Maximum number of reclaimed leases per cycle."; + } + leaf max-reclaim-time { + type uint32; + units "milliseconds"; + description "Maximum duration of a reclamation cycle."; + } + leaf unwarned-reclaim-cycles { + type uint32; + description "Maximum numbers of uncomplete cycles before warning."; + } + } + } + + grouping hostname-char-set { + description "Hostname character set grouping."; + leaf hostname-char-set { + type string; + description "A regex defining invalid characters. If detected, those + will be replaced by hostname-char-replacement."; + } + } + + grouping hostname-char-replacement { + description "Hostname character replacement grouping."; + leaf hostname-char-replacement { + type string; + description "Replacement for invalid charaters. See + hostname-char-set."; + } + } + + grouping dhcp-ddns { + description "DHCP-DDNS grouping."; + container dhcp-ddns { + description "DHCP-DDNS client setup."; + leaf enable-updates { + type boolean; + description "Enable DHCP-DDNS updates."; + } + leaf qualifying-suffix { + type string; + description "DHCP-DDNS qualifying suffix."; + } + leaf server-ip { + type inet:ip-address; + description "DHCP-DDNS server IP address."; + } + leaf server-port { + type uint16; + description "DHCP-DDNS server port."; + } + leaf sender-ip { + type inet:ip-address; + description "DHCP-DDNS sender IP address."; + } + leaf sender-port { + type uint16; + description "DHCP-DDNS sender port."; + } + leaf max-queue-size { + type uint32; + description "Maximum DHCP-DDNS queue size."; + } + leaf ncr-protocol { + type enumeration { + enum "UDP" { + description "UDP transport"; + } + enum "TCP" { + description "TCP transport"; + } + } + description "Protocol to use for DHCP-DDNS communication. + Currently only UDP is supported."; + } + leaf ncr-format { + type enumeration { + enum "JSON" { + description "JSON format"; + } + } + description "Packet format to use for DHCP-DDNS."; + } + leaf override-no-update { + type boolean; + description "Ignore client request and send update."; + } + leaf override-client-update { + type boolean; + description "Ignore client delegation."; + } + leaf replace-client-name { + type enumeration { + enum "when-present" { + description "When the client sent a name."; + } + enum "never" { + description "Never replace or generate a name."; + } + enum "always" { + description "Always replace or generate a name."; + } + enum "when-not-present" { + description "When the client did not send a name."; + } + } + description "Replace the name provided by the client."; + } + leaf generated-prefix { + type string; + description "DHCP-DDNS generated prefix."; + } + uses hostname-char-set; + uses hostname-char-replacement; + uses kea:user-context { + refine user-context { + description "DHCP-DDNS user context. Arbitrary JSON data can + be stored here."; + } + } + } + } + + grouping sanity-checks { + description "Sanity checks grouping."; + container sanity-checks { + description "Sanity checks container."; + leaf lease-checks { + type enumeration { + enum "none" { + description "No checks."; + } + enum "warn" { + description "When a check fails print a warning and accept the + lease."; + } + enum "fix" { + description "When a check fails try to fix it and accept the + lease."; + } + enum "fix-del" { + description "When a check fails try to fix it and reject the + lease if still bad."; + } + enum "del" { + description "When a check fails reject the lease."; + } + } + description "Lease checks: verify subnet-id consistency on memfile + loading."; + } + } + } + + grouping client-class { + description "Client class grouping."; + leaf client-class { + type string; + description "Client class entry."; + } + } + + grouping pool-client-class { + description "Client class grouping for a pool."; + uses client-class { + refine client-class { + description "Pool client class guard (only clients belonging + to this class will be allowed in this pool)."; + } + } + } + + grouping subnet-client-class { + description "Client class grouping for a subnet."; + uses client-class { + refine client-class { + description "Subnet client class guard (only clients belonging to this + class will be allowed in this subnet)."; + } + } + } + + grouping network-client-class { + description "Client class grouping for a shared network."; + uses client-class { + refine client-class { + description "Shared network client class guard (only clients + belonging to this class will be allowed in this + shared network)."; + } + } + } + + grouping require-client-classes { + description "Require client classes grouping."; + leaf-list require-client-classes { + type string; + description "List of client classes."; + } + } + + grouping pool-require-client-classes { + description "Require client classes grouping for a pool."; + uses require-client-classes { + refine require-client-classes { + description "Pool require client classes."; + } + } + } + + grouping subnet-require-client-classes { + description "Require client classes grouping for a subnet."; + uses require-client-classes { + refine require-client-classes { + description "Subnet require client classes."; + } + } + } + + grouping network-require-client-classes { + description "Require client classes grouping for a shared network."; + uses require-client-classes { + refine require-client-classes { + description "Shared network require client classes."; + } + } + } + + grouping interface { + description "Interface grouping."; + leaf interface { + type string; + description "Interface entry."; + } + } + + grouping subnet-interface { + description "Interface grouping for a subnet."; + uses interface { + refine interface { + description "Name of the network interface this subnet is directly + accessible with (optional)."; + } + } + } + + grouping network-interface { + description "Interface grouping for a shared network."; + uses interface { + refine interface { + description "Specifies the network interface this shared network is + directly accessible with. (optional)"; + } + } + } + + grouping subnet-id { + description "Subnet ID grouping."; + leaf id { + type uint32 { + range 1..max; + } + mandatory true; + description "Subnet ID, a unique identifier used to locate or reference + a subnet."; + } + } + + grouping host-identifier { + description "Host identifier grouping."; + leaf identifier { + type string; + description "Host identifier."; + } + } + + grouping host-hostname { + description "Host DNS name grouping."; + leaf hostname { + type string; + description "Host DNS name."; + } + } + + grouping host-client-classes { + description "Host client classes grouping."; + leaf-list client-classes { + type string; + description "Host client classes (if host identifier matches, a + client's packet will be added to the classes liste + here.)"; + } + } + + grouping host-subnet-id { + description "Host subnet ID grouping."; + leaf subnet-id { + type uint32; + mandatory true; + description "Host subnet ID."; + } + } + + grouping reservation-mode { + description "Reservation mode grouping."; + leaf reservation-mode { + type host-reservation-mode; + description "Reservation mode entry."; + } + } + + grouping interfaces-re-detect { + description "Interfaces re-detect grouping."; + leaf re-detect { + type boolean; + description "Re-detect interfaces at each reconfiguration."; + } + } + + grouping class-name { + description "Client class name grouping."; + leaf name { + type string; + mandatory true; + description "Name of the client class."; + } + } + + grouping class-test { + description "Client class test grouping."; + leaf test { + type string; + description "Defines an expression that evaluates every incoming + packet."; + } + } + + grouping class-only-if-required { + description "Client class only-if-required grouping."; + leaf only-if-required { + type boolean; + description "Client class only if required flag."; + } + } + + grouping option-def-name { + description "Option definition name grouping."; + leaf name { + type string; + mandatory true; + description "Name of the new option being defined."; + } + } + + grouping option-def-type { + description "Option definition type grouping."; + leaf type { + type string; + mandatory true; + description "Type of the new option being defined (such as + string, record or uint8)."; + } + } + + grouping option-def-record-types { + description "Option definition record types grouping."; + leaf record-types { + type string; + description "Option definition record types."; + } + } + + grouping option-def-encapsulate { + description "Option definition encapsulate grouping."; + leaf encapsulate { + type string; + description "Defines option space this new option encapsulates. + Usually empty."; + } + } + + grouping option-data-name { + description "Option data name grouping."; + leaf name { + type string; + description "Option name."; + } + } + + grouping option-data-data { + description "Option data data grouping."; + leaf data { + type string; + description "Option data."; + } + } + + grouping option-data-csv-format { + description "Option data csv-format grouping."; + leaf csv-format { + type boolean; + description "If true, the option is specified as comma separated + values. If false, it is expected as a hex string."; + } + } + + grouping option-data-always-send { + description "Option data always-send grouping."; + leaf always-send { + type boolean; + description "Defines whether to always send the option, + regardless if the client requested it or not."; + } + } + + grouping option-def-array { + description "Option data array grouping."; + leaf array { + type boolean; + description "Option definition array flag."; + } + } + + grouping decline-probation-period { + description "Decline probation period grouping."; + leaf decline-probation-period { + type uint32; + units "seconds"; + description "Decline probabation period."; + } + } + + grouping network-name { + description "Shared network name grouping."; + leaf name { + type string; + mandatory true; + description "Shared network name."; + } + } + + grouping dhcp4o6-port { + description "DHCPv4-over-DHCPv6 port grouping."; + leaf dhcp4o6-port { + type uint16; + description "DHCPv4-over-DHCPv6 interserver port."; + } + } + + grouping pool-user-context { + description "User context grouping for a pool."; + uses kea:user-context { + refine user-context { + description "Pool user context. Arbitrary JSON data can be + stored here."; + } + } + } + + grouping host-user-context { + description "User context grouping for a host reservation."; + uses kea:user-context { + refine user-context { + description "Host user context. Arbitrary JSON data can be + stored here."; + } + } + } + + grouping subnet-user-context { + description "User context grouping for a subnet."; + uses kea:user-context { + refine user-context { + description "Subnet user context. Arbitrary JSON data can be + stored here."; + } + } + } + + grouping network-user-context { + description "User context grouping for a shared network."; + uses kea:user-context { + refine user-context { + description "Shared network user context. Arbitrary JSON data can be + stored here."; + } + } + } + + grouping interfaces-user-context { + description "User context grouping for interfaces."; + uses kea:user-context { + refine user-context { + description "Interfaces user context. Arbitrary JSON data can + be stored here."; + } + } + } + + grouping class-user-context { + description "User context grouping for a client class."; + uses kea:user-context { + refine user-context { + description "Client class user context. Arbitrary JSON data can + be stored here."; + } + } + } + + grouping option-def-user-context { + description "User context grouping for an option definition."; + uses kea:user-context { + refine user-context { + description "Option definition user context. Arbitrary JSON data + can be stored here."; + } + } + } + + grouping option-data-user-context { + description "User context grouping for an option data."; + uses kea:user-context { + refine user-context { + description "Option user context. Arbitrary JSON data can be + stored here."; + } + } + } + + grouping config-control { + description "Config control grouping."; + container config-control { + description "Config control."; + leaf config-fetch-wait-time { + type uint32; + units "seconds"; + description "Configuration fetch wait time entry."; + } + list config-database { + key database-type; + description "List of databases."; + uses database; + } + } + } + + grouping server-tag { + description "Server tag grouping."; + leaf server-tag { + type string; + description "Server tag."; + } + } + + grouping dhcp-queue-control { + description "DHCP queue control grouping."; + leaf dhcp-queue-control { + type string; + description "DHCP queue control (JSON map)."; + } + } + +} diff --git a/src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang b/src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang deleted file mode 100644 index 7ec16607fc..0000000000 --- a/src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang +++ /dev/null @@ -1,519 +0,0 @@ -module kea-dhcp4-server { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:kea-dhcp4-server"; - prefix "kea-dhcp4-server"; - - import ietf-inet-types { - prefix inet; - } - import kea-types { - prefix kea; - revision-date 2019-08-09; - } - import kea-dhcp-types { - prefix dhcp; - revision-date 2019-08-09; - } - - organization "Internet Systems Consortium"; - contact "kea-dev@lists.isc.org"; - description "This model defines a YANG data model that can be - used to configure and manage a Kea DHCPv4 server."; - - revision 2019-08-09 { - description "Initial revision"; - reference ""; - } - - /* - * Typedefs - */ - typedef host-identifier-type { - type enumeration { - enum "duid" { - description "DUID"; - } - enum "hw-address" { - description "Hardware address"; - } - enum "circuit-id" { - description "Circuit-id option"; - } - enum "client-id" { - description "Client identifier"; - } - enum "flex-id" { - description "Flexible identifier"; - } - } - description "Host identifier type."; - } - - /* - * Groupings - */ - grouping match-client-id { - description "Match client ID grouping."; - leaf match-client-id { - type boolean; - description "Use client-id for lease lookups. If set to false, client-id - will be ignored."; - } - } - - grouping next-server { - description "Next server address grouping."; - leaf next-server { - type inet:ipv4-address; - description "Next server IPv4 address. If set, this value will be set - in siaddr field."; - } - } - - grouping server-hostname { - description "Server hostname grouping."; - leaf server-hostname { - type string; - description "Server hostname (up to 64 bytes)."; - } - } - - grouping boot-file-name { - description "Boot file name grouping."; - leaf boot-file-name { - type string; - description "Boot file name (up to 128 bytes)."; - } - } - - grouping authoritative { - description "Authoritative grouping."; - leaf authoritative { - type boolean; - description "NAK requests for unknown clients. If set to false - ignore them."; - } - } - - grouping relay { - description "Relay grouping."; - leaf-list ip-addresses { - type inet:ipv4-address; - description "IPv4 addresses."; - } - } - - grouping host { - description "Host grouping."; - leaf identifier-type { - type host-identifier-type; - mandatory true; - description "Host identifier type."; - } - uses dhcp:host-identifier; - leaf ip-address { - type inet:ipv4-address; - description "Host reserved IPv4 address."; - } - uses dhcp:host-hostname; - uses dhcp:host-client-classes; - uses option-data-list; - uses next-server; - uses server-hostname; - uses boot-file-name; - uses dhcp:host-user-context; - } - - grouping reservations { - description "Host reservations grouping."; - list host { - key "identifier-type identifier"; - description "Host reservation list."; - uses host; - } - } - - grouping subnet4-list { - description "Subnet4 list grouping."; - list subnet4 { - key id; - ordered-by user; - description "List of IPv4 subnets."; - uses dhcp:valid-lifetime; - uses dhcp:min-valid-lifetime; - uses dhcp:max-valid-lifetime; - uses dhcp:renew-timer; - uses dhcp:rebind-timer; - uses dhcp:calculate-tee-times; - uses dhcp:t1-percent; - uses dhcp:t2-percent; - uses option-data-list; - list pool { - key "start-address end-address"; - ordered-by user; - description "Pool list."; - leaf prefix { - type inet:ipv4-prefix; - description "Defines a pool of dynamic IPv4 addresses to be managed - by the server."; - } - leaf start-address { - type inet:ipv4-address; - mandatory true; - description "First IPv4 address in a pool."; - } - leaf end-address { - type inet:ipv4-address; - mandatory true; - description "Last IPv4 address in a pool."; - } - uses option-data-list; - uses dhcp:pool-client-class; - uses dhcp:pool-require-client-classes; - uses dhcp:pool-user-context; - } - leaf subnet { - type inet:ipv4-prefix; - mandatory true; - description "IPv4 subnet prefix."; - } - uses dhcp:subnet-interface; - uses dhcp:subnet-id; - uses dhcp:subnet-client-class; - uses dhcp:subnet-require-client-classes; - uses reservations { - refine host { - description "Subnet host reservations list."; - } - } - uses dhcp:reservation-mode; - container relay { - description "Optional information about relay agent."; - uses relay; - } - uses match-client-id; - uses next-server; - uses server-hostname; - uses boot-file-name; - leaf subnet-4o6-interface { - type string; - description "Subnet DHCPv4-over-DHCPv6 interface."; - } - leaf subnet-4o6-interface-id { - type string; - description "Subnet DHCPv4-over-DHCPv6 interface-id option."; - } - leaf subnet-4o6-subnet { - type inet:ipv6-prefix; - description "Subnet DHCPv4-over-DHCPv6 IPv6 prefix."; - } - uses authoritative; - uses dhcp:subnet-user-context; - } - } - - grouping client-classes { - description "Client class grouping."; - list client-class { - key name; - ordered-by user; - description "List of client classes."; - uses dhcp:class-name; - uses dhcp:class-test; - uses dhcp:class-only-if-required; - uses option-def-list; - uses option-data-list; - uses next-server; - uses server-hostname; - uses boot-file-name; - uses dhcp:class-user-context; - } - } - - grouping option-def-list { - description "Option definition list grouping."; - list option-def { - key "code space"; - description "Option definition entry."; - leaf code { - type uint8; - mandatory true; - description "Option code to be used by the new option definition."; - } - leaf space { - type string; - mandatory true; - description "Option space for the new option (typically dhcp4)."; - } - uses dhcp:option-def-name; - uses dhcp:option-def-type; - uses dhcp:option-def-record-types; - uses dhcp:option-def-encapsulate; - uses dhcp:option-def-array; - uses dhcp:option-def-user-context; - } - } - - grouping option-data-list { - description "Option data list grouping."; - list option-data { - key "code space"; - description "Option data entry."; - leaf code { - type uint8; - mandatory true; - description "Option code."; - } - leaf space { - type string; - mandatory true; - description "Option space."; - } - uses dhcp:option-data-name; - uses dhcp:option-data-data; - uses dhcp:option-data-csv-format; - uses dhcp:option-data-always-send; - uses dhcp:option-data-user-context; - } - } - - /* - * Data Nodes - */ - - container config { - // config true; - description "Contains DHCPv4 server configuration."; - - uses dhcp:valid-lifetime; - uses dhcp:min-valid-lifetime; - uses dhcp:max-valid-lifetime; - uses dhcp:renew-timer; - uses dhcp:rebind-timer; - uses dhcp:calculate-tee-times; - uses dhcp:t1-percent; - uses dhcp:t2-percent; - uses dhcp:decline-probation-period; - uses subnet4-list; - - list shared-network { - key name; - description "List of IPv4 shared networks."; - uses dhcp:network-name; - uses subnet4-list; - uses dhcp:network-interface; - uses dhcp:renew-timer; - uses dhcp:rebind-timer; - uses option-data-list; - uses match-client-id; - uses next-server; - uses server-hostname; - uses boot-file-name; - container relay { - description "Optional information about relay agent."; - uses relay; - } - uses authoritative; - uses dhcp:reservation-mode; - uses dhcp:network-client-class; - uses dhcp:network-require-client-classes; - uses dhcp:valid-lifetime; - uses dhcp:min-valid-lifetime; - uses dhcp:max-valid-lifetime; - uses dhcp:calculate-tee-times; - uses dhcp:t1-percent; - uses dhcp:t2-percent; - uses dhcp:network-user-context; - } - - container interfaces-config { - description "Network interfaces configuration."; - leaf-list interfaces { - type string; - description "Name of the interface (e.g. eth0) or name/address - (e.g. eth0/192.168.1.1) or * (use all interfaces)."; - } - leaf dhcp-socket-type { - type enumeration { - enum "raw" { - description "DHCP service uses RAW sockets."; - } - enum "udp" { - description "DHCP service uses UDP sockets."; - } - } - description "Type of sockets to use."; - } - leaf outbound-interface { - type enumeration { - enum "same-as-inbound" { - description "Send the response on the interface where the query - was received."; - } - enum "use-routing" { - description "Use kernel routing."; - } - } - description "Control the interface used to send a response."; - } - uses dhcp:interfaces-re-detect; - uses dhcp:interfaces-user-context; - } - - uses dhcp:databases; - - leaf-list host-reservation-identifiers { - type host-identifier-type; - description "Host reservation identifiers."; - } - - uses client-classes; - uses option-def-list; - uses option-data-list; - uses kea:hooks-libraries; - uses dhcp:expired-leases-processing; - uses dhcp:dhcp4o6-port; - uses kea:control-socket; - uses dhcp:hostname-char-set; - uses dhcp:hostname-char-replacement; - uses dhcp:dhcp-ddns; - - leaf echo-client-id { - type boolean; - description "Send client-id back when the client sent it. This - is conformant with RFC6842, but some older, buggy - clients have problems with it."; - } - - uses match-client-id; - uses next-server; - uses server-hostname; - uses boot-file-name; - uses authoritative; - uses kea:user-context { - refine user-context { - description "DHCPv4 server user context. Arbitrary JSON data can - be stored here."; - } - } - uses dhcp:sanity-checks; - uses dhcp:reservation-mode; - uses reservations { - refine host { - description "Global host reservations list."; - } - } - uses dhcp:config-control; - uses dhcp:server-tag; - uses dhcp:dhcp-queue-control; - uses kea:loggers; - } - - /* - * State data - */ - container state { - config false; - description "State of Kea DHCPv4 server."; - - container leases { - description "Kea DHCPv4 leases."; - list lease { - key ip-address; - description "List of Kea DHCPv4 leases."; - leaf ip-address { - type inet:ipv4-address; - mandatory true; - description "Lease IP address."; - } - leaf hw-address { - type binary; - mandatory true; - description "Lease hardware address."; - } - leaf client-id { - type binary; - description "Lease client-id."; - } - uses dhcp:valid-lifetime { - refine valid-lifetime { - mandatory true; - } - } - leaf cltt { - type uint32; - units "seconds"; - mandatory true; - description "Lease client last transmission time."; - } - leaf subnet-id { - type uint32; - mandatory true; - description "Lease subnet ID."; - } - leaf fqdn-fwd { - type boolean; - description "Lease FQDN forward flag."; - } - leaf fqdn-rev { - type boolean; - description "Lease FQDN reverse lag."; - } - leaf hostname { - type string; - description "Lease hostname."; - } - leaf state { - type dhcp:lease-state; - description "Lease state."; - } - leaf user-context { - type kea:user-context; - description "Lease user context."; - } - } - } - - container lease-stats { - description "Lease statistics."; - list subnet { - key subnet-id; - description "List of IPv4 subnets."; - leaf subnet-id { - type uint32; - mandatory true; - description "Subnet ID."; - } - leaf total-addresses { - type uint32; - mandatory true; - description "Total addresses counter."; - } - leaf assigned-addresses { - type uint32; - mandatory true; - description "Assigned addresses counter."; - } - leaf declined-addresses { - type uint32; - mandatory true; - description "Declined addresses counter."; - } - } - } - - container hosts { - description "Kea DHCPv4 hosts."; - list host { - key "subnet-id identifier-type identifier"; - description "List of Kea DHCPv4 hosts."; - uses host; - uses dhcp:host-subnet-id; - leaf auth-key { - type string; - description "Host authentication key (unused in DHCPv4)."; - } - } - } - } -} diff --git a/src/share/yang/modules/kea-dhcp4-server@2019-08-12.yang b/src/share/yang/modules/kea-dhcp4-server@2019-08-12.yang new file mode 100644 index 0000000000..c3a2a7cbfa --- /dev/null +++ b/src/share/yang/modules/kea-dhcp4-server@2019-08-12.yang @@ -0,0 +1,519 @@ +module kea-dhcp4-server { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:kea-dhcp4-server"; + prefix "kea-dhcp4-server"; + + import ietf-inet-types { + prefix inet; + } + import kea-types { + prefix kea; + revision-date 2019-08-12; + } + import kea-dhcp-types { + prefix dhcp; + revision-date 2019-08-12; + } + + organization "Internet Systems Consortium"; + contact "kea-dev@lists.isc.org"; + description "This model defines a YANG data model that can be + used to configure and manage a Kea DHCPv4 server."; + + revision 2019-08-12 { + description "Initial revision"; + reference ""; + } + + /* + * Typedefs + */ + typedef host-identifier-type { + type enumeration { + enum "duid" { + description "DUID"; + } + enum "hw-address" { + description "Hardware address"; + } + enum "circuit-id" { + description "Circuit-id option"; + } + enum "client-id" { + description "Client identifier"; + } + enum "flex-id" { + description "Flexible identifier"; + } + } + description "Host identifier type."; + } + + /* + * Groupings + */ + grouping match-client-id { + description "Match client ID grouping."; + leaf match-client-id { + type boolean; + description "Use client-id for lease lookups. If set to false, client-id + will be ignored."; + } + } + + grouping next-server { + description "Next server address grouping."; + leaf next-server { + type inet:ipv4-address; + description "Next server IPv4 address. If set, this value will be set + in siaddr field."; + } + } + + grouping server-hostname { + description "Server hostname grouping."; + leaf server-hostname { + type string; + description "Server hostname (up to 64 bytes)."; + } + } + + grouping boot-file-name { + description "Boot file name grouping."; + leaf boot-file-name { + type string; + description "Boot file name (up to 128 bytes)."; + } + } + + grouping authoritative { + description "Authoritative grouping."; + leaf authoritative { + type boolean; + description "NAK requests for unknown clients. If set to false + ignore them."; + } + } + + grouping relay { + description "Relay grouping."; + leaf-list ip-addresses { + type inet:ipv4-address; + description "IPv4 addresses."; + } + } + + grouping host { + description "Host grouping."; + leaf identifier-type { + type host-identifier-type; + mandatory true; + description "Host identifier type."; + } + uses dhcp:host-identifier; + leaf ip-address { + type inet:ipv4-address; + description "Host reserved IPv4 address."; + } + uses dhcp:host-hostname; + uses dhcp:host-client-classes; + uses option-data-list; + uses next-server; + uses server-hostname; + uses boot-file-name; + uses dhcp:host-user-context; + } + + grouping reservations { + description "Host reservations grouping."; + list host { + key "identifier-type identifier"; + description "Host reservation list."; + uses host; + } + } + + grouping subnet4-list { + description "Subnet4 list grouping."; + list subnet4 { + key id; + ordered-by user; + description "List of IPv4 subnets."; + uses dhcp:valid-lifetime; + uses dhcp:min-valid-lifetime; + uses dhcp:max-valid-lifetime; + uses dhcp:renew-timer; + uses dhcp:rebind-timer; + uses dhcp:calculate-tee-times; + uses dhcp:t1-percent; + uses dhcp:t2-percent; + uses option-data-list; + list pool { + key "start-address end-address"; + ordered-by user; + description "Pool list."; + leaf prefix { + type inet:ipv4-prefix; + description "Defines a pool of dynamic IPv4 addresses to be managed + by the server."; + } + leaf start-address { + type inet:ipv4-address; + mandatory true; + description "First IPv4 address in a pool."; + } + leaf end-address { + type inet:ipv4-address; + mandatory true; + description "Last IPv4 address in a pool."; + } + uses option-data-list; + uses dhcp:pool-client-class; + uses dhcp:pool-require-client-classes; + uses dhcp:pool-user-context; + } + leaf subnet { + type inet:ipv4-prefix; + mandatory true; + description "IPv4 subnet prefix."; + } + uses dhcp:subnet-interface; + uses dhcp:subnet-id; + uses dhcp:subnet-client-class; + uses dhcp:subnet-require-client-classes; + uses reservations { + refine host { + description "Subnet host reservations list."; + } + } + uses dhcp:reservation-mode; + container relay { + description "Optional information about relay agent."; + uses relay; + } + uses match-client-id; + uses next-server; + uses server-hostname; + uses boot-file-name; + leaf subnet-4o6-interface { + type string; + description "Subnet DHCPv4-over-DHCPv6 interface."; + } + leaf subnet-4o6-interface-id { + type string; + description "Subnet DHCPv4-over-DHCPv6 interface-id option."; + } + leaf subnet-4o6-subnet { + type inet:ipv6-prefix; + description "Subnet DHCPv4-over-DHCPv6 IPv6 prefix."; + } + uses authoritative; + uses dhcp:subnet-user-context; + } + } + + grouping client-classes { + description "Client class grouping."; + list client-class { + key name; + ordered-by user; + description "List of client classes."; + uses dhcp:class-name; + uses dhcp:class-test; + uses dhcp:class-only-if-required; + uses option-def-list; + uses option-data-list; + uses next-server; + uses server-hostname; + uses boot-file-name; + uses dhcp:class-user-context; + } + } + + grouping option-def-list { + description "Option definition list grouping."; + list option-def { + key "code space"; + description "Option definition entry."; + leaf code { + type uint8; + mandatory true; + description "Option code to be used by the new option definition."; + } + leaf space { + type string; + mandatory true; + description "Option space for the new option (typically dhcp4)."; + } + uses dhcp:option-def-name; + uses dhcp:option-def-type; + uses dhcp:option-def-record-types; + uses dhcp:option-def-encapsulate; + uses dhcp:option-def-array; + uses dhcp:option-def-user-context; + } + } + + grouping option-data-list { + description "Option data list grouping."; + list option-data { + key "code space"; + description "Option data entry."; + leaf code { + type uint8; + mandatory true; + description "Option code."; + } + leaf space { + type string; + mandatory true; + description "Option space."; + } + uses dhcp:option-data-name; + uses dhcp:option-data-data; + uses dhcp:option-data-csv-format; + uses dhcp:option-data-always-send; + uses dhcp:option-data-user-context; + } + } + + /* + * Data Nodes + */ + + container config { + // config true; + description "Contains DHCPv4 server configuration."; + + uses dhcp:valid-lifetime; + uses dhcp:min-valid-lifetime; + uses dhcp:max-valid-lifetime; + uses dhcp:renew-timer; + uses dhcp:rebind-timer; + uses dhcp:calculate-tee-times; + uses dhcp:t1-percent; + uses dhcp:t2-percent; + uses dhcp:decline-probation-period; + uses subnet4-list; + + list shared-network { + key name; + description "List of IPv4 shared networks."; + uses dhcp:network-name; + uses subnet4-list; + uses dhcp:network-interface; + uses dhcp:renew-timer; + uses dhcp:rebind-timer; + uses option-data-list; + uses match-client-id; + uses next-server; + uses server-hostname; + uses boot-file-name; + container relay { + description "Optional information about relay agent."; + uses relay; + } + uses authoritative; + uses dhcp:reservation-mode; + uses dhcp:network-client-class; + uses dhcp:network-require-client-classes; + uses dhcp:valid-lifetime; + uses dhcp:min-valid-lifetime; + uses dhcp:max-valid-lifetime; + uses dhcp:calculate-tee-times; + uses dhcp:t1-percent; + uses dhcp:t2-percent; + uses dhcp:network-user-context; + } + + container interfaces-config { + description "Network interfaces configuration."; + leaf-list interfaces { + type string; + description "Name of the interface (e.g. eth0) or name/address + (e.g. eth0/192.168.1.1) or * (use all interfaces)."; + } + leaf dhcp-socket-type { + type enumeration { + enum "raw" { + description "DHCP service uses RAW sockets."; + } + enum "udp" { + description "DHCP service uses UDP sockets."; + } + } + description "Type of sockets to use."; + } + leaf outbound-interface { + type enumeration { + enum "same-as-inbound" { + description "Send the response on the interface where the query + was received."; + } + enum "use-routing" { + description "Use kernel routing."; + } + } + description "Control the interface used to send a response."; + } + uses dhcp:interfaces-re-detect; + uses dhcp:interfaces-user-context; + } + + uses dhcp:databases; + + leaf-list host-reservation-identifiers { + type host-identifier-type; + description "Host reservation identifiers."; + } + + uses client-classes; + uses option-def-list; + uses option-data-list; + uses kea:hooks-libraries; + uses dhcp:expired-leases-processing; + uses dhcp:dhcp4o6-port; + uses kea:control-socket; + uses dhcp:hostname-char-set; + uses dhcp:hostname-char-replacement; + uses dhcp:dhcp-ddns; + + leaf echo-client-id { + type boolean; + description "Send client-id back when the client sent it. This + is conformant with RFC6842, but some older, buggy + clients have problems with it."; + } + + uses match-client-id; + uses next-server; + uses server-hostname; + uses boot-file-name; + uses authoritative; + uses kea:user-context { + refine user-context { + description "DHCPv4 server user context. Arbitrary JSON data can + be stored here."; + } + } + uses dhcp:sanity-checks; + uses dhcp:reservation-mode; + uses reservations { + refine host { + description "Global host reservations list."; + } + } + uses dhcp:config-control; + uses dhcp:server-tag; + uses dhcp:dhcp-queue-control; + uses kea:loggers; + } + + /* + * State data + */ + container state { + config false; + description "State of Kea DHCPv4 server."; + + container leases { + description "Kea DHCPv4 leases."; + list lease { + key ip-address; + description "List of Kea DHCPv4 leases."; + leaf ip-address { + type inet:ipv4-address; + mandatory true; + description "Lease IP address."; + } + leaf hw-address { + type binary; + mandatory true; + description "Lease hardware address."; + } + leaf client-id { + type binary; + description "Lease client-id."; + } + uses dhcp:valid-lifetime { + refine valid-lifetime { + mandatory true; + } + } + leaf cltt { + type uint32; + units "seconds"; + mandatory true; + description "Lease client last transmission time."; + } + leaf subnet-id { + type uint32; + mandatory true; + description "Lease subnet ID."; + } + leaf fqdn-fwd { + type boolean; + description "Lease FQDN forward flag."; + } + leaf fqdn-rev { + type boolean; + description "Lease FQDN reverse lag."; + } + leaf hostname { + type string; + description "Lease hostname."; + } + leaf state { + type dhcp:lease-state; + description "Lease state."; + } + leaf user-context { + type kea:user-context; + description "Lease user context."; + } + } + } + + container lease-stats { + description "Lease statistics."; + list subnet { + key subnet-id; + description "List of IPv4 subnets."; + leaf subnet-id { + type uint32; + mandatory true; + description "Subnet ID."; + } + leaf total-addresses { + type uint32; + mandatory true; + description "Total addresses counter."; + } + leaf assigned-addresses { + type uint32; + mandatory true; + description "Assigned addresses counter."; + } + leaf declined-addresses { + type uint32; + mandatory true; + description "Declined addresses counter."; + } + } + } + + container hosts { + description "Kea DHCPv4 hosts."; + list host { + key "subnet-id identifier-type identifier"; + description "List of Kea DHCPv4 hosts."; + uses host; + uses dhcp:host-subnet-id; + leaf auth-key { + type string; + description "Host authentication key (unused in DHCPv4)."; + } + } + } + } +} diff --git a/src/share/yang/modules/kea-dhcp6-server@2019-08-09.yang b/src/share/yang/modules/kea-dhcp6-server@2019-08-09.yang deleted file mode 100644 index 15185a3f15..0000000000 --- a/src/share/yang/modules/kea-dhcp6-server@2019-08-09.yang +++ /dev/null @@ -1,622 +0,0 @@ -module kea-dhcp6-server { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:kea-dhcp6-server"; - prefix "kea-dhcp6-server"; - - import ietf-inet-types { - prefix inet; - } - import kea-types { - prefix kea; - revision-date 2019-08-09; - } - import kea-dhcp-types { - prefix dhcp; - revision-date 2019-08-09; - } - - organization "Internet Systems Consortium"; - contact "kea-dev@lists.isc.org"; - description "This model defines a YANG data model that can be - used to configure and manage a Kea DHCPv6 server."; - - revision 2019-08-09 { - description "Initial revision"; - reference ""; - } - - /* - * Typedefs - */ - typedef host-identifier-type { - type enumeration { - enum "duid" { - description "DUID"; - } - enum "hw-address" { - description "Hardware address"; - } - enum "flex-id" { - description "Flexible identifier"; - } - } - description "Host identifier type."; - } - - /* - * Groupings - */ - grouping data-directory { - description "Data directory grouping."; - leaf data-directory { - type string; - description "Server data directory."; - } - } - - grouping preferred-lifetime { - description "Preferred lifetime grouping."; - leaf preferred-lifetime { - type uint32; - units "seconds"; - description "Preferred lifetime."; - } - } - - grouping min-preferred-lifetime { - description "Minimum preferred lifetime grouping."; - leaf min-preferred-lifetime { - type uint32; - units "seconds"; - description "Minimum preferred lifetime."; - } - } - - grouping max-preferred-lifetime { - description "Maximum preferred lifetime grouping."; - leaf max-preferred-lifetime { - type uint32; - units "seconds"; - description "Maximum preferred lifetime."; - } - } - - grouping interface-id { - description "Interface ID grouping."; - leaf interface-id { - type string; - description "Interface ID entry."; - } - } - - grouping relay { - description "Relay grouping."; - leaf-list ip-addresses { - type inet:ipv6-address; - description "IPv6 addresses."; - } - } - - grouping rapid-commit { - description "Rapid commit grouping."; - leaf rapid-commit { - type boolean; - description "Rapid commit entry."; - } - } - - grouping host { - description "Host grouping."; - leaf identifier-type { - type host-identifier-type; - mandatory true; - description "Host identifier type."; - } - uses dhcp:host-identifier; - leaf-list ip-addresses { - type inet:ipv6-address; - description "Host reserved IP addresses."; - } - leaf-list prefixes { - type inet:ipv6-prefix; - description "Host reserved IP prefixes."; - } - uses dhcp:host-hostname; - uses dhcp:host-client-classes; - uses option-data-list; - uses dhcp:host-user-context; - } - - grouping reservations { - description "Host reservations grouping."; - list host { - key "identifier-type identifier"; - description "Host reservation list."; - uses host; - } - } - - grouping subnet6-list { - description "Subnet6 list grouping."; - list subnet6 { - key id; - ordered-by user; - description "List of IPv6 subnets."; - uses preferred-lifetime; - uses min-preferred-lifetime; - uses max-preferred-lifetime; - uses dhcp:valid-lifetime; - uses dhcp:min-valid-lifetime; - uses dhcp:max-valid-lifetime; - uses dhcp:renew-timer; - uses dhcp:rebind-timer; - uses dhcp:calculate-tee-times; - uses dhcp:t1-percent; - uses dhcp:t2-percent; - uses option-data-list; - list pool { - key "start-address end-address"; - ordered-by user; - description "Pool list."; - leaf prefix { - type inet:ipv6-prefix; - description "Pool prefix."; - } - leaf start-address { - type inet:ipv6-address; - mandatory true; - description "First IPv6 address in a pool."; - } - leaf end-address { - type inet:ipv6-address; - mandatory true; - description "Last IPv6 address in a pool."; - } - uses option-data-list; - uses dhcp:pool-client-class; - uses dhcp:pool-require-client-classes; - uses dhcp:pool-user-context; - } - list pd-pool { - key prefix; - ordered-by user; - description "Prefix delegation pool list."; - leaf prefix { - type inet:ipv6-prefix; - mandatory true; - description "IPv6 pool prefix."; - } - leaf delegated-len { - type uint8; - description "Prefix pool delegated length."; - } - uses option-data-list; - uses dhcp:client-class { - refine client-class { - description "Prefix pool client class guard. (only - clients belonging to this class will be - allowed in this pool)."; - } - } - uses dhcp:require-client-classes { - refine require-client-classes { - description "Prefix pool require client classes."; - } - } - leaf excluded-prefix { - type inet:ipv6-prefix; - description "Prefix pool excluded prefix."; - } - uses kea:user-context { - refine user-context { - description "Prefix pool user context. Arbitrary JSON data - can be stored here."; - } - } - } - leaf subnet { - type inet:ipv6-prefix; - mandatory true; - description "IPv6 subnet prefix."; - } - uses dhcp:subnet-interface; - uses interface-id { - refine interface-id { - description "Subnet interface-id option."; - } - } - uses dhcp:subnet-id; - uses rapid-commit { - refine rapid-commit { - description "Subnet rapid commit flag."; - } - } - uses dhcp:subnet-client-class; - uses dhcp:require-client-classes; - uses reservations { - refine host { - description "Subnet host reservations list."; - } - } - uses dhcp:reservation-mode; - container relay { - description "Optional information about relay agent."; - uses relay; - } - uses dhcp:subnet-user-context; - } - } - - grouping client-classes { - description "Client classes grouping."; - list client-class { - key name; - ordered-by user; - description "List of client classes."; - uses dhcp:class-name; - uses dhcp:class-test; - uses dhcp:class-only-if-required; - uses option-data-list; - uses dhcp:class-user-context; - } - } - - grouping option-def-list { - description "Option definition list grouping."; - list option-def { - key "code space"; - description "Option definition entry."; - leaf code { - type uint16; - mandatory true; - description "Option code to be used by the new option definition."; - } - leaf space { - type string; - mandatory true; - description "Option space for the new option (typically dhcp6)."; - } - uses dhcp:option-def-name; - uses dhcp:option-def-type; - uses dhcp:option-def-record-types; - uses dhcp:option-def-encapsulate; - uses dhcp:option-def-array; - uses dhcp:option-def-user-context; - } - } - - grouping option-data-list { - description "Option data list grouping."; - list option-data { - key "code space"; - description "Option data entry."; - leaf code { - type uint16; - mandatory true; - description "Option code."; - } - leaf space { - type string; - mandatory true; - description "Option space."; - } - uses dhcp:option-data-name; - uses dhcp:option-data-data; - uses dhcp:option-data-csv-format; - uses dhcp:option-data-always-send; - uses dhcp:option-data-user-context; - } - } - - /* - * Data Nodes - */ - - container config { - // config true; - description "Contains DHCPv6 server configuration."; - - uses data-directory; - uses preferred-lifetime; - uses min-preferred-lifetime; - uses max-preferred-lifetime; - uses dhcp:valid-lifetime; - uses dhcp:min-valid-lifetime; - uses dhcp:max-valid-lifetime; - uses dhcp:renew-timer; - uses dhcp:rebind-timer; - uses dhcp:calculate-tee-times; - uses dhcp:t1-percent; - uses dhcp:t2-percent; - uses dhcp:decline-probation-period; - uses subnet6-list; - - list shared-network { - key name; - uses dhcp:network-name; - description "List of IPv4 shared networks."; - uses subnet6-list; - uses dhcp:network-interface; - uses interface-id { - refine interface-id { - description "Shared network interface-id option."; - } - } - uses dhcp:renew-timer; - uses dhcp:rebind-timer; - uses option-data-list; - container relay { - description "Optional information about relay agent."; - uses relay; - } - uses dhcp:reservation-mode; - uses dhcp:network-client-class; - uses dhcp:require-client-classes; - uses preferred-lifetime; - uses min-preferred-lifetime; - uses max-preferred-lifetime; - uses rapid-commit { - refine rapid-commit { - description "Shared network rapid commit flag."; - } - } - uses dhcp:valid-lifetime; - uses dhcp:min-valid-lifetime; - uses dhcp:max-valid-lifetime; - uses dhcp:calculate-tee-times; - uses dhcp:t1-percent; - uses dhcp:t2-percent; - uses dhcp:network-user-context; - } - - container interfaces-config { - description "Network interfaces configuration."; - leaf-list interfaces { - type string; - description "Name of the interface (e.g. eth0) or name/address - (e.g. eth0/2001:db8::1) or * (use all interfaces)."; - } - uses dhcp:interfaces-re-detect; - uses dhcp:interfaces-user-context; - } - - uses dhcp:databases; - - leaf-list relay-supplied-options { - type string; - description "Relay supplied options."; - } - - leaf-list mac-sources { - type string; - description "MAC address sources."; - } - - leaf-list host-reservation-identifiers { - type host-identifier-type; - description "Host reservation identifiers."; - } - - uses client-classes; - uses option-def-list; - uses option-data-list; - uses kea:hooks-libraries; - uses dhcp:expired-leases-processing; - - container server-id { - presence "Have server ID."; - description "Server DUID."; - leaf type { - type enumeration { - enum "LLT" { - description "Link-layer address and timestamp."; - } - enum "EN" { - description "Enterprise number."; - } - enum "LL" { - description "Link-layer address."; - } - } - description "Server DIOD type."; - } - leaf identifier { - type string; - description "Server DUID identifier."; - } - leaf time { - type uint32; - description "Server DUID time."; - } - leaf htype { - type uint16; - description "Server DUID hardware type."; - } - leaf enterprise-id { - type uint32; - description "Server DUID enterprise ID."; - } - leaf persist { - type boolean; - description "Server DUID persist flag."; - } - leaf user-context { - type kea:user-context; - description "Server DUID user context."; - } - } - - uses dhcp:dhcp4o6-port; - uses kea:control-socket; - uses dhcp:hostname-char-set; - uses dhcp:hostname-char-replacement; - uses dhcp:dhcp-ddns; - uses kea:user-context { - refine user-context { - description "DHCPv6 server user context. Arbitrary JSON data can - be stored here."; - } - } - uses dhcp:sanity-checks; - uses dhcp:reservation-mode; - uses reservations { - refine host { - description "Global host reservations list."; - } - } - uses dhcp:config-control; - uses dhcp:server-tag; - uses dhcp:dhcp-queue-control; - uses kea:loggers; - } - - /* - * State data - */ - container state { - config false; - description "State of Kea DHCPv6 server."; - - container leases { - description "Kea DHCPv6 leases."; - list lease { - key ip-address; - description "List of Kea DHCPv6 leases."; - leaf ip-address { - type inet:ipv6-address; - mandatory true; - description "Lease IP address."; - } - leaf duid { - type binary; - mandatory true; - description "Lease DUID."; - } - uses dhcp:valid-lifetime { - refine valid-lifetime { - mandatory true; - } - } - leaf cltt { - type uint32; - units "seconds"; - mandatory true; - description "Lease client last transmission time."; - } - leaf subnet-id { - type uint32; - mandatory true; - description "Lease subnet ID."; - } - leaf preferred-lifetime { - type uint32; - units "seconds"; - mandatory true; - description "Lease preferred lifetime."; - } - leaf lease-type { - type enumeration { - enum "IA_NA" { - description "Identity association for non-temporary addresses."; - } - enum "IA_TA" { - description "Identity association for temporary addresses."; - } - enum "IA_PD" { - description "Identity association for prefix delegation."; - } - } - mandatory true; - description "Lease IA type."; - } - leaf iaid { - type uint32; - mandatory true; - description "Lease IA ID."; - } - leaf prefix-length { - type uint8 { - range 0..128; - } - description "Lease prefix length."; - } - leaf fqdn-fwd { - type boolean; - description "Lease FQDN forward flag."; - } - leaf fqdn-rev { - type boolean; - description "Lease FQDN reverse lag."; - } - leaf hostname { - type string; - description "Lease hostname."; - } - leaf state { - type dhcp:lease-state; - description "Lease state."; - } - leaf user-context { - type kea:user-context; - description "Lease user context."; - } - leaf hw-address { - type string; - description "Lease hardware address."; - } - } - } - - container lease-stats { - description "Lease statistics."; - list subnet { - key subnet-id; - description "List of IPv6 subnets."; - leaf subnet-id { - type uint32; - mandatory true; - description "Subnet ID."; - } - leaf total-nas { - type uint32; - mandatory true; - description "Total non-temporary addresses counter."; - } - leaf assigned-nas { - type uint32; - mandatory true; - description "Assigned non-temporary counter."; - } - leaf declined-nas { - type uint32; - mandatory true; - description "Declined non-temporary addresses counter."; - } - leaf total-pds { - type uint32; - mandatory true; - description "Total delegated prefixes counter."; - } - leaf assigned-pds { - type uint32; - mandatory true; - description "Assigned delegated prefixe counter."; - } - } - } - - container hosts { - description "Kea DHCPv6 hosts."; - list host { - key "subnet-id identifier-type identifier"; - description "List of Kea DHCPv6 hosts."; - uses host; - uses dhcp:host-subnet-id; - leaf auth-key { - type string; - description "Host authentication key."; - } - } - } - } -} diff --git a/src/share/yang/modules/kea-dhcp6-server@2019-08-12.yang b/src/share/yang/modules/kea-dhcp6-server@2019-08-12.yang new file mode 100644 index 0000000000..ac6ef6792e --- /dev/null +++ b/src/share/yang/modules/kea-dhcp6-server@2019-08-12.yang @@ -0,0 +1,622 @@ +module kea-dhcp6-server { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:kea-dhcp6-server"; + prefix "kea-dhcp6-server"; + + import ietf-inet-types { + prefix inet; + } + import kea-types { + prefix kea; + revision-date 2019-08-12; + } + import kea-dhcp-types { + prefix dhcp; + revision-date 2019-08-12; + } + + organization "Internet Systems Consortium"; + contact "kea-dev@lists.isc.org"; + description "This model defines a YANG data model that can be + used to configure and manage a Kea DHCPv6 server."; + + revision 2019-08-12 { + description "Initial revision"; + reference ""; + } + + /* + * Typedefs + */ + typedef host-identifier-type { + type enumeration { + enum "duid" { + description "DUID"; + } + enum "hw-address" { + description "Hardware address"; + } + enum "flex-id" { + description "Flexible identifier"; + } + } + description "Host identifier type."; + } + + /* + * Groupings + */ + grouping data-directory { + description "Data directory grouping."; + leaf data-directory { + type string; + description "Server data directory."; + } + } + + grouping preferred-lifetime { + description "Preferred lifetime grouping."; + leaf preferred-lifetime { + type uint32; + units "seconds"; + description "Preferred lifetime."; + } + } + + grouping min-preferred-lifetime { + description "Minimum preferred lifetime grouping."; + leaf min-preferred-lifetime { + type uint32; + units "seconds"; + description "Minimum preferred lifetime."; + } + } + + grouping max-preferred-lifetime { + description "Maximum preferred lifetime grouping."; + leaf max-preferred-lifetime { + type uint32; + units "seconds"; + description "Maximum preferred lifetime."; + } + } + + grouping interface-id { + description "Interface ID grouping."; + leaf interface-id { + type string; + description "Interface ID entry."; + } + } + + grouping relay { + description "Relay grouping."; + leaf-list ip-addresses { + type inet:ipv6-address; + description "IPv6 addresses."; + } + } + + grouping rapid-commit { + description "Rapid commit grouping."; + leaf rapid-commit { + type boolean; + description "Rapid commit entry."; + } + } + + grouping host { + description "Host grouping."; + leaf identifier-type { + type host-identifier-type; + mandatory true; + description "Host identifier type."; + } + uses dhcp:host-identifier; + leaf-list ip-addresses { + type inet:ipv6-address; + description "Host reserved IP addresses."; + } + leaf-list prefixes { + type inet:ipv6-prefix; + description "Host reserved IP prefixes."; + } + uses dhcp:host-hostname; + uses dhcp:host-client-classes; + uses option-data-list; + uses dhcp:host-user-context; + } + + grouping reservations { + description "Host reservations grouping."; + list host { + key "identifier-type identifier"; + description "Host reservation list."; + uses host; + } + } + + grouping subnet6-list { + description "Subnet6 list grouping."; + list subnet6 { + key id; + ordered-by user; + description "List of IPv6 subnets."; + uses preferred-lifetime; + uses min-preferred-lifetime; + uses max-preferred-lifetime; + uses dhcp:valid-lifetime; + uses dhcp:min-valid-lifetime; + uses dhcp:max-valid-lifetime; + uses dhcp:renew-timer; + uses dhcp:rebind-timer; + uses dhcp:calculate-tee-times; + uses dhcp:t1-percent; + uses dhcp:t2-percent; + uses option-data-list; + list pool { + key "start-address end-address"; + ordered-by user; + description "Pool list."; + leaf prefix { + type inet:ipv6-prefix; + description "Pool prefix."; + } + leaf start-address { + type inet:ipv6-address; + mandatory true; + description "First IPv6 address in a pool."; + } + leaf end-address { + type inet:ipv6-address; + mandatory true; + description "Last IPv6 address in a pool."; + } + uses option-data-list; + uses dhcp:pool-client-class; + uses dhcp:pool-require-client-classes; + uses dhcp:pool-user-context; + } + list pd-pool { + key prefix; + ordered-by user; + description "Prefix delegation pool list."; + leaf prefix { + type inet:ipv6-prefix; + mandatory true; + description "IPv6 pool prefix."; + } + leaf delegated-len { + type uint8; + description "Prefix pool delegated length."; + } + uses option-data-list; + uses dhcp:client-class { + refine client-class { + description "Prefix pool client class guard. (only + clients belonging to this class will be + allowed in this pool)."; + } + } + uses dhcp:require-client-classes { + refine require-client-classes { + description "Prefix pool require client classes."; + } + } + leaf excluded-prefix { + type inet:ipv6-prefix; + description "Prefix pool excluded prefix."; + } + uses kea:user-context { + refine user-context { + description "Prefix pool user context. Arbitrary JSON data + can be stored here."; + } + } + } + leaf subnet { + type inet:ipv6-prefix; + mandatory true; + description "IPv6 subnet prefix."; + } + uses dhcp:subnet-interface; + uses interface-id { + refine interface-id { + description "Subnet interface-id option."; + } + } + uses dhcp:subnet-id; + uses rapid-commit { + refine rapid-commit { + description "Subnet rapid commit flag."; + } + } + uses dhcp:subnet-client-class; + uses dhcp:require-client-classes; + uses reservations { + refine host { + description "Subnet host reservations list."; + } + } + uses dhcp:reservation-mode; + container relay { + description "Optional information about relay agent."; + uses relay; + } + uses dhcp:subnet-user-context; + } + } + + grouping client-classes { + description "Client classes grouping."; + list client-class { + key name; + ordered-by user; + description "List of client classes."; + uses dhcp:class-name; + uses dhcp:class-test; + uses dhcp:class-only-if-required; + uses option-data-list; + uses dhcp:class-user-context; + } + } + + grouping option-def-list { + description "Option definition list grouping."; + list option-def { + key "code space"; + description "Option definition entry."; + leaf code { + type uint16; + mandatory true; + description "Option code to be used by the new option definition."; + } + leaf space { + type string; + mandatory true; + description "Option space for the new option (typically dhcp6)."; + } + uses dhcp:option-def-name; + uses dhcp:option-def-type; + uses dhcp:option-def-record-types; + uses dhcp:option-def-encapsulate; + uses dhcp:option-def-array; + uses dhcp:option-def-user-context; + } + } + + grouping option-data-list { + description "Option data list grouping."; + list option-data { + key "code space"; + description "Option data entry."; + leaf code { + type uint16; + mandatory true; + description "Option code."; + } + leaf space { + type string; + mandatory true; + description "Option space."; + } + uses dhcp:option-data-name; + uses dhcp:option-data-data; + uses dhcp:option-data-csv-format; + uses dhcp:option-data-always-send; + uses dhcp:option-data-user-context; + } + } + + /* + * Data Nodes + */ + + container config { + // config true; + description "Contains DHCPv6 server configuration."; + + uses data-directory; + uses preferred-lifetime; + uses min-preferred-lifetime; + uses max-preferred-lifetime; + uses dhcp:valid-lifetime; + uses dhcp:min-valid-lifetime; + uses dhcp:max-valid-lifetime; + uses dhcp:renew-timer; + uses dhcp:rebind-timer; + uses dhcp:calculate-tee-times; + uses dhcp:t1-percent; + uses dhcp:t2-percent; + uses dhcp:decline-probation-period; + uses subnet6-list; + + list shared-network { + key name; + uses dhcp:network-name; + description "List of IPv4 shared networks."; + uses subnet6-list; + uses dhcp:network-interface; + uses interface-id { + refine interface-id { + description "Shared network interface-id option."; + } + } + uses dhcp:renew-timer; + uses dhcp:rebind-timer; + uses option-data-list; + container relay { + description "Optional information about relay agent."; + uses relay; + } + uses dhcp:reservation-mode; + uses dhcp:network-client-class; + uses dhcp:require-client-classes; + uses preferred-lifetime; + uses min-preferred-lifetime; + uses max-preferred-lifetime; + uses rapid-commit { + refine rapid-commit { + description "Shared network rapid commit flag."; + } + } + uses dhcp:valid-lifetime; + uses dhcp:min-valid-lifetime; + uses dhcp:max-valid-lifetime; + uses dhcp:calculate-tee-times; + uses dhcp:t1-percent; + uses dhcp:t2-percent; + uses dhcp:network-user-context; + } + + container interfaces-config { + description "Network interfaces configuration."; + leaf-list interfaces { + type string; + description "Name of the interface (e.g. eth0) or name/address + (e.g. eth0/2001:db8::1) or * (use all interfaces)."; + } + uses dhcp:interfaces-re-detect; + uses dhcp:interfaces-user-context; + } + + uses dhcp:databases; + + leaf-list relay-supplied-options { + type string; + description "Relay supplied options."; + } + + leaf-list mac-sources { + type string; + description "MAC address sources."; + } + + leaf-list host-reservation-identifiers { + type host-identifier-type; + description "Host reservation identifiers."; + } + + uses client-classes; + uses option-def-list; + uses option-data-list; + uses kea:hooks-libraries; + uses dhcp:expired-leases-processing; + + container server-id { + presence "Have server ID."; + description "Server DUID."; + leaf type { + type enumeration { + enum "LLT" { + description "Link-layer address and timestamp."; + } + enum "EN" { + description "Enterprise number."; + } + enum "LL" { + description "Link-layer address."; + } + } + description "Server DIOD type."; + } + leaf identifier { + type string; + description "Server DUID identifier."; + } + leaf time { + type uint32; + description "Server DUID time."; + } + leaf htype { + type uint16; + description "Server DUID hardware type."; + } + leaf enterprise-id { + type uint32; + description "Server DUID enterprise ID."; + } + leaf persist { + type boolean; + description "Server DUID persist flag."; + } + leaf user-context { + type kea:user-context; + description "Server DUID user context."; + } + } + + uses dhcp:dhcp4o6-port; + uses kea:control-socket; + uses dhcp:hostname-char-set; + uses dhcp:hostname-char-replacement; + uses dhcp:dhcp-ddns; + uses kea:user-context { + refine user-context { + description "DHCPv6 server user context. Arbitrary JSON data can + be stored here."; + } + } + uses dhcp:sanity-checks; + uses dhcp:reservation-mode; + uses reservations { + refine host { + description "Global host reservations list."; + } + } + uses dhcp:config-control; + uses dhcp:server-tag; + uses dhcp:dhcp-queue-control; + uses kea:loggers; + } + + /* + * State data + */ + container state { + config false; + description "State of Kea DHCPv6 server."; + + container leases { + description "Kea DHCPv6 leases."; + list lease { + key ip-address; + description "List of Kea DHCPv6 leases."; + leaf ip-address { + type inet:ipv6-address; + mandatory true; + description "Lease IP address."; + } + leaf duid { + type binary; + mandatory true; + description "Lease DUID."; + } + uses dhcp:valid-lifetime { + refine valid-lifetime { + mandatory true; + } + } + leaf cltt { + type uint32; + units "seconds"; + mandatory true; + description "Lease client last transmission time."; + } + leaf subnet-id { + type uint32; + mandatory true; + description "Lease subnet ID."; + } + leaf preferred-lifetime { + type uint32; + units "seconds"; + mandatory true; + description "Lease preferred lifetime."; + } + leaf lease-type { + type enumeration { + enum "IA_NA" { + description "Identity association for non-temporary addresses."; + } + enum "IA_TA" { + description "Identity association for temporary addresses."; + } + enum "IA_PD" { + description "Identity association for prefix delegation."; + } + } + mandatory true; + description "Lease IA type."; + } + leaf iaid { + type uint32; + mandatory true; + description "Lease IA ID."; + } + leaf prefix-length { + type uint8 { + range 0..128; + } + description "Lease prefix length."; + } + leaf fqdn-fwd { + type boolean; + description "Lease FQDN forward flag."; + } + leaf fqdn-rev { + type boolean; + description "Lease FQDN reverse lag."; + } + leaf hostname { + type string; + description "Lease hostname."; + } + leaf state { + type dhcp:lease-state; + description "Lease state."; + } + leaf user-context { + type kea:user-context; + description "Lease user context."; + } + leaf hw-address { + type string; + description "Lease hardware address."; + } + } + } + + container lease-stats { + description "Lease statistics."; + list subnet { + key subnet-id; + description "List of IPv6 subnets."; + leaf subnet-id { + type uint32; + mandatory true; + description "Subnet ID."; + } + leaf total-nas { + type uint32; + mandatory true; + description "Total non-temporary addresses counter."; + } + leaf assigned-nas { + type uint32; + mandatory true; + description "Assigned non-temporary counter."; + } + leaf declined-nas { + type uint32; + mandatory true; + description "Declined non-temporary addresses counter."; + } + leaf total-pds { + type uint32; + mandatory true; + description "Total delegated prefixes counter."; + } + leaf assigned-pds { + type uint32; + mandatory true; + description "Assigned delegated prefixe counter."; + } + } + } + + container hosts { + description "Kea DHCPv6 hosts."; + list host { + key "subnet-id identifier-type identifier"; + description "List of Kea DHCPv6 hosts."; + uses host; + uses dhcp:host-subnet-id; + leaf auth-key { + type string; + description "Host authentication key."; + } + } + } + } +} diff --git a/src/share/yang/modules/kea-types@2019-08-09.yang b/src/share/yang/modules/kea-types@2019-08-09.yang deleted file mode 100644 index ec10b54e9b..0000000000 --- a/src/share/yang/modules/kea-types@2019-08-09.yang +++ /dev/null @@ -1,156 +0,0 @@ -module kea-types { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:kea-types"; - prefix "kea-types"; - - organization "Internet Systems Consortium"; - contact "kea-dev@lists.isc.org"; - description "This file defines some commonly used Kea types and groupings."; - - revision 2019-08-09 { - description "Initial revision"; - reference ""; - } - - /* - * Typedef - */ - typedef user-context { - type string; - description "User context (JSON map)."; - } - - /* - * Grouping - */ - grouping user-context { - description "User context grouping."; - leaf user-context { - type user-context; - description "User context entry."; - } - } - - grouping control-socket-info { - description "Control socket parameters."; - leaf socket-name { - type string; - mandatory true; - description "Path to the UNIX socket."; - } - leaf socket-type { - type enumeration { - enum "unix" { - description "Unix socket type."; - } - } - mandatory true; - description "Socket type."; - } - leaf user-context { - type user-context; - description "Control socket user context."; - } - } - - grouping control-socket { - description "Control socket grouping."; - container control-socket { - presence "Have control socket."; - description "Control socket container."; - uses control-socket-info; - } - } - - grouping hooks-libraries { - description "Hooks libraries grouping."; - list hook-library { - key library; - description "List of hook library."; - leaf library { - type string; - mandatory true; - description "Path to the DSO."; - } - leaf parameters { - type string; - description "Parameters (JSON value)."; - } - } - } - - grouping loggers { - description "Loggers."; - list logger { - key name; - description "List of loggers."; - leaf name { - type string; - mandatory true; - description "Name of the logger."; - } - list output-option { - key output; - description "List of output options."; - leaf output { - type string; - description "Type of output. Special values are stdout (standard - output), stderr (standard error), syslog (syslog using default - name), syslog:name (syslog using specified name). Any other - value is interpreted as a filename."; - } - leaf flush { - type boolean; - description "When true flush buffers after each message."; - } - leaf maxsize { - type uint32; - description "Maximum size of output file before rotation. - Values below 204800 including 0 disable rotation."; - } - leaf maxver { - type uint32 { - range 1..max; - } - description "Maximum version to keep a rotated output file."; - } - } - leaf debuglevel { - type uint8 { - range 0..99; - } - description "What level of debug messages should be printed."; - } - leaf severity { - type enumeration { - enum "FATAL" { - description "Condition is so serious that the server cannot - continue executing"; - } - enum "ERROR" { - description "Error condition. The server will continue - executing, but the results may not be as expected."; - } - enum "WARN" { - description "Out of the ordinary condition. However, the server - will continue executing normally."; - } - enum "INFO" { - description "Information message marking some event."; - } - enum "DEBUG" { - description "For debugging purposes."; - } - enum "NONE" { - description "All messages are inhibited."; - } - } - description "Category of messages logged."; - } - leaf user-context { - type user-context; - description "Logger user context."; - } - } - } -} diff --git a/src/share/yang/modules/kea-types@2019-08-12.yang b/src/share/yang/modules/kea-types@2019-08-12.yang new file mode 100644 index 0000000000..a1a46dcfba --- /dev/null +++ b/src/share/yang/modules/kea-types@2019-08-12.yang @@ -0,0 +1,160 @@ +module kea-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:kea-types"; + prefix "kea-types"; + + organization "Internet Systems Consortium"; + contact "kea-dev@lists.isc.org"; + description "This file defines some commonly used Kea types and groupings."; + + revision 2019-08-12 { + description "Initial revision"; + reference ""; + } + + /* + * Typedef + */ + typedef user-context { + type string; + description "User context (JSON map)."; + } + + /* + * Grouping + */ + grouping user-context { + description "User context grouping."; + leaf user-context { + type user-context; + description "User context entry."; + } + } + + grouping control-socket-info { + description "Control socket parameters."; + leaf socket-name { + type string; + mandatory true; + description "Path to the UNIX socket."; + } + leaf socket-type { + type enumeration { + enum "unix" { + description "Unix socket type."; + } + } + mandatory true; + description "Socket type."; + } + leaf user-context { + type user-context; + description "Control socket user context."; + } + } + + grouping control-socket { + description "Control socket grouping."; + container control-socket { + presence "Have control socket."; + description "Control socket container."; + uses control-socket-info; + } + } + + grouping hooks-libraries { + description "Hooks libraries grouping."; + list hook-library { + key library; + description "List of hook library."; + leaf library { + type string; + mandatory true; + description "Path to the DSO."; + } + leaf parameters { + type string; + description "Parameters (JSON value)."; + } + } + } + + grouping loggers { + description "Loggers."; + list logger { + key name; + description "List of loggers."; + leaf name { + type string; + mandatory true; + description "Name of the logger."; + } + list output-option { + key output; + description "List of output options."; + leaf output { + type string; + description "Type of output. Special values are stdout (standard + output), stderr (standard error), syslog (syslog using default + name), syslog:name (syslog using specified name). Any other + value is interpreted as a filename."; + } + leaf flush { + type boolean; + description "When true flush buffers after each message."; + } + leaf maxsize { + type uint32; + description "Maximum size of output file before rotation. + Values below 204800 including 0 disable rotation."; + } + leaf maxver { + type uint32 { + range 1..max; + } + description "Maximum version to keep a rotated output file."; + } + leaf pattern { + type string; + description "Custom log layout."; + } + } + leaf debuglevel { + type uint8 { + range 0..99; + } + description "What level of debug messages should be printed."; + } + leaf severity { + type enumeration { + enum "FATAL" { + description "Condition is so serious that the server cannot + continue executing"; + } + enum "ERROR" { + description "Error condition. The server will continue + executing, but the results may not be as expected."; + } + enum "WARN" { + description "Out of the ordinary condition. However, the server + will continue executing normally."; + } + enum "INFO" { + description "Information message marking some event."; + } + enum "DEBUG" { + description "For debugging purposes."; + } + enum "NONE" { + description "All messages are inhibited."; + } + } + description "Category of messages logged."; + } + leaf user-context { + type user-context; + description "Logger user context."; + } + } + } +} -- cgit v1.2.3