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

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>
module cznic-resolver-common {
yang-version "1.1";
namespace "https://www.nic.cz/ns/yang/resolver-common";
prefix "drc";
import ietf-inet-types {
prefix "inet";
}
organization
"CZ.NIC, z. s. p. o.";
contact
"Editor:   Ladislav Lhotka
          <mailto:lhotka@nic.cz>";
description
"This YANG module defines the common part of a data model for DNS
resolvers.";
revision 2018-07-27 {
description
"Initial revision.";
reference
"TODO: put git tag here";
}
/* Features */
feature set-group {
description
"This feature indicates support for setting the group.";
}
/* Typedefs */
typedef fs-path {
type string;
description
"This type is used for specifying a filesystem path (absolute
or relative).
An implementation must check that the string satisfies all
rules of the underlying operating system.";
}
typedef l2-protocol-selection {
type bits {
bit ipv4 {
description
"Enable/disable IPv4.";
}
bit ipv6 {
description
"Enable/disable IPv6.";
}
}
default "ipv4 ipv6";
}
/* Groupings */
grouping static-hint {
description
"This grouping defines the content of a static hint.";
leaf name {
type inet:domain-name;
description
"Domain name of a root server.";
}
leaf-list values {
type inet:ip-address-no-zone;
min-elements "1";
description
"One or more IPv4/IPv6 addresses of the root server.";
}
}
/* Data definitions */
container dns-resolver {
description
"DNS resolver parameters.";
container server {
description
"Parameters of the resolver process.";
leaf user-name {
type string;
description
"After binding the network socket, drop the privileges and
run with effective user ID of this user.";
}
leaf group-name {
if-feature "set-group";
type string;
description
"After binding the network socket, drop the privileges and
run with effective group ID of this group.";
}
}
container network {
description
"Network connection parameters.";
list listen-interfaces {
key "name";
unique "ip-address port";
description
"Inet sockets to use for listening to queries.";
leaf name {
type string;
description
"Arbitrary name of the listening socket.";
}
leaf ip-address {
type inet:ip-address;
mandatory "true";
description
"IPv4 or IPv6 address.";
}
leaf port {
type inet:port-number;
default "53";
description
"Port number.";
}
}
container source-address {
leaf ipv4 {
type inet:ipv4-address-no-zone;
description
"IPv4 address to use as the source address in outgoing
queries.
If not configured, the resolver uses any address
provided by the operationg system.";
}
leaf ipv6 {
type inet:ipv6-address-no-zone;
description
"IPv6 address to use as the source address in outgoing
queries.
If not configured, the resolver uses any address
provided by the operationg system.";
}
}
container client-transport {
description
"Specify L2 and L3 protocols used for receiving and
answering client queries.";
leaf l2-protocols {
type l2-protocol-selection;
description
"L2 protocols used for receiving and answering client
queries.";
}
}
container recursion-transport {
description
"Specify L2 and L3 protocols used for recursive queries.";
leaf l2-protocols {