Commit 73c75ccc authored by Ladislav Lhotka's avatar Ladislav Lhotka

Migrate to revision-less module names

parent e0214482
Pipeline #41667 passed with stages
in 53 seconds
......@@ -12,13 +12,13 @@ Data model and library for DNS resolvers:
* [Unbound](https://www.unbound.net/)
## Data Model
* [Current schema tree](https://gitlab.labs.nic.cz/labs/resolvers-yang/raw/master/data-model/model.tree)
* [Current schema tree](https://gitlab.labs.nic.cz/labs/resolvers-yang/raw/master/yang-modules/model.tree)
* [Example JSON data](https://gitlab.labs.nic.cz/labs/resolvers-yang/raw/master/examples/example-data.json)
#### YANG Modules
* [cznic-dns-types](https://gitlab.labs.nic.cz/labs/resolvers-yang//raw/master/yang-modules/cznic-dns-types@2018-05-14.yang)
* [cznic-resolver-common](https://gitlab.labs.nic.cz/labs/resolvers-yang/raw/master/yang-modules/cznic-resolver-common@2018-07-27.yang)
* [cznic-resolver-knot](https://gitlab.labs.nic.cz/labs/resolvers-yang/raw/master/yang-modules/cznic-resolver-knot@2018-07-27.yang)
* [cznic-resolver-common](https://gitlab.labs.nic.cz/labs/resolvers-yang/raw/master/yang-modules/cznic-resolver-common.yang)
* [cznic-resolver-knot](https://gitlab.labs.nic.cz/labs/resolvers-yang/raw/master/yang-modules/cznic-resolver-knot.yang)
* [cznic-deckard](https://gitlab.labs.nic.cz/labs/resolvers-yang//raw/master/yang-modules/cznic-deckard.yang)
## Getting Started
......
module cznic-dns-types {
yang-version "1.1";
namespace "https://www.nic.cz/ns/yang/dns-types";
prefix "dns";
organization
"CZ.NIC, z. s. p. o.";
contact
"Editor:   Ladislav Lhotka
          <mailto:lhotka@nic.cz>";
description
"This YANG module defines common types related to DNS.";
revision 2018-05-14 {
description
"Initial revision.";
reference
"TODO: put git tag here";
}
/* Typedefs */
typedef domain-name {
type string {
length "1..253";
pattern "((\\*\\.)?(([a-zA-Z0-9_]([a-zA-Z0-9\\-/_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|"
+ "\\.";
}
}
}
module: cznic-resolver-common
+--rw dns-resolver
+--rw server
| +--rw user-name? string
| +--rw group-name? string {set-group}?
+--rw network
| +--rw listen-interfaces* [name]
| | +--rw name string
| | +--rw ip-address inet:ip-address
| | +--rw port? inet:port-number
| +--rw source-address
| | +--rw ipv4? inet:ipv4-address-no-zone
| | +--rw ipv6? inet:ipv6-address-no-zone
| +--rw client-transport
| | +--rw l2-protocols? l2-protocol-selection
| +--rw recursion-transport
| | +--rw l2-protocols? l2-protocol-selection
| +--rw udp-payload-size? uint16
+--rw resolver
| +--rw stub-zones* [domain]
| | +--rw domain inet:domain-name
| | +--rw nameserver? inet:host
| | +--rw port? inet:port-number
| +--rw hints
| | +--rw root-hint* [name]
| | | +--rw name inet:domain-name
| | | +--rw values* inet:ip-address-no-zone
| | +--rw root-zone-file? fs-path
| | +--rw kres:hint* [name]
| | | +--rw kres:name inet:domain-name
| | | +--rw kres:values* inet:ip-address-no-zone
| | | +--rw kres:canonical? boolean
| | +--rw kres:hosts-file? drc:fs-path
| +--rw options
| +--rw glue-checking? enumeration
| +--rw qname-minimisation? boolean
| +--rw query-loopback? boolean
| +--rw reorder-rrset? boolean
+--rw logging
| +--rw verbosity? uint8
+--rw dnssec!
| +--rw trust-anchors
| | +--rw key-files* [domain]
| | +--rw domain inet:domain-name
| | +--rw file? fs-path
| | +--rw read-only? boolean
| +--rw negative-trust-anchors* inet:domain-name
+--rw cache
| +--rw max-size? uint64
| +--ro current-size? uint64
| +--rw max-ttl? uint32
| +--rw min-ttl? uint32
| +--rw kres:prefill* [origin]
| +--rw kres:origin inet:domain-name
| +--rw kres:url inet:uri
| +--rw kres:ca-file drc:fs-path
| +--rw kres:refresh-interval? uint32
+--rw dns64!
+--rw prefix? inet:ipv6-prefix
module: cznic-deckard
+--rw deckard
+--rw mock-data? drc:fs-path
module: cznic-resolver-common
+--rw dns-resolver
+--rw server
| +--rw user-name? string
| +--rw group-name? string {set-group}?
+--rw network
| +--rw listen-interfaces* [name]
| | +--rw name string
| | +--rw ip-address inet:ip-address
| | +--rw port? inet:port-number
| +--rw source-address
| | +--rw ipv4? inet:ipv4-address-no-zone
| | +--rw ipv6? inet:ipv6-address-no-zone
| +--rw client-transport
| | +--rw l2-protocols? l2-protocol-selection
| +--rw recursion-transport
| | +--rw l2-protocols? l2-protocol-selection
| +--rw udp-payload-size? uint16
+--rw resolver
| +--rw stub-zones* [domain]
| | +--rw domain inet:domain-name
| | +--rw nameserver? inet:host
| | +--rw port? inet:port-number
| +--rw hints
| | +--rw root-hint* [name]
| | | +--rw name inet:domain-name
| | | +--rw values* inet:ip-address-no-zone
| | +--rw root-zone-file? fs-path
| | +--rw kres:hint* [name]
| | | +--rw kres:name inet:domain-name
| | | +--rw kres:values* inet:ip-address-no-zone
| | | +--rw kres:canonical? boolean
| | +--rw kres:hosts-file? drc:fs-path
| +--rw options
| +--rw glue-checking? enumeration
| +--rw qname-minimisation? boolean
| +--rw query-loopback? boolean
| +--rw reorder-rrset? boolean
+--rw logging
| +--rw verbosity? uint8
+--rw dnssec!
| +--rw trust-anchors
| | +--rw key-files* [domain]
| | +--rw domain inet:domain-name
| | +--rw file? fs-path
| | +--rw read-only? boolean
| +--rw negative-trust-anchors* inet:domain-name
+--rw cache
| +--rw max-size? uint64
| +--ro current-size? uint64
| +--rw max-ttl? uint32
| +--rw min-ttl? uint32
| +--rw kres:prefill* [origin]
| +--rw kres:origin inet:domain-name
| +--rw kres:url inet:uri
| +--rw kres:ca-file drc:fs-path
| +--rw kres:refresh-interval? uint32
+--rw dns64!
+--rw prefix? inet:ipv6-prefix
MODULES = cznic-resolver-common cznic-resolver-knot cznic-deckard
YLIB = yanglib.json
DATE ?= $(shell date +%F)
xsldir = ../../yangson/tools/xslt
xsldir = ../../../yangson/tools/xslt
yypars = --stringparam date $(DATE)
yams = $(addsuffix .yang, $(MODULES))
......@@ -13,5 +14,5 @@ all: $(yams)
@xsltproc --xinclude $(xsldir)/canonicalize.xsl $< | \
xsltproc --output $@ $(yypars) $(xsldir)/yin2yang.xsl -
model.tree: $(yams)
@pyang $(PYANG_OPTS) -f tree -o $@ $^
model.tree: $(YLIB) $(yams)
@yangson --tree $< > $@
......@@ -20,7 +20,7 @@ module cznic-deckard {
description
"This YANG module defines data for deckard test tool.";
revision 2018-07-27 {
revision 2018-10-26 {
description
"Initial revision.";
}
......
module cznic-deckard {
yang-version "1.1";
namespace "https://www.nic.cz/ns/yang/deckard";
prefix "dcd";
import cznic-resolver-common {
prefix "drc";
}
organization
"CZ.NIC, z. s. p. o.";
contact
"Editor:   Ladislav Lhotka
          <mailto:lhotka@nic.cz>";
description
"This YANG module defines data for deckard test tool..";
revision 2018-06-06 {
description
"Initial revision.";
}
/* Data nodes */
container deckard {
description
"Parameters for deckard test tool.";
leaf mock-data {
type drc:fs-path;
description
"Name of the file containing mock data for the test DNS
server and client instructions.
This data is copied to the resulting RPL file.";
}
}
}
module cznic-dns-types {
yang-version "1.1";
namespace "https://www.nic.cz/ns/yang/dns-types";
prefix "dns";
organization
"CZ.NIC, z. s. p. o.";
contact
"Editor:   Ladislav Lhotka
          <mailto:lhotka@nic.cz>";
description
"This YANG module defines common types related to DNS.";
revision 2018-05-14 {
description
"Initial revision.";
reference
"TODO: put git tag here";
}
/* Typedefs */
typedef domain-name {
type string {
length "1..253";
pattern "((\\*\\.)?(([a-zA-Z0-9_]([a-zA-Z0-9\\-/_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|"
+ "\\.";
}
}
}
......@@ -10,6 +10,10 @@ module cznic-resolver-common {
prefix "inet";
}
import iana-dns-class-rr-type {
prefix "dnsct";
}
organization
"CZ.NIC, z. s. p. o.";
......@@ -21,7 +25,7 @@ module cznic-resolver-common {
"This YANG module defines the common part of a data model for DNS
resolvers.";
revision 2018-07-27 {
revision 2018-10-26 {
description
"Initial revision.";
reference
......@@ -234,14 +238,11 @@ module cznic-resolver-common {
description
"Fine-tuning parameters of resolver operation.";
leaf glue-checking {
type enumeration {
/* TODO: add descriptions of the enums */
enum strict;
enum normal;
enum permissive;
}
type boolean;
default "true";
description
"Level of strictness in accepting glue records.";
"If true, the resolver will only trust glue records that
are within the responding server's authority.";
}
leaf qname-minimisation {
type boolean;
......@@ -289,8 +290,6 @@ module cznic-resolver-common {
description
"DNSSEC trust anchor files.
Each file is expected to
These files should exist and contain trust anchors (DS
or DNSKEY recors) for a single domain. The only
exception is the file for the root domain (key '.'): if
......@@ -378,4 +377,33 @@ module cznic-resolver-common {
}
}
}
/* Operations */
rpc resolve {
description
"Query the resolver and return the result.";
input {
leaf name {
type inet:domain-name;
mandatory "true";
description
"Query name.";
}
leaf type {
type identityref {
base dnsct:rr-type;
}
mandatory "true";
description
"Query type.";
}
leaf class {
type dnsct:dns-class;
default "IN";
description
"Query class.";
}
}
}
}
......@@ -9,6 +9,9 @@
<import module="ietf-inet-types">
<prefix value="inet"/>
</import>
<import module="iana-dns-class-rr-type">
<prefix value="dnsct"/>
</import>
<organization>
<text>CZ.NIC, z. s. p. o.</text>
</organization>
......@@ -285,15 +288,11 @@
</description>
<leaf name="glue-checking">
<description>
<text>Level of strictness in accepting glue
records.</text>
<text>If true, the resolver will only trust glue records
that are within the responding server's authority.</text>
</description>
<type name="enumeration">
<!-- TODO: add descriptions of the enums -->
<enum name="strict"/>
<enum name="normal"/>
<enum name="permissive"/>
</type>
<type name="boolean"/>
<default value="true"/>
</leaf>
<leaf name="qname-minimisation">
<type name="boolean"/>
......@@ -348,7 +347,6 @@
<description>
<text>
<h:p>DNSSEC trust anchor files.</h:p>
<h:p>Each file is expected to </h:p>
<h:p>These files should exist and contain trust anchors
(DS or DNSKEY recors) for a single domain. The only
exception is the file for the root domain (key '.'): if
......@@ -459,5 +457,36 @@
</container>
<!-- Operations -->
<rpc name="resolve">
<description>
<text>Query the resolver and return the result.</text>
</description>
<input>
<leaf name="name">
<mandatory value="true"/>
<type name="inet:domain-name"/>
<description>
<text>Query name.</text>
</description>
</leaf>
<leaf name="type">
<mandatory value="true"/>
<type name="identityref">
<base name="dnsct:rr-type"/>
</type>
<description>
<text>Query type.</text>
</description>
</leaf>
<leaf name="class">
<type name="dnsct:dns-class"/>
<default value="IN"/>
<description>
<text>Query class.</text>
</description>
</leaf>
</input>
</rpc>
</module>
This diff is collapsed.
......@@ -25,7 +25,7 @@ module cznic-resolver-knot {
"This YANG module augment common resolver data with parts
specific to Knot Resolver.";
revision 2018-07-27 {
revision 2018-10-26 {
description
"Initial revision.";
}
......
module cznic-resolver-knot {
yang-version "1.1";
namespace "https://www.nic.cz/ns/yang/resolver-knot";
prefix "kres";
import ietf-inet-types {
prefix "inet";
}
import cznic-resolver-common {
prefix "drc";
}
organization
"CZ.NIC, z. s. p. o.";
contact
"Editor:   Ladislav Lhotka
          <mailto:lhotka@nic.cz>";
description
"This YANG module augment common resolver data with parts
specific to Knot Resolver.";
revision 2018-07-27 {
description
"Initial revision.";
}
/* Data definitions */
augment "/drc:dns-resolver/drc:resolver/drc:hints" {
description
"Knot Resolver module: hints";
list hint {
key "name";
description
"Each entry defines a static hint.
Forward queries for A/AAAA records corresponding to 'name'
(the list key) shall be answered with all IPv4/IPv6
addresses from the 'values' leaf-list.
The PTR record linking all addresses from 'values' to 'name'
in the reverse zone.
If multiple entries with the same address in 'values' exist,
the one having the 'canonical' flag set to true is used for
the PTR record in the reverse zone. If no such entry exists,
the name for the PTR record is chosen randomly.";
uses drc:static-hint;
leaf canonical {
type boolean;
must ". = 'false' or "
+ "not(../preceding-sibling::hint[canonical = 'true' and "
+ "values = current()/../values])" {
error-message
"Duplicate canonical name for the same IP address.";
}
default "false";
description
"Only one key can be designated as the canonical name for
any given IP address.";
}
}
leaf hosts-file {
type drc:fs-path;
description
"Static hints will be added from the file with this path. The
file has to be in the format of Unix /etc/hosts file.";
}
}
augment "/drc:dns-resolver/drc:cache" {
description
"Knot Resolver module: prefill";
list prefill {
key "origin";
description
"Prefill the cache periodically by importing zone data
obtained over HTTP.";
leaf origin {
type inet:domain-name;
must ". = '.'" {
error-message "Cache prefilling is not yet supported for "
+ "non-root zones.";
description
"Cache prefilling is only supported for the root zone.";
}
description
"Origin for the imported data.";
}
leaf url {
type inet:uri;
mandatory "true";
description
"URL of the zone file to be imported.";
}
leaf ca-file {
type drc:fs-path;
mandatory "true";
description
"Path to the file containing a CA certificate bundle that
is used to authenticate the HTTPS connection.";
}
leaf refresh-interval {
type uint32;
units "seconds";
default "86400";
description
"Time interval between consecutive refreshes of the
imported zone data.";
}
}
}
}
This diff is collapsed.
+--rw cznic-resolver-common:dns-resolver
| +--rw cache
| | +--ro current-size? <uint64>
| | +--rw max-size? <uint64>
| | +--rw max-ttl? <uint32>
| | +--rw min-ttl? <uint32>
| | +--rw cznic-resolver-knot:prefill* [origin]
| | +--rw ca-file <fs-path(string)>
| | +--rw origin <domain-name(string)>
| | +--rw refresh-interval? <uint32>
| | +--rw url <uri(string)>
| +--rw dns64!
| | +--rw prefix? <ipv6-prefix(string)>
| +--rw dnssec!
| | +--rw negative-trust-anchors* <domain-name(string)>
| | +--rw trust-anchors
| | +--rw key-files* [domain]
| | +--rw domain <domain-name(string)>
| | +--rw file? <fs-path(string)>
| | +--rw read-only? <boolean>
| +--rw logging
| | +--rw verbosity? <uint8>
| +--rw network
| | +--rw client-transport
| | | +--rw l2-protocols? <l2-protocol-selection(bits)>
| | +--rw listen-interfaces* [name]
| | | +--rw ip-address <ip-address(union)>
| | | +--rw name <string>
| | | +--rw port? <port-number(uint16)>
| | +--rw recursion-transport
| | | +--rw l2-protocols? <l2-protocol-selection(bits)>
| | +--rw source-address
| | | +--rw ipv4? <ipv4-address-no-zone(string)>
| | | +--rw ipv6? <ipv6-address-no-zone(string)>
| | +--rw udp-payload-size? <uint16>
| +--rw resolver
| | +--rw hints
| | | +--rw cznic-resolver-knot:hint* [name]
| | | | +--rw canonical? <boolean>
| | | | +--rw name <domain-name(string)>
| | | | +--rw values* <ip-address-no-zone(union)>
| | | +--rw cznic-resolver-knot:hosts-file? <fs-path(string)>
| | | +--rw root-hint* [name]
| | | | +--rw name <domain-name(string)>
| | | | +--rw values* <ip-address-no-zone(union)>
| | | +--rw root-zone-file? <fs-path(string)>
| | +--rw options
| | | +--rw glue-checking? <boolean>
| | | +--rw qname-minimisation? <boolean>
| | | +--rw query-loopback? <boolean>
| | | +--rw reorder-rrset? <boolean>
| | +--rw stub-zones* [domain]
| | +--rw domain <domain-name(string)>
| | +--rw nameserver? <host(union)>
| | +--rw port? <port-number(uint16)>
| +--rw server
| +--rw group-name? <string>
| +--rw user-name? <string>
+---x cznic-resolver-common:resolve
+--ro input
| +--ro cznic-resolver-common:class? <dns-class(union)>
| +--ro cznic-resolver-common:name <domain-name(string)>
| +--ro cznic-resolver-common:type <identityref>
+--ro output
......@@ -2,16 +2,9 @@
"ietf-yang-library:modules-state": {
"module-set-id": "e595da11ace92c0d881995fa7e56bbe86f1f48e9",
"module": [
{
"name": "cznic-dns-types",
"revision": "2018-05-14",
"namespace": "https://www.nic.cz/ns/yang/dns-types",
"conformance-type": "implement",
"schema": "https://gitlab.labs.nic.cz/jetconf/jetconf-resolver/blob/master/yang-modules/cznic-dns-types.yang"
},
{
"name": "cznic-resolver-common",
"revision": "2018-07-27",
"revision": "2018-10-26",
"feature": [
"set-group"
],
......@@ -20,30 +13,22 @@
},
{
"name": "cznic-resolver-knot",
"revision": "2018-07-27",
"revision": "2018-10-26",
"namespace": "https://www.nic.cz/ns/yang/resolver-knot",
"conformance-type": "implement"
},
{
"name": "ietf-inet-types",
"revision": "2013-07-15",
"namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types",
"conformance-type": "import",
"schema": "https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types.yang"
},
{
"name": "ietf-yang-library",
"revision": "2016-06-21",
"namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-library",
"conformance-type": "implement"
"name": "iana-dns-class-rr-type",
"revision": "2018-10-26",
"namespace": "urn:ietf:params:xml:ns:yang:iana-dns-class-rr-type",
"conformance-type": "import"
},
{
"name": "ietf-yang-types",
"name": "ietf-inet-types",
"revision": "2013-07-15",
"namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-types",
"conformance-type": "import",
"schema": "https://github.com/YangModels/yang/blob/master/standard/ietf/RFC/ietf-yang-types.yang"
"namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types",
"conformance-type": "import"
}
]
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment