summaryrefslogtreecommitdiffstats
path: root/yang
diff options
context:
space:
mode:
Diffstat (limited to 'yang')
-rw-r--r--yang/.gitignore2
-rw-r--r--yang/confd/confd.frr-ripd.yang24
-rw-r--r--yang/confd/confd.frr-ripngd.yang24
-rw-r--r--yang/embedmodel.py112
-rw-r--r--yang/example/ietf-rip.json40
-rw-r--r--yang/example/ripd.json47
-rw-r--r--yang/example/ripd.xml35
-rw-r--r--yang/frr-affinity-map.yang81
-rw-r--r--yang/frr-bfdd.yang512
-rw-r--r--yang/frr-bgp-bmp.yang204
-rw-r--r--yang/frr-bgp-common-multiprotocol.yang208
-rw-r--r--yang/frr-bgp-common-structure.yang815
-rw-r--r--yang/frr-bgp-common.yang1172
-rw-r--r--yang/frr-bgp-filter.yang329
-rw-r--r--yang/frr-bgp-neighbor.yang134
-rw-r--r--yang/frr-bgp-peer-group.yang99
-rw-r--r--yang/frr-bgp-route-map.yang1169
-rw-r--r--yang/frr-bgp-rpki.yang210
-rw-r--r--yang/frr-bgp-types.yang151
-rw-r--r--yang/frr-bgp.yang1369
-rw-r--r--yang/frr-deviations-bgp-datacenter.yang107
-rw-r--r--yang/frr-eigrpd.yang367
-rw-r--r--yang/frr-filter.yang357
-rw-r--r--yang/frr-gmp.yang183
-rw-r--r--yang/frr-if-rmap.yang80
-rw-r--r--yang/frr-interface.yang320
-rw-r--r--yang/frr-isisd.yang2517
-rw-r--r--yang/frr-module-translator.yang94
-rw-r--r--yang/frr-nexthop.yang348
-rw-r--r--yang/frr-ospf-route-map.yang52
-rw-r--r--yang/frr-ospf6-route-map.yang47
-rw-r--r--yang/frr-ospfd.yang1004
-rw-r--r--yang/frr-pathd.yang505
-rw-r--r--yang/frr-pim-rp.yang128
-rw-r--r--yang/frr-pim.yang552
-rw-r--r--yang/frr-ripd.yang768
-rw-r--r--yang/frr-ripngd.yang384
-rw-r--r--yang/frr-route-map.yang542
-rw-r--r--yang/frr-route-types.yang182
-rw-r--r--yang/frr-routing.yang260
-rw-r--r--yang/frr-staticd.yang149
-rw-r--r--yang/frr-test-module.yang86
-rw-r--r--yang/frr-vrf.yang86
-rw-r--r--yang/frr-vrrpd.yang293
-rw-r--r--yang/frr-zebra-route-map.yang136
-rw-r--r--yang/frr-zebra.yang2236
-rw-r--r--yang/ietf/frr-deviations-ietf-interfaces.yang72
-rw-r--r--yang/ietf/frr-deviations-ietf-rip.yang197
-rw-r--r--yang/ietf/frr-deviations-ietf-routing.yang53
-rw-r--r--yang/ietf/frr-ietf-translator.json99
-rw-r--r--yang/ietf/ietf-bgp-types.yang525
-rw-r--r--yang/ietf/ietf-interfaces.yang1123
-rw-r--r--yang/ietf/ietf-routing-types.yang751
-rw-r--r--yang/libyang_plugins/frr_user_types.c122
-rw-r--r--yang/libyang_plugins/subdir.am7
-rw-r--r--yang/subdir.am131
56 files changed, 21600 insertions, 0 deletions
diff --git a/yang/.gitignore b/yang/.gitignore
new file mode 100644
index 0000000..f43a1c3
--- /dev/null
+++ b/yang/.gitignore
@@ -0,0 +1,2 @@
+*.yang.c
+*.yin
diff --git a/yang/confd/confd.frr-ripd.yang b/yang/confd/confd.frr-ripd.yang
new file mode 100644
index 0000000..7bbe54c
--- /dev/null
+++ b/yang/confd/confd.frr-ripd.yang
@@ -0,0 +1,24 @@
+module confd.frr-ripd {
+ namespace "urn:dummy";
+ prefix "dummy";
+
+ import tailf-common {
+ prefix tailf;
+ }
+ import frr-ripd {
+ prefix frr-ripd;
+ }
+
+ tailf:annotate-module "frr-ripd" {
+ tailf:annotate-statement "container[name='ripd']" {
+ tailf:annotate-statement "list[name='instance']" {
+ tailf:annotate-statement "container[name='state']" {
+ tailf:callpoint "state";
+ }
+ }
+ }
+ tailf:annotate-statement "rpc[name='clear-rip-route']" {
+ tailf:actionpoint "actionpoint";
+ }
+ }
+}
diff --git a/yang/confd/confd.frr-ripngd.yang b/yang/confd/confd.frr-ripngd.yang
new file mode 100644
index 0000000..83383fb
--- /dev/null
+++ b/yang/confd/confd.frr-ripngd.yang
@@ -0,0 +1,24 @@
+module confd.frr-ripngd {
+ namespace "urn:dummy";
+ prefix "dummy";
+
+ import tailf-common {
+ prefix tailf;
+ }
+ import frr-ripngd {
+ prefix frr-ripngd;
+ }
+
+ tailf:annotate-module "frr-ripngd" {
+ tailf:annotate-statement "container[name='ripngd']" {
+ tailf:annotate-statement "list[name='instance']" {
+ tailf:annotate-statement "container[name='state']" {
+ tailf:callpoint "state";
+ }
+ }
+ }
+ tailf:annotate-statement "rpc[name='clear-ripng-route']" {
+ tailf:actionpoint "actionpoint";
+ }
+ }
+}
diff --git a/yang/embedmodel.py b/yang/embedmodel.py
new file mode 100644
index 0000000..6d37839
--- /dev/null
+++ b/yang/embedmodel.py
@@ -0,0 +1,112 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: NONE
+#
+# YANG module to C wrapper
+# written 2018 by David Lamparter, placed in Public Domain.
+
+import sys
+import os
+import string
+import re
+
+inname = sys.argv[1]
+outname = sys.argv[2]
+
+outdir = os.path.dirname(os.path.abspath(outname))
+try:
+ os.makedirs(outdir)
+except FileExistsError:
+ pass
+
+# these are regexes to avoid a compile-time/host dependency on yang-tools
+# or python-yang. Cross-compiling FRR is already somewhat involved, no need
+# to make it even harder.
+
+re_name = re.compile(r"\bmodule\s+([^\s]+)\s+\{")
+re_subname = re.compile(r"\bsubmodule\s+([^\s]+)\s+\{")
+re_mainname = re.compile(r"\bbelongs-to\s+([^\s]+)\s+\{")
+re_rev = re.compile(r"\brevision\s+([\d-]+)\s+\{")
+
+
+template = """/* autogenerated by embedmodel.py. DO NOT EDIT */
+
+#include <zebra.h>
+#include "yang.h"
+
+static const char model[] =
+\t"%s";
+
+static struct yang_module_embed embed = {
+\t.mod_name = "%s",
+\t.mod_rev = "%s",
+\t.sub_mod_name = "%s",
+\t.sub_mod_rev = "%s",
+\t.data = model,
+\t.format = %s,
+};
+
+static void embed_register(void) __attribute__((_CONSTRUCTOR(2000)));
+static void embed_register(void)
+{
+\tyang_module_embed(&embed);
+}
+"""
+
+passchars = set(string.printable) - set("\\'\"%\r\n\t\x0b\x0c")
+
+
+def escapech(char):
+ if char in passchars:
+ return char
+ if char == "\n":
+ return "\\n"
+ if char == "\t":
+ return "\\t"
+ if char in "\"\\'":
+ return "\\" + char
+ return "\\x%02x" % (ord(char))
+
+
+def escape(line):
+ return "".join([escapech(i) for i in line])
+
+
+with open(inname, "r") as fd:
+ data = fd.read()
+
+sub_name = ""
+rev = ""
+sub_rev = ""
+
+# XML support isn't actively used currently, but it's here in case the need
+# arises. It does avoid the regex'ing.
+if "<?xml" in data:
+ from xml.etree import ElementTree
+
+ xml = ElementTree.fromstring(data)
+ name = xml.get("name")
+ rev = xml.find("{urn:ietf:params:xml:ns:yang:yin:1}revision").get("date")
+ fmt = "LYS_YIN"
+else:
+ search_name = re_name.search(data)
+ if search_name:
+ name = search_name.group(1)
+ rev = re_rev.search(data).group(1)
+ else:
+ search_name = re_subname.search(data)
+ sub_name = search_name.group(1)
+ name = re_mainname.search(data).group(1)
+ sub_rev = re_rev.search(data).group(1)
+ fmt = "LYS_IN_YANG"
+
+if name is None or rev is None:
+ raise ValueError("cannot determine YANG module name and revision")
+
+lines = [escape(row) for row in data.split("\n")]
+text = '\\n"\n\t"'.join(lines)
+
+with open(outname, "w") as fd:
+ fd.write(
+ template
+ % (text, escape(name), escape(rev), escape(sub_name), escape(sub_rev), fmt)
+ )
diff --git a/yang/example/ietf-rip.json b/yang/example/ietf-rip.json
new file mode 100644
index 0000000..bc76207
--- /dev/null
+++ b/yang/example/ietf-rip.json
@@ -0,0 +1,40 @@
+{
+ "ietf-interfaces:interfaces": {
+ "interface": [
+ {
+ "description": "Engineering",
+ "name": "eth0"
+ }
+ ]
+ },
+ "ietf-routing:routing": {
+ "control-plane-protocols": {
+ "control-plane-protocol": [
+ {
+ "name": "main",
+ "type": "ietf-rip:ripv2",
+ "ietf-rip:rip": {
+ "default-metric": "2",
+ "distance": "80",
+ "interfaces": {
+ "interface": [
+ {
+ "interface": "eth0",
+ "split-horizon": "poison-reverse"
+ }
+ ]
+ },
+ "originate-default-route": {
+ "enabled": "true"
+ },
+ "timers": {
+ "flush-interval": "241",
+ "holddown-interval": "181",
+ "update-interval": "31"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/yang/example/ripd.json b/yang/example/ripd.json
new file mode 100644
index 0000000..799f46a
--- /dev/null
+++ b/yang/example/ripd.json
@@ -0,0 +1,47 @@
+{
+ "frr-interface:lib": {
+ "interface": [
+ {
+ "name": "eth0",
+ "vrf": "default",
+ "description": "engineering",
+ "frr-ripd:rip": {
+ "split-horizon": "poison-reverse",
+ "v2-broadcast": "true",
+ "version-receive": "1",
+ "version-send": "1"
+ }
+ },
+ {
+ "name": "eth1",
+ "vrf": "default",
+ "description": "marketing"
+ }
+ ]
+ },
+ "frr-ripd:ripd": {
+ "instance": [
+ {
+ "vrf": "default",
+ "allow-ecmp": 1,
+ "distance": {
+ "source": [
+ {
+ "distance": "25",
+ "prefix": "172.16.1.0/24"
+ }
+ ]
+ },
+ "redistribute": [
+ {
+ "metric": "3",
+ "protocol": "ospf"
+ }
+ ],
+ "static-route": [
+ "10.0.1.0/24"
+ ]
+ }
+ ]
+ }
+}
diff --git a/yang/example/ripd.xml b/yang/example/ripd.xml
new file mode 100644
index 0000000..dad8361
--- /dev/null
+++ b/yang/example/ripd.xml
@@ -0,0 +1,35 @@
+<lib xmlns="http://frrouting.org/yang/interface">
+ <interface>
+ <name>eth0</name>
+ <vrf>default</vrf>
+ <description>engineering</description>
+ <rip xmlns="http://frrouting.org/yang/ripd">
+ <split-horizon>poison-reverse</split-horizon>
+ <version-receive>1</version-receive>
+ <version-send>1</version-send>
+ <v2-broadcast>true</v2-broadcast>
+ </rip>
+ </interface>
+ <interface>
+ <name>eth1</name>
+ <vrf>default</vrf>
+ <description>marketing</description>
+ </interface>
+</lib>
+<ripd xmlns="http://frrouting.org/yang/ripd">
+ <instance>
+ <vrf>default</vrf>
+ <allow-ecmp>1</allow-ecmp>
+ <static-route>10.0.1.0/24</static-route>
+ <distance>
+ <source>
+ <prefix>172.16.1.0/24</prefix>
+ <distance>25</distance>
+ </source>
+ </distance>
+ <redistribute>
+ <protocol>ospf</protocol>
+ <metric>3</metric>
+ </redistribute>
+ </instance>
+</ripd>
diff --git a/yang/frr-affinity-map.yang b/yang/frr-affinity-map.yang
new file mode 100644
index 0000000..c4377e6
--- /dev/null
+++ b/yang/frr-affinity-map.yang
@@ -0,0 +1,81 @@
+module frr-affinity-map {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/affinity-map";
+ prefix frr-affinity-map;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-filter {
+ prefix filter;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines route map settings
+
+ Copyright 2022 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2022-11-03 {
+ description
+ "Initial revision";
+ }
+
+ container lib {
+ container affinity-maps {
+ description
+ "Affinity Mapping Table";
+ list affinity-map {
+ key "name";
+ description
+ "Affinity Mapping configuration";
+ leaf name {
+ type string {
+ length "1..32";
+ }
+ description
+ "Affinity Name";
+ }
+ leaf value {
+ type uint16 {
+ range "0..1023";
+ }
+ description
+ "Bit position";
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-bfdd.yang b/yang/frr-bfdd.yang
new file mode 100644
index 0000000..ffba42b
--- /dev/null
+++ b/yang/frr-bfdd.yang
@@ -0,0 +1,512 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-bfdd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/bfdd";
+ prefix frr-bfdd;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import frr-interface {
+ prefix frr-interface;
+ }
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR bfdd daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-05-09 {
+ description "Initial revision.";
+ reference
+ "RFC 5880: Bidirectional Forwarding Detection (BFD).
+ RFC 5881: Bidirectional Forwarding Detection (BFD)
+ for IPv4 and IPv6 (Single Hop).
+ RFC 5883: Bidirectional Forwarding Detection (BFD) for Multihop Paths.";
+ }
+
+
+ /*
+ * BFD types declaration.
+ */
+ typedef multiplier {
+ description "Detection multiplier";
+ type uint8 {
+ range "2..255";
+ }
+ }
+
+ typedef discriminator {
+ description "BFD session identification";
+ type uint32 {
+ range "1..4294967295";
+ }
+ }
+
+ typedef state {
+ description "BFD session state";
+ type enumeration {
+ enum admin-down {
+ value 0;
+ description "Administratively down";
+ }
+ enum down {
+ value 1;
+ description "Down";
+ }
+ enum init {
+ value 2;
+ description "Initializing";
+ }
+ enum up {
+ value 3;
+ description "Up";
+ }
+ }
+ }
+
+ typedef diagnostic {
+ description "BFD session diagnostic";
+ type enumeration {
+ enum ok {
+ value 0;
+ description "Ok";
+ }
+ enum control-expired {
+ value 1;
+ description "Control timer expired";
+ }
+ enum echo-failed {
+ value 2;
+ description "Echo function failed";
+ }
+ enum neighbor-down {
+ value 3;
+ description "Neighbor signaled session down";
+ }
+ enum forwarding-reset {
+ value 4;
+ description "Forwarding plane reset";
+ }
+ enum path-down {
+ value 5;
+ description "Path down";
+ }
+ enum concatenated-path-down {
+ value 6;
+ description "Concatenated path down";
+ }
+ enum administratively-down {
+ value 7;
+ description "Administratively down";
+ }
+ enum reverse-concat-path-down {
+ value 8;
+ description "Reverse concatenated path down";
+ }
+ }
+ }
+
+ typedef profile-name {
+ type string {
+ length "1..64";
+ }
+ description "Profile name format";
+ }
+
+ typedef profile-ref {
+ type leafref {
+ path "/frr-bfdd:bfdd/frr-bfdd:bfd/frr-bfdd:profile/frr-bfdd:name";
+ require-instance false;
+ }
+ description "Reference to a BFD profile";
+ }
+
+ /*
+ * Shared BFD items.
+ */
+ grouping session-common {
+ description "Common BFD session settings";
+
+ leaf detection-multiplier {
+ type multiplier;
+ default 3;
+ description "Local session detection multiplier";
+ }
+
+ leaf desired-transmission-interval {
+ type uint32 {
+ range "10000..60000000";
+ }
+ units microseconds;
+ default 300000;
+ description "Minimum desired control packet transmission interval";
+ }
+
+ leaf required-receive-interval {
+ type uint32 {
+ range "10000..60000000";
+ }
+ units microseconds;
+ default 300000;
+ description "Minimum required control packet receive interval";
+ }
+
+ leaf administrative-down {
+ type boolean;
+ default false;
+ description "Disables or enables the session administratively";
+ }
+
+ leaf passive-mode {
+ type boolean;
+ default false;
+ description
+ "Don't attempt to start session establishment.";
+ }
+ }
+
+ grouping session-echo {
+ description "BFD session echo settings";
+
+ leaf echo-mode {
+ type boolean;
+ default false;
+ description "Use echo packets to detect failures";
+ }
+
+ leaf desired-echo-transmission-interval {
+ type uint32 {
+ range "10000..60000000";
+ }
+ units microseconds;
+ default 50000;
+ description "Minimum desired echo packet transmission interval";
+ }
+
+ leaf required-echo-receive-interval {
+ type uint32 {
+ range "0 | 10000..60000000";
+ }
+ units microseconds;
+ default 50000;
+ description "Minimum required echo packet receive interval";
+ }
+ }
+
+ grouping session-multi-hop {
+ description "BFD session multi hop settings.";
+
+ leaf minimum-ttl {
+ type uint8 {
+ range "1..254";
+ }
+ default "254";
+ description
+ "Minimum expected TTL on received packets.";
+ }
+ }
+
+ grouping bfd-monitoring {
+ description
+ "BFD monitoring template for protocol integration.";
+
+ leaf source {
+ type inet:ip-address;
+ description
+ "Source address to use for liveness check.
+
+ When source is not set and multi-hop is `false` the source
+ address will be `0.0.0.0` (any).
+
+ When source is not set and multi-hop is `true` the source
+ address will be automatic selected through Next Hop Tracking (NHT).";
+ }
+
+ leaf multi-hop {
+ description
+ "Use multi hop session instead of single hop.";
+ type boolean;
+ default false;
+ }
+
+ leaf profile {
+ description
+ "BFD pre configured profile.";
+ type frr-bfdd:profile-ref;
+ }
+ }
+
+ grouping session-states {
+ /*
+ * Local settings.
+ */
+ leaf local-discriminator {
+ type discriminator;
+ description "Local session identifier";
+ }
+
+ leaf local-state {
+ type state;
+ description "Local session state";
+ }
+
+ leaf local-diagnostic {
+ type diagnostic;
+ description "Local session diagnostic";
+ }
+
+ leaf local-multiplier {
+ type multiplier;
+ description "Local session current multiplier";
+ }
+
+ /*
+ * Remote settings.
+ */
+ leaf remote-discriminator {
+ type discriminator;
+ description "Remote session identifier";
+ }
+
+ leaf remote-state {
+ type state;
+ description "Remote session state";
+ }
+
+ leaf remote-diagnostic {
+ type diagnostic;
+ description "Local session diagnostic";
+ }
+
+ leaf remote-multiplier {
+ type multiplier;
+ description "Remote session detection multiplier";
+ }
+
+ /*
+ * Negotiated settings.
+ */
+ leaf negotiated-transmission-interval {
+ description "Negotiated transmit interval";
+ type uint32;
+ units microseconds;
+ }
+
+ leaf negotiated-receive-interval {
+ description "Negotiated receive interval";
+ type uint32;
+ units microseconds;
+ }
+
+ leaf detection-mode {
+ description "Detection mode";
+
+ type enumeration {
+ enum async-with-echo {
+ value "1";
+ description "Async with echo";
+ }
+ enum async-without-echo {
+ value "2";
+ description "Async without echo";
+ }
+ enum demand-with-echo {
+ value "3";
+ description "Demand with echo";
+ }
+ enum demand-without-echo {
+ value "4";
+ description "Demand without echo";
+ }
+ }
+ }
+
+ /*
+ * Statistics.
+ */
+ leaf last-down-time {
+ type yang:date-and-time;
+ description "Time and date of the last time session was down";
+ }
+
+ leaf last-up-time {
+ type yang:date-and-time;
+ description "Time and date of the last time session was up";
+ }
+
+ leaf session-down-count {
+ type uint32;
+ description "Number of times the session went down";
+ }
+
+ leaf session-up-count {
+ type uint32;
+ description "Number of times the session went up";
+ }
+
+ leaf control-packet-input-count {
+ type uint64;
+ description "Number of control packets received";
+ }
+
+ leaf control-packet-output-count {
+ type uint64;
+ description "Number of control packets sent";
+ }
+
+ /*
+ * Echo mode operational data.
+ */
+ leaf negotiated-echo-transmission-interval {
+ type uint32;
+ units microseconds;
+ description "Negotiated echo transmit interval";
+ }
+
+ /*
+ * Statistics.
+ */
+ leaf echo-packet-input-count {
+ type uint64;
+ description "Number of echo packets received";
+ }
+
+ leaf echo-packet-output-count {
+ type uint64;
+ description "Number of echo packets sent";
+ }
+ }
+
+ /*
+ * BFD operational.
+ */
+ container bfdd {
+ container bfd {
+ presence "Present if the BFD protocol is enabled";
+
+ list profile {
+ key "name";
+ description "BFD pre configuration profiles";
+
+ leaf name {
+ type profile-name;
+ description "Profile name";
+ }
+
+ uses session-common;
+ uses session-echo;
+ uses session-multi-hop;
+ }
+
+ container sessions {
+ list single-hop {
+ key "dest-addr interface vrf";
+ description "List of single hop sessions";
+
+ leaf dest-addr {
+ type inet:ip-address;
+ description "IP address of the peer";
+ }
+
+ leaf interface {
+ type frr-interface:interface-ref;
+ description "Interface to use to contact peer";
+ }
+
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description "Virtual Routing Domain name";
+ }
+
+ leaf source-addr {
+ type inet:ip-address;
+ description "Local IP address";
+ }
+
+ leaf profile {
+ type profile-ref;
+ description "Override defaults with profile.";
+ }
+
+ uses session-common;
+ uses session-echo;
+
+ container stats {
+ uses session-states;
+ config false;
+ }
+ }
+
+ list multi-hop {
+ key "source-addr dest-addr vrf";
+ description "List of multi hop sessions";
+
+ leaf source-addr {
+ type inet:ip-address;
+ description "Local IP address";
+ }
+
+ leaf dest-addr {
+ type inet:ip-address;
+ description "IP address of the peer";
+ }
+
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description "Virtual Routing Domain name";
+ }
+
+ leaf profile {
+ type profile-ref;
+ description "Override defaults with profile.";
+ }
+
+ uses session-common;
+ uses session-multi-hop;
+
+ container stats {
+ uses session-states;
+ config false;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-bgp-bmp.yang b/yang/frr-bgp-bmp.yang
new file mode 100644
index 0000000..d6196d6
--- /dev/null
+++ b/yang/frr-bgp-bmp.yang
@@ -0,0 +1,204 @@
+// SPDX-License-Identifier: BSD-2-Clause
+submodule frr-bgp-bmp {
+ yang-version 1.1;
+
+ belongs-to frr-bgp {
+ prefix "bgp";
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-bgp-types {
+ prefix frr-bt;
+ }
+
+ include "frr-bgp-common-multiprotocol";
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This submodule defines a model for managing FRR BGP BMP.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ grouping bmp-incoming-session {
+ container incoming-session {
+ list session-list {
+ key "address tcp-port";
+ leaf address {
+ type inet:ip-address;
+ description
+ "IPv4 address to listen on.";
+ }
+
+ leaf tcp-port {
+ type uint32;
+ }
+ }
+ }
+ }
+
+ grouping bmp-outgoing-session {
+ container outgoing-session {
+ list session-list {
+ key "hostname tcp-port";
+ leaf hostname {
+ type string;
+ }
+
+ leaf tcp-port {
+ type uint32;
+ }
+
+ leaf min-retry-time {
+ type uint32 {
+ range "100..86400000";
+ }
+ units "milliseconds";
+ default "30000";
+ description
+ "Minimum connection retry interval.";
+ }
+
+ leaf max-retry-time {
+ type uint32 {
+ range "100..86400000";
+ }
+ units "milliseconds";
+ default "720000";
+ description
+ "Maximum connection retry interval.";
+ }
+ }
+ }
+ }
+
+ grouping bmp-afi-safis {
+ container afi-safis {
+ description
+ "List of address-families associated with the BGP
+ instance.";
+ list afi-safi {
+ key "afi-safi-name";
+ description
+ "AFI, SAFI configuration available for the
+ neighbour or group.";
+ uses mp-afi-safi-config;
+
+ uses mp-all-afi-safi-list-contents;
+ }
+ }
+ }
+
+ grouping bmp-afi-safi-common-config {
+ container common-config {
+ leaf pre-policy {
+ type boolean;
+ default "false";
+ description
+ "Send state before policy and filter processing.";
+ }
+
+ leaf post-policy {
+ type boolean;
+ default "false";
+ description
+ "Send state after policy and filter processing.";
+ }
+ }
+ }
+
+ grouping global-bmp-config {
+ description
+ "Structural grouping used to include filter
+ configuration for BMP.";
+ container bmp-config {
+ description
+ "BMP related parameters.";
+ list target-list {
+ key "target-name";
+ leaf target-name {
+ type string;
+ description
+ "Targets group name.";
+ }
+
+ uses bmp-incoming-session;
+
+ uses bmp-outgoing-session;
+
+ leaf mirror {
+ type boolean;
+ default "false";
+ description
+ "When set to 'TRUE' it send BMP route mirroring messages.";
+ }
+
+ leaf stats-time {
+ type uint32 {
+ range "100..86400000";
+ }
+ units "milliseconds";
+ description
+ "Interval to send BMP Stats.";
+ }
+
+ leaf ipv4-access-list {
+ type frr-bt:access-list-ref;
+ description
+ "Access list to restrict BMP sessions.";
+ }
+
+ leaf ipv6-access-list {
+ type frr-bt:access-list-ref;
+ description
+ "Access list to restrict BMP sessions.";
+ }
+
+ uses bmp-afi-safis;
+ }
+
+ leaf mirror-buffer-limit {
+ type uint32 {
+ range "0..4294967294";
+ }
+ units "bytes";
+ description
+ "Maximum memory used for buffered mirroring messages.";
+ }
+ }
+ }
+}
diff --git a/yang/frr-bgp-common-multiprotocol.yang b/yang/frr-bgp-common-multiprotocol.yang
new file mode 100644
index 0000000..c22bdf9
--- /dev/null
+++ b/yang/frr-bgp-common-multiprotocol.yang
@@ -0,0 +1,208 @@
+// SPDX-License-Identifier: BSD-2-Clause
+submodule frr-bgp-common-multiprotocol {
+ yang-version 1.1;
+
+ belongs-to frr-bgp {
+ prefix "bgp";
+ }
+
+ import frr-routing {
+ prefix frr-rt;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module contains general data definitions for use in BGP
+ Multiprotocol.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ grouping mp-afi-safi-config {
+ description
+ "Configuration parameters used for all BGP AFI-SAFIs.";
+ leaf afi-safi-name {
+ type identityref {
+ base frr-rt:afi-safi-type;
+ }
+ description
+ "AFI, SAFI.";
+ }
+ }
+
+ grouping mp-all-afi-safi-list-contents {
+ description
+ "A common grouping used for contents of the list that is used
+ for AFI-SAFI entries.";
+ container ipv4-unicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:ipv4-unicast')" {
+ description
+ "Include this container for IPv4 Unicast specific
+ configuration.";
+ }
+ description
+ "IPv4 unicast configuration options.";
+ }
+
+ container ipv6-unicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:ipv6-unicast')" {
+ description
+ "Include this container for IPv6 Unicast specific
+ configuration.";
+ }
+ description
+ "IPv6 unicast configuration options.";
+ }
+
+ container ipv4-labeled-unicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:ipv4-labeled-unicast')" {
+ description
+ "Include this container for IPv4 Labeled Unicast specific
+ configuration.";
+ }
+ description
+ "IPv4 Labeled Unicast configuration options.";
+ }
+
+ container ipv6-labeled-unicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:ipv6-labeled-unicast')" {
+ description
+ "Include this container for IPv6 Labeled Unicast specific
+ configuration.";
+ }
+ description
+ "IPv6 Labeled Unicast configuration options.";
+ }
+
+ container l3vpn-ipv4-unicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:l3vpn-ipv4-unicast')" {
+ description
+ "Include this container for IPv4 Unicast L3VPN specific
+ configuration.";
+ }
+ description
+ "Unicast IPv4 L3VPN configuration options.";
+ }
+
+ container l3vpn-ipv6-unicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:l3vpn-ipv6-unicast')" {
+ description
+ "Include this container for unicast IPv6 L3VPN specific
+ configuration.";
+ }
+ description
+ "Unicast IPv6 L3VPN configuration options.";
+ }
+
+ container l3vpn-ipv4-multicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:l3vpn-ipv4-multicast')" {
+ description
+ "Include this container for multicast IPv4 L3VPN specific
+ configuration.";
+ }
+ description
+ "Multicast IPv4 L3VPN configuration options.";
+ }
+
+ container l3vpn-ipv6-multicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:l3vpn-ipv6-multicast')" {
+ description
+ "Include this container for multicast IPv6 L3VPN specific
+ configuration.";
+ }
+ description
+ "Multicast IPv6 L3VPN configuration options.";
+ }
+
+ container l2vpn-vpls {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:l2vpn-vpls')" {
+ description
+ "Include this container for BGP-signalled VPLS specific
+ configuration.";
+ }
+ description
+ "BGP-signalled VPLS configuration options.";
+ }
+
+ container l2vpn-evpn {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:l2vpn-evpn')" {
+ description
+ "Include this container for BGP EVPN specific
+ configuration.";
+ }
+ description
+ "BGP EVPN configuration options.";
+ }
+
+ container ipv4-multicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:ipv4-multicast')" {
+ description
+ "Include this container for IPv4 multicast specific
+ configuration.";
+ }
+ description
+ "IPv4 multicast configuration options.";
+ }
+
+ container ipv6-multicast {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:ipv6-multicast')" {
+ description
+ "Include this container for IPv6 multicast specific
+ configuration.";
+ }
+ description
+ "IPv6 multicast configuration options.";
+ }
+
+ container ipv4-flowspec {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:ipv4-flowspec')" {
+ description
+ "Include this container for IPv4 flowspec specific
+ configuration.";
+ }
+ description
+ "IPv4 flowspec configuration options.";
+ }
+
+ container ipv6-flowspec {
+ when "derived-from-or-self(../afi-safi-name, 'frr-rt:ipv6-flowspec')" {
+ description
+ "Include this container for IPv6 flowspec specific
+ configuration.";
+ }
+ description
+ "IPv6 flowspec configuration options.";
+ }
+ }
+}
diff --git a/yang/frr-bgp-common-structure.yang b/yang/frr-bgp-common-structure.yang
new file mode 100644
index 0000000..81683e8
--- /dev/null
+++ b/yang/frr-bgp-common-structure.yang
@@ -0,0 +1,815 @@
+// SPDX-License-Identifier: BSD-2-Clause
+submodule frr-bgp-common-structure {
+ yang-version 1.1;
+
+ belongs-to frr-bgp {
+ prefix "bgp";
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ import ietf-bgp-types {
+ prefix bt;
+ }
+
+ import frr-bgp-types {
+ prefix frr-bt;
+ }
+
+ include "frr-bgp-common";
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This submodule contains general data definitions for use in BGP.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ grouping structure-neighbor-group-ebgp-multihop {
+ description
+ "Structural grouping used to include EBGP multi-hop
+ configuration for both BGP neighbors and peer groups.";
+ container ebgp-multihop {
+ description
+ "EBGP multi-hop parameters for the BGP group.";
+ choice hop-count-choice {
+ case default-hop-count {
+ leaf enabled {
+ type boolean;
+ default "false";
+ description
+ "When enabled the referenced group or neighbors are
+ permitted to be indirectly connected - including cases
+ where the TTL can be decremented between the BGP peers.";
+ }
+ }
+
+ case max-hop-count {
+ leaf multihop-ttl {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Time-to-live value to use when packets are sent to the
+ referenced group or neighbors and ebgp-multihop is
+ enabled.";
+ }
+ }
+ }
+
+ leaf disable-connected-check {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it enforces EBGP neighbors perform multihop.";
+ }
+ }
+ }
+
+ grouping neighbor-local-as-options {
+ container local-as {
+ leaf local-as {
+ type inet:as-number;
+ description
+ "The local autonomous system number that is to be used when
+ establishing sessions with the remote peer or peer group, if
+ this differs from the global BGP router autonomous system
+ number.";
+ }
+
+ leaf no-prepend {
+ type boolean;
+ default "false";
+ description
+ "Do not prepend local-as to updates from EBGP peers. When
+ set to 'true' it will not prepend local-as to updates. When
+ set to 'false' it will prepend local-as to updates.";
+ }
+
+ leaf replace-as {
+ type boolean;
+ default "false";
+ description
+ "Do not prepend local-as to updates from IBGP peers.";
+ }
+ }
+ }
+
+ grouping neighbor-bfd-options {
+ container bfd-options {
+ leaf enable {
+ type boolean;
+ default "false";
+ description
+ "BFD support.";
+ }
+
+ leaf detect-multiplier {
+ when "../enable = 'true'";
+ type uint8 {
+ range "2..255";
+ }
+ default "3";
+ description
+ "Detect multiplier.";
+ }
+
+ leaf required-min-rx {
+ when "../enable = 'true'";
+ type uint16 {
+ range "50..60000";
+ }
+ units "milliseconds";
+ default "300";
+ description
+ "Required min receive interval.";
+ }
+
+ leaf desired-min-tx {
+ when "../enable = 'true'";
+ type uint16 {
+ range "50..60000";
+ }
+ units "milliseconds";
+ default "300";
+ description
+ "Desired min transmit interval.";
+ }
+
+ leaf session-type {
+ when "../enable = 'true'";
+ type frr-bt:bfd-session-type;
+ default "not-configured";
+ description
+ "BFD session type.";
+ }
+
+ leaf check-cp-failure {
+ when "../enable = 'true'";
+ type boolean;
+ default "false";
+ description
+ "Link dataplane status with BGP control plane.";
+ }
+ }
+ }
+
+ grouping neighbor-remote-as {
+ container neighbor-remote-as {
+ leaf remote-as-type {
+ type frr-bt:as-type;
+ description
+ "Remote AS type.";
+ }
+
+ leaf remote-as {
+ when "../remote-as-type = 'as-specified'";
+ type inet:as-number;
+ description
+ "The remote autonomous system number received in
+ the BGP OPEN message.";
+ reference
+ "RFC 4271";
+ }
+ }
+ }
+
+ grouping neighbor-update-source {
+ description
+ "Source of routing updates.";
+ container update-source {
+ description
+ "Source of routing updates config.";
+ choice source {
+ case ip-based {
+ leaf ip {
+ type inet:ip-address;
+ description
+ "IPv4 address/IPv6 address.";
+ }
+ }
+
+ case interface-based {
+ leaf interface {
+ type frr-interface:interface-ref {
+ require-instance false;
+ }
+ description
+ "The local interface.";
+ }
+ }
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-add-paths {
+ description
+ "Structural grouping used to include ADD-PATHs configuration
+ and state for both BGP neighbors and peer groups.";
+ container add-paths {
+ description
+ "Parameters relating to the advertisement and receipt of
+ multiple paths for a single NLRI (add-paths).";
+ reference
+ "RFC 7911: ADD-PATH.";
+ leaf path-type {
+ type frr-bt:add-path-type;
+ default "none";
+ description
+ "Enable ability to receive multiple path advertisements for
+ an NLRI from the neighbor or group.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-as-path-options {
+ description
+ "Structural grouping used to include AS_PATH manipulation
+ configuration both BGP neighbors and peer groups.";
+ container as-path-options {
+ description
+ "AS_PATH manipulation parameters for the BGP neighbor or
+ group.";
+ choice allowas-in {
+ case occurence-based {
+ leaf allow-own-as {
+ type uint8 {
+ range "1..10";
+ }
+ description
+ "Specify the number of occurrences of the local BGP
+ speaker's AS that can occur within the AS_PATH before it
+ is rejected.";
+ }
+ }
+
+ case origin-based {
+ leaf allow-own-origin-as {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' only accept my AS in the as-path
+ if the route was originated in my AS.";
+ }
+ }
+ }
+
+ leaf replace-peer-as {
+ type boolean;
+ default "false";
+ description
+ "Replace occurrences of the peer's AS in the AS_PATH with
+ the local autonomous system number. This is same as override
+ ASN CLI.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-capability-options {
+ description
+ "Structural grouping used to include capability
+ configuration for both BGP neighbors and peer groups.";
+ container capability-options {
+ description
+ "Capability manipulation parameters for the BGP neighbor or
+ group.";
+ leaf dynamic-capability {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' dynamic capability is advertise to this peer.";
+ }
+
+ leaf strict-capability {
+ type boolean;
+ default "false";
+ description
+ "Strict capability negotiation match. When set to 'true'
+ remote and local capabilities are strictly compared
+ if capabilities are different, send Unsupported Capability
+ error then reset connection.";
+ }
+
+ leaf extended-nexthop-capability {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' extended next-hop capability is advertise
+ to this peer.";
+ }
+
+ leaf capability-negotiate {
+ type boolean;
+ default "true";
+ description
+ "When set to 'true' sending Capability Negotiation in the open
+ message is suppressed to this peer.";
+ }
+
+ leaf override-capability {
+ type boolean;
+ default "false";
+ description
+ "Overrides the result of Capability Negotiation, ignoring remote
+ peer's capability value, when set to 'true'.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-default-originate-options {
+ description
+ "Structural grouping used to include default-originate
+ configuration for both BGP neighbors and peer groups.";
+ container default-originate {
+ description
+ "default originate parameters for the BGP neighbor or
+ group.";
+ leaf originate {
+ type boolean;
+ default "false";
+ description
+ "If set to 'true', send the default-route to the neighbour(s).";
+ }
+
+ leaf route-map {
+ type frr-route-map:route-map-ref;
+ description
+ "Route-map to specify criteria to originate default.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-prefix-limit {
+ container prefix-limit {
+ description
+ "Parameters relating to the prefix limit for the AFI-SAFI.";
+ list direction-list {
+ key "direction";
+ leaf direction {
+ type frr-bt:direction;
+ description
+ "Prefix limit applied on Tx route-updates or Rx route-updates.";
+ }
+
+ leaf max-prefixes {
+ type uint32;
+ mandatory true;
+ description
+ "Maximum number of prefixes that will be accepted from the
+ neighbour.";
+ }
+
+ leaf force-check {
+ type boolean;
+ default false;
+ description
+ "Force check all received routes.";
+ }
+
+ container options {
+ when "../direction = 'in'";
+ choice options {
+ case warning {
+ leaf warning-only {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' only give warning message when limit
+ is exceeded.";
+ }
+ }
+
+ case restart {
+ leaf restart-timer {
+ type uint16;
+ units "minutes";
+ description
+ "Time interval in seconds after which the BGP session is
+ re-established after being torn down due to exceeding the
+ max-prefix limit.";
+ }
+ }
+
+ case threshold {
+ leaf shutdown-threshold-pct {
+ type bt:percentage;
+ description
+ "Threshold on number of prefixes that can be received from
+ a neighbour before generation of warning messages or log
+ entries. Expressed as a percentage of max-prefixes.";
+ }
+ }
+
+ case threshold-restart {
+ leaf tr-shutdown-threshold-pct {
+ type bt:percentage;
+ description
+ "Threshold on number of prefixes that can be received from
+ a neighbour before generation of warning messages or log
+ entries. Expressed as a percentage of max-prefixes.";
+ }
+
+ leaf tr-restart-timer {
+ type uint16;
+ units "minutes";
+ description
+ "Time interval in seconds after which the BGP session is
+ re-established after being torn down due to exceeding the
+ max-prefix limit.";
+ }
+ }
+
+ case threshold-warning {
+ leaf tw-shutdown-threshold-pct {
+ type bt:percentage;
+ description
+ "Threshold on number of prefixes that can be received from
+ a neighbour before generation of warning messages or log
+ entries. Expressed as a percentage of max-prefixes.";
+ }
+
+ leaf tw-warning-only {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' only give warning message when limit
+ is exceeded.";
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ grouping structure-neighbor-nexthop-self {
+ container nexthop-self {
+ description
+ "Parameters relating to the nexthop-self for the AFI-SAFI.";
+ leaf next-hop-self {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true', EBGP learned routes are announced with the
+ local speaker's nexthop.";
+ }
+
+ leaf next-hop-self-force {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true', EBGP learned routes are announced with the
+ local speaker's nexthop.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-private-as {
+ container private-as {
+ description
+ "Parameters relating to the private-as for the AFI-SAFI.";
+ leaf remove-private-as-all {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true', private ASNs are removed from outbound updates;
+ applies to all AS numbers.";
+ }
+
+ leaf remove-private-as-all-replace {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true', private ASNs are replaced by the local
+ speaker's ASN in all outbound updates; applies to all AS numbers.";
+ }
+
+ leaf remove-private-as {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true', removes private ASNs in outbound updates;
+ applies to all AS numbers.";
+ }
+
+ leaf remove-private-as-replace {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true', private ASNs are replaced with the local
+ speaker's ASN in all outbound updates; applies to all AS numbers.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-weight {
+ container weight {
+ description
+ "Parameters relating to the weight for the AFI-SAFI.";
+ leaf weight-attribute {
+ type uint16 {
+ range "0..65535";
+ }
+ description
+ "Set default weight for routes from this neighbor.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-route-reflector {
+ container route-reflector {
+ description
+ "Parameters relating to the route-reflector for the AFI-SAFI.";
+ leaf route-reflector-client {
+ type boolean;
+ default "false";
+ description
+ "Configure a neighbor as route reflector client.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-route-server {
+ container route-server {
+ description
+ "Parameters relating to the route-server for the AFI-SAFI.";
+ leaf route-server-client {
+ type boolean;
+ default "false";
+ description
+ "Configure a neighbor as route server client.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-send-community {
+ container send-community {
+ description
+ "Parameters relating to the send-community for the AFI-SAFI.";
+ leaf send-community {
+ type boolean;
+ default "true";
+ description
+ "Send standard community attribute to this neighbor.";
+ }
+
+ leaf send-ext-community {
+ type boolean;
+ default "true";
+ description
+ "Send extended community attribute to this neighbor.";
+ }
+
+ leaf send-large-community {
+ type boolean;
+ default "true";
+ description
+ "Send large community attribute to this neighbor.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-admin-shutdown {
+ description
+ "Structural grouping used to include admin-shutdown
+ configuration for both BGP neighbors and peer groups.";
+ container admin-shutdown {
+ description
+ "BGP Administrative Shutdown Communication.";
+ leaf enable {
+ type boolean;
+ description
+ "When set to 'true', BGP shutdown communication is enabled.";
+ }
+
+ leaf message {
+ type string;
+ description
+ "Shutdown message.";
+ reference
+ "draft-ietf-idr-shutdown-06";
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-graceful-restart {
+ description
+ "Structural grouping used to include graceful-restart
+ configuration for both BGP neighbors and peer groups.";
+ container graceful-restart {
+ description
+ "BGP Graceful restart feature.";
+ choice mode {
+ case graceful-restart-mode {
+ leaf enable {
+ type boolean;
+ default "false";
+ description
+ "Enable or disable the graceful-restart capability.
+ Setting this value to 'true' enables the graceful-restart
+ and helper both at peer level. Setting this value to 'false'
+ disables graceful restart and helper mode. The peer will inherit
+ global configuration.";
+ }
+ }
+
+ case graceful-restart-helper-mode {
+ leaf graceful-restart-helper {
+ type boolean;
+ default "false";
+ description
+ "Setting this value to 'true' enables helper mode for the peer
+ Setting this value to 'false' disables the helper mode. The
+ peer will inherit global configuration.";
+ }
+ }
+
+ case graceful-restart-disable-mode {
+ leaf graceful-restart-disable {
+ type boolean;
+ default "false";
+ description
+ "Setting this value to 'true' disables the graceful-restart
+ and helper Mode. Setting this value to 'false' causes the peer
+ to inherit global configuration.";
+ }
+ }
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-soft-reconfiguration {
+ description
+ "Structural grouping used to include soft-reconfiguration
+ configuration for both BGP neighbors and peer groups.";
+ leaf soft-reconfiguration {
+ type boolean;
+ default "false";
+ description
+ "Allow inbound soft reconfiguration for this neighbor.";
+ }
+ }
+
+ grouping structure-neighbor-group-attr-unchanged {
+ description
+ "Structural grouping used to include BGP route propagation
+ rules configuration for both BGP neighbors and peer groups.";
+ container attr-unchanged {
+ description
+ "BGP route propagation rules configuration.";
+ leaf as-path-unchanged {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' as-path attribute is propagated unchanged.";
+ }
+
+ leaf next-hop-unchanged {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' next-hop attribute is propagated unchanged.";
+ }
+
+ leaf med-unchanged {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' med attribute is propagated unchanged.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-orf-capability {
+ description
+ "Structural grouping used to include orf
+ configuration for both BGP neighbors and peer groups.";
+ container orf-capability {
+ choice orf-update {
+ case send {
+ leaf orf-send {
+ type boolean;
+ default "false";
+ description
+ "Setting to 'true' advertises the ORF capability.";
+ }
+ }
+
+ case receive {
+ leaf orf-receive {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it receives the orf capability.";
+ }
+ }
+
+ case both {
+ leaf orf-both {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it advertises/receives the orf capability.";
+ }
+ }
+ }
+ }
+ }
+
+ grouping structure-neighbor-config-timers {
+ description
+ "Structural grouping used to include per neighbor timers
+ configuration for both BGP neighbors and peer groups.";
+ container timers {
+ leaf advertise-interval {
+ type uint16 {
+ range "0..600";
+ }
+ units "seconds";
+ description
+ "Minimum interval between sending BGP routing updates.";
+ }
+
+ leaf connect-time {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ description
+ "BGP connect timer.";
+ }
+
+ uses neighbor-timers;
+ }
+ }
+
+ grouping structure-neighbor-group-filter-config {
+ description
+ "Structural grouping used to include filter
+ configuration for both BGP neighbors and peer groups.";
+ container filter-config {
+ description
+ "BGP Policy configuration for both BGP neighbors and groups.";
+ uses rmap-policy-import;
+
+ uses rmap-policy-export;
+
+ uses plist-policy-import;
+
+ uses plist-policy-export;
+
+ uses access-list-policy-import;
+
+ uses access-list-policy-export;
+
+ uses as-path-filter-list-policy-import;
+
+ uses as-path-filter-list-policy-export;
+
+ uses unsuppress-map-policy-import;
+
+ uses unsuppress-map-policy-export;
+ }
+ }
+}
diff --git a/yang/frr-bgp-common.yang b/yang/frr-bgp-common.yang
new file mode 100644
index 0000000..2b1babd
--- /dev/null
+++ b/yang/frr-bgp-common.yang
@@ -0,0 +1,1172 @@
+submodule frr-bgp-common {
+ yang-version 1.1;
+
+ belongs-to frr-bgp {
+ prefix "bgp";
+ }
+
+ import ietf-bgp-types {
+ prefix bt;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-bgp-types {
+ prefix frr-bt;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ import frr-route-types {
+ prefix frr-rt-type;
+ }
+
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+
+ import ietf-routing-types {
+ prefix rt-types;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This submodule contains general data definitions for use in BGP.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ grouping rmap-policy-import {
+ leaf rmap-import {
+ type frr-route-map:route-map-ref;
+ }
+ }
+
+ grouping rmap-policy-export {
+ leaf rmap-export {
+ type frr-route-map:route-map-ref;
+ }
+ }
+
+ grouping unsuppress-map-policy-import {
+ leaf unsuppress-map-import {
+ type frr-route-map:route-map-ref;
+ }
+ }
+
+ grouping unsuppress-map-policy-export {
+ leaf unsuppress-map-export {
+ type frr-route-map:route-map-ref;
+ }
+ }
+
+ grouping plist-policy-import {
+ leaf plist-import {
+ type frr-bt:plist-ref;
+ }
+ }
+
+ grouping plist-policy-export {
+ leaf plist-export {
+ type frr-bt:plist-ref;
+ }
+ }
+
+ grouping access-list-policy-import {
+ leaf access-list-import {
+ type frr-bt:access-list-ref;
+ }
+ }
+
+ grouping access-list-policy-export {
+ leaf access-list-export {
+ type frr-bt:access-list-ref;
+ }
+ }
+
+ grouping as-path-filter-list-policy-import {
+ leaf as-path-filter-list-import {
+ type frr-bt:as-path-filter-ref;
+ }
+ }
+
+ grouping as-path-filter-list-policy-export {
+ leaf as-path-filter-list-export {
+ type frr-bt:as-path-filter-ref;
+ }
+ }
+
+ grouping route-selection-options {
+ description
+ "Configuration relating to route selection options.";
+ container route-selection-options {
+ description
+ "Parameters relating to options for route selection.";
+ leaf always-compare-med {
+ type boolean;
+ default "false";
+ description
+ "Compare multi-exit discriminator (MED) value from
+ different ASes when selecting the best route. The
+ default behaviour is to only compare MEDs for paths
+ received from the same AS.";
+ }
+
+ leaf deterministic-med {
+ type boolean;
+ default "false";
+ description
+ "Compare multi-exit discriminator (MED) value from
+ Same ASes when selecting the best route.";
+ }
+
+ leaf confed-med {
+ type boolean;
+ default "false";
+ description
+ "Compare multi-exit discriminator (MED) value from
+ different Sub ASes when selecting the best route.";
+ }
+
+ leaf missing-as-worst-med {
+ type boolean;
+ default "false";
+ description
+ "Missing multi-exit discriminator (MED) value is
+ considered as value of infinity, making the path
+ least desirable when selecting the best route.";
+ }
+
+ leaf aspath-confed {
+ type boolean;
+ default "false";
+ description
+ "Compare path lengths including confederation sets
+ and sequences in selecting a route.";
+ }
+
+ leaf ignore-as-path-length {
+ type boolean;
+ default "false";
+ description
+ "Ignore the AS path length when selecting the best path.
+ The default is to use the AS path length and prefer paths
+ with shorter length.";
+ }
+
+ leaf external-compare-router-id {
+ type boolean;
+ default "false";
+ description
+ "When comparing similar routes received from external BGP
+ peers, use the router-id as a criterion to select the
+ active path.";
+ }
+
+ leaf allow-multiple-as {
+ type boolean;
+ default "false";
+ description
+ "Allow multi-path to use paths from different neighbouring
+ ASes. The default is to only consider multiple paths
+ from the same neighbouring AS.";
+ }
+
+ leaf multi-path-as-set {
+ when "../allow-multiple-as = 'true'";
+ type boolean;
+ default "false";
+ description
+ "Multi-path with AS-SET, When set to 'true' it adds AS set
+ information for aggregate routes, When set to 'false' it
+ prevents AS set generation.";
+ }
+ }
+ }
+
+ grouping med-config {
+ description
+ "Configuration relating to MED.";
+ container med-config {
+ leaf enable-med-admin {
+ type boolean;
+ default "false";
+ description
+ "Flag to enable receiving of MED metric attribute
+ in routing updates.";
+ }
+ leaf max-med-admin {
+ type uint32 {
+ range "0..4294967295";
+ }
+ default "4294967294";
+ description
+ "Tells the router to announce routes with this MED value
+ This MED value is applicable for indefinite time.";
+ }
+
+ leaf max-med-onstart-up-time {
+ type uint32 {
+ range "5..86400";
+ }
+ units "seconds";
+ description
+ "Tells the router to announce routes with MED value,
+ This MED value is applicable for this duration during
+ start-up.";
+ }
+
+ leaf max-med-onstart-up-value {
+ type uint32 {
+ range "0..4294967295";
+ }
+ default "4294967294";
+ description
+ "Tells the router to announce routes with this MED value
+ This MED value is applicable for start-up time.";
+ }
+ }
+ }
+
+ grouping route-reflector-config {
+ description
+ "Grouping used to include route reflector
+ configuration for BGP global.";
+ container route-reflector {
+ description
+ "Route reflector parameters for the BGP global.";
+ leaf route-reflector-cluster-id {
+ type bt:rr-cluster-id-type;
+ description
+ "Route Reflector cluster ID to use when local router is
+ configured as a route reflector. Commonly set at the
+ group level, but allows a different cluster ID to be set
+ for each neighbor.";
+ reference
+ "RFC 4456: BGP Route Reflection: An Alternative to
+ Full Mesh.";
+ }
+
+ leaf no-client-reflect {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true', this disables route redistribution
+ by the Route Reflector. It is set 'true' when the client is
+ fully meshed to prevent sending of redundant route
+ advertisements.";
+ reference
+ "TODO: Add reference when IETF writes a draft describing
+ this.";
+ }
+
+ leaf allow-outbound-policy {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true', this allow RR to modify the attributes of the
+ reflected IBGP routes as per the out route-map. It is set 'false'
+ RR will not modify the attributes of the reflected IBGP routes as
+ per the out route-map rules.";
+ }
+ }
+ }
+
+ grouping global-bgp-config {
+ leaf instance-type-view {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' BGP instance type is view.
+ When set to 'false' BGP instance type is regular.";
+ }
+
+ leaf ebgp-multihop-connected-route-check {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it will disable checking if nexthop is connected
+ on EBGP sessions. When set to 'false' it will enable checking if
+ nexthop is connected on EBGP sessions.";
+ }
+
+ leaf fast-external-failover {
+ type boolean;
+ default "true";
+ description
+ "It's an interface tracking mechanism. When set to 'true' don't
+ immediately reset session if a link to a directly connected
+ external peer goes down. When set to 'false' it will immediately
+ reset session if a link to a directly connected external peer goes down.";
+ }
+
+ leaf local-pref {
+ type uint32;
+ default "100";
+ description
+ "BGP local preference attribute sent to internal peers to
+ indicate the degree of preference for externally learned
+ routes. The route with the highest local preference
+ value is preferred.";
+ reference
+ "RFC 4271.";
+ }
+
+ leaf default-shutdown {
+ type boolean;
+ default "false";
+ description
+ "Apply administrative shutdown to newly configured peers.";
+ }
+
+ leaf suppress-duplicates {
+ type boolean;
+ default "true";
+ description
+ "Suppress duplicate updates if the route actually not changed.";
+ }
+
+ leaf ebgp-requires-policy {
+ type boolean;
+ default "true";
+ description
+ "When set to 'true' BGP speaker requires in and out policy
+ for EBGP peers (RFC8212).";
+ }
+
+ leaf show-hostname {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' BGP show hostname in certain command outputs.";
+ }
+
+ leaf show-nexthop-hostname {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' BGP show hostname for nexthop in certain
+ command outputs.";
+ }
+ }
+
+ grouping global-neighbor-config {
+ container global-neighbor-config {
+ leaf dynamic-neighbors-limit {
+ type uint32 {
+ range "1..65535";
+ }
+ description
+ "Maximum number of BGP Dynamic Neighbors that can be created.";
+ }
+
+ leaf log-neighbor-changes {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' BGP will start logging neighbor up/down and reset reason.
+ When set to 'false' BGP will stop logging neighbor up/down and reset reason.";
+ }
+
+ container packet-quanta-config {
+ leaf wpkt-quanta {
+ type uint32 {
+ range "1..64";
+ }
+ default "64";
+ description
+ "How many packets to write to peer socket per run.";
+ }
+
+ leaf rpkt-quanta {
+ type uint32 {
+ range "1..10";
+ }
+ default "10";
+ description
+ "How many packets to read from peer socket per I/O cycle.";
+ }
+ }
+ }
+ }
+
+ grouping global-update-group-config {
+ container global-update-group-config {
+ leaf subgroup-pkt-queue-size {
+ type uint32 {
+ range "20..100";
+ }
+ default "40";
+ description
+ "Subgroup packet queue size.";
+ }
+
+ leaf coalesce-time {
+ type uint32 {
+ range "0..4294967295";
+ }
+ units "milliseconds";
+ default "1000";
+ description
+ "Configures the Subgroup coalesce timer.";
+ }
+ }
+ }
+
+ grouping global-network-config {
+ leaf import-check {
+ type boolean;
+ default "true";
+ description
+ "When set to 'true' bgp creates entries for network statements
+ if a matching prefix exists in the rib. When set to 'false' bgp
+ creates entries for networks that the router cannot reach.
+
+ In FRR versions < 7.4 this used to default to 'false' this is an
+ incompatible backward change";
+ }
+ }
+
+ grouping neighbor-timers {
+ leaf hold-time {
+ type uint16 {
+ range "0 | 3..65535";
+ }
+ units "seconds";
+ default "180";
+ description
+ "Time interval (in seconds) for the HoldTimer established
+ with the peer. When read as operational data (ro), the
+ value of this object is calculated by this BGP speaker,
+ using the smaller of the values in hold-time that was
+ configured (rw) in the running datastore and the Hold Time
+ received in the OPEN message.
+
+ This value must be at least three seconds
+ if it is not zero (0).
+
+ If the Hold Timer has not been established
+ with the peer this object MUST have a value
+ of zero (0).
+
+ If the configured value of hold-time object was
+ a value of (0), then when read this object MUST have a
+ value of (0) also.";
+ reference
+ "RFC 4271";
+ }
+
+ leaf keepalive {
+ type uint16 {
+ range "0..65535";
+ }
+ units "seconds";
+ default "60";
+ description
+ "When used as a configuration (rw) value, this Time interval
+ (in seconds) for the KeepAlive timer configured for this BGP
+ speaker with this peer. The value of this object will only
+ determine the KEEPALIVE messages' frequency relative to
+ the value specified in configured value for hold-time.
+
+ If the value of this object is zero (0), no periodical
+ KEEPALIVE messages are sent to the peer after the BGP
+ connection has been established. The suggested value for
+ this timer is 30 seconds.;
+
+ The actual time interval for the KEEPALIVE messages is
+ indicated by operational value of keepalive. That value
+ of this object is calculated by this BGP speaker such that,
+ when compared with hold-time, it has the same proportion
+ that keepalive has, compared with hold-time. A
+ reasonable maximum value for this timer would be one third
+ of that of hold-time.";
+ reference
+ "RFC 4271";
+ }
+ }
+
+ grouping global-config-timers {
+ container global-config-timers {
+ leaf rmap-delay-time {
+ type uint16 {
+ range "0..600";
+ }
+ units "seconds";
+ default "5";
+ description
+ "Time to wait before processing route-map changes.";
+ }
+
+ leaf update-delay-time {
+ type uint16 {
+ range "0..3600";
+ }
+ units "seconds";
+ description
+ "Time to force initial delay for best-path and updates.";
+ }
+
+ leaf establish-wait-time {
+ type uint16 {
+ range "1..3600";
+ }
+ units "seconds";
+ description
+ "Time to force initial delay for updates.";
+ }
+
+ leaf connect-retry-interval {
+ type uint16 {
+ range "1..max";
+ }
+ units "seconds";
+ default "120";
+ description
+ "Time interval (in seconds) for the ConnectRetryTimer. The
+ suggested value for this timer is 120 seconds.";
+ reference
+ "RFC 4271, This is the value used
+ to initialize the 'ConnectRetryTimer'.";
+ }
+
+ uses neighbor-timers;
+ }
+ }
+
+ grouping graceful-restart-config {
+ description
+ "Configuration parameters relating to BGP graceful restart.";
+ choice mode {
+ case graceful-restart-mode {
+ leaf enabled {
+ type boolean;
+ default "false";
+ description
+ "Enable or disable the graceful-restart capability. When set to 'true'
+ it will enable graceful restart and helper both globally. When set
+ to 'false' it will enable the default behaviour global helper mode.";
+ }
+ }
+
+ case graceful-restart-disable-mode {
+ leaf graceful-restart-disable {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it will disable graceful restart and helper both
+ globally. when set to 'false' it will enable the default behaviour
+ global helper mode.";
+ }
+ }
+ }
+
+ leaf preserve-fw-entry {
+ type boolean;
+ default "false";
+ description
+ "Sets F-bit indication that fib is preserved while doing Graceful Restart.
+ When set to 'true' Zebra would preserve the FIB entry on the restarting
+ node.";
+ }
+
+ leaf restart-time {
+ type uint16 {
+ range "1..3600";
+ }
+ units "seconds";
+ default "120";
+ description
+ "Estimated time (in seconds) for the local BGP speaker to
+ restart a session. This value is advertise in the graceful
+ restart BGP capability. This is a 12-bit value, referred to
+ as Restart Time in RFC4724. Per RFC4724, the suggested
+ default value is <= the hold-time value. This timer is
+ applicable for helper node.";
+ reference
+ "RFC 4724: Graceful Restart Mechanism for BGP.";
+ }
+
+ leaf stale-routes-time {
+ type uint16 {
+ range "1..3600";
+ }
+ units "seconds";
+ default "360";
+ description
+ "An upper-bound on the time that stale routes will be
+ retained by a router after a session is restarted. If an
+ End-of-RIB (EOR) marker is received prior to this timer
+ expiring stale-routes will be flushed upon its receipt - if
+ no EOR is received, then when this timer expires stale paths
+ will be purged. This timer is applicable for restarting node.";
+ reference
+ "RFC 4724: Graceful Restart Mechanism for BGP.";
+ }
+
+ leaf selection-deferral-time {
+ type uint16 {
+ range "0..3600";
+ }
+ units "seconds";
+ default "360";
+ description
+ "An upper-bound on the time that restarting router defers
+ the route selection process after restart.";
+ reference
+ "RFC 4724: Graceful Restart Mechanism for BGP.";
+ }
+
+ leaf rib-stale-time {
+ type uint16 {
+ range "1..3600";
+ }
+ units "seconds";
+ default "500";
+ description
+ "An upper-bound on the time that helper router holds the
+ stale routes in Zebra, When this timer gets expired Zebra
+ removes the stale routes.";
+ }
+ }
+
+ grouping global-group-use-multiple-paths {
+ description
+ "Common grouping used for both global and groups which provides
+ configuration parameters relating to use of multiple paths.";
+ container use-multiple-paths {
+ description
+ "Parameters related to the use of multiple paths for the
+ same NLRI.";
+ container ebgp {
+ description
+ "Multi-Path parameters for EBGP.";
+ leaf maximum-paths {
+ type uint16;
+ default "64";
+ description
+ "Maximum number of parallel paths to consider when using
+ BGP multi-path. The default is use a single path.";
+ }
+ }
+
+ container ibgp {
+ description
+ "Multi-Path parameters for IBGP.";
+ leaf maximum-paths {
+ type uint16;
+ default "64";
+ description
+ "Maximum number of parallel paths to consider when using
+ IBGP multi-path. The default is to use a single path.";
+ }
+
+ leaf cluster-length-list {
+ when "../maximum-paths != 0";
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' route with the shortest cluster-list
+ length is used. The cluster-list reflects the IBGP
+ reflection path the route has taken. It's the part
+ of route selection algo.";
+ }
+ }
+ }
+ }
+
+ grouping global-redistribute {
+ description
+ "List of route redistribution per AFI.";
+ list redistribution-list {
+ key "route-type route-instance";
+ leaf route-type {
+ type frr-rt-type:frr-route-types;
+ description
+ "Protocol route type.";
+ }
+
+ leaf route-instance {
+ type uint16 {
+ range "0..65535";
+ }
+ description
+ "Protocol Instance.";
+ }
+
+ leaf metric {
+ type uint32 {
+ range "0..4294967295";
+ }
+ description
+ "Metric for redistributed routes.";
+ }
+
+ leaf rmap-policy-import {
+ type frr-route-map:route-map-ref;
+ description
+ "Route-map to be applied for redistributed routes into the bgp.";
+ }
+ }
+ }
+
+ grouping mp-afi-safi-network-config {
+ leaf label-index {
+ type rt-types:mpls-label;
+ description
+ "Label index to associate with the prefix.";
+ }
+
+ leaf rmap-policy-export {
+ type frr-route-map:route-map-ref;
+ description
+ "Route-map to modify the attributes for Routes going out
+ via BGP updates.";
+ }
+ }
+
+ grouping mp-afi-safi-agg-route-config {
+ leaf as-set {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' AS set path information is generated
+ for aggregate address. When set to 'false' AS set path
+ information is not generated.";
+ }
+
+ leaf summary-only {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it advertise only the aggregate route
+ and suppress the advertisement of all the component routes.
+ When set to 'false' all more-specific routes summarized
+ by the aggregate route are advertised.";
+ }
+
+ leaf rmap-policy-export {
+ type frr-route-map:route-map-ref;
+ description
+ "Apply route map to aggregate network.";
+ }
+
+ leaf origin {
+ type enumeration {
+ enum "igp" {
+ value 0;
+ description
+ "Local IGP.";
+ }
+ enum "egp" {
+ value 1;
+ description
+ "Remote EGP.";
+ }
+ enum "incomplete" {
+ value 2;
+ description
+ "Unknown heritage.";
+ }
+ enum "unspecified" {
+ value 255;
+ description
+ "Unspecified.";
+ }
+ }
+ default "unspecified";
+ description
+ "BGP origin type.";
+ }
+
+ leaf match-med {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' aggregate-route matches only
+ med.";
+ }
+
+ leaf suppress-map {
+ type string;
+ description
+ "Suppress more specific routes specified in route-map.";
+ }
+ }
+
+ grouping admin-distance {
+ container admin-distance {
+ description
+ "Administrative distance (or preference) assigned to
+ routes received from different sources
+ (external, internal, and local).";
+ leaf external {
+ type uint8 {
+ range "1..255";
+ }
+ default "20";
+ description
+ "Administrative distance for routes learned from
+ external BGP (EBGP).";
+ }
+
+ leaf internal {
+ type uint8 {
+ range "1..255";
+ }
+ default "200";
+ description
+ "Administrative distance for routes learned from
+ internal BGP (IBGP).";
+ }
+
+ leaf local {
+ type uint8 {
+ range "1..255";
+ }
+ default "200";
+ description
+ "Administrative distance for routes learned from
+ local.";
+ }
+ }
+ }
+
+ grouping distance-per-route-config {
+ leaf distance {
+ type uint8 {
+ range "1..255";
+ }
+ mandatory true;
+ description
+ "Administrative distance for route.";
+ }
+
+ leaf access-list-policy-export {
+ type frr-bt:access-list-ref;
+ description
+ "Access-list policy applied on routes going from BGP to Zebra.";
+ }
+ }
+
+ grouping route-flap-dampening {
+ container route-flap-dampening {
+ description
+ "Dampening feature";
+ leaf enable {
+ type boolean;
+ default "false";
+ description
+ "Enable route flap dampening.";
+ }
+
+ leaf reach-decay {
+ when "../enable = 'true'";
+ type uint8 {
+ range "1..45";
+ }
+ units "seconds";
+ default "15";
+ description
+ "This value specifies the time desired for the instability
+ metric value to reach one-half of its current value when
+ the route is reachable. This half-life value determines
+ the rate at which the metric value is decayed. A smaller
+ half-life value makes a suppressed route reusable sooner
+ than a larger value. The accumulated penalty will be reduced
+ to half after this duration.";
+ }
+
+ leaf reuse-above {
+ when "../enable = 'true'";
+ type uint16 {
+ range "1..20000";
+ }
+ default "750";
+ description
+ "This is the value of the instability metric at which a
+ suppressed route becomes unsuppressed if it is reachable
+ but currently suppressed. The value assigned to
+ reuse-below must be less than suppress-above.";
+ }
+
+ leaf suppress-above {
+ when "../enable = 'true'";
+ type uint16 {
+ range "1..20000";
+ }
+ default "2000";
+ description
+ "This is the value of the instability metric at which
+ route suppression takes place. A route is not installed
+ in the forwarding information base (FIB), or announced
+ even if it is reachable during the period that it is
+ suppressed.";
+ }
+
+ leaf unreach-decay {
+ when "../enable = 'true'";
+ type uint8 {
+ range "1..255";
+ }
+ units "seconds";
+ default "60";
+ description
+ "This value acts the same as reach-decay except that it
+ specifies the rate at which the instability metric is
+ decayed when a route is unreachable. It should have a
+ value greater than or equal to reach-decay.";
+ }
+ }
+ }
+
+ grouping flow-spec-config {
+ container flow-spec-config {
+ description
+ "Flow spec feature.";
+ leaf interface {
+ type frr-interface:interface-ref {
+ require-instance false;
+ }
+ description
+ "The local interface.";
+ }
+ }
+ }
+
+ grouping global-graceful-shutdown {
+ description
+ "Structural grouping used to include graceful-shutdown
+ configuration for both BGP neighbors and peer groups.";
+ container graceful-shutdown {
+ description
+ "BGP Graceful shutdown feature.";
+ leaf enable {
+ type boolean;
+ default "false";
+ description
+ "Enable graceful-shutdown feature.";
+ }
+ }
+ }
+
+ grouping global-filter-config {
+ description
+ "Structural grouping used to include filter
+ configuration for BGP RIB table.";
+ container filter-config {
+ description
+ "BGP table to RIB route download filter.";
+ uses rmap-policy-export;
+ }
+ }
+
+ grouping route-distinguisher-params {
+ description
+ "Route distinguisher value as per RFC4364.";
+ leaf rd {
+ type rt-types:route-distinguisher;
+ description
+ "Route distinguisher value as per RFC4364.";
+ }
+ }
+
+ grouping vpn-label-params {
+ description
+ "Label value for VRF.";
+ choice label-allocation-mode {
+ case manual {
+ leaf label {
+ type rt-types:mpls-label;
+ description
+ "Label index to associate with the prefix.";
+ }
+ }
+
+ case auto {
+ leaf label-auto {
+ type boolean;
+ default "false";
+ description
+ "Automatically assign a label.";
+ }
+ }
+ }
+ }
+
+ grouping vpn-nexthop-params {
+ description
+ "Specify next hop to use for VRF advertised prefixes.";
+ leaf nexthop {
+ type inet:ip-address;
+ description
+ "Nexthop IP address.";
+ }
+ }
+
+ grouping rt-list {
+ description
+ "Route Target list";
+ leaf-list import-rt-list {
+ type rt-types:route-target;
+ description
+ "For routes leaked from vpn to current address-family: match any.";
+ }
+
+ leaf-list export-rt-list {
+ type rt-types:route-target;
+ description
+ "For routes leaked from current address-family to vpn: set.";
+ }
+ }
+
+ grouping vpn-route-target-params {
+ description
+ "Route Target value.";
+ leaf redirect-rt {
+ type rt-types:route-target;
+ description
+ "Flow-spec redirect type route target.";
+ }
+
+ choice rt-direction {
+ case import-export {
+ uses rt-list;
+ }
+
+ case both {
+ leaf-list rt-list {
+ type rt-types:route-target;
+ description
+ "Both import: match any and export: set.";
+ }
+ }
+ }
+ }
+
+ grouping vpn-import-params {
+ description
+ "VPN route leaking parameters.";
+ leaf import-vpn {
+ type boolean;
+ default "false";
+ description
+ "Import routes from default instance VPN RIB.";
+ }
+
+ leaf export-vpn {
+ type boolean;
+ default "false";
+ description
+ "Export routes to default instance VPN RIB.";
+ }
+
+ list import-vrf-list {
+ key "vrf";
+ description
+ "List of VRFs to import routes from.";
+ leaf vrf {
+ type frr-vrf:vrf-ref {
+ require-instance false;
+ }
+ description
+ "Routing instance.";
+ }
+ }
+
+ uses rmap-policy-import;
+
+ uses rmap-policy-export;
+ }
+
+ grouping global-afi-safi-vpn-config {
+ container vpn-config {
+ leaf rd {
+ type string;
+ description
+ "Route distinguisher value as per RFC4364.";
+ }
+
+ uses vpn-label-params;
+
+ uses vpn-nexthop-params;
+
+ uses vpn-import-params;
+
+ uses vpn-route-target-params;
+ }
+ }
+
+ grouping global-afi-safi-vpn-network-config {
+ list network-config {
+ key "rd";
+ description
+ "A list of rd.";
+ uses route-distinguisher-params;
+
+ list prefix-list {
+ key "prefix";
+ description
+ "A list of prefix.";
+ leaf prefix {
+ type inet:ip-prefix;
+ description
+ "IP destination prefix.";
+ }
+
+ leaf label-index {
+ type uint32;
+ mandatory true;
+ description
+ "Label index to associate with the prefix.";
+ }
+
+ leaf rmap-policy-export {
+ type frr-route-map:route-map-ref;
+ description
+ "Route-map to modify the attributes for Routes going out
+ via BGP updates.";
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-bgp-filter.yang b/yang/frr-bgp-filter.yang
new file mode 100644
index 0000000..199e709
--- /dev/null
+++ b/yang/frr-bgp-filter.yang
@@ -0,0 +1,329 @@
+module frr-bgp-filter {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/bgp-filter";
+ prefix frr-bgp-filter;
+
+ import frr-filter {
+ prefix frr-filter;
+ }
+
+ import ietf-routing-types {
+ prefix rt-types;
+ }
+
+ organization
+ "Free Range Routing";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines filter settings";
+
+ revision 2020-01-15 {
+ description
+ "Initial revision";
+ }
+
+ typedef list-sequence {
+ type uint32 {
+ range "1..4294967295";
+ }
+ description
+ "List instance priority (low number means higher priority)";
+ }
+
+ typedef list-action {
+ type enumeration {
+ enum "deny" {
+ value 0;
+ description
+ "Deny an entry";
+ }
+ enum "permit" {
+ value 1;
+ description
+ "Accept an entry";
+ }
+ }
+ description
+ "Return action on match";
+ }
+
+ typedef bgp-list-name {
+ type string;
+ description
+ "List name";
+ }
+
+ typedef community-string {
+ type string {
+ pattern "(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)|((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|(local-AS)|(no-advertise)|(no-export)|(internet)";
+ }
+ description
+ "The BGP community string";
+ }
+
+ typedef large-community-string {
+ type string {
+ pattern "(429496729[0-5]|42949672[0-8][0-9]|4294967[01][0-9]{2}|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|[1-3][0-9]{9}|[1-9][0-9]{0,8}|0)|(429496729[0-5]|42949672[0-8][0-9]|4294967[01][0-9]{2}|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):(429496729[0-5]|42949672[0-8][0-9]|4294967[01][0-9]{2}|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|[1-3][0-9]{9}|[1-9][0-9]{0,8}|0)|(429496729[0-5]|42949672[0-8][0-9]|4294967[01][0-9]{2}|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):(429496729[0-5]|42949672[0-8][0-9]|4294967[01][0-9]{2}|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):(429496729[0-5]|42949672[0-8][0-9]|4294967[01][0-9]{2}|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|[1-3][0-9]{9}|[1-9][0-9]{0,8}|0)";
+ }
+ description
+ "The BGP large-community string";
+ }
+
+ augment "/frr-filter:lib" {
+ list community-list {
+ key "name";
+ description
+ "Community-list instance";
+ leaf name {
+ type string;
+ }
+
+ list entry {
+ key "sequence";
+ description
+ "Community-list entry";
+ leaf sequence {
+ type list-sequence;
+ }
+
+ leaf action {
+ type list-action;
+ }
+
+ leaf type {
+ type enumeration {
+ enum "community-list-standard" {
+ value 0;
+ description
+ "Standard community-list name/identifier";
+ }
+ enum "community-list-extended" {
+ value 1;
+ description
+ "Expanded community-list name/identifier";
+ }
+ }
+ mandatory true;
+ description
+ "Community-list instance name/identifier";
+ }
+
+ choice community-string {
+ description
+ "Community string";
+ case standard {
+ when "./type = 'community-list-standard'";
+ leaf-list standard-community-string {
+ type community-string;
+ description
+ "Community string";
+ }
+ }
+
+ case expanded {
+ when "./type = 'community-list-extended'";
+ leaf expanded-community-string {
+ type string;
+ description
+ "Community string reg-ex";
+ }
+ }
+ }
+ }
+ }
+
+ list large-community-list {
+ key "name";
+ description
+ "Large community-list instance";
+ leaf name {
+ type string;
+ }
+
+ list entry {
+ key "sequence";
+ description
+ "Large community-list entry";
+ leaf sequence {
+ type list-sequence;
+ }
+
+ leaf action {
+ type list-action;
+ }
+
+ leaf type {
+ type enumeration {
+ enum "large-community-list-standard-id" {
+ value 0;
+ description
+ "Standard large-community-list identifier";
+ }
+ enum "large-community-list-extended-id" {
+ value 1;
+ description
+ "Expanded large-community-list identifier";
+ }
+ enum "large-community-list-standard-name" {
+ value 2;
+ description
+ "Standard large-community-list name";
+ }
+ enum "large-community-list-extended-name" {
+ value 3;
+ description
+ "Expanded large-community-list name";
+ }
+ }
+ mandatory true;
+ description
+ "Large community-list instance name/identifier";
+ }
+
+ choice large-community-string {
+ description
+ "Large community string";
+ case standard {
+ when "./type = 'large-community-list-standard-id' or "
+ + "./type = 'large-community-list-standard-name'";
+ leaf-list standard-large-community-string {
+ type large-community-string;
+ description
+ "Large community string";
+ }
+ }
+
+ case expanded {
+ when "./type = 'large-community-list-extended-id' or "
+ + "./type = 'large-community-list-extended-name'";
+ leaf expanded-large-community-string {
+ type string;
+ description
+ "Large community string reg-ex";
+ }
+ }
+ }
+ }
+ }
+
+ list extcommunity-list {
+ key "name";
+ description
+ "Extcommunity-list instance";
+ leaf name {
+ type string;
+ }
+
+ list entry {
+ key "sequence";
+ description
+ "Extcommunity-list entry";
+ leaf sequence {
+ type list-sequence;
+ }
+
+ leaf action {
+ type list-action;
+ }
+
+ leaf type {
+ type enumeration {
+ enum "extcommunity-list-standard-id" {
+ value 0;
+ description
+ "Standard extcommunity-list identifier";
+ }
+ enum "extcommunity-list-extended-id" {
+ value 1;
+ description
+ "Expanded extcommunity-list identifier";
+ }
+ enum "extcommunity-list-standard-name" {
+ value 2;
+ description
+ "Standard extcommunity-list name";
+ }
+ enum "extcommunity-list-extended-name" {
+ value 3;
+ description
+ "Expanded extcommunity-list name";
+ }
+ }
+ mandatory true;
+ description
+ "Extcommunity-list instance name/identifier";
+ }
+
+ choice extcommunity-string {
+ description
+ "Extcommunity string";
+ case standard {
+ when "./type = 'extcommunity-list-standard-id' or "
+ + "./type = 'extcommunity-list-standard-name'";
+ choice standard-extcommunity-string {
+ description
+ "Value of the ext-community";
+ case extcommunity-rt {
+ description
+ "Set BGP ext-community route-target attribute";
+ leaf-list extcommunity-rt {
+ type rt-types:route-target;
+ }
+ }
+
+ case extcommunity-soo {
+ description
+ "Set BGP ext-community site-of-origin attribute";
+ leaf-list extcommunity-soo {
+ type rt-types:route-target;
+ }
+ }
+ }
+ }
+
+ case expanded {
+ when "./type = 'extcommunity-list-extended-id' or "
+ + "./type = 'extcommunity-list-extended-name'";
+ leaf expanded-extcommunity-string {
+ type string;
+ description
+ "Extcommunity string reg-ex";
+ }
+ }
+ }
+ }
+ }
+
+ list as-path-list {
+ key "name";
+ description
+ "AS-path access-list instance";
+ leaf name {
+ type string;
+ description
+ "AS-path access-list instance name/identifier";
+ }
+
+ list entry {
+ key "sequence";
+ description
+ "AS-path access-list entry";
+ leaf sequence {
+ type list-sequence;
+ }
+
+ leaf action {
+ type list-action;
+ }
+
+ leaf as-path {
+ type string;
+ description
+ "AS-path access-list string reg-ex";
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-bgp-neighbor.yang b/yang/frr-bgp-neighbor.yang
new file mode 100644
index 0000000..5a4c379
--- /dev/null
+++ b/yang/frr-bgp-neighbor.yang
@@ -0,0 +1,134 @@
+// SPDX-License-Identifier: BSD-2-Clause
+submodule frr-bgp-neighbor {
+ yang-version 1.1;
+
+ belongs-to frr-bgp {
+ prefix "bgp";
+ }
+
+ include "frr-bgp-common-multiprotocol";
+
+ include "frr-bgp-common-structure";
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This submodule contains general data definitions for use in BGP neighbor.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ grouping neighbor-parameters {
+ leaf password {
+ type string {
+ length "1..254";
+ }
+ description
+ "Actual password.";
+ }
+
+ leaf ttl-security {
+ type uint8;
+ description
+ "BGP Time To Live (TTL) security check.";
+ reference
+ "RFC 5082: The Generalized TTL Security Mechanism
+ (GTSM),
+ RFC 7454: BGP Operations and Security.";
+ }
+
+ leaf solo {
+ type boolean;
+ default "false";
+ description
+ "Solo peer - part of its own update group.";
+ }
+
+ leaf enforce-first-as {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it will enforce the first AS for EBGP routes.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "An optional textual description (intended primarily for use
+ with a peer or group.";
+ }
+
+ leaf passive-mode {
+ type boolean;
+ default "false";
+ description
+ "Don't send open messages to this neighbor.";
+ }
+
+ uses neighbor-update-source;
+
+ uses structure-neighbor-group-ebgp-multihop;
+
+ uses neighbor-local-as-options;
+
+ uses neighbor-bfd-options;
+
+ uses structure-neighbor-group-admin-shutdown;
+
+ uses structure-neighbor-group-graceful-restart;
+
+ uses structure-neighbor-config-timers;
+
+ container afi-safis {
+ description
+ "List of address-families associated with the BGP
+ instance.";
+ list afi-safi {
+ key "afi-safi-name";
+ description
+ "AFI, SAFI configuration available for the
+ neighbour or group.";
+ uses mp-afi-safi-config;
+
+ leaf enabled {
+ type boolean;
+ description
+ "This leaf indicates whether the IPv4 Unicast AFI, SAFI is
+ enabled for the neighbour or group.";
+ }
+
+ uses mp-all-afi-safi-list-contents;
+ }
+ }
+ }
+}
diff --git a/yang/frr-bgp-peer-group.yang b/yang/frr-bgp-peer-group.yang
new file mode 100644
index 0000000..34214b7
--- /dev/null
+++ b/yang/frr-bgp-peer-group.yang
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: BSD-2-Clause
+submodule frr-bgp-peer-group {
+ yang-version 1.1;
+
+ belongs-to frr-bgp {
+ prefix "bgp";
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-bgp-types {
+ prefix frr-bt;
+ }
+
+ include "frr-bgp-common-structure";
+
+ include "frr-bgp-neighbor";
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This submodule contains general data definitions for use in BGP
+ peer group.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ grouping bgp-peer-group-base {
+ description
+ "Parameters related to a BGP group.";
+ leaf peer-group-name {
+ type string;
+ description
+ "Name of the BGP peer-group.";
+ }
+
+ leaf-list ipv4-listen-range {
+ type inet:ipv4-address;
+ description
+ "Configure BGP dynamic neighbors listen range.";
+ }
+
+ leaf-list ipv6-listen-range {
+ type inet:ipv6-address;
+ description
+ "Configure BGP dynamic neighbors listen range.";
+ }
+
+ uses neighbor-remote-as;
+
+ uses neighbor-parameters;
+
+ uses structure-neighbor-group-capability-options;
+ }
+
+ grouping bgp-peer-group-list {
+ description
+ "The list of BGP peer groups.";
+ list peer-group {
+ key "peer-group-name";
+ description
+ "List of BGP peer-groups configured on the local system -
+ uniquely identified by peer-group name.";
+ uses bgp-peer-group-base;
+ }
+ }
+}
diff --git a/yang/frr-bgp-route-map.yang b/yang/frr-bgp-route-map.yang
new file mode 100644
index 0000000..c50c513
--- /dev/null
+++ b/yang/frr-bgp-route-map.yang
@@ -0,0 +1,1169 @@
+module frr-bgp-route-map {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/bgp-route-map";
+ prefix frr-bgp-route-map;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ import frr-filter {
+ prefix filter;
+ }
+
+ import frr-bgp-filter {
+ prefix bgp-filter;
+ }
+
+ import ietf-routing-types {
+ prefix rt-types;
+ }
+
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization
+ "Free Range Routing";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines bgp route map settings";
+
+ revision 2020-01-02 {
+ description
+ "Initial revision";
+ }
+
+ identity match-alias {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match BGP community alias name";
+ }
+
+ identity match-local-preference {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match local-preference of routes";
+ }
+
+ identity match-script {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match script of routes";
+ }
+
+ identity match-origin {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match BGP route origin code";
+ }
+
+ identity rpki {
+ base frr-route-map:rmap-match-type;
+ description
+ "Control rpki specific settings";
+ }
+
+ identity rpki-extcommunity {
+ base frr-route-map:rmap-match-type;
+ description
+ "Control rpki specific settings derived from extended community";
+ }
+
+ identity probability {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match portion of routes defined by percentage value";
+ }
+
+ identity source-vrf {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match source vrf of routes";
+ }
+
+ identity peer {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match peer address";
+ }
+
+ identity mac-address-list {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match MAC address access-list";
+ }
+
+ identity ip-route-source {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match advertising source address of route";
+ }
+
+ identity ip-route-source-prefix-list {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match advertising source address of route";
+ }
+
+ identity evpn-route-type {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match EVPN route type";
+ }
+
+ identity evpn-default-route {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match EVPN default Type-5 route";
+ }
+
+ identity evpn-vni {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match EVPN VNI";
+ }
+
+ identity evpn-rd {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match EVPN route distinguisher";
+ }
+
+ identity match-community {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match BGP community list";
+ }
+
+ identity match-large-community {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match BGP large-community list";
+ }
+
+ identity match-extcommunity {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match BGP extcommunity list";
+ }
+
+ identity as-path-list {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match BGP AS path list";
+ }
+
+ identity ipv4-nexthop {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match IPv4 next hop address";
+ }
+
+ identity ipv6-nexthop {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match IPv6 next hop address";
+ }
+
+ identity source-protocol {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match protocol via which the route was learnt";
+ }
+
+ identity distance {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP administrative distance to use";
+ }
+
+ identity set-extcommunity-none {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP extended community attribute";
+ }
+
+ identity set-extcommunity-rt {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP extended community attribute";
+ }
+
+ identity set-extcommunity-nt {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP extended community attribute";
+ }
+
+ identity set-extcommunity-soo {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP extended community attribute";
+ }
+
+ identity set-extcommunity-lb {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP extended community attribute";
+ }
+
+identity set-extcommunity-color {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP extended community attribute";
+ }
+
+ identity set-ipv4-nexthop {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the IPv4 next-hop to peer-address/unchanged";
+ }
+
+ identity ipv4-vpn-address {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set IPv4 VPN next-hop address";
+ }
+
+ identity ipv6-nexthop-global {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set IPv6 next-hop global address";
+ }
+
+ identity ipv6-prefer-global {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set IPv6 next-hop to prefer global address";
+ }
+
+ identity ipv6-peer-address {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set IPv6 next-hop peer address";
+ }
+
+ identity ipv6-vpn-address {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set IPv6 VPN next-hop address";
+ }
+
+ identity label-index {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the label index to associate with the prefixs";
+ }
+
+ identity set-local-preference {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the BGP local preference path attribute";
+ }
+
+ identity set-origin {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP route origin code";
+ }
+
+ identity weight {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the BGP weight attribute";
+ }
+
+ identity originator-id {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the BGP originator ID attribute";
+ }
+
+ identity table {
+ base frr-route-map:rmap-set-type;
+ description
+ "Export route to non-main kernel table";
+ }
+
+ identity atomic-aggregate {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP atomic-aggregate attribute";
+ }
+
+ identity aigp-metric {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP AIGP attribute (AIGP TLV Metric)";
+ }
+
+ identity as-path-prepend {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the BGP AS-path attribute";
+ }
+
+ identity as-path-exclude {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the BGP AS-path attribute";
+ }
+
+ identity as-path-replace {
+ base frr-route-map:rmap-set-type;
+ description
+ "Replace ASNs to local AS number";
+ }
+
+ identity set-community {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the BGP community attribute";
+ }
+
+ identity set-large-community {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the BGP large-community attribute";
+ }
+
+ identity aggregator {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the BGP aggregator attribute";
+ }
+
+ identity comm-list-delete {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP community list (for deletion)";
+ }
+
+ identity large-comm-list-delete {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP large community list (for deletion)";
+ }
+
+ identity extended-comm-list-delete {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set BGP extended community list (for deletion)";
+ }
+
+ identity set-evpn-gateway-ip-ipv4 {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set EVPN gateway IP overlay index IPv4";
+ }
+
+ identity set-evpn-gateway-ip-ipv6 {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set EVPN gateway IP overlay index IPv6";
+ }
+
+ identity set-l3vpn-nexthop-encapsulation {
+ base frr-route-map:rmap-set-type;
+ description
+ "Accept L3VPN traffic over other than LSP encapsulation";
+ }
+
+ grouping extcommunity-non-transitive-types {
+ leaf two-octet-as-specific {
+ type boolean;
+ description
+ "Non-Transitive Two-Octet AS-Specific Extended Community";
+ }
+ }
+
+ typedef route-distinguisher {
+ type string {
+ pattern
+ '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+ + '42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+ + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
+ + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+ + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+ + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+ + '655[0-2][0-9]|'
+ + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(6(:[a-fA-F0-9]{2}){6})|'
+ + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
+ + '[0-9a-fA-F]{1,12})|'
+ + '((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+ + '42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+ + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0)|'
+ + '((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+ + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+ + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+ + '655[0-2][0-9]|'
+ + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '((429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0).'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):'
+ + '(429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))';
+ }
+
+ description
+ "A Route Distinguisher is an 8-octet value used to
+ distinguish routes from different BGP VPNs (RFC 4364).
+ A Route Distinguisher will have the same format as a
+ Route Target as per RFC 4360 and will consist of
+ two or three fields: a 2-octet Type field, an administrator
+ field, and, optionally, an assigned number field.
+ According to the data formats for types 0, 1, 2, and 6 as
+ defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
+ pattern is defined as:
+ 0:2-octet-asn:4-octet-number
+ 1:4-octet-ipv4addr:2-octet-number
+ 2:4-octet-asn:2-octet-number
+ 6:6-octet-mac-address
+ Additionally, a generic pattern is defined for future
+ route discriminator types:
+ 2-octet-other-hex-number:6-octet-hex-number
+ Some valid examples are 0:100:100, 1:1.1.1.1:100,
+ 2:1234567890:203, and 6:26:00:08:92:78:00.
+ The following route distinguisher with two fields are also
+ accepted : 10000:44 1.2.3.4:44.";
+ reference
+ "RFC 4360: BGP Extended Communities Attribute.
+ RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
+ RFC 5668: 4-Octet AS Specific BGP Extended Community.
+ RFC 7432: BGP MPLS-Based Ethernet VPN.";
+ }
+
+ typedef extcommunity-lb-type {
+ type enumeration {
+ enum "explicit-bandwidth" {
+ value 0;
+ description
+ "Bandwidth value in Mbps";
+ }
+ enum "cumulative-bandwidth" {
+ value 1;
+ description
+ "Cumulative bandwidth of all multipaths (outbound-only)";
+ }
+ enum "computed-bandwidth" {
+ value 2;
+ description
+ "Internally computed bandwidth based on number of multipaths (outbound-only)";
+ }
+ }
+ description
+ "ext-community link bandwidth types.";
+ }
+
+ typedef asn-type {
+ type union {
+ type uint32 {
+ range "1..4294967295";
+ }
+ type string {
+ pattern '(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|'
+ + '6[0-4][0-9]{3}|65[0-4][0-9]{2}|'
+ + '655[0-2][0-9]|6553[0-5])\.'
+ + '(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|'
+ + '65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])' {
+ error-message "AS dot should be in the form [0..65535].[0..65535].";
+ }
+ pattern '^0\.0$' {
+ modifier "invert-match";
+ error-message "AS dot can't be equal to 0.0.";
+ }
+ }
+ }
+ }
+
+ typedef color-list {
+ type string {
+ pattern '((429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[0-1][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|'
+ + '4[0-1][0-9]{8}|[1-3][0-9]{9}|'
+ + '[1-9][0-9]{0,8})(\s*))+';
+ }
+ description
+ "The color-list type represent a set of colors of value (1..4294967295)
+ values are separated by white spaces";
+ reference
+ "RFC 9012 - The BGP Tunnel Encapsulation Attribute";
+ }
+
+ augment "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:rmap-match-condition/frr-route-map:match-condition" {
+ case local-preference {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-local-preference')";
+ leaf local-preference {
+ type uint32 {
+ range "0..4294967295";
+ }
+ }
+ }
+
+ case alias {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-alias')";
+ leaf alias {
+ type string;
+ }
+ }
+
+ case script {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-script')";
+ leaf script {
+ type string;
+ }
+ }
+
+ case origin {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-origin')";
+ leaf origin {
+ type enumeration {
+ enum "egp" {
+ value 0;
+ description
+ "Remote EGP";
+ }
+ enum "igp" {
+ value 1;
+ description
+ "Local IGP";
+ }
+ enum "incomplete" {
+ value 2;
+ description
+ "Unknown heritage";
+ }
+ }
+ }
+ }
+
+ case rpki {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:rpki')";
+ leaf rpki {
+ type enumeration {
+ enum "invalid" {
+ value 0;
+ description
+ "Invalid prefix";
+ }
+ enum "notfound" {
+ value 1;
+ description
+ "Prefix not found";
+ }
+ enum "valid" {
+ value 2;
+ description
+ "Valid prefix";
+ }
+ }
+ }
+ }
+
+ case rpki-extcommunity {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:rpki-extcommunity')";
+ leaf rpki-extcommunity {
+ type enumeration {
+ enum "valid" {
+ value 0;
+ description
+ "Valid prefix";
+ }
+ enum "notfound" {
+ value 1;
+ description
+ "Prefix not found";
+ }
+ enum "invalid" {
+ value 2;
+ description
+ "Invalid prefix";
+ }
+ }
+ }
+ }
+
+ case probability {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:probability')";
+ leaf probability {
+ type uint8 {
+ range "0..100";
+ }
+ }
+ }
+
+ case source-vrf {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:source-vrf')";
+ leaf source-vrf {
+ type string;
+ }
+ }
+
+ case peer {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:peer')";
+ choice peer {
+ description
+ "Value of the peer";
+ case peer-ipv4-address {
+ description
+ "IP address of peer";
+ leaf peer-ipv4-address {
+ type inet:ipv4-address;
+ }
+ }
+
+ case peer-interface {
+ description
+ "Interface name of peer";
+ leaf peer-interface {
+ type string;
+ }
+ }
+
+ case peer-ipv6-address {
+ description
+ "IPv6 address of peer";
+ leaf peer-ipv6-address {
+ type inet:ipv6-address;
+ }
+ }
+
+ case peer-local {
+ description
+ "Static or Redistributed routes";
+ leaf peer-local {
+ type boolean;
+ }
+ }
+ }
+ }
+
+ case access-list-name {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:mac-address-list') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:as-path-list') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:ip-route-source') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:ip-route-source-prefix-list')";
+ description
+ "Access-list name";
+ leaf list-name {
+ type filter:access-list-name;
+ }
+ }
+
+ case evpn-default-route {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:evpn-default-route')";
+ description
+ "Match default EVPN type-5 route";
+ leaf evpn-default-route {
+ type empty;
+ }
+ }
+
+ case evpn-vni {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:evpn-vni')";
+ description
+ "Match eVPN VNI";
+ leaf evpn-vni {
+ type uint32 {
+ range "1..16777215";
+ }
+ }
+ }
+
+ case evpn-route-type {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:evpn-route-type')";
+ description
+ "Match eVPN route-type";
+ leaf evpn-route-type {
+ type enumeration {
+ enum "macip" {
+ value 0;
+ description
+ "Mac-IP route";
+ }
+ enum "multicast" {
+ value 1;
+ description
+ "IMET route";
+ }
+ enum "prefix" {
+ value 2;
+ description
+ "Prefix route";
+ }
+ enum "ead" {
+ value 3;
+ description
+ "Ethernet Auto-Discovery route";
+ }
+ enum "es" {
+ value 4;
+ description
+ "Ethernet Segment route";
+ }
+ }
+ }
+ }
+
+ case evpn-rd {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:evpn-rd')";
+ description
+ "Match eVPN route-distinguisher";
+ leaf route-distinguisher {
+ type route-distinguisher;
+ }
+ }
+
+ case comm-list-name {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-community') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-large-community') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-extcommunity')";
+ container comm-list {
+ leaf comm-list-name {
+ type bgp-filter:bgp-list-name;
+ }
+
+ leaf comm-list-name-exact-match {
+ type boolean;
+ description
+ "Do exact matching of communities";
+ }
+
+ leaf comm-list-name-any {
+ type boolean;
+ description
+ "Do matching of any community";
+ }
+
+ }
+ }
+
+ case ipv4-address {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:ipv4-nexthop')";
+ leaf ipv4-address {
+ type inet:ipv4-address;
+ description
+ "IPv4 address";
+ }
+ }
+
+ case ipv6-address {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:ipv6-nexthop')";
+ leaf ipv6-address {
+ type inet:ipv6-address;
+ description
+ "IPv6 address";
+ }
+ }
+
+ case source-protocol {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-bgp-route-map:source-protocol')";
+ leaf source-protocol {
+ type frr-route-types:frr-route-types;
+ }
+ }
+ }
+
+ augment "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:rmap-set-action/frr-route-map:set-action" {
+ case distance {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:distance')";
+ leaf distance {
+ type uint8 {
+ range "1..255";
+ }
+ }
+ }
+
+ case extcommunity-none {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-none')";
+ description
+ "Value of the BGP extended community attribute";
+ leaf extcommunity-none {
+ type boolean;
+ description "No extended community attribute";
+ }
+ }
+
+ case extcommunity-rt {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-rt')";
+ description
+ "Value of the ext-community";
+ leaf extcommunity-rt {
+ type string;
+ description
+ "Set BGP ext-community route-target attribute";
+ }
+ }
+
+ case extcommunity-nt {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-nt')";
+ description
+ "Value of the ext-community";
+ leaf extcommunity-nt {
+ type string;
+ description
+ "Set BGP ext-community node-target attribute";
+ }
+ }
+
+ case extcommunity-soo {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-soo')";
+ description
+ "Value of the ext-community";
+ leaf extcommunity-soo {
+ type string;
+ description
+ "Set BGP ext-community site-of-origin attribute";
+ }
+ }
+
+ case extcommunity-lb {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-lb')";
+ container extcommunity-lb {
+ description
+ "Value of the ext-community.";
+ leaf lb-type {
+ type frr-bgp-route-map:extcommunity-lb-type;
+ }
+
+ leaf bandwidth {
+ when "../lb-type = 'explicit-bandwidth'";
+ type uint16 {
+ range "1..25600";
+ }
+ description
+ "Bandwidth value in Mbps";
+ }
+ uses extcommunity-non-transitive-types;
+ }
+ }
+
+ case extcommunity-color {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-color')";
+ description
+ "Value of the ext-community";
+ leaf extcommunity-color {
+ type color-list;
+ description
+ "Set BGP ext-community color attribute with a list of colors";
+ reference
+ "RFC9012";
+ }
+ }
+
+ case ipv4-address {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv4-vpn-address')";
+ description
+ "Set the IPv4 address";
+ leaf ipv4-address {
+ type inet:ipv4-address;
+ }
+ }
+
+ case ipv4-nexthop {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-ipv4-nexthop')";
+ leaf ipv4-nexthop {
+ type string;
+ }
+ }
+
+ case ipv6-address {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv6-nexthop-global') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv6-vpn-address')";
+ description
+ "Set the IPv6 address";
+ leaf ipv6-address {
+ type inet:ipv6-address;
+ }
+ }
+
+ case preference {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv6-prefer-global') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv6-peer-address')";
+ leaf preference {
+ type boolean;
+ }
+ }
+
+ case label-index {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:label-index')";
+ leaf label-index {
+ type uint32 {
+ range "0..1048560";
+ }
+ }
+ }
+
+ case local-pref {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-local-preference')";
+ leaf local-pref {
+ type string;
+ }
+ }
+
+ case weight {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:weight')";
+ leaf weight {
+ type uint32 {
+ range "0..4294967295";
+ }
+ }
+ }
+
+ case origin {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-origin')";
+ leaf origin {
+ type enumeration {
+ enum "egp" {
+ value 0;
+ description
+ "Remote EGP";
+ }
+ enum "igp" {
+ value 1;
+ description
+ "Local IGP";
+ }
+ enum "incomplete" {
+ value 2;
+ description
+ "Unknown heritage";
+ }
+ }
+ }
+ }
+
+ case originator-id {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:originator-id')";
+ leaf originator-id {
+ type inet:ipv4-address;
+ }
+ }
+
+ case table {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:table')";
+ leaf table {
+ type uint32 {
+ range "1..4294967295";
+ }
+ }
+ }
+
+ case atomic-aggregate {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:atomic-aggregate')";
+ leaf atomic-aggregate {
+ type empty;
+ }
+ }
+
+ case aigp-metric {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:aigp-metric')";
+ leaf aigp-metric {
+ type string;
+ description
+ "Set BGP AIGP attribute (AIGP Metric TLV)";
+ }
+ }
+
+ case as-path-prepend {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:as-path-prepend')";
+ choice as-path-prepend {
+ description
+ "Value of the BGP AS-path attribute";
+ case prepend-as {
+ description
+ "Prepend the mentioned AS-path";
+ leaf prepend-as-path {
+ type string;
+ }
+ }
+
+ case last-as {
+ description
+ "Prepend the last ASN in the AS-path";
+ leaf last-as {
+ type uint8 {
+ range "1..10";
+ }
+ }
+ }
+ }
+ }
+
+ case as-path-exclude {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:as-path-exclude')";
+ leaf exclude-as-path {
+ type string;
+ description
+ "Exclude the mentioned AS-path";
+ }
+ }
+
+ case as-path-replace {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:as-path-replace')";
+ leaf replace-as-path {
+ type string;
+ description
+ "Replace ASNs to local AS number";
+ }
+ }
+
+ case community {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-community')";
+ choice community {
+ description
+ "Value of the BGP community attribute";
+ case none {
+ description
+ "No community attribute";
+ leaf community-none {
+ type boolean;
+ }
+ }
+
+ case community-string {
+ description
+ "Community string";
+ leaf community-string {
+ type string;
+ }
+ }
+ }
+ }
+
+ case large-community {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-large-community')";
+ choice large-community {
+ description
+ "Value of the BGP large-community attribute";
+ case none {
+ description
+ "No large-community attribute";
+ leaf large-community-none {
+ type boolean;
+ }
+ }
+
+ case large-community-string {
+ description
+ "Large-Community string";
+ leaf large-community-string {
+ type string;
+ }
+ }
+ }
+ }
+
+ case aggregator {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:aggregator')";
+ container aggregator {
+ leaf aggregator-asn {
+ type asn-type;
+ description
+ "ASN of the aggregator";
+ }
+
+ leaf aggregator-address {
+ type inet:ipv4-address;
+ description
+ "IPv4 address of the aggregator";
+ }
+ }
+ }
+
+ case comm-list-name {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:comm-list-delete') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:large-comm-list-delete') or "
+ + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action,
+'frr-bgp-route-map:extended-comm-list-delete')";
+ leaf comm-list-name {
+ type bgp-filter:bgp-list-name;
+ }
+ }
+ case evpn-gateway-ip-ipv4 {
+ when
+ "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action,
+ 'frr-bgp-route-map:set-evpn-gateway-ip-ipv4')";
+ description
+ "Set EVPN gateway IP overlay index IPv4";
+ leaf evpn-gateway-ip-ipv4 {
+ type inet:ipv4-address;
+ }
+ }
+ case evpn-gateway-ip-ipv6 {
+ when
+ "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action,
+ 'frr-bgp-route-map:set-evpn-gateway-ip-ipv6')";
+ description
+ "Set EVPN gateway IP overlay index IPv6";
+ leaf evpn-gateway-ip-ipv6 {
+ type inet:ipv6-address;
+ }
+ }
+ case l3vpn-nexthop-encapsulation {
+ when
+ "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action,
+ 'frr-bgp-route-map:set-l3vpn-nexthop-encapsulation')";
+ description
+ "Accept L3VPN traffic over other than LSP encapsulation";
+ leaf l3vpn-nexthop-encapsulation {
+ type enumeration {
+ enum "gre" {
+ value 0;
+ description
+ "GRE protocol";
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-bgp-rpki.yang b/yang/frr-bgp-rpki.yang
new file mode 100644
index 0000000..7e75580
--- /dev/null
+++ b/yang/frr-bgp-rpki.yang
@@ -0,0 +1,210 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-bgp-rpki {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/frr-bgp-rpki";
+ prefix frr-bgp-rpki;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR BGP RPKI.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ typedef transport-type {
+ type enumeration {
+ enum "TCP" {
+ value 1;
+ description
+ "Connection to server is TCP based.";
+ }
+ enum "SSH" {
+ value 2;
+ description
+ "Connection to server is SSH based.";
+ }
+ }
+ }
+
+ grouping bgp-rpki-timers {
+ container rpki-timers {
+ description
+ "RPKI timers config.";
+ leaf polling-time {
+ type uint32 {
+ range "1..86400";
+ }
+ units "seconds";
+ default "3600";
+ description
+ "Set the number of seconds the router waits until the
+ router asks the cache again for updated data.";
+ }
+
+ leaf expire-time {
+ type uint32 {
+ range "600..172800";
+ }
+ units "seconds";
+ default "7200";
+ description
+ "Set the expire interval.";
+ }
+
+ leaf retry-time {
+ type uint16 {
+ range "1..7200";
+ }
+ units "seconds";
+ default "600";
+ description
+ "Set the retry interval.";
+ }
+ }
+ }
+
+ grouping bgp-rpki-cache-server {
+ container rpki-cache-server {
+ description
+ "Add a cache server to the socket.";
+ list cache-list {
+ key "preference";
+ leaf preference {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Preference of the cache server.";
+ }
+
+ leaf cache-type {
+ type transport-type;
+ mandatory true;
+ description
+ "Specifies a transport method for the RPKI cache.";
+ }
+
+ choice server {
+ case ip-address {
+ leaf ip-address {
+ type inet:ip-address;
+ mandatory true;
+ }
+ }
+
+ case host-name {
+ leaf ip-host-address {
+ type inet:host;
+ mandatory true;
+ }
+ }
+ }
+
+ container transport {
+ container tcp {
+ when "../../cache-type = 'TCP'";
+ description
+ "TCP server details.";
+ leaf tcp-port {
+ type uint32;
+ }
+ }
+
+ container ssh {
+ when "../../cache-type = 'SSH'";
+ description
+ "SSH login details";
+ leaf ssh-port {
+ type uint32 {
+ range "1..65535";
+ }
+ description
+ "SSH port on which session gets opened.";
+ }
+
+ leaf user-name {
+ type string;
+ description
+ "SSH username to establish an SSH connection to the
+ cache server.";
+ }
+
+ leaf private-key {
+ type string;
+ description
+ "Local path that includes the private key file of the router.";
+ }
+
+ leaf public-key {
+ type string;
+ description
+ "Local path that includes the public key file of the router.";
+ }
+
+ leaf server-public-ley {
+ type string;
+ description
+ "Server public key.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ augment "/frr-vrf:lib/frr-vrf:vrf" {
+ container bgp-rpki {
+ description
+ "RPKI configuration parameters.";
+ leaf enable {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it enables the RPKI.";
+ }
+
+ uses bgp-rpki-timers;
+
+ uses bgp-rpki-cache-server;
+ }
+ }
+}
diff --git a/yang/frr-bgp-types.yang b/yang/frr-bgp-types.yang
new file mode 100644
index 0000000..7229572
--- /dev/null
+++ b/yang/frr-bgp-types.yang
@@ -0,0 +1,151 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-bgp-types {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/bgp-types";
+ prefix frr-bt;
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module contains general data definitions for use in BGP.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ typedef plist-ref {
+ type string;
+ }
+
+ typedef access-list-ref {
+ type string;
+ }
+
+ typedef as-path-filter-ref {
+ type string;
+ }
+
+ typedef bgp-instance-type {
+ type enumeration {
+ enum "default" {
+ value 1;
+ description
+ "BGP instance default.";
+ }
+ enum "vrf" {
+ value 2;
+ description
+ "BGP instance vrf.";
+ }
+ enum "view" {
+ value 3;
+ description
+ "BGP instance view.";
+ }
+ }
+ }
+
+ typedef as-type {
+ type enumeration {
+ enum "as-specified" {
+ value 1;
+ description
+ "AS has explicitly specified value.";
+ }
+ enum "internal" {
+ value 2;
+ description
+ "Internal BGP peer.";
+ }
+ enum "external" {
+ value 3;
+ description
+ "External BGP peer.";
+ }
+ }
+ }
+
+ typedef add-path-type {
+ type enumeration {
+ enum "all" {
+ value 1;
+ description
+ "To advertise all paths to a neighbor.";
+ }
+ enum "per-as" {
+ value 2;
+ description
+ "To advertise the best path per each neighboring AS.";
+ }
+ enum "none" {
+ value 3;
+ description
+ "Add path feature is disabled.";
+ }
+ }
+ }
+
+ typedef bfd-session-type {
+ type enumeration {
+ enum "single-hop" {
+ value 1;
+ description
+ "Single hop session.";
+ }
+ enum "multi-hop" {
+ value 2;
+ description
+ "Multiple hop session.";
+ }
+ enum "not-configured" {
+ value 3;
+ description
+ "Not Configured.";
+ }
+ }
+ }
+
+ typedef direction {
+ type enumeration {
+ enum "in" {
+ value 1;
+ description
+ "IN, ingress, Rx.";
+ }
+ enum "out" {
+ value 2;
+ description
+ "OUT, egress, Tx.";
+ }
+ }
+ }
+}
diff --git a/yang/frr-bgp.yang b/yang/frr-bgp.yang
new file mode 100644
index 0000000..b34fd43
--- /dev/null
+++ b/yang/frr-bgp.yang
@@ -0,0 +1,1369 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-bgp {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/bgp";
+ prefix frr-bgp;
+
+ import frr-routing {
+ prefix frr-rt;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ import frr-bgp-types {
+ prefix frr-bt;
+ }
+
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ include "frr-bgp-common";
+
+ include "frr-bgp-common-structure";
+
+ include "frr-bgp-common-multiprotocol";
+
+ include "frr-bgp-neighbor";
+
+ include "frr-bgp-peer-group";
+
+ include "frr-bgp-bmp";
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR bgpd daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ identity bgp {
+ base frr-rt:routing-protocol;
+ description
+ "BGP protocol.";
+ }
+
+ grouping mp-afi-unicast-common {
+ uses global-group-use-multiple-paths;
+
+ uses global-redistribute;
+
+ uses admin-distance;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol" {
+ container bgp {
+ when "../frr-rt:type = 'frr-bgp:bgp'" {
+ description
+ "BGP protocol augmentation of ietf-routing module
+ control-plane-protocol.";
+ }
+ presence "Enables configuration of BGP";
+ description
+ "Top-level configuration for the BGP router.";
+ container global {
+ description
+ "Global configuration for the BGP router.";
+ leaf local-as {
+ type inet:as-number;
+ mandatory true;
+ description
+ "Local autonomous system number of the router. Uses
+ the 32-bit as-number type from the model in RFC 6991.";
+ }
+
+ uses frr-rt:router-id;
+
+ container confederation {
+ description
+ "Configuration options specifying parameters when the
+ local router is within an autonomous system which is
+ part of a BGP confederation.";
+ leaf identifier {
+ type inet:as-number;
+ description
+ "Confederation identifier for the autonomous system.";
+ }
+
+ leaf-list member-as {
+ type inet:as-number;
+ description
+ "Remote autonomous systems that are to be treated
+ as part of the local confederation.";
+ }
+ }
+
+ uses med-config;
+
+ uses route-reflector-config;
+
+ uses route-selection-options;
+
+ uses global-neighbor-config;
+
+ container graceful-restart {
+ description
+ "Parameters relating the graceful restart mechanism for
+ BGP.";
+ uses graceful-restart-config;
+ }
+
+ uses global-update-group-config;
+
+ uses global-config-timers;
+
+ uses global-bgp-config;
+
+ uses global-network-config;
+
+ uses global-graceful-shutdown;
+
+ uses global-bmp-config;
+
+ container afi-safis {
+ description
+ "List of address-families associated with the BGP
+ instance.";
+ list afi-safi {
+ key "afi-safi-name";
+ description
+ "AFI, SAFI configuration available for the
+ neighbour or group.";
+ uses mp-afi-safi-config;
+
+ uses mp-all-afi-safi-list-contents;
+ }
+ }
+ }
+
+ container neighbors {
+ description
+ "Configuration for BGP neighbors.";
+ list neighbor {
+ key "remote-address";
+ description
+ "List of BGP neighbors configured on the local system,
+ uniquely identified by remote IPv[46] address.";
+ leaf remote-address {
+ type inet:ip-address;
+ description
+ "The remote IP address of this entry's BGP peer.";
+ }
+
+ leaf local-interface {
+ type frr-interface:interface-ref {
+ require-instance false;
+ }
+ description
+ "Neighbor's interface name.";
+ }
+
+ leaf local-port {
+ type inet:port-number {
+ range "0..65535";
+ }
+ description
+ "Neighbor's BGP TCP port number.";
+ }
+
+ leaf peer-group {
+ type leafref {
+ path "../../../peer-groups/peer-group/peer-group-name";
+ }
+ description
+ "The peer-group with which this neighbor is associated.";
+ }
+
+ container neighbor-remote-as {
+ leaf remote-as-type {
+ type frr-bt:as-type;
+ mandatory true;
+ description
+ "Remote AS type.";
+ }
+
+ leaf remote-as {
+ when "../remote-as-type = 'as-specified'";
+ type inet:as-number;
+ description
+ "The remote autonomous system number received in
+ the BGP OPEN message.";
+ reference
+ "RFC 4271";
+ }
+ }
+
+ uses neighbor-parameters;
+
+ uses structure-neighbor-group-capability-options;
+ }
+
+ list unnumbered-neighbor {
+ key "interface";
+ description
+ "List of BGP neighbors configured on the local system,
+ uniquely identified by interfaces.";
+ leaf interface {
+ type frr-interface:interface-ref {
+ require-instance false;
+ }
+ description
+ "The local interface of this entry's BGP peer.";
+ }
+
+ leaf v6only {
+ type boolean;
+ default "false";
+ description
+ "When set to 'true' it will create a neighbor with v6
+ link local only.";
+ }
+
+ leaf peer-group {
+ type leafref {
+ path "../../../peer-groups/peer-group/peer-group-name";
+ }
+ description
+ "The peer-group with which this neighbor is associated.";
+ }
+
+ uses neighbor-remote-as;
+
+ uses neighbor-parameters;
+
+ uses structure-neighbor-group-capability-options {
+ refine "frr-bgp:capability-options/extended-nexthop-capability" {
+ default "true";
+ }
+ }
+ }
+ }
+
+ container peer-groups {
+ description
+ "Configuration for BGP peer-groups.";
+ uses bgp-peer-group-list;
+ }
+ }
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/ipv4-unicast" {
+ list network-config {
+ key "prefix";
+ description
+ "A list of network routes.";
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "IPv4 destination prefix.";
+ }
+
+ leaf backdoor {
+ type boolean;
+ default "false";
+ description
+ "Specify a BGP backdoor route.";
+ }
+
+ uses mp-afi-safi-network-config;
+ }
+
+ list aggregate-route {
+ key "prefix";
+ description
+ "A list of aggregated routes.";
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "IPv4 destination prefix.";
+ }
+
+ uses mp-afi-safi-agg-route-config;
+ }
+
+ list admin-distance-route {
+ key "prefix";
+ description
+ "A list of routes with a particular admin distance.";
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "IPv4 destination prefix.";
+ }
+
+ uses distance-per-route-config;
+ }
+
+ uses route-flap-dampening;
+
+ uses mp-afi-unicast-common;
+
+ uses global-filter-config;
+
+ uses global-afi-safi-vpn-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/ipv6-unicast" {
+ list network-config {
+ key "prefix";
+ description
+ "A list of network routes.";
+ leaf prefix {
+ type inet:ipv6-prefix;
+ description
+ "IPv6 destination prefix.";
+ }
+
+ leaf backdoor {
+ type boolean;
+ default "false";
+ description
+ "Specify a BGP backdoor route.";
+ }
+
+ uses mp-afi-safi-network-config;
+ }
+
+ list aggregate-route {
+ key "prefix";
+ description
+ "A list of aggregated routes.";
+ leaf prefix {
+ type inet:ipv6-prefix;
+ description
+ "IPv6 destination prefix.";
+ }
+
+ uses mp-afi-safi-agg-route-config;
+ }
+
+ list admin-distance-route {
+ key "prefix";
+ description
+ "A list of routes with a particular admin distance.";
+ leaf prefix {
+ type inet:ipv6-prefix;
+ description
+ "IPv6 destination prefix.";
+ }
+
+ uses distance-per-route-config;
+ }
+
+ uses route-flap-dampening;
+
+ uses mp-afi-unicast-common;
+
+ uses global-filter-config;
+
+ uses global-afi-safi-vpn-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/ipv4-labeled-unicast" {
+ uses global-group-use-multiple-paths;
+
+ uses route-flap-dampening;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/ipv6-labeled-unicast" {
+ uses global-group-use-multiple-paths;
+
+ uses route-flap-dampening;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/ipv4-multicast" {
+ list network-config {
+ key "prefix";
+ description
+ "A list of network routes.";
+ leaf prefix {
+ type frr-route-types:ipv4-multicast-group-prefix;
+ description
+ "IPv4 multicast destination prefix.";
+ }
+
+ leaf backdoor {
+ type boolean;
+ default "false";
+ description
+ "Specify a BGP backdoor route.";
+ }
+
+ uses mp-afi-safi-network-config;
+ }
+
+ list aggregate-route {
+ key "prefix";
+ description
+ "A list of aggregated routes.";
+ leaf prefix {
+ type frr-route-types:ipv4-multicast-group-prefix;
+ description
+ "IPv4 multicast destination prefix.";
+ }
+
+ uses mp-afi-safi-agg-route-config;
+ }
+
+ list admin-distance-route {
+ key "prefix";
+ description
+ "A list of routes with a particular admin distance.";
+ leaf prefix {
+ type frr-route-types:ipv4-multicast-group-prefix;
+ description
+ "IPv4 multicast destination prefix.";
+ }
+
+ uses distance-per-route-config;
+ }
+
+ uses admin-distance;
+
+ uses route-flap-dampening;
+
+ uses global-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/ipv6-multicast" {
+ list network-config {
+ key "prefix";
+ description
+ "A list of network routes.";
+ leaf prefix {
+ type frr-route-types:ipv6-multicast-group-prefix;
+ description
+ "IPv6 multicast destination prefix.";
+ }
+
+ leaf backdoor {
+ type boolean;
+ default "false";
+ description
+ "Specify a BGP backdoor route.";
+ }
+
+ uses mp-afi-safi-network-config;
+ }
+
+ list aggregate-route {
+ key "prefix";
+ description
+ "A list of aggregated routes.";
+ leaf prefix {
+ type frr-route-types:ipv6-multicast-group-prefix;
+ description
+ "IPv6 multicast destination prefix.";
+ }
+
+ uses mp-afi-safi-agg-route-config;
+ }
+
+ list admin-distance-route {
+ key "prefix";
+ description
+ "A list of routes with a particular admin distance.";
+ leaf prefix {
+ type frr-route-types:ipv6-multicast-group-prefix;
+ description
+ "IPv6 multicast destination prefix.";
+ }
+
+ uses distance-per-route-config;
+ }
+
+ uses route-flap-dampening;
+
+ uses admin-distance;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/ipv4-flowspec" {
+ uses flow-spec-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/l3vpn-ipv4-unicast" {
+ uses global-afi-safi-vpn-network-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/afi-safis/afi-safi/l3vpn-ipv6-unicast" {
+ uses global-afi-safi-vpn-network-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/bmp-config/target-list/afi-safis/afi-safi/ipv4-unicast" {
+ uses bmp-afi-safi-common-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/bmp-config/target-list/afi-safis/afi-safi/ipv4-multicast" {
+ uses bmp-afi-safi-common-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/bmp-config/target-list/afi-safis/afi-safi/ipv6-unicast" {
+ uses bmp-afi-safi-common-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/global/bmp-config/target-list/afi-safis/afi-safi/ipv6-multicast" {
+ uses bmp-afi-safi-common-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/ipv4-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/ipv6-unicast" {
+ leaf nexthop-local-unchanged {
+ type boolean;
+ default "false";
+ description
+ "Configure treatment of outgoing link-local nexthop attribute.
+ When set to 'true' it leaves link-local nexthop unchanged
+ for this peer.";
+ }
+
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/ipv4-multicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/ipv6-multicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/ipv4-labeled-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/ipv6-labeled-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/l3vpn-ipv4-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/l3vpn-ipv6-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/l2vpn-evpn" {
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/ipv4-flowspec" {
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/ipv6-flowspec" {
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/ipv4-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/ipv6-unicast" {
+ leaf nexthop-local-unchanged {
+ type boolean;
+ default "false";
+ description
+ "Configure treatment of outgoing link-local nexthop attribute.
+ When set to 'true' it leaves link-local nexthop unchanged
+ for this peer.";
+ }
+
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/ipv4-multicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/ipv6-multicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/ipv4-labeled-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/ipv6-labeled-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/l3vpn-ipv4-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/l3vpn-ipv6-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/l2vpn-evpn" {
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/ipv4-flowspec" {
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/neighbors/unnumbered-neighbor/afi-safis/afi-safi/ipv6-flowspec" {
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv4-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv6-unicast" {
+ leaf nexthop-local-unchanged {
+ type boolean;
+ default "false";
+ description
+ "Configure treatment of outgoing link-local nexthop attribute.
+ When set to 'true' it leaves link-local nexthop unchanged
+ for this peer.";
+ }
+
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv4-multicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv6-multicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv4-labeled-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv6-labeled-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-default-originate-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-group-orf-capability;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/l3vpn-ipv4-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/l3vpn-ipv6-unicast" {
+ uses structure-neighbor-group-add-paths;
+
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-prefix-limit;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-private-as;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-send-community;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-weight;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/l2vpn-evpn" {
+ uses structure-neighbor-group-as-path-options;
+
+ uses structure-neighbor-group-attr-unchanged;
+
+ uses structure-neighbor-nexthop-self;
+
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv4-flowspec" {
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv6-flowspec" {
+ uses structure-neighbor-route-reflector;
+
+ uses structure-neighbor-route-server;
+
+ uses structure-neighbor-group-soft-reconfiguration;
+
+ uses structure-neighbor-group-filter-config;
+ }
+}
diff --git a/yang/frr-deviations-bgp-datacenter.yang b/yang/frr-deviations-bgp-datacenter.yang
new file mode 100644
index 0000000..46092cb
--- /dev/null
+++ b/yang/frr-deviations-bgp-datacenter.yang
@@ -0,0 +1,107 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-deviations-bgp-datacenter {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/frr-deviations-bgp-datacenter";
+ prefix frr-deviations-bgp-dc;
+
+ import frr-routing {
+ prefix frr-rt;
+ }
+
+ import frr-bgp {
+ prefix frr-bgp;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines deviations for the frr-bgp module with
+ datacenter profile.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:global-config-timers/frr-bgp:connect-retry-interval" {
+ deviate replace {
+ default "10";
+ }
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:global-config-timers/frr-bgp:hold-time" {
+ deviate replace {
+ default "9";
+ }
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:global-config-timers/frr-bgp:keepalive" {
+ deviate replace {
+ default "3";
+ }
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:route-selection-options/frr-bgp:deterministic-med" {
+ deviate replace {
+ default "false";
+ }
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:import-check" {
+ deviate replace {
+ default "true";
+ }
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:show-hostname" {
+ deviate replace {
+ default "true";
+ }
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:show-nexthop-hostname" {
+ deviate replace {
+ default "true";
+ }
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:ebgp-requires-policy" {
+ deviate replace {
+ default "false";
+ }
+ }
+
+ deviation "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-bgp:bgp/frr-bgp:global/frr-bgp:global-neighbor-config/frr-bgp:log-neighbor-changes" {
+ deviate replace {
+ default "true";
+ }
+ }
+}
diff --git a/yang/frr-eigrpd.yang b/yang/frr-eigrpd.yang
new file mode 100644
index 0000000..e9071c8
--- /dev/null
+++ b/yang/frr-eigrpd.yang
@@ -0,0 +1,367 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-eigrpd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/eigrpd";
+ prefix frr-eigrpd;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import frr-interface {
+ prefix frr-interface;
+ }
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR eigrpd daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-09-09 {
+ description
+ "Changed interface references to use
+ frr-interface:interface-ref typedef";
+ }
+ revision 2019-06-19 {
+ description "Initial revision.";
+ reference
+ "RFC 7868: Cisco's Enhanced Interior Gateway Routing Protocol (EIGRP).";
+ }
+
+ /*
+ * Types specification.
+ */
+ typedef autonomous-system {
+ description "Administrative domain identification for a network";
+ type uint16 {
+ range 1..65535;
+ }
+ }
+
+ typedef authentication-type {
+ description "Authentication types";
+ type enumeration {
+ enum none {
+ description "Don't authenticate";
+ value 0;
+ }
+
+ enum text {
+ description "User defined text";
+ value 1;
+ }
+
+ enum md5 {
+ description "MD5 algorithm";
+ value 2;
+ }
+
+ enum hmac-sha-256 {
+ description "HMAC SHA256 algorithm";
+ value 3;
+ }
+ }
+ }
+
+ /*
+ * EIGRP operational data.
+ */
+ container eigrpd {
+ list instance {
+ key "asn vrf";
+ description "EIGRP autonomous system instance";
+
+ leaf asn {
+ description "Autonomous System Number";
+ type autonomous-system;
+ }
+
+ leaf vrf {
+ description "Virtual Routing Domain name";
+ type frr-vrf:vrf-ref;
+ }
+
+ /*
+ * Configurations.
+ */
+ leaf router-id {
+ description "Router identification";
+ type inet:ipv4-address;
+ }
+
+ leaf-list passive-interface {
+ description "List of suppressed interfaces";
+ type frr-interface:interface-ref;
+ }
+
+ leaf active-time {
+ description "ACTIVE time limit in seconds (0 disables limit)";
+ type uint16 {
+ range "0..65535";
+ }
+ units seconds;
+ default 180;
+ }
+
+ leaf variance {
+ description "Control load balance variance";
+ type uint8 {
+ range "1..128";
+ }
+ }
+
+ leaf maximum-paths {
+ description "Most number of paths to forward packets to";
+ type uint8 {
+ range "1..32";
+ }
+ }
+
+ container metric-weights {
+ description
+ "Metrics and parameters for advertisement.
+
+ EIGRP calculates the composite metric with the following formula:
+
+ metric = 256 * ({(K1*BW) + [(K2*BW)/(256-LOAD)] + (K3*DELAY)} *
+ (K5/(REL+K4)))
+
+ Composite calculation:
+ K5
+ metric =[(K1*Net-Throughput) + Latency)+(K6*ExtAttr)] * ------
+ K4+Rel
+
+ RFC 7868 Sections 5.5 and 5.6.2.5.";
+
+ leaf K1 {
+ description "Bandwidth coefficient.";
+ type uint8 {
+ range "0..255";
+ }
+ }
+
+ leaf K2 {
+ description "Bandwidth on load coefficient.";
+ type uint8 {
+ range "0..255";
+ }
+ }
+
+ leaf K3 {
+ description "Delay or latency-based coefficient.";
+ type uint8 {
+ range "0..255";
+ }
+ }
+
+ leaf K4 {
+ description "Link quality coefficient.";
+ type uint8 {
+ range "0..255";
+ }
+ }
+
+ leaf K5 {
+ description "Packet loss coefficient.";
+ type uint8 {
+ range "0..255";
+ }
+ }
+
+ leaf K6 {
+ description "Jitter coefficient.";
+ type uint8 {
+ range "0..255";
+ }
+ }
+ }
+
+ leaf-list network {
+ description "Enable EIGRP on the specific network";
+ type inet:ipv4-prefix;
+ }
+
+ leaf-list neighbor {
+ description "Specific EIGRP neighbor";
+ type inet:ipv4-address;
+ }
+
+ list redistribute {
+ description "Redistribute routes learned from other routing protocols";
+
+ key "protocol";
+
+ leaf protocol {
+ description "Routing protocol";
+ type frr-route-types:frr-route-types-v4;
+ must '. != "eigrp"';
+ }
+
+ leaf route-map {
+ description
+ "Applies the conditions of the specified route-map to
+ routes that are redistributed into the EIGRP routing
+ instance";
+ type frr-route-map:route-map-ref;
+ }
+
+ container metrics {
+ description "Metric for the redistributed routes";
+
+ leaf bandwidth {
+ description "Bandwidth metric in Kbits per second";
+ type uint32 {
+ range "1..4294967295";
+ }
+ }
+
+ leaf delay {
+ description "Delay metric";
+ units microseconds;
+ type uint32 {
+ range "0..4294967295";
+ }
+ }
+
+ leaf reliability {
+ description "Reliability metric";
+ type uint32 {
+ range "0..255";
+ }
+ }
+
+ leaf load {
+ description "Effective bandwidth usage";
+ type uint32 {
+ range "1..255";
+ }
+ }
+
+ leaf mtu {
+ description "Path Maximum Transmission Unit";
+ type uint32 {
+ range "1..65535";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * EIGRP interface configurations.
+ */
+ augment "/frr-interface:lib/frr-interface:interface" {
+ container eigrp {
+ description "EIGRP interface parameters";
+
+ leaf delay {
+ description "Throughput delay";
+ type uint32 {
+ range "1..16777215";
+ }
+ default 10;
+ }
+
+ leaf bandwidth {
+ description "Interface bandwidth value";
+ type uint32 {
+ range "1..10000000";
+ }
+ default 100000;
+ }
+
+ leaf hello-interval {
+ description "Hello packet interval";
+ type uint16 {
+ range "1..65535";
+ }
+ units seconds;
+ default 5;
+ }
+
+ leaf hold-time {
+ description "Timeout amount to consider neighbor down";
+ type uint16 {
+ range "1..65535";
+ }
+ units seconds;
+ default 15;
+ }
+
+ leaf split-horizon {
+ description "Perform split horizon loop preventing technique";
+ type boolean;
+ default true;
+ }
+
+ /*
+ * Per AS configuration.
+ */
+ list instance {
+ description "Autonomous System specific configuration";
+
+ key "asn";
+
+ leaf asn {
+ description "Autonomous System Number";
+ type autonomous-system;
+ }
+
+ leaf-list summarize-addresses {
+ description "Peform address summarization";
+ type inet:ipv4-prefix;
+ }
+
+ leaf authentication {
+ description "Authentication digest algorithm";
+ type authentication-type;
+ default "none";
+ }
+
+ leaf keychain {
+ description "FRR key chain name to use with authentication";
+ type string;
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-filter.yang b/yang/frr-filter.yang
new file mode 100644
index 0000000..a1946d8
--- /dev/null
+++ b/yang/frr-filter.yang
@@ -0,0 +1,357 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-filter {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/filter";
+ prefix frr-filter;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines filter settings
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-07-04 {
+ description "Initial revision";
+ }
+
+ /*
+ * Types.
+ */
+ typedef access-list-name {
+ description "Access list name formatting";
+ type string {
+ length 1..128;
+ }
+ }
+
+ typedef access-list-sequence {
+ description "Access list sequence number";
+ type uint32 {
+ range "1..4294967295";
+ }
+ }
+
+ typedef access-list-action {
+ description "Access list return action on match";
+ type enumeration {
+ enum deny {
+ description "Deny an entry";
+ value 0;
+ }
+ enum permit {
+ description "Accept an entry";
+ value 1;
+ }
+ }
+ }
+
+ /*
+ * Configuration data.
+ */
+ container lib {
+ list access-list {
+ description "Access list instance";
+
+ key "type name";
+
+ leaf type {
+ description "Access list content type";
+ type enumeration {
+ enum ipv4 {
+ description "Internet Protocol address version 4";
+ value 0;
+ }
+ enum ipv6 {
+ description "Internet Protocol address version 6";
+ value 1;
+ }
+ enum mac {
+ description "Media Access Control address";
+ value 2;
+ }
+ }
+ }
+
+ leaf name {
+ description "Access list name";
+ type access-list-name;
+ }
+
+ leaf remark {
+ description "Access list remark";
+ type string;
+ }
+
+ list entry {
+ description "Access list entry";
+
+ key "sequence";
+
+ leaf sequence {
+ description "Access list sequence value";
+ type access-list-sequence;
+ }
+
+ leaf action {
+ description "Access list action on match";
+ type access-list-action;
+ mandatory true;
+ }
+
+ choice value {
+ description "Access list value to match";
+ mandatory true;
+
+ case ipv4-prefix {
+ when "../type = 'ipv4'";
+
+ choice style {
+ description "Access list entry style selection: zebra or cisco.";
+ mandatory true;
+
+ case zebra {
+ leaf ipv4-prefix {
+ description "Configure IPv4 prefix to match";
+ type inet:ipv4-prefix;
+ mandatory true;
+ }
+
+ leaf ipv4-exact-match {
+ description "Exact match of prefix";
+ type boolean;
+ default false;
+ }
+ }
+ case cisco {
+ choice standard-value {
+ description "Source value to match";
+
+ leaf host {
+ description "Host to match";
+ type inet:ipv4-address;
+ }
+ container network {
+ leaf address {
+ mandatory true;
+ description "Network address part.";
+ type inet:ipv4-address;
+ }
+ leaf mask {
+ mandatory true;
+ description "Network mask/wildcard part.";
+ type inet:ipv4-address;
+ }
+ }
+ leaf source-any {
+ /*
+ * Was `any`, however it conflicts with `any` leaf
+ * outside this choice.
+ */
+ description "Match any";
+ type empty;
+ }
+ }
+
+ choice extended-value {
+ description "Destination value to match";
+
+ leaf destination-host {
+ description "Host to match";
+ type inet:ipv4-address;
+ }
+ container destination-network {
+ leaf address {
+ mandatory true;
+ description "Network address part.";
+ type inet:ipv4-address;
+ }
+ leaf mask {
+ mandatory true;
+ description "Network mask/wildcard part.";
+ type inet:ipv4-address;
+ }
+ }
+ leaf destination-any {
+ description "Match any";
+ type empty;
+ }
+ }
+ }
+ }
+ }
+ case ipv6-prefix {
+ when "../type = 'ipv6'";
+
+ leaf ipv6-prefix {
+ description "Configure IPv6 prefix to match";
+ type inet:ipv6-prefix;
+ mandatory true;
+ }
+
+ leaf ipv6-exact-match {
+ description "Exact match of prefix";
+ type boolean;
+ default false;
+ }
+ }
+ case mac {
+ when "../type = 'mac'";
+
+ leaf mac {
+ description "Configure MAC address to match";
+ type yang:mac-address;
+ }
+ }
+ case any {
+ leaf any {
+ description "Match anything";
+ type empty;
+ }
+ }
+ }
+ }
+ }
+
+ list prefix-list {
+ description "Prefix list instance";
+
+ key "type name";
+
+ leaf type {
+ description "Prefix list type";
+ type enumeration {
+ enum ipv4 {
+ description "Internet Protocol address version 4";
+ value 0;
+ }
+ enum ipv6 {
+ description "Internet Protocol address version 6";
+ value 1;
+ }
+ }
+ }
+
+ leaf name {
+ description "Prefix list name";
+ type access-list-name;
+ }
+
+ leaf remark {
+ description "Prefix list user description";
+ type string;
+ }
+
+ list entry {
+ description "Prefix list entry";
+
+ key "sequence";
+
+ leaf sequence {
+ description "Prefix list sequence value";
+ type access-list-sequence;
+ }
+
+ leaf action {
+ description "Prefix list action on match";
+ type access-list-action;
+ mandatory true;
+ }
+
+ choice value {
+ description "Prefix list value to match";
+ mandatory true;
+
+ case ipv4-prefix {
+ leaf ipv4-prefix {
+ description "Configure IPv4 prefix to match";
+ type inet:ipv4-prefix;
+ mandatory true;
+ }
+
+ leaf ipv4-prefix-length-greater-or-equal {
+ description
+ "Specifies if matching prefixes with length greater than
+ or equal to value";
+ type uint8 {
+ range "0..32";
+ }
+ }
+
+ leaf ipv4-prefix-length-lesser-or-equal {
+ description
+ "Specifies if matching prefixes with length lesser than
+ or equal to value";
+ type uint8 {
+ range "0..32";
+ }
+ }
+ }
+ case ipv6-prefix {
+ leaf ipv6-prefix {
+ description "Configure IPv6 prefix to match";
+ type inet:ipv6-prefix;
+ mandatory true;
+ }
+
+ leaf ipv6-prefix-length-greater-or-equal {
+ description
+ "Specifies if matching prefixes with length greater than
+ or equal to value";
+ type uint8 {
+ range "0..128";
+ }
+ }
+
+ leaf ipv6-prefix-length-lesser-or-equal {
+ description
+ "Specifies if matching prefixes with length lesser than
+ or equal to value";
+ type uint8 {
+ range "0..128";
+ }
+ }
+ }
+ case any {
+ leaf any {
+ description "Match anything";
+ type empty;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-gmp.yang b/yang/frr-gmp.yang
new file mode 100644
index 0000000..c8a05a2
--- /dev/null
+++ b/yang/frr-gmp.yang
@@ -0,0 +1,183 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-gmp {
+ yang-version "1.1";
+ namespace "http://frrouting.org/yang/gmp";
+
+ prefix frr-gmp;
+
+ import frr-routing {
+ prefix "frr-rt";
+ }
+
+ import ietf-routing-types {
+ prefix "rt-types";
+ }
+
+ import ietf-inet-types {
+ prefix "inet";
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ organization
+ "FRRouting";
+
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+
+ description
+ "This module defines a model for managing FRR pimd daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2021-11-22 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 2236: IGMP v2.
+ RFC 3376: IGMP v3.
+ RFC 2710: MLD.
+ RFC 3810: MLD v2.";
+ }
+
+ grouping interface-config-attributes {
+ description
+ "Configuration IGMP/MLD attributes applied to the interface level.";
+
+ leaf enable {
+ type boolean;
+ default "false";
+ description
+ "Enable IGMP/MLD flag on the interface.";
+ }
+
+ leaf igmp-version {
+ when "../frr-gmp:address-family = 'frr-rt:ipv4'" {
+ description
+ "Only applicable to IPv4 address family.";
+ }
+ type uint8 {
+ range "2..3";
+ }
+ description
+ "IGMP version.";
+ }
+
+ leaf mld-version {
+ when "../frr-gmp:address-family = 'frr-rt:ipv6'" {
+ description
+ "Only applicable to IPv6 address family.";
+ }
+ type uint8 {
+ range "1..2";
+ }
+ default "2";
+ description
+ "MLD version.";
+ }
+
+ leaf query-interval {
+ type uint16 {
+ range "1..max";
+ }
+ units seconds;
+ must ". * 10 > ../query-max-response-time";
+ default "125";
+ description
+ "The Query Interval is the interval between General Queries
+ sent by the Querier.";
+ }
+
+ leaf query-max-response-time {
+ type uint16 {
+ range "1..max";
+ }
+ units deciseconds;
+ must ". <= ../query-interval * 10";
+ default "100";
+ description
+ "Query maximum response time specifies the maximum time
+ allowed before sending a responding report.";
+ }
+
+ leaf last-member-query-interval {
+ type uint16 {
+ range "1..max";
+ }
+ units deciseconds;
+ default "10";
+ description
+ "Last Member Query Interval, which may be tuned to modify
+ the leave latency of the network.";
+ }
+
+ leaf robustness-variable {
+ type uint8 {
+ range "1..max";
+ }
+ default "2";
+ description
+ "Querier's Robustness Variable allows tuning for the
+ expected packet loss on a network.";
+ }
+
+ list static-group {
+ key "group-addr source-addr";
+ description
+ "A static multicast route, (*,G) or (S,G).
+ The version of IGMP must be 3 to support (S,G).";
+
+ leaf group-addr {
+ type rt-types:ip-multicast-group-address;
+ description
+ "Multicast group address.";
+ }
+ leaf source-addr {
+ type inet:ip-address;
+ description
+ "Multicast source address.";
+ }
+ }
+ } // interface-config-attributes
+
+ /*
+ * Per-interface configuration data
+ */
+ augment "/frr-interface:lib/frr-interface:interface" {
+ container gmp {
+ list address-family {
+ key "address-family";
+ description
+ "Each list entry for one address family.";
+ uses frr-rt:address-family;
+ uses interface-config-attributes;
+ } //address-family
+ }
+ }
+}
diff --git a/yang/frr-if-rmap.yang b/yang/frr-if-rmap.yang
new file mode 100644
index 0000000..0fa2c5e
--- /dev/null
+++ b/yang/frr-if-rmap.yang
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-if-rmap {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/frr-if-rmap";
+ prefix frr-if-map;
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines route map settings
+
+ Copyright 2023 LabN Consulting L.L.C
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2023-04-09 {
+ description
+ "Initial revision";
+ reference "FRRouting";
+ }
+
+ grouping if-route-maps-group {
+ description "Grouping for interface route maps";
+
+ container if-route-maps {
+ description "Collection of interface route-maps";
+
+ list if-route-map {
+ must "in-route-map or out-route-map";
+ key "interface";
+ description "Collection of route-maps for an interface";
+
+ leaf "interface" {
+ type frr-interface:interface-ref;
+ description "The interface the route maps are associated with";
+ }
+ leaf "in-route-map" {
+ type frr-route-map:route-map-name;
+ description "Name of the ingress route map";
+ }
+ leaf "out-route-map" {
+ type frr-route-map:route-map-name;
+ description "Name of the egress route map";
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-interface.yang b/yang/frr-interface.yang
new file mode 100644
index 0000000..012c96b
--- /dev/null
+++ b/yang/frr-interface.yang
@@ -0,0 +1,320 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-interface {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/interface";
+ prefix frr-interface;
+
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+
+ import ietf-interfaces {
+ prefix ietf-if;
+ }
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR interfaces.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2020-02-05 {
+ description
+ "Added operational data";
+ }
+ revision 2019-09-09 {
+ description
+ "Added interface-ref typedef";
+ }
+ revision 2018-03-28 {
+ description
+ "Initial revision.";
+ }
+
+ identity other {
+ base ietf-if:interface-type;
+ description
+ "Other type";
+ }
+
+ identity unknown {
+ base ietf-if:interface-type;
+ description
+ "Unknown type";
+ }
+
+ identity ethernet {
+ base ietf-if:interface-type;
+ description
+ "Ethernet type";
+ }
+
+ identity exper-ethernet {
+ base ietf-if:interface-type;
+ description
+ "Experimental Ethernet type";
+ }
+
+ identity loopback {
+ base ietf-if:interface-type;
+ description
+ "Loopback type";
+ }
+
+ identity pimreg {
+ base ietf-if:interface-type;
+ description
+ "PIMSM Registration.";
+ }
+
+ identity ipip {
+ base ietf-if:interface-type;
+ description
+ "IPIP Tunnel.";
+ }
+
+ identity ipip6 {
+ base ietf-if:interface-type;
+ description
+ "IPIP6 Tunnel.";
+ }
+
+ identity ipgre {
+ base ietf-if:interface-type;
+ description
+ "GRE over IP.";
+ }
+
+ typedef interface-ref {
+ type leafref {
+ path "/frr-interface:lib/frr-interface:interface/frr-interface:name";
+ require-instance false;
+ }
+ description
+ "Reference to an interface";
+ }
+
+ typedef if-flags-type {
+ type enumeration {
+ enum "up" {
+ value 1;
+ description
+ "Active and ready to transfer packets.";
+ }
+ enum "broadcast" {
+ value 2;
+ description
+ "Broadcast enabled.";
+ }
+ enum "debug" {
+ value 3;
+ description
+ "Debug mode.";
+ }
+ enum "loopback" {
+ value 4;
+ description
+ "Loopback interface.";
+ }
+ enum "point-to-point" {
+ value 5;
+ description
+ "Point-to-Point link.";
+ }
+ enum "notrailers" {
+ value 6;
+ description
+ "This flag is unused in Linux, but it exists for BSD compatibility.
+ Avoid use of trailers";
+ }
+ enum "running" {
+ value 7;
+ description
+ "Up and Running.";
+ }
+ enum "noarp" {
+ value 8;
+ description
+ "Can't perform address resolution protocol.";
+ }
+ enum "promisc" {
+ value 9;
+ description
+ "Promiscuous mode. Receive all packets.";
+ }
+ enum "allmulti" {
+ value 10;
+ description
+ "Receive all multicast packets.";
+ }
+ enum "simplex" {
+ value 11;
+ description
+ "Does not Rx or Tx at the sametime.";
+ }
+ enum "link0" {
+ value 12;
+ description
+ "Link0.";
+ }
+ enum "link1" {
+ value 13;
+ description
+ "Link1.";
+ }
+ enum "link2" {
+ value 14;
+ description
+ "Link2.";
+ }
+ enum "multicast" {
+ value 15;
+ description
+ "Supports multicast transmission.";
+ }
+ enum "notransmit" {
+ value 16;
+ description
+ "Interface is no transmit mode.";
+ }
+ enum "nortexch" {
+ value 17;
+ description
+ "No routing info exchange.";
+ }
+ enum "virtual" {
+ value 18;
+ description
+ "Virtual interface.";
+ }
+ enum "ipv4" {
+ value 19;
+ description
+ "IPv4 enabled.";
+ }
+ enum "ipv6" {
+ value 20;
+ description
+ "IPv6 enabled.";
+ }
+ }
+ }
+
+ grouping if-common-operational {
+ leaf if-index {
+ type int32 {
+ range "0..2147483647";
+ }
+ description
+ "Interface index.";
+ }
+
+ leaf mtu {
+ type uint16;
+ description
+ "The size of the largest IPV4 packet that the interface
+ will send and receive.";
+ }
+
+ leaf mtu6 {
+ type uint32;
+ description
+ "The size of the largest IPV6 packet that the interface
+ will send and receive.";
+ }
+
+ leaf speed {
+ type uint32;
+ description
+ "Interface speed.";
+ }
+
+ leaf metric {
+ type uint32;
+ description
+ "Interface metric.";
+ }
+
+ leaf flags {
+ type if-flags-type;
+ description
+ "Interface flags.";
+ }
+
+ leaf type {
+ type identityref {
+ base ietf-if:interface-type;
+ }
+ description
+ "The link type of the interface.";
+ }
+
+ leaf phy-address {
+ type yang:mac-address;
+ description
+ "The interface's MAC address.";
+ }
+ }
+
+ container lib {
+ list interface {
+ key "name";
+ description
+ "Interface.";
+ leaf name {
+ type string;
+ description
+ "Interface name.";
+ }
+
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "VRF this interface is associated with.";
+ config false;
+ }
+
+ leaf description {
+ type string;
+ description
+ "Interface description.";
+ }
+
+ container state {
+ config false;
+ uses if-common-operational;
+ }
+ }
+ }
+}
diff --git a/yang/frr-isisd.yang b/yang/frr-isisd.yang
new file mode 100644
index 0000000..5d7c739
--- /dev/null
+++ b/yang/frr-isisd.yang
@@ -0,0 +1,2517 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-isisd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/isisd";
+ prefix frr-isisd;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
+ List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR isisd daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2021-02-15 {
+ description
+ "Group SRGB and SRLB in a container so that they can be displayed
+ and configured together";
+ }
+ revision 2020-04-06 {
+ description
+ "Group LSP timers in a container so that they can be displayed and
+ configured together";
+ }
+ revision 2019-12-17 {
+ description
+ "Changed default area is-type to level-1-2";
+ }
+ revision 2019-09-09 {
+ description
+ "Changed interface references to use
+ frr-interface:interface-ref typedef";
+ }
+ revision 2018-07-26 {
+ description
+ "Initial revision.";
+ reference
+ "ISO/IEC 10589:2002.";
+ }
+
+ typedef level {
+ type enumeration {
+ enum "level-1" {
+ value 1;
+ description
+ "This enum indicates L1-only capability.";
+ }
+ enum "level-2" {
+ value 2;
+ description
+ "This enum indicates L2-only capability.";
+ }
+ enum "level-1-2" {
+ value 3;
+ description
+ "This enum indicates capability for both levels.";
+ }
+ }
+ description
+ "This type defines IS-IS level of an object.";
+ }
+
+ typedef extended-circuit-id {
+ type uint32;
+ description
+ "This type defines the extended circuit ID
+ associated with an interface.";
+ }
+
+ typedef hello-padding-type {
+ type enumeration {
+ enum "always" {
+ value 0;
+ description
+ "Add padding to all hello packets.";
+ }
+ enum "disabled" {
+ value 1;
+ description
+ "Do not add any padding to hello packets.";
+ }
+ enum "during-adjacency-formation" {
+ value 2;
+ description
+ "Add padding to hello packets during adjacency formation only.";
+ }
+ }
+ }
+
+ typedef network-type {
+ type enumeration {
+ enum "unknown" {
+ value 0;
+ description
+ "Unknown network type. Only valid as a state.";
+ }
+ enum "broadcast" {
+ value 1;
+ description
+ "Broadcast circuit network-type.";
+ }
+ enum "point-to-point" {
+ value 2;
+ description
+ "Point-to-point circuit network-type.";
+ }
+ enum "loopback" {
+ value 3;
+ description
+ "Loopback circuit network-type. Only valid as a state.";
+ }
+ }
+ }
+
+ typedef lsp-id {
+ type string {
+ pattern "[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}\\.[0-9][0-9]-[0-9][0-9]";
+ }
+ description
+ "This type defines the IS-IS LSP ID format using a
+ pattern, An example LSP ID is 0143.0438.AeF0.02-01";
+ }
+
+ typedef snpa {
+ type string {
+ length "0 .. 20";
+ }
+ description
+ "This type defines the Subnetwork Point
+ of Attachment (SNPA) format.
+ The SNPA should be encoded according to the rules
+ specified for the particular type of subnetwork
+ being used. As an example, for an ethernet subnetwork,
+ the SNPA is encoded as a MAC address like
+ '00aa.bbcc.ddee'.";
+ }
+
+ typedef system-id {
+ type string {
+ pattern "[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}";
+ }
+ description
+ "This type defines IS-IS system-id using a pattern,
+ An example system-id is 0143.0438.AeF0";
+ }
+
+ typedef net-address {
+ type string {
+ pattern "[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}";
+ }
+ description
+ "This type defines an OSI NET address using a pattern,
+ An example net-address is 49.0123.6452.1972.00";
+ }
+
+ typedef if-state-type {
+ type enumeration {
+ enum "up" {
+ value 0;
+ description
+ "Up state.";
+ }
+ enum "down" {
+ value 1;
+ description
+ "Down state";
+ }
+ }
+ description
+ "This type defines the state of an interface";
+ }
+
+ typedef adj-state-type {
+ type enumeration {
+ enum "up" {
+ value 0;
+ description
+ "State indicates the adjacency is established.";
+ }
+ enum "down" {
+ value 1;
+ description
+ "State indicates the adjacency is NOT established.";
+ }
+ enum "init" {
+ value 2;
+ description
+ "State indicates the adjacency is establishing.";
+ }
+ enum "failed" {
+ value 3;
+ description
+ "State indicates the adjacency is failed.";
+ }
+ }
+ description
+ "This type defines states of an adjacency";
+ }
+
+ typedef metric-style-type {
+ type enumeration {
+ enum "narrow" {
+ value 0;
+ description
+ "This enum describes narrow metric style";
+ reference
+ "RFC1195";
+ }
+ enum "wide" {
+ value 1;
+ description
+ "This enum describes wide metric style";
+ reference
+ "RFC5305";
+ }
+ enum "transition" {
+ value 2;
+ description
+ "This enum describes transition metric style";
+ }
+ }
+ }
+
+ typedef access-list-ref {
+ type string;
+ }
+
+ typedef prefix-list-ref {
+ type string;
+ }
+
+ grouping redistribute-attributes {
+ description
+ "Common optional attributes of any redistribute entry.";
+ leaf route-map {
+ type frr-route-map:route-map-ref;
+ description
+ "Applies the conditions of the specified route-map to routes that
+ are redistributed into this routing instance.";
+ }
+
+ leaf metric {
+ type uint32 {
+ range "0..16777215";
+ }
+ default "0";
+ description
+ "Metric used for the redistributed route. If 0,
+ the default-metric attribute is used instead.";
+ }
+ }
+
+ grouping redistribute-default {
+ description
+ "Redistribution of default route within a level.";
+ leaf always {
+ type boolean;
+ default "false";
+ description
+ "Always advertise default route.";
+ }
+
+ uses redistribute-attributes;
+ }
+
+ grouping isis-password {
+ description
+ "Authentication attributes or an IS-IS area or domain.";
+ leaf password {
+ type string {
+ length "1..254";
+ }
+ mandatory true;
+ description
+ "Actual password.";
+ }
+
+ leaf password-type {
+ type enumeration {
+ enum "clear" {
+ value 1;
+ description
+ "Clear-text password type.";
+ }
+ enum "md5" {
+ value 54;
+ description
+ "MD5 password type.";
+ }
+ }
+ mandatory true;
+ description
+ "Type of password used.";
+ }
+ }
+
+ grouping isis-area-password {
+ uses isis-password;
+
+ leaf authenticate-snp {
+ type enumeration {
+ enum "none" {
+ value 0;
+ description
+ "No SNP authentication.";
+ }
+ enum "send-only" {
+ value 1;
+ description
+ "Send authenticated PDUs but do not check on receiving.";
+ }
+ enum "validate" {
+ value 3;
+ description
+ "Send authenticated PDUs and check on receiving.";
+ }
+ }
+ default "none";
+ description
+ "SNP PDUs authentication.";
+ }
+ }
+
+ grouping global-config-lfa {
+ container lfa {
+ description
+ "LFA configuration.";
+
+ leaf load-sharing {
+ type boolean;
+ default "true";
+ description
+ "Load share prefixes across multiple backups.";
+ }
+ leaf priority-limit {
+ type enumeration {
+ enum "critical" {
+ value 0;
+ description
+ "Compute for critical priority prefixes only.";
+ }
+ enum "high" {
+ value 1;
+ description
+ "Compute for critical & high priority prefixes.";
+ }
+ enum "medium" {
+ value 2;
+ description
+ "Compute for critical, high & medium priority prefixes.";
+ }
+ }
+ description
+ "Limit backup computation up to the prefix priority.";
+ }
+ list tiebreaker {
+ key "index";
+ unique "type";
+ description
+ "Configure tiebreaker for multiple backups.";
+ leaf index {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Preference order among tiebreakers.";
+ }
+ leaf type {
+ type enumeration {
+ enum "downstream" {
+ value 0;
+ description
+ "Prefer backup path via downstream node.";
+ }
+ enum "lowest-backup-metric" {
+ value 1;
+ description
+ "Prefer backup path with lowest total metric.";
+ }
+ enum "node-protecting" {
+ value 2;
+ description
+ "Prefer node protecting backup path.";
+ }
+ }
+ mandatory true;
+ description
+ "Tiebreaker type.";
+ }
+ }
+ }
+ }
+
+ grouping global-config-remote-lfa {
+ container remote-lfa {
+ description
+ "Remote LFA configuration.";
+
+ leaf prefix-list {
+ type prefix-list-ref;
+ description
+ "Filter PQ node router ID based on prefix list.";
+ }
+ }
+ }
+
+ grouping interface-config-lfa {
+ container lfa {
+ description
+ "LFA configuration.";
+ leaf enable {
+ type boolean;
+ default false;
+ description
+ "Enables LFA computation.";
+ }
+ leaf-list exclude-interface {
+ type frr-interface:interface-ref;
+ description
+ "Exclude an interface from computation.";
+ }
+ }
+ }
+
+ grouping interface-config-remote-lfa {
+ container remote-lfa {
+ description
+ "Remote LFA configuration.";
+
+ leaf enable {
+ type boolean;
+ default false;
+ description
+ "Enables remote LFA computation using LDP tunnels.";
+ must ". = 'false' or ../../lfa/enable = 'true'" {
+ error-message
+ "Remote LFA depends on classic LFA being configured in the interface.";
+ }
+
+ }
+ leaf maximum-metric {
+ type uint32 {
+ range "1..16777215";
+ }
+ description
+ "Limit remote LFA node selection within the metric.";
+ }
+ }
+ }
+
+ grouping interface-config-ti-lfa {
+ container ti-lfa {
+ description
+ "TI-LFA configuration.";
+ leaf enable {
+ must ". = 'false' or ../../lfa/enable = 'false'" {
+ error-message
+ "Can't enable both classic LFA and TI-LFA in the same interface.";
+ }
+ type boolean;
+ default false;
+ description
+ "Enables TI-LFA computation.";
+ }
+ leaf node-protection {
+ type boolean;
+ must ". = 'false' or ../enable = 'true'";
+ default false;
+ description
+ "Node protection is provided by the alternate.";
+ }
+ leaf link-fallback {
+ type boolean;
+ must ". = 'false' or ../enable = 'true'";
+ default false;
+ description
+ "Fallback to link protection.";
+ }
+ }
+ }
+
+ grouping interface-config {
+ description
+ "Interface configuration grouping";
+ leaf area-tag {
+ type string;
+ mandatory true;
+ description
+ "Area-tag associated to this circuit.";
+ }
+
+ leaf ipv4-routing {
+ type boolean;
+ default "false";
+ description
+ "Routing IS-IS IPv4 traffic over this circuit.";
+ }
+
+ leaf ipv6-routing {
+ type boolean;
+ default "false";
+ description
+ "Routing IS-IS IPv6 traffic over this circuit.";
+ }
+
+ leaf circuit-type {
+ type level;
+ default "level-1-2";
+ description
+ "IS-type of this circuit.";
+ }
+
+ container bfd-monitoring {
+ leaf enabled {
+ type boolean;
+ default "false";
+ description
+ "Monitor IS-IS peers on this circuit.";
+ }
+ leaf profile {
+ type string;
+ description
+ "Let BFD use a pre-configured profile.";
+ }
+ }
+
+ container csnp-interval {
+ description
+ "Complete Sequence Number PDU (CSNP) generation interval.";
+ leaf level-1 {
+ type uint16 {
+ range "1..600";
+ }
+ units "seconds";
+ default "10";
+ description
+ "CNSP interval for level-1";
+ }
+
+ leaf level-2 {
+ type uint16 {
+ range "1..600";
+ }
+ units "seconds";
+ default "10";
+ description
+ "CNSP interval for level-2";
+ }
+ }
+
+ container psnp-interval {
+ description
+ "Partial Sequence Number PDU (PSNP) generation interval.";
+ leaf level-1 {
+ type uint16 {
+ range "1..120";
+ }
+ units "seconds";
+ default "2";
+ description
+ "PNSP interval for level-1";
+ }
+
+ leaf level-2 {
+ type uint16 {
+ range "1..120";
+ }
+ units "seconds";
+ default "2";
+ description
+ "PCNSP interval for level-2";
+ }
+ }
+
+ container hello {
+ description
+ "Parameters related to IS-IS hello PDUs.";
+ leaf padding {
+ type hello-padding-type;
+ default "always";
+ description
+ "Type of padding for IS-IS hello packets.";
+ }
+
+ container interval {
+ description
+ "Interval between consecutive hello messages.";
+ leaf level-1 {
+ type uint32 {
+ range "1..600";
+ }
+ units "seconds";
+ default "3";
+ description
+ "Holding time for level-1; interval will depend on multiplier.";
+ }
+
+ leaf level-2 {
+ type uint32 {
+ range "1..600";
+ }
+ units "seconds";
+ default "3";
+ description
+ "Holding time for level-2; interval will depend on multiplier.";
+ }
+ }
+
+ container multiplier {
+ description
+ "Multiplier for the hello messages holding time.";
+ leaf level-1 {
+ type uint16 {
+ range "2..100";
+ }
+ default "10";
+ description
+ "Multiplier for the hello holding time.";
+ }
+
+ leaf level-2 {
+ type uint16 {
+ range "2..100";
+ }
+ default "10";
+ description
+ "Multiplier for the hello holding time.";
+ }
+ }
+ }
+
+ container metric {
+ description
+ "Default metric for this IS-IS circuit.";
+ leaf level-1 {
+ type uint32 {
+ range "0..16777215";
+ }
+ must ". < 64 or /frr-isisd:isis/instance[area-tag = current()/../../area-tag]/metric-style = 'wide'";
+ default "10";
+ description
+ "Default level-1 metric for this IS-IS circuit.";
+ }
+
+ leaf level-2 {
+ type uint32 {
+ range "0..16777215";
+ }
+ must ". < 64 or /frr-isisd:isis/instance[area-tag = current()/../../area-tag]/metric-style = 'wide'";
+ default "10";
+ description
+ "Default level-2 metric for this IS-IS circuit.";
+ }
+ }
+
+ container priority {
+ description
+ "Priority for Designated Router election.";
+ leaf level-1 {
+ type uint8 {
+ range "0..127";
+ }
+ default "64";
+ description
+ "Level-1 priority for this IS-IS circuit.";
+ }
+
+ leaf level-2 {
+ type uint8 {
+ range "0..127";
+ }
+ default "64";
+ description
+ "Level-2 priority for this IS-IS circuit.";
+ }
+ }
+
+ leaf network-type {
+ type network-type;
+ must "(. = \"point-to-point\") or (. = \"broadcast\")";
+ default "broadcast";
+ description
+ "Explicitly configured type of IS-IS circuit (broadcast or point-to-point).";
+ }
+
+ leaf passive {
+ type boolean;
+ default "false";
+ description
+ "Interface is in passive mode.";
+ }
+
+ container password {
+ presence "Present if a password is set for this IS interface.";
+ uses isis-password;
+ }
+
+ leaf disable-three-way-handshake {
+ type boolean;
+ default "false";
+ description
+ "Disables three-way handshake when creating new adjacencies.";
+ }
+
+ container multi-topology {
+ description
+ "IS-IS topologies configured on this circuit.";
+ leaf standard {
+ type boolean;
+ default "true";
+ description
+ "Standard (IPV4 unicast) topology.";
+ }
+
+ leaf ipv4-multicast {
+ type boolean;
+ default "true";
+ description
+ "IPv4 multicast topology.";
+ }
+
+ leaf ipv4-management {
+ type boolean;
+ default "true";
+ description
+ "IPv4 management topology.";
+ }
+
+ leaf ipv6-unicast {
+ type boolean;
+ default "true";
+ description
+ "IPv6 unicast topology.";
+ }
+
+ leaf ipv6-multicast {
+ type boolean;
+ default "true";
+ description
+ "IPv6 multicast topology.";
+ }
+
+ leaf ipv6-management {
+ type boolean;
+ default "true";
+ description
+ "IPv6 management topology.";
+ }
+
+ leaf ipv6-dstsrc {
+ type boolean;
+ default "true";
+ description
+ "IPv6 destination-source topology.";
+ }
+ }
+
+ container mpls {
+ description
+ "Configuration of MPLS parameters";
+ leaf ldp-sync {
+ type boolean;
+ default "true";
+ description
+ "Enable MPLS LDP-Sync functionality on this circuit.";
+ }
+ leaf holddown {
+ type uint16 {
+ range "0..10000";
+ }
+ units "seconds";
+ description
+ "Time to wait for LDP-Sync to occur before restoring interface metric.";
+ }
+ }
+
+ container fast-reroute {
+ description
+ "Interface IP Fast-reroute configuration.";
+ container level-1 {
+ description
+ "Level-1 IP Fast-reroute configuration.";
+ uses interface-config-lfa;
+ uses interface-config-remote-lfa;
+ uses interface-config-ti-lfa;
+ }
+ container level-2 {
+ description
+ "Level-2 IP Fast-reroute configuration.";
+ uses interface-config-lfa;
+ uses interface-config-remote-lfa;
+ uses interface-config-ti-lfa;
+ }
+ }
+ }
+
+ grouping adjacency-state {
+ description
+ "Adjacency state";
+ container adjacencies {
+ config false;
+ description
+ "This container lists the adjacencies of
+ the local node.";
+ list adjacency {
+ description
+ "List of operational adjacencies.";
+ leaf neighbor-sys-type {
+ type level;
+ description
+ "Level capability of neighboring system";
+ }
+
+ leaf neighbor-sysid {
+ type system-id;
+ description
+ "The system-id of the neighbor";
+ }
+
+ leaf neighbor-extended-circuit-id {
+ type extended-circuit-id;
+ description
+ "Circuit ID of the neighbor";
+ }
+
+ leaf neighbor-snpa {
+ type snpa;
+ description
+ "SNPA of the neighbor";
+ }
+
+ leaf hold-timer {
+ type uint16;
+ units "seconds";
+ description
+ "The holding time in seconds for this
+ adjacency. This value is based on
+ received hello PDUs and the elapsed
+ time since receipt.";
+ }
+
+ leaf neighbor-priority {
+ type uint8 {
+ range "0 .. 127";
+ }
+ description
+ "Priority of the neighboring IS for becoming
+ the DIS.";
+ }
+
+ leaf state {
+ type adj-state-type;
+ description
+ "This leaf describes the state of the interface.";
+ }
+
+ uses adjacency-sids;
+ uses lan-adjacency-sids;
+ }
+ }
+ }
+
+ grouping event-counters {
+ description
+ "Grouping for IS-IS interface event counters";
+ container event-counters {
+ config false;
+ description
+ "IS-IS interface event counters.";
+ leaf adjacency-changes {
+ type uint32;
+ description
+ "The number of times an adjacency state change has
+ occurred on this interface.";
+ }
+
+ leaf adjacency-number {
+ type uint32;
+ description
+ "The number of adjacencies on this interface.";
+ }
+
+ leaf init-fails {
+ type uint32;
+ description
+ "The number of times initialization of this
+ interface has failed. This counts events such
+ as PPP NCP failures. Failures to form an
+ adjacency are counted by adjacency-rejects.";
+ }
+
+ leaf adjacency-rejects {
+ type uint32;
+ description
+ "The number of times an adjacency has been
+ rejected on this interface.";
+ }
+
+ leaf id-len-mismatch {
+ type uint32;
+ description
+ "The number of times an IS-IS PDU with an ID
+ field length different from that for this
+ system has been received on this interface.";
+ }
+
+ leaf max-area-addresses-mismatch {
+ type uint32;
+ description
+ "The number of times an IS-IS PDU has been
+ received on this interface with the
+ max area address field differing from that of
+ this system.";
+ }
+
+ leaf authentication-type-fails {
+ type uint32;
+ description
+ "Number of authentication type mismatches.";
+ }
+
+ leaf authentication-fails {
+ type uint32;
+ description
+ "Number of authentication key failures.";
+ }
+ }
+ }
+
+ grouping interface-state {
+ description
+ "IS-IS interface operational state.";
+ uses adjacency-state;
+
+ uses event-counters;
+ }
+
+ grouping notification-instance-hdr {
+ description
+ "Instance specific IS-IS notification data grouping";
+ leaf routing-instance {
+ type string;
+ description
+ "Name of the routing-instance instance.";
+ }
+
+ leaf routing-protocol-name {
+ type string;
+ description
+ "Name of the IS-IS instance.";
+ }
+
+ leaf isis-level {
+ type level;
+ description
+ "IS-IS level of the instance.";
+ }
+ }
+
+ grouping notification-interface-hdr {
+ description
+ "Interface specific IS-IS notification data grouping";
+ leaf interface-name {
+ type frr-interface:interface-ref;
+ description
+ "IS-IS interface name";
+ }
+
+ leaf interface-level {
+ type level;
+ description
+ "IS-IS level of the interface.";
+ }
+
+ leaf extended-circuit-id {
+ type extended-circuit-id;
+ description
+ "Eextended circuit-id of the interface.";
+ }
+ }
+
+ grouping adjacency-sids {
+ description
+ "IS-IS segment routing adjacency SID grouping.";
+ container adjacency-sids {
+ description
+ "This container lists the information of adjacency SID.";
+ list adjacency-sid {
+ leaf af {
+ type uint8;
+ description
+ "This leaf describes the protocol-family associated with the
+ adjacency SID.";
+ }
+
+ leaf value {
+ type uint32;
+ description
+ "This leaf describes the value of adjacency SID.";
+ }
+
+ leaf weight {
+ type uint8;
+ description
+ "This leaf describes the weight of the adjacency SID.";
+ }
+
+ leaf protection-requested {
+ type boolean;
+ description
+ "This leaf describes if the adjacency SID must be protected.";
+ }
+ }
+ }
+ }
+
+ grouping lan-adjacency-sids {
+ description
+ "IS-IS segment routing LAN adjacency SID grouping.";
+ container lan-adjacency-sids {
+ description
+ "This container lists the information of LAN adjacency SID.";
+ list lan-adjacency-sid {
+ leaf af {
+ type uint8;
+ description
+ "This leaf describes the protocol-family associated with the
+ LAN adjacency SID.";
+ }
+
+ leaf value {
+ type uint32;
+ description
+ "This leaf describes the value of LAN adjacency SID.";
+ }
+
+ leaf weight {
+ type uint8;
+ description
+ "This leaf describes the weight of the LAN adjacency SID.";
+ }
+
+ leaf protection-requested {
+ type boolean;
+ description
+ "This leaf describes if the LAN adjacency SID must be protected.";
+ }
+ }
+ }
+ }
+
+ container isis {
+ description
+ "Configuration of the IS-IS routing daemon.";
+ list instance {
+ key "area-tag vrf";
+ description
+ "IS-IS routing instance.";
+ leaf area-tag {
+ type string;
+ description
+ "Area-tag associated to this routing instance.";
+ }
+
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "VRF NAME.";
+ }
+
+ leaf is-type {
+ type level;
+ default "level-1-2";
+ description
+ "Level of the IS-IS routing instance (OSI only).";
+ }
+
+ leaf-list area-address {
+ type net-address;
+ max-elements 3;
+ description
+ "List of OSI NET addresses for this protocol instance.";
+ }
+
+ leaf dynamic-hostname {
+ type boolean;
+ default "true";
+ description
+ "Dynamic hostname support for IS-IS.";
+ }
+
+ leaf attach-send {
+ type boolean;
+ default "true";
+ description
+ "If true, attached bits are sent in LSP if L1/L2 router for inter-area traffic.";
+ }
+
+ leaf attach-receive-ignore {
+ type boolean;
+ default "false";
+ description
+ "If false, attached bits received in LSP, cause default route add, if L1 router for inter-area traffic.";
+ }
+
+ leaf attached {
+ type boolean;
+ default "false";
+ status deprecated;
+ description
+ "If true, identify as L1/L2 router for inter-area traffic.";
+ }
+
+ container overload {
+ description
+ "Overload bit configuration.";
+ leaf enabled {
+ type boolean;
+ default "false";
+ description
+ "If true, avoid any transit traffic.";
+ }
+
+ leaf on-startup {
+ type uint32 {
+ range "0..86400";
+ }
+ units "seconds";
+ default "0";
+ description
+ "The duration the overload bit should be set on startup.";
+ }
+ }
+
+ leaf metric-style {
+ type metric-style-type;
+ must ". = 'wide' or count(../multi-topology/*) = 0";
+ default "wide";
+ description
+ "Define the style of TLVs metric supported.";
+ }
+
+ leaf advertise-high-metrics {
+ type boolean;
+ default "false";
+ description
+ "Advertise high metric value on all interfaces.";
+ }
+
+ leaf purge-originator {
+ type boolean;
+ default "false";
+ description
+ "Use the RFC 6232 purge-originator.";
+ reference
+ "RFC6232";
+ }
+
+ leaf advertise-passive-only {
+ type boolean;
+ default "false";
+ description
+ "Advertise prefixes of passive interfaces only";
+ }
+
+ leaf admin-group-send-zero {
+ type boolean;
+ default "false";
+ description
+ "Allow sending the default admin-group value of 0x00000000";
+ }
+
+ leaf asla-legacy-flag {
+ type boolean;
+ default "false";
+ description
+ "Set the legacy flag (aka. L-FLAG) in the ASLA Sub-TLV.";
+ }
+
+ container lsp {
+ description
+ "Configuration of Link-State Packets (LSP) parameters";
+ leaf mtu {
+ type uint16 {
+ range "128..4352";
+ }
+ default "1497";
+ description
+ "MTU of an LSP.";
+ }
+
+ container timers {
+ description
+ "LSP-related timers";
+ container level-1 {
+ description
+ "Level-1 LSP-related timers";
+ leaf refresh-interval {
+ type uint16;
+ units "seconds";
+ default "900";
+ description
+ "LSP refresh interval for level-1.";
+ }
+
+ leaf maximum-lifetime {
+ type uint16 {
+ range "350..65535";
+ }
+ units "seconds";
+ must ". >= ../refresh-interval + 300";
+ default "1200";
+ description
+ "Maximum LSP lifetime for level-1.";
+ }
+
+ leaf generation-interval {
+ type uint16 {
+ range "1..120";
+ }
+ units "seconds";
+ must ". < ../refresh-interval";
+ default "30";
+ description
+ "Minimum time allowed before level-1 LSP retransmissions.";
+ }
+ }
+
+ container level-2 {
+ description
+ "Level-2 LSP-related timers";
+ leaf refresh-interval {
+ type uint16;
+ units "seconds";
+ default "900";
+ description
+ "LSP refresh interval for level-2.";
+ }
+
+ leaf maximum-lifetime {
+ type uint16 {
+ range "350..65535";
+ }
+ units "seconds";
+ must ". >= ../refresh-interval + 300";
+ default "1200";
+ description
+ "Maximum LSP lifetime for level-2.";
+ }
+
+ leaf generation-interval {
+ type uint16 {
+ range "1..120";
+ }
+ units "seconds";
+ must ". < ../refresh-interval";
+ default "30";
+ description
+ "Minimum time allowed before level-2 LSP retransmissions.";
+ }
+ }
+ }
+ }
+
+ container spf {
+ description
+ "Parameters related to the Shortest Path First algorithm.";
+ container ietf-backoff-delay {
+ presence "Present if IETF SPF back-off delay is enabled.";
+ description
+ "SPF back-off delay algorithm parameters (see RFC 8405).";
+ leaf init-delay {
+ type uint16 {
+ range "0..60000";
+ }
+ units "msec";
+ mandatory true;
+ description
+ "Delay used while in QUIET state";
+ }
+
+ leaf short-delay {
+ type uint16 {
+ range "0..60000";
+ }
+ units "msec";
+ mandatory true;
+ description
+ "Delay used while in SHORT_WAIT state";
+ }
+
+ leaf long-delay {
+ type uint16 {
+ range "0..60000";
+ }
+ units "msec";
+ mandatory true;
+ description
+ "Delay used while in LONG_WAIT state";
+ }
+
+ leaf hold-down {
+ type uint16 {
+ range "0..60000";
+ }
+ units "msec";
+ mandatory true;
+ description
+ "Time with no received IGP events before considering IGP stable";
+ }
+
+ leaf time-to-learn {
+ type uint16 {
+ range "0..60000";
+ }
+ units "msec";
+ mandatory true;
+ description
+ "Maximum duration needed to learn all the events related to a
+ single failure";
+ }
+ }
+
+ container minimum-interval {
+ description
+ "Minimum interval between consecutive executions of the
+ SPF algorithm.";
+ leaf level-1 {
+ type uint16 {
+ range "1..120";
+ }
+ units "seconds";
+ default "1";
+ description
+ "Minimum time between consecutive level-1 SPFs.";
+ }
+
+ leaf level-2 {
+ type uint16 {
+ range "1..120";
+ }
+ units "seconds";
+ default "1";
+ description
+ "Minimum time between consecutive level-2 SPFs.";
+ }
+ }
+
+ container prefix-priorities {
+ description
+ "SPF Prefix Priority configuration";
+
+ container critical {
+ description
+ "Critical prefix priority";
+ leaf access-list-name {
+ type access-list-ref;
+ description
+ "Access List to determine prefixes for
+ this priority";
+ }
+ }
+ container high {
+ description
+ "High prefix priority";
+ leaf access-list-name {
+ type access-list-ref;
+ description
+ "Access List to determine prefixes for
+ this priority";
+ }
+ }
+ container medium {
+ description
+ "Medium prefix priority";
+ leaf access-list-name {
+ type access-list-ref;
+ description
+ "Access List to determine prefixes for
+ this priority";
+ }
+ }
+ }
+ }
+
+ container area-password {
+ presence "Present if authentication is required for IS level-1.";
+ description
+ "Authentication password for an IS-IS area.";
+ uses isis-area-password;
+ }
+
+ container domain-password {
+ presence "Present if authentication is required for IS level-2.";
+ description
+ "Authentication password for an IS-IS domain.";
+ uses isis-area-password;
+ }
+
+ container default-information-originate {
+ description
+ "Distribution of default information.";
+ list ipv4 {
+ key "level";
+ description
+ "Distribute default route for IPv4.";
+ leaf level {
+ type level;
+ must "(. != \"level-1-2\") and ((../../../is-type = \"level-1-2\") or (. = ../../../is-type))";
+ }
+
+ uses redistribute-default;
+ }
+
+ list ipv6 {
+ key "level";
+ description
+ "Distribute default route for IPv6.";
+ leaf level {
+ type level;
+ must "(. != \"level-1-2\") and ((../../../is-type = \"level-1-2\") or (. = ../../../is-type))";
+ }
+
+ uses redistribute-default;
+ }
+ }
+
+ container redistribute {
+ description
+ "Redistributes routes learned from other routing protocols.";
+ list ipv4 {
+ key "protocol level";
+ description
+ "IPv4 route redistribution.";
+ leaf protocol {
+ type frr-route-types:frr-route-types-v4;
+ must ". != \"isis\"";
+ description
+ "Originating routing protocol for the IPv4 routes.";
+ }
+
+ leaf level {
+ type level;
+ must "(. != \"level-1-2\") and ((../../../is-type = \"level-1-2\") or (. = ../../../is-type))";
+ description
+ "IS-IS level into which the routes should be redistributed.";
+ }
+
+ choice protocol-type {
+ case protocol-table {
+ when "./protocol = \"table\"";
+ list table {
+ key "table";
+ when "../protocol = \"table\"";
+ description
+ "Routing table number";
+
+ leaf table {
+ type uint16 {
+ range "1..65535";
+ }
+ description
+ "Routing table number.";
+ }
+
+ uses redistribute-attributes;
+ }
+ }
+ case protocol-other {
+ uses redistribute-attributes;
+ }
+ }
+
+ }
+ list ipv6 {
+ key "protocol level";
+ description
+ "IPv6 route redistribution.";
+ leaf protocol {
+ type frr-route-types:frr-route-types-v6;
+ must ". != \"isis\"";
+ description
+ "Originating routing protocol for the IPv6 routes.";
+ }
+
+ leaf level {
+ type level;
+ must "(. != \"level-1-2\") and ((../../../is-type = \"level-1-2\") or (. = ../../../is-type))";
+ description
+ "IS-IS level into which the routes should be redistributed.";
+ }
+
+ choice protocol-type {
+ case protocol-table {
+ when "./protocol = \"table\"";
+ list table {
+ key "table";
+ when "../protocol = \"table\"";
+
+ leaf table {
+ type uint16 {
+ range "1..65535";
+ }
+ description
+ "Routing table number.";
+ }
+
+ uses redistribute-attributes;
+ }
+ }
+ case protocol-other {
+ uses redistribute-attributes;
+ }
+ }
+
+ }
+ }
+
+ container multi-topology {
+ description
+ "IS-IS topologies configured for this area.";
+ container ipv4-multicast {
+ presence "Present if a separate IPv4-multicast topology is configured for this area.";
+ description
+ "IPv4 multicast topology.";
+ leaf overload {
+ type boolean;
+ default "false";
+ }
+ }
+
+ container ipv4-management {
+ presence "Present if a separate IPv4-management topology is configured for this area.";
+ description
+ "IPv4 management topology.";
+ leaf overload {
+ type boolean;
+ default "false";
+ }
+ }
+
+ container ipv6-unicast {
+ presence "Present if a separate IPv6-unicast topology is configured for this area.";
+ description
+ "IPv6 unicast topology.";
+ leaf overload {
+ type boolean;
+ default "false";
+ }
+ }
+
+ container ipv6-multicast {
+ presence "Present if a separate IPv6-multicast topology is configured for this area.";
+ description
+ "IPv6 multicast topology.";
+ leaf overload {
+ type boolean;
+ default "false";
+ }
+ }
+
+ container ipv6-management {
+ presence "Present if a separate IPv6-management topology is configured for this area.";
+ description
+ "IPv6 management topology.";
+ leaf overload {
+ type boolean;
+ default "false";
+ }
+ }
+
+ container ipv6-dstsrc {
+ presence "Present if a separate IPv6 destination-source topology is configured for this area.";
+ description
+ "IPv6 destination-source topology.";
+ leaf overload {
+ type boolean;
+ default "false";
+ }
+ }
+ }
+
+ container fast-reroute {
+ description
+ "IP Fast-reroute configuration.";
+ container level-1 {
+ description
+ "Level-1 IP Fast-reroute configuration.";
+ uses global-config-lfa;
+ uses global-config-remote-lfa;
+ }
+ container level-2 {
+ description
+ "Level-2 IP Fast-reroute configuration.";
+ uses global-config-lfa;
+ uses global-config-remote-lfa;
+ }
+ }
+
+ leaf log-adjacency-changes {
+ type boolean;
+ default "false";
+ description
+ "Log changes to the IS-IS adjacencies in this area.";
+ }
+
+ leaf log-pdu-drops {
+ type boolean;
+ default "false";
+ description
+ "Log any dropped PDUs in this area.";
+ }
+
+ container mpls-te {
+ presence "Present if MPLS-TE is enabled.";
+ description
+ "Enable MPLS-TE functionality.";
+ leaf router-address {
+ type inet:ipv4-address;
+ description
+ "Stable IP address of the advertising router.";
+ }
+ leaf router-address-v6 {
+ type inet:ipv6-address;
+ description
+ "Stable IPv6 address of the advertising router.";
+ }
+ leaf export {
+ type boolean;
+ default "false";
+ description
+ "Export Link State informatin.";
+ }
+ }
+
+ container flex-algos {
+ description
+ "Flex-Algo Table";
+ list flex-algo {
+ key "flex-algo";
+ description
+ "Configuration for an IS-IS Flex-Algo";
+ leaf advertise-definition {
+ type boolean;
+ description
+ "If TRUE, Flex-Algo definition is advertised";
+ }
+ container affinity-include-alls {
+ description
+ "Set the include-all affinity";
+ leaf-list affinity-include-all {
+ type string;
+ max-elements "256";
+ description
+ "Array of Attribute Names";
+ }
+ }
+ container affinity-include-anies {
+ description
+ "Set the include-any affinity";
+ leaf-list affinity-include-any {
+ type string;
+ max-elements "256";
+ description
+ "Array of Attribute Names";
+ }
+ }
+ container affinity-exclude-anies {
+ description
+ "Set the exclude-any affinity";
+ leaf-list affinity-exclude-any {
+ type string;
+ max-elements "256";
+ description
+ "Array of Attribute Names";
+ }
+ }
+ leaf prefix-metric {
+ type empty;
+ description
+ "Use Flex-algo Prefix Metric";
+ }
+ leaf metric-type {
+ default "igp";
+ description
+ "Set the Flex-Algo metric-type";
+ type enumeration {
+ enum "igp" {
+ value 0;
+ description
+ "IGP Metric";
+ }
+ enum "min-uni-link-delay" {
+ value 1;
+ description
+ "RFC 8570 Sec 4.2 Min Unidirectional Link Delay";
+ }
+ enum "te-default" {
+ value 2;
+ description
+ "RFC 5305 Sec 3.7 Traffic Engineering Default Metric";
+ }
+ }
+ }
+ leaf priority {
+ type uint32 {
+ range "0..255";
+ }
+ description
+ "Set the Flex-Algo priority";
+ }
+ leaf dplane-sr-mpls {
+ type empty;
+ description
+ "Advertise and participate in the Flex-Algo Segment-Routing MPLS data-plane";
+ }
+ leaf dplane-srv6 {
+ type empty;
+ description
+ "Advertise and participate in the Flex-Algo Segment-Routing SRv6 data-plane";
+ }
+ leaf dplane-ip {
+ type empty;
+ description
+ "Advertise and participate in the Flex-Algo IP data-plane";
+ }
+ leaf flex-algo {
+ type uint32 {
+ range "128..255";
+ }
+ description
+ "Flex-Algo";
+ }
+ }
+ }
+
+ container segment-routing {
+ description
+ "Segment Routing global configuration.";
+ leaf enabled {
+ type boolean;
+ default "false";
+ description
+ "Enables segment-routing protocol extensions.";
+ }
+ container label-blocks {
+ description
+ "Local and global label blocks.";
+ container srgb {
+ description
+ "Global blocks to be advertised.";
+ leaf lower-bound {
+ must "../upper-bound > .";
+ type uint32;
+ default "16000";
+ description
+ "Lower value in the label range.";
+ }
+ leaf upper-bound {
+ must ". > ../lower-bound";
+ type uint32;
+ default "23999";
+ description
+ "Upper value in the label range.";
+ }
+ }
+ container srlb {
+ description
+ "Local blocks to be advertised.";
+ leaf lower-bound {
+ must "../upper-bound > .";
+ type uint32;
+ default "15000";
+ description
+ "Lower value in the label range.";
+ }
+ leaf upper-bound {
+ must ". > ../lower-bound";
+ type uint32;
+ default "15999";
+ description
+ "Upper value in the label range.";
+ }
+ }
+ }
+ container msd {
+ description
+ "MSD configuration.";
+ leaf node-msd {
+ type uint8;
+ description
+ "Node MSD is the lowest MSD supported by the node.";
+ }
+ }
+ container prefix-sid-map {
+ description
+ "Prefix SID configuration.";
+ list prefix-sid {
+ key "prefix";
+ unique "sid-value-type sid-value";
+ description
+ "List of prefix SID mapped to IPv4/IPv6
+ local prefixes.";
+ leaf prefix {
+ type inet:ip-prefix;
+ description
+ "Connected prefix sid.";
+ }
+ leaf sid-value-type {
+ type enumeration {
+ enum "index" {
+ value 0;
+ description
+ "The value will be interpreted as an index.";
+ }
+ enum "absolute" {
+ value 1;
+ description
+ "The value will become interpreted as an absolute
+ value.";
+ }
+ }
+ default "index";
+ description
+ "This leaf defines how value must be interpreted.";
+ }
+ leaf sid-value {
+ type uint32;
+ mandatory true;
+ description
+ "Value associated with prefix. The value must be
+ interpreted in the context of sid-value-type.";
+ }
+ leaf last-hop-behavior {
+ type enumeration {
+ enum "explicit-null" {
+ value 0;
+ description
+ "Use explicit-null for the SID.";
+ }
+ enum "no-php" {
+ value 1;
+ description
+ "Do not use Penultimate Hop Popping (PHP)
+ for the SID.";
+ }
+ enum "php" {
+ value 2;
+ description
+ "Use PHP for the SID.";
+ }
+ }
+ default "php";
+ description
+ "Configure last hop behavior.";
+ }
+ leaf n-flag-clear {
+ type boolean;
+ default "false";
+ description
+ "Not a node SID";
+ }
+ }
+ }
+ container algorithm-prefix-sids {
+ description
+ "Algorithm SID Table";
+ list algorithm-prefix-sid {
+ key "prefix algo";
+ description
+ "Assign prefix SID for algorithm to an
+ interface, ISISPHPFlag will be rejected
+ if set to disable, ISISEXPLICITNULLFlag
+ will override the value of ISISPHPFlag";
+ leaf algo {
+ type uint32 {
+ range "128..255";
+ }
+ description
+ "Algorithm";
+ }
+ leaf prefix {
+ type inet:ip-prefix;
+ mandatory true;
+ description
+ "Connected prefix sid.";
+ }
+ leaf sid-value-type {
+ type enumeration {
+ enum "index" {
+ value 0;
+ description
+ "The value will be interpreted as an index.";
+ }
+ enum "absolute" {
+ value 1;
+ description
+ "The value will become interpreted as an absolute
+ value.";
+ }
+ }
+ default "index";
+ description
+ "This leaf defines how value must be interpreted.";
+ }
+ leaf sid-value {
+ type uint32 {
+ range "0..1048575";
+ }
+ mandatory true;
+ description
+ "Value associated with prefix. The value must be
+ interpreted in the context of sid-value-type.";
+ }
+ leaf last-hop-behavior {
+ type enumeration {
+ enum "explicit-null" {
+ value 0;
+ description
+ "Use explicit-null for the SID.";
+ }
+ enum "no-php" {
+ value 1;
+ description
+ "Do not use Penultimate Hop Popping (PHP)
+ for the SID.";
+ }
+ enum "php" {
+ value 2;
+ description
+ "Use PHP for the SID.";
+ }
+ }
+ default "php";
+ description
+ "Configure last hop behavior.";
+ }
+ leaf n-flag-clear {
+ type boolean;
+ default "false";
+ description
+ "Not a node SID";
+ }
+ }
+ }
+ }
+
+ container segment-routing-srv6 {
+ description
+ "Segment Routing over IPv6 (SRv6) global configuration.";
+ leaf enabled {
+ type boolean;
+ default "false";
+ description
+ "Enable IS-IS extensions to support Segment Routing over
+ IPv6 data plane (SRv6).";
+ reference
+ "RFC 9352";
+ }
+ leaf locator {
+ type string;
+ description
+ "SRv6 locator.";
+ }
+ container msd {
+ description
+ "SRv6 Maximum SRv6 SID Depths.";
+ container node-msd {
+ description
+ "SRv6 Node Maximum SRv6 SID Depths.";
+ leaf max-segs-left {
+ type uint8 {
+ range "0..255";
+ }
+ default 3;
+ description
+ "Maximum Segments Left MSD.";
+ }
+ leaf max-end-pop {
+ type uint8 {
+ range "0..255";
+ }
+ default 3;
+ description
+ "Maximum End Pop MSD.";
+ }
+ leaf max-h-encaps {
+ type uint8 {
+ range "0..255";
+ }
+ default 2;
+ description
+ "Maximum H.Encaps MSD.";
+ }
+ leaf max-end-d {
+ type uint8 {
+ range "0..255";
+ }
+ default 5;
+ description
+ "Maximum End D MSD.";
+ }
+ }
+ }
+ leaf interface {
+ type string;
+ description
+ "Dummy interface used to install SRv6 SIDs into the Linux data plane.";
+ default "sr0";
+ }
+ }
+
+ container mpls {
+ description
+ "Configuration of MPLS parameters";
+ container ldp-sync {
+ presence "Present if MPLS LDP-Sync is enabled.";
+ description
+ "Enable MPLS LDP-Sync functionality.";
+ leaf holddown {
+ type uint16 {
+ range "0..10000";
+ }
+ units "seconds";
+ default "0";
+ description
+ "Time to wait for LDP-Sync to occur before restoring interface metric.";
+ }
+ }
+ }
+
+ }
+ }
+
+ augment "/frr-interface:lib/frr-interface:interface" {
+ description
+ "Extends interface model with IS-IS related parameters.";
+ container isis {
+ presence "Present if an IS-IS circuit is defined for this interface.";
+ description
+ "IS-IS interface parameters.";
+ uses interface-config;
+ }
+ }
+
+ augment "/frr-interface:lib/frr-interface:interface/frr-interface:state" {
+ description
+ "Extends interface model with IS-IS operational data.";
+ container isis {
+ presence "Present if an IS-IS circuit is defined for this interface.";
+ description
+ "IS-IS interface operational data.";
+
+ uses interface-state;
+ }
+ }
+
+ notification database-overload {
+ description
+ "This notification is sent when an IS-IS instance
+ overload state changes.";
+ uses notification-instance-hdr;
+
+ leaf overload {
+ type enumeration {
+ enum "off" {
+ value 0;
+ description
+ "Indicates IS-IS instance has left overload state";
+ }
+ enum "on" {
+ value 1;
+ description
+ "Indicates IS-IS instance has entered overload state";
+ }
+ }
+ description
+ "New overload state of the IS-IS instance";
+ }
+ }
+
+ notification lsp-too-large {
+ description
+ "This notification is sent when we attempt to propagate
+ an LSP that is larger than the dataLinkBlockSize for the
+ circuit. The notification generation must be throttled
+ with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf pdu-size {
+ type uint32;
+ description
+ "Size of the LSP PDU";
+ }
+
+ leaf lsp-id {
+ type lsp-id;
+ description
+ "LSP ID";
+ }
+ }
+
+ notification if-state-change {
+ description
+ "This notification is sent when an interface
+ state change is detected.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf state {
+ type if-state-type;
+ description
+ "Interface state.";
+ }
+ }
+
+ notification corrupted-lsp-detected {
+ description
+ "This notification is sent when we find that
+ an LSP that was stored in memory has become
+ corrupted.";
+ uses notification-instance-hdr;
+
+ leaf lsp-id {
+ type lsp-id;
+ description
+ "LSP ID";
+ }
+ }
+
+ notification attempt-to-exceed-max-sequence {
+ description
+ "This notification is sent when the system
+ wraps the 32-bit sequence counter of an LSP.";
+ uses notification-instance-hdr;
+
+ leaf lsp-id {
+ type lsp-id;
+ description
+ "LSP ID";
+ }
+ }
+
+ notification id-len-mismatch {
+ description
+ "This notification is sent when we receive a PDU
+ with a different value for the System ID length.
+ The notification generation must be throttled
+ with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf pdu-field-len {
+ type uint8;
+ description
+ "Size of the ID length in the received PDU";
+ }
+
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+ }
+
+ notification max-area-addresses-mismatch {
+ description
+ "This notification is sent when we receive a PDU
+ with a different value for the Maximum Area Addresses.
+ The notification generation must be throttled
+ with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf max-area-addresses {
+ type uint8;
+ description
+ "Received number of supported areas";
+ }
+
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+ }
+
+ notification own-lsp-purge {
+ description
+ "This notification is sent when the system receives
+ a PDU with its own system ID and zero age.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf lsp-id {
+ type lsp-id;
+ description
+ "LSP ID";
+ }
+ }
+
+ notification sequence-number-skipped {
+ description
+ "This notification is sent when the system receives a
+ PDU with its own system ID and different contents. The
+ system has to reoriginate the LSP with a higher sequence
+ number.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf lsp-id {
+ type lsp-id;
+ description
+ "LSP ID";
+ }
+ }
+
+ notification authentication-type-failure {
+ description
+ "This notification is sent when the system receives a
+ PDU with the wrong authentication type field.
+ The notification generation must be throttled
+ with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+ }
+
+ notification authentication-failure {
+ description
+ "This notification is sent when the system receives
+ a PDU with the wrong authentication information.
+ The notification generation must be throttled with
+ with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+ }
+
+ notification version-skew {
+ description
+ "This notification is sent when the system receives a
+ PDU with a different protocol version number.
+ The notification generation must be throttled
+ with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf protocol-version {
+ type uint8;
+ description
+ "Protocol version received in the PDU.";
+ }
+
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+ }
+
+ notification area-mismatch {
+ description
+ "This notification is sent when the system receives a
+ Hello PDU from an IS that does not share any area
+ address. The notification generation must be throttled
+ with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+ }
+
+ notification rejected-adjacency {
+ description
+ "This notification is sent when the system receives a
+ Hello PDU from an IS but does not establish an adjacency
+ for some reason. The notification generation must be
+ throttled with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+
+ leaf reason {
+ type string;
+ description
+ "The system may provide a reason to reject the
+ adjacency. If the reason is not available,
+ an empty string will be returned.";
+ }
+ }
+
+ notification lsp-error-detected {
+ description
+ "This notification is sent when the system receives an
+ LSP with a parse error. The notification generation must
+ be throttled with at least 5 seconds between successive
+ notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf lsp-id {
+ type lsp-id;
+ description
+ "LSP ID.";
+ }
+
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+
+ leaf error-offset {
+ type uint32;
+ description
+ "If the problem is a malformed TLV, the error-offset
+ points to the start of the TLV. If the problem is with
+ the LSP header, the error-offset points to the errant
+ byte";
+ }
+
+ leaf tlv-type {
+ type uint8;
+ description
+ "If the problem is a malformed TLV, the tlv-type is set
+ to the type value of the suspicious TLV. Otherwise,
+ this leaf is not present.";
+ }
+ }
+
+ notification adjacency-state-change {
+ description
+ "This notification is sent when an IS-IS adjacency
+ moves to Up state or to Down state.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf neighbor {
+ type string;
+ description
+ "Name of the neighbor. If the name of the neighbor is
+ not available, it is not returned.";
+ }
+
+ leaf neighbor-system-id {
+ type system-id;
+ description
+ "Neighbor system-id";
+ }
+
+ leaf state {
+ type adj-state-type;
+ description
+ "New state of the IS-IS adjacency.";
+ }
+
+ leaf reason {
+ type string;
+ description
+ "If the adjacency is going to DOWN, this leaf provides
+ a reason for the adjacency going down. The reason is
+ provided as a text. If the adjacency is going to UP, no
+ reason is provided.";
+ }
+ }
+
+ notification lsp-received {
+ description
+ "This notification is sent when an LSP is received.
+ The notification generation must be throttled with at
+ least 5 seconds between successive notifications.";
+ uses notification-instance-hdr;
+
+ uses notification-interface-hdr;
+
+ leaf lsp-id {
+ type lsp-id;
+ description
+ "LSP ID";
+ }
+
+ leaf sequence {
+ type uint32;
+ description
+ "Sequence number of the received LSP.";
+ }
+
+ leaf received-timestamp {
+ type yang:timestamp;
+ description
+ "Timestamp when the LSP was received.";
+ }
+
+ leaf neighbor-system-id {
+ type system-id;
+ description
+ "Neighbor system-id of LSP sender";
+ }
+ }
+
+ notification lsp-generation {
+ description
+ "This notification is sent when an LSP is regenerated.
+ The notification generation must be throttled with at
+ least 5 seconds between successive notifications.";
+ uses notification-instance-hdr;
+
+ leaf lsp-id {
+ type lsp-id;
+ description
+ "LSP ID";
+ }
+
+ leaf sequence {
+ type uint32;
+ description
+ "Sequence number of the received LSP.";
+ }
+
+ leaf send-timestamp {
+ type yang:timestamp;
+ description
+ "Timestamp when our LSP was regenerated.";
+ }
+ }
+}
diff --git a/yang/frr-module-translator.yang b/yang/frr-module-translator.yang
new file mode 100644
index 0000000..668bb21
--- /dev/null
+++ b/yang/frr-module-translator.yang
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-module-translator {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/frr-module-translator";
+ prefix frr-module-translator;
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "A model for FRR YANG module translators.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2018-07-31 {
+ description
+ "Initial revision.";
+ }
+
+ container frr-module-translator {
+ leaf family {
+ type string {
+ length "0 .. 32";
+ }
+ mandatory true;
+ description
+ "Family of YANG models.";
+ }
+ list module {
+ key "name";
+ ordered-by user;
+ description
+ "YANG module.";
+
+ leaf name {
+ type string;
+ description
+ "Module name.";
+ }
+ leaf deviations {
+ type string;
+ mandatory true;
+ description
+ "Module containing the YANG deviations.";
+ }
+ list mappings {
+ key "custom";
+ description
+ "YANG mappings between the custom module and FRR native modules.";
+
+ leaf custom {
+ type string {
+ length "0 .. 256";
+ }
+ description
+ "YANG path of the custom module.";
+ }
+ leaf native {
+ type string {
+ length "0 .. 256";
+ }
+ mandatory true;
+ description
+ "Corresponding path of the native YANG modules";
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-nexthop.yang b/yang/frr-nexthop.yang
new file mode 100644
index 0000000..175487d
--- /dev/null
+++ b/yang/frr-nexthop.yang
@@ -0,0 +1,348 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-nexthop {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/nexthop";
+ prefix frr-nexthop;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import ietf-routing-types {
+ prefix rt-types;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR nexthop information.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-08-15 {
+ description
+ "Initial revision.";
+ }
+
+ typedef optional-ip-address {
+ type union {
+ type inet:ip-address;
+ type string {
+ length "0";
+ }
+ }
+ }
+
+ /*
+ * Nexthop types.
+ */
+ typedef nexthop-type {
+ type enumeration {
+ enum "ifindex" {
+ value 1;
+ description
+ "Specific interface.";
+ }
+ enum "ip4" {
+ value 2;
+ description
+ "IPv4 address.";
+ }
+ enum "ip4-ifindex" {
+ value 3;
+ description
+ "IPv4 address and interface.";
+ }
+ enum "ip6" {
+ value 4;
+ description
+ "IPv6 address.";
+ }
+ enum "ip6-ifindex" {
+ value 5;
+ description
+ "IPv6 address and interface.";
+ }
+ enum "blackhole" {
+ value 6;
+ description
+ "Unreachable or prohibited.";
+ }
+ }
+ description
+ "Nexthop types.";
+ }
+
+ /*
+ * Blockhole nexthop type.
+ */
+ typedef blackhole-type {
+ type enumeration {
+ enum "unspec" {
+ value 0;
+ description
+ "Generic unreachable.";
+ }
+ enum "null" {
+ value 1;
+ description
+ "Null type.";
+ }
+ enum "reject" {
+ value 2;
+ description
+ "ICMP unreachable.";
+ }
+ enum "prohibited" {
+ value 3;
+ description
+ "ICMP admin-prohibited.";
+ }
+ }
+ default "null";
+ description
+ "Nexthop blackhole types.";
+ }
+
+ typedef nexthop-group-ref {
+ type leafref {
+ path "/frr-nexthop:frr-nexthop-group/frr-nexthop:nexthop-groups/frr-nexthop:name";
+ require-instance false;
+ }
+ }
+
+ /*
+ * Common nexthop attributes grouping.
+ */
+ grouping frr-nexthop-attributes {
+ leaf nh-type {
+ type nexthop-type;
+ mandatory true;
+ description
+ "The nexthop type.";
+ }
+
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "The nexthop vrf name, if different from the route.";
+ }
+
+ leaf gateway {
+ type frr-nexthop:optional-ip-address;
+ description
+ "The nexthop gateway address.";
+ }
+
+ leaf interface {
+ type frr-interface:interface-ref;
+ description
+ "The nexthop egress interface.";
+ }
+
+ leaf bh-type {
+ type blackhole-type;
+ description
+ "A blackhole sub-type, if the nexthop is a blackhole type.";
+ }
+
+ leaf onlink {
+ type boolean;
+ default "false";
+ description
+ "Nexthop is directly connected.";
+ }
+
+ leaf srte-color {
+ when "../nh-type = 'ip4' or
+ ../nh-type = 'ip6' or
+ ../nh-type = 'ip4-ifindex' or
+ ../nh-type = 'ip6-ifindex'";
+ type uint32;
+ description
+ "The nexthop SR-TE color";
+ }
+
+ uses rt-types:mpls-label-stack {
+ description
+ "Nexthop's MPLS label stack.";
+ }
+
+ uses srv6-segs-stack {
+ description
+ "Nexthop's SRv6 segs SIDs stack.";
+ }
+ }
+
+ /*
+ * operational common attributes for nexthop
+ */
+ grouping frr-nexthop-operational {
+ leaf duplicate {
+ type empty;
+ config false;
+ description
+ "Duplicate nexthop";
+ }
+
+ leaf recursive {
+ type empty;
+ config false;
+ description
+ "Nexthop resolved through another gateway.";
+ }
+
+ leaf active {
+ type empty;
+ config false;
+ description
+ "Nexthop is active.";
+ }
+
+ leaf fib {
+ type empty;
+ config false;
+ description
+ "Nexthop is installed in fib.";
+ }
+
+ leaf weight {
+ type uint8;
+ config false;
+ description
+ "Weight to be used by the nexthop for purposes of ECMP";
+ }
+ }
+
+ grouping nexthop-grouping {
+ list nexthop {
+ key "nh-type vrf gateway interface";
+ min-elements 1;
+ description
+ "A list of nexthop objects.";
+ uses frr-nexthop-attributes;
+ }
+ }
+
+ /*
+ * Single nexthop grouping.
+ */
+ grouping frr-nexthop {
+ container frr-nexthops {
+ description
+ "FRR nexthop object.";
+ uses nexthop-grouping;
+ }
+ }
+
+
+ /*
+ * Container for FRR nexthop group.
+ */
+ grouping frr-nexthop-grouping {
+ list nexthop-groups {
+ key "name";
+ description
+ "List of nexthop groups, each contains group of nexthops";
+ leaf name {
+ type string;
+ description
+ "The nexthop-group name.";
+ }
+
+ uses frr-nexthop;
+ }
+ }
+
+ /* Operational nexthop-group */
+ grouping frr-nexthop-group-operational {
+ container nexthop-group {
+ description
+ "A group of nexthops.";
+ leaf id {
+ type uint32;
+ description
+ "The nexthop-group id.";
+ }
+
+ uses nexthop-grouping;
+ }
+ }
+
+ /* Contaner for SRv6 segs SIDs */
+ grouping srv6-segs-stack {
+ description
+ "This grouping specifies an SRv6 segs SIDs stack. The segs
+ SIDs stack is encoded as a list of SID entries. The
+ list key is an identifier that indicates the relative
+ ordering of each entry.";
+ container srv6-segs-stack {
+ description
+ "Container for a list of SRv6 segs SIDs entries.";
+ list entry {
+ key "id";
+ description
+ "List of SRv6 segs SIDs entries.";
+ leaf id {
+ type uint8;
+ description
+ "Identifies the entry in a sequence of SRv6 segs SIDs
+ entries.";
+ }
+ leaf seg {
+ type inet:ipv6-address;
+ }
+ }
+ }
+ }
+ container frr-nexthop-group {
+ description
+ "A nexthop-group, represented as a list of nexthop objects.";
+ uses frr-nexthop-grouping;
+ }
+
+ /*
+ * Augment weight attributes to nexthop group.
+ */
+ augment "/frr-nexthop-group/nexthop-groups/frr-nexthops/nexthop" {
+ leaf weight {
+ type uint8;
+ description
+ "Weight to be used by the nexthop for purposes of ECMP";
+ }
+ }
+}
diff --git a/yang/frr-ospf-route-map.yang b/yang/frr-ospf-route-map.yang
new file mode 100644
index 0000000..ad7ba5c
--- /dev/null
+++ b/yang/frr-ospf-route-map.yang
@@ -0,0 +1,52 @@
+module frr-ospf-route-map {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/ospf-route-map";
+ prefix frr-ospf-route-map;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ organization
+ "Free Range Routing";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines ospf route map settings";
+
+ revision 2020-01-02 {
+ description
+ "Initial revision";
+ }
+
+ identity metric-type {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the type of metric";
+ }
+
+ augment "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:rmap-set-action/frr-route-map:set-action" {
+ case metric-type {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'metric-type')";
+ leaf metric-type {
+ type enumeration {
+ enum "type-1" {
+ value 0;
+ description
+ "OSPF6 external type 1 metric";
+ }
+ enum "type-2" {
+ value 1;
+ description
+ "OSPF6 external type 2 metric";
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-ospf6-route-map.yang b/yang/frr-ospf6-route-map.yang
new file mode 100644
index 0000000..e5d4969
--- /dev/null
+++ b/yang/frr-ospf6-route-map.yang
@@ -0,0 +1,47 @@
+module frr-ospf6-route-map {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/ospf6-route-map";
+ prefix frr-ospf6-route-map;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ organization
+ "Free Range Routing";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines ospf6 route map settings";
+
+ revision 2020-01-02 {
+ description
+ "Initial revision";
+ }
+
+ identity forwarding-address {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the forwarding address";
+ }
+
+ identity metric-type {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set the type of metric";
+ }
+
+ augment "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:rmap-set-action/frr-route-map:set-action" {
+ case ipv6-address {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'forwarding-address')";
+ leaf ipv6-address {
+ type inet:ipv6-address;
+ }
+ }
+ }
+}
diff --git a/yang/frr-ospfd.yang b/yang/frr-ospfd.yang
new file mode 100644
index 0000000..b0150cc
--- /dev/null
+++ b/yang/frr-ospfd.yang
@@ -0,0 +1,1004 @@
+module frr-ospfd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/ospfd";
+ prefix frr-ospfd;
+
+ import frr-routing {
+ prefix frr-rt;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR OSPFd information.
+ This YANG module augments the basic routing with additional
+ OSPF information";
+
+ revision 2020-07-21 {
+ description
+ "Initial revision.";
+ }
+
+ identity ospf {
+ base frr-rt:routing-protocol;
+ description
+ "'OSPF' routing ospf-protocol.";
+ }
+
+ /* Policy types to be removed later, once policy Yang finalized */
+ typedef plist-ref {
+ type string;
+ }
+
+ typedef access-list-ref {
+ type string;
+ }
+
+ typedef ospf-area-id {
+ type union {
+ type inet:ipv4-address;
+ type uint32;
+ }
+ description "OSPF Area ID.";
+ }
+
+ grouping nssa-grouping {
+ container nssa {
+ presence "Present if the nssa is enabled";
+ leaf no-summary {
+ type boolean;
+ default "false";
+ description
+ "Do not inject inter-area routes into nssa";
+ }
+
+ leaf translate-always {
+ type boolean;
+ default "false";
+ description
+ "NSSA-ABR to always translate";
+ }
+
+ leaf translate-candidate {
+ type boolean;
+ default "false";
+ description
+ "NSSA-ABR for translate election";
+ }
+
+ leaf translate-never {
+ type boolean;
+ default "false";
+ description
+ "NSSA-ABR to never translate";
+ }
+ }
+ }
+
+ grouping range-grouping {
+ container ranges {
+ list range {
+ key "prefix";
+ description
+ "A list of range objects";
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "Area range prefix";
+ }
+
+ leaf advertise {
+ type boolean;
+ description
+ "Advertise this range";
+ }
+
+ leaf not-advertise {
+ type boolean;
+ default "false";
+ description
+ "Do not advertise this range";
+ }
+
+ leaf cost {
+ type uint32 {
+ range "0..16777215";
+ }
+ description
+ "Metric for this range";
+ }
+
+ leaf substitute {
+ type inet:ipv4-prefix;
+ description
+ "Network prefix to be announced instead of range";
+ }
+ }
+ }
+ }
+
+ grouping stub-grouping {
+ container stub {
+ presence "Present when area is stub";
+ leaf no-summary {
+ type boolean;
+ default "false";
+ description
+ "Do not inject inter-area routes into stub";
+ }
+ }
+ }
+
+ grouping shortcut-grouping {
+ container shortcut {
+ leaf default {
+ type boolean;
+ default "false";
+ description
+ "Default shortcutting behavior";
+ }
+
+ leaf disable {
+ type boolean;
+ description
+ "Disable shortcutting through the area";
+ }
+
+ leaf enable {
+ type boolean;
+ description
+ "Enable shortcutting through the area";
+ }
+ }
+ }
+
+ grouping authentication-group {
+ container authentication {
+ presence "Enable authentication.";
+ description
+ "Enable authentication on this virtual link.";
+ leaf message-digest {
+ type boolean;
+ description
+ "Use message-digest authentication.";
+ }
+
+ leaf null {
+ type boolean;
+ description
+ "Use null authentication.";
+ }
+ }
+
+ list message-digest-key {
+ key "key-id";
+ leaf key-id {
+ type uint8;
+ description
+ "Key id";
+ }
+
+ leaf mds-key {
+ type string;
+ description
+ "The OSPF password.";
+ }
+ }
+
+ leaf authentication-key {
+ type string;
+ description
+ "The OSPF password.";
+ }
+ }
+
+ grouping virtual-link-group {
+ list virtual-link {
+ key "neighbor area-id";
+ description
+ "Virtual link parameters.";
+ leaf neighbor {
+ type inet:ipv4-address;
+ description
+ "Router ID of the remote ABR.";
+ }
+
+ leaf area-id {
+ mandatory true;
+ type ospf-area-id;
+ }
+
+ uses authentication-group;
+
+ container timers {
+ leaf dead-interval {
+ type uint16;
+ units "seconds";
+ description
+ "Interval time after which a neighbor is declared down.";
+ }
+
+ leaf hello-interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ description
+ "Time between HELLO packets.";
+ }
+
+ leaf retransmit-interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ description
+ "Time between retransmitting lost link state advertisements.";
+ }
+
+ leaf transmit-delay {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ description
+ "Link state transmit delay.";
+ }
+ }
+ }
+ }
+
+ grouping area-groupings {
+ container areas {
+ list area {
+ key "area-id";
+ description
+ "A list of area objects";
+ leaf area-id {
+ type ospf-area-id;
+ }
+
+ container authentication {
+ presence "Enable authentication";
+ leaf message-digest {
+ type boolean;
+ description
+ "Use message-digest authentication";
+ }
+ }
+
+ leaf default-cost {
+ type uint32 {
+ range "0..16777215";
+ }
+ description
+ "Advertised default summary cost";
+ }
+
+ leaf export-list {
+ type access-list-ref;
+ description
+ "Filter for networks announced to other areas.";
+ }
+
+ leaf import-list {
+ type access-list-ref;
+ description
+ "Filter for networks from other areas announced to the specified one.";
+ }
+
+ container filter-list {
+ leaf prefix {
+ type plist-ref;
+ description
+ "Filter networks between OSPF areas.";
+ }
+
+ leaf in {
+ type boolean;
+ }
+
+ leaf out {
+ type boolean;
+ }
+ }
+
+ uses nssa-grouping;
+
+ uses range-grouping;
+
+ uses stub-grouping;
+
+ uses shortcut-grouping;
+
+ uses virtual-link-group;
+ }
+ }
+ }
+
+ /* router ospf attributes */
+ grouping route-ospf-leaf-attributes {
+ leaf auto-cost-reference-bandwidth {
+ type uint32 {
+ range "1..4294967";
+ }
+ units "Mbits";
+ description
+ "The reference bandwidth in terms of Mbits per second.";
+ }
+
+ leaf use-arp {
+ type boolean;
+ default "true";
+ description
+ "ARP for neighbor table entry.";
+ }
+
+ leaf capability-opaque {
+ type boolean;
+ default "false";
+ description
+ "Opaque LSA.";
+ }
+
+ leaf compatible-rfc1583 {
+ type boolean;
+ description
+ "Compatible with RFC 1583.";
+ }
+
+ leaf default-metric {
+ type uint32 {
+ range "0..16777214";
+ }
+ description
+ "Metric of redistributed routes.";
+ }
+
+ leaf write-multiplier {
+ type uint8 {
+ range "1..100";
+ }
+ description
+ "Maximum number of interfaces serviced per write.";
+ }
+
+ container router-info {
+ choice router-info {
+ case as {
+ leaf as {
+ type boolean;
+ description
+ "Enable the Router Information functionality with AS flooding scope.";
+ }
+ }
+ case area {
+ leaf area {
+ type ospf-area-id;
+ description
+ "Enable the Router Information functionality with Area flooding scope.";
+ }
+ }
+ }
+ }
+ }
+
+ grouping metric-common-group {
+ leaf metric {
+ type uint32 {
+ range "0..16777214";
+ }
+ description
+ "OSPF default metric.";
+ }
+
+ leaf metric-type {
+ type enumeration {
+ enum "type-1" {
+ value 1;
+ }
+ enum "type-2" {
+ value 2;
+ }
+ }
+ description
+ "Metric type (1/2).";
+ }
+
+ leaf route-map {
+ type frr-route-map:route-map-ref;
+ description
+ "Route map reference.";
+ }
+ }
+
+ grouping default-info-group {
+ container default-information {
+ leaf originate {
+ type boolean;
+ description
+ "Advertise a default route";
+ }
+
+ leaf always {
+ type boolean;
+ description
+ "Always advertise default route.";
+ }
+
+ uses metric-common-group;
+ }
+ }
+
+ grouping redistribute-group {
+ list redistribute {
+ key "protocol";
+ leaf protocol {
+ type frr-route-types:frr-route-types-v4;
+ description
+ "Protocol.";
+ }
+
+ uses metric-common-group;
+ }
+ }
+
+ grouping distance-group {
+ container distance {
+ leaf admin-value {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Admin value.";
+ }
+
+ container ospf {
+ leaf external {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Distance for external routes.";
+ }
+
+ leaf inter-area {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Distance for inter-area routes.";
+ }
+
+ leaf intra-area {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Distance for intra-area routes.";
+ }
+ }
+ }
+ }
+
+ grouping distribute-list-group {
+ container distribute-list {
+ list dlist {
+ key "name protocol";
+ leaf name {
+ type string;
+ description
+ "Filter networks in routing updates.";
+ }
+
+ leaf protocol {
+ type frr-route-types:frr-route-types-v4;
+ description
+ "Out protocol.";
+ }
+ }
+ }
+ }
+
+ grouping max-metric-group {
+ container max-metric {
+ container router-lsa {
+ description
+ "Advertise own Router-LSA with infinite distance (stub router).";
+ leaf administrative {
+ type boolean;
+ description
+ "Administratively applied, for an indefinite period.";
+ }
+
+ leaf on-shutdown {
+ type uint8 {
+ range "5..100";
+ }
+ description
+ "Advertise stub-router prior to full shutdown of OSPF.";
+ }
+
+ leaf on-startup {
+ type uint32 {
+ range "5..86400";
+ }
+ description
+ "Automatically advertise stub Router-LSA on startup of OSPF.";
+ }
+ }
+ }
+ }
+
+ grouping mpls-te-group {
+ container mpls-te {
+ leaf on {
+ type boolean;
+ description
+ "Enable the MPLS-TE functionality.";
+ }
+
+ leaf router-address {
+ type inet:ipv4-address;
+ description
+ "Stable IP address of the advertising router.";
+ }
+
+ container inter-as {
+ leaf as {
+ type boolean;
+ description
+ "AS native mode self originate INTER-AS LSA with Type 11 (as flooding scope).";
+ }
+
+ leaf area {
+ type ospf-area-id;
+ description
+ "AREA native mode self originate INTER-AS LSA with Type 10 (area flooding scope).";
+ }
+ }
+ }
+ }
+
+ grouping ospf-group {
+ container ospf {
+ leaf abr-type {
+ type enumeration {
+ enum "cisco" {
+ value 1;
+ description
+ "Alternative ABR, Cisco implementation.";
+ }
+ enum "ibm" {
+ value 2;
+ description
+ "Alternative ABR, IBM implementation.";
+ }
+ enum "shortcut" {
+ value 3;
+ description
+ "Shortcut ABR.";
+ }
+ enum "standard" {
+ value 4;
+ description
+ "Standard behavior (RFC2328).";
+ }
+ }
+ }
+
+ leaf opaque-lsa {
+ type boolean;
+ description
+ "Enable the Opaque-LSA capability (RFC2370)";
+ }
+
+ leaf rfc1583compatibility {
+ type boolean;
+ description
+ "Enable the RFC 1583 compatibility flag.";
+ }
+
+ leaf router-id {
+ type inet:ipv4-address;
+ description
+ "Router-id for the OSPF process.";
+ }
+
+ leaf write-multiplier {
+ type uint8 {
+ range "1..100";
+ }
+ description
+ "Write multiplier.";
+ }
+ }
+ }
+
+ grouping timer-group {
+ container timers {
+ leaf refresh-interval {
+ type uint16 {
+ range "10..1800";
+ }
+ units "seconds";
+ description
+ "The maximum time between distinct originations of any particular
+ LSA, value in units seconds.";
+ }
+
+ leaf lsa-min-arrival {
+ type uint32 {
+ range "0..600000";
+ }
+ units "milliseconds";
+ description
+ "Minimum delay in receiving new version of an LSA.";
+ }
+
+ container throttle {
+ leaf lsa-all {
+ type uint16 {
+ range "0..5000";
+ }
+ units "milliseconds";
+ description
+ "LSA delay between transmissions.";
+ }
+
+ leaf spf {
+ type uint32 {
+ range "0..600000";
+ }
+ units "milliseconds";
+ description
+ "Delay from first change received till SPF calculation.";
+ }
+ }
+ }
+ }
+
+ grouping segment-routing-group {
+ container segment-routing {
+ container global-block {
+ description
+ "Segment Routing Global Block label range.";
+ leaf lower-bound {
+ must "../upper-bound > .";
+ type uint32 {
+ range "0..1048575";
+ }
+ default "16000";
+ }
+
+ leaf upper-bound {
+ must ". > ../lower-bound";
+ type uint32 {
+ range "0..1048575";
+ }
+ default "23999";
+ }
+ }
+
+ container srlb {
+ description
+ "Local blocks to be advertised.";
+ leaf lower-bound {
+ must "../upper-bound > .";
+ type uint32;
+ default "15000";
+ description
+ "Lower value in the label range.";
+ }
+ leaf upper-bound {
+ must ". > ../lower-bound";
+ type uint32;
+ default "15999";
+ description
+ "Upper value in the label range.";
+ }
+ }
+
+ leaf node-msd {
+ type uint8 {
+ range "1..16";
+ }
+ description
+ "Maximum Stack Depth for this router.";
+ }
+
+ leaf on {
+ type boolean;
+ description
+ "Enable Segment Routing.";
+ }
+
+ list prefix-sid {
+ key "index";
+ leaf index {
+ type uint16;
+ description
+ "SID index for this prefix.";
+ }
+
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "Prefix SID.";
+ }
+
+ leaf last-hop-behavior {
+ type enumeration {
+ enum "explicit-null" {
+ value 0;
+ description
+ "Use explicit-null for the SID.";
+ }
+ enum "no-php" {
+ value 1;
+ description
+ "Do not use Penultimate Hop Popping (PHP)
+ for the SID.";
+ }
+ enum "php" {
+ value 2;
+ description
+ "Use PHP for the SID.";
+ }
+ }
+ default "php";
+ description
+ "Configure last hop behavior.";
+ }
+ }
+ }
+ }
+
+ grouping ospf-list-group {
+ list neighbor {
+ key "ip";
+ description
+ "Neighbor list.";
+ leaf ip {
+ type inet:ipv4-address;
+ description
+ "Neighbor IP address.";
+ }
+
+ leaf priority {
+ type uint8;
+ description
+ "Neighbor Priority.";
+ }
+
+ leaf poll-interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ description
+ "Dead Neighbor Polling interval.";
+ }
+ }
+
+ list network {
+ key "prefix";
+ description
+ "Enable routing on list of IP network.";
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "Prefix on which routing needs to be enabled.";
+ }
+
+ leaf area {
+ type ospf-area-id;
+ description
+ "Area ID for this network.";
+ }
+ }
+
+ list passive-interface {
+ key "interface";
+ description
+ "Suppress routing updates on list interface.";
+ leaf interface {
+ type frr-interface:interface-ref;
+ description
+ "Suppress routing updates on an interface.";
+ }
+
+ leaf address {
+ type inet:ipv4-address;
+ description
+ "Interface address.";
+ }
+ }
+ }
+
+ grouping interface-ospf-attribute-group {
+ leaf area {
+ type ospf-area-id;
+ description
+ "OSPF area ID.";
+ }
+
+ uses authentication-group;
+
+ leaf cost {
+ type uint16 {
+ range "1..65535";
+ }
+ description
+ "Interface cost";
+ }
+
+ container dead-interval {
+ leaf interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ }
+
+ container minimal {
+ leaf hello-multiplier {
+ type uint8 {
+ range "1..10";
+ }
+ }
+ }
+ }
+
+ leaf hello-interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ description
+ "Time between HELLO packets.";
+ }
+
+ leaf retransmit-interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ description
+ "Time between retransmitting lost link state advertisements.";
+ }
+
+ leaf transmit-delay {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ description
+ "Link state transmit delay.";
+ }
+
+ leaf mtu-ignore {
+ type boolean;
+ description
+ "Disable MTU mismatch detection on this interface.";
+ }
+
+ leaf priority {
+ type uint8;
+ description
+ "Router priority.";
+ }
+ }
+
+ grouping interface-ospf-group {
+ list instance {
+ key "id";
+ leaf id {
+ type uint16;
+ description
+ "OSPF instance ID.";
+ }
+
+ leaf bfd {
+ type boolean;
+ default "false";
+ description
+ "BFD support.";
+ }
+
+ leaf network {
+ type enumeration {
+ enum "broadcast" {
+ value 1;
+ }
+ enum "non-broadcast" {
+ value 2;
+ }
+ enum "point-to-multipoint" {
+ value 3;
+ }
+ enum "point-to-point" {
+ value 4;
+ }
+ }
+ }
+
+ uses interface-ospf-attribute-group;
+
+ list interface-address {
+ key "address";
+ leaf address {
+ type inet:ipv4-address;
+ description
+ "Address of interface";
+ }
+
+ uses interface-ospf-attribute-group;
+ }
+ }
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol" {
+ container ospf {
+ when "../frr-rt:type = 'frr-ospfd:ospf'" {
+ description
+ "This container is only valid for the 'OSPF' routing
+ protocol.";
+ }
+
+ uses route-ospf-leaf-attributes;
+
+ uses default-info-group;
+
+ uses redistribute-group;
+
+ uses distance-group;
+
+ uses distribute-list-group;
+
+ uses max-metric-group;
+
+ uses mpls-te-group;
+
+ uses ospf-group;
+
+ uses timer-group;
+
+ uses segment-routing-group;
+
+ uses ospf-list-group;
+
+ uses area-groupings;
+ }
+ }
+
+ /*
+ * Per-interface configuration data
+ */
+ augment "/frr-interface:lib/frr-interface:interface" {
+ container ospf {
+ description
+ "OSPF interface parameters.";
+ uses interface-ospf-group;
+ }
+ }
+}
diff --git a/yang/frr-pathd.yang b/yang/frr-pathd.yang
new file mode 100644
index 0000000..5beda76
--- /dev/null
+++ b/yang/frr-pathd.yang
@@ -0,0 +1,505 @@
+module frr-pathd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/pathd";
+ prefix frr-pathd;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import ietf-routing-types {
+ prefix rt-types;
+ }
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ organization
+ "Free Range Routing";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR pathd daemon.";
+
+ revision 2018-11-06 {
+ description
+ "Initial revision.";
+ }
+
+ typedef protocol-origin-type {
+ description
+ "Indication for the protocol origin of an object.";
+ type enumeration {
+ enum pcep {
+ value 1;
+ description "The object was created through PCEP";
+ }
+ enum bgp {
+ value 2;
+ description "The object was created through GBP";
+ }
+ enum local {
+ value 3;
+ description "The object was created through CLI, Yang model via Netconf, gRPC, etc";
+ }
+ }
+ }
+
+ typedef originator-type {
+ type string {
+ length "1..64";
+ }
+ description
+ "Identifier of the originator of an object, could be 'config', '1.1.1.1:4189' or '2001:db8:85a3::8a2e:370:7334:4189'";
+ }
+
+ container pathd {
+ container srte {
+ list segment-list {
+ key "name";
+ description "Segment-list properties";
+ leaf name {
+ type string {
+ length "1..64";
+ }
+ description "Segment-list name";
+ }
+ leaf protocol-origin {
+ type protocol-origin-type;
+ mandatory true;
+ description
+ "Indication for the protocol origin of the segment list.";
+ }
+ leaf originator {
+ type originator-type;
+ mandatory true;
+ description "Originator of the segment list";
+ }
+ list segment {
+ key "index";
+ description "Configure Segment/hop at the index";
+ leaf index {
+ type uint32;
+ description "Segment index";
+ }
+ leaf sid-value {
+ type rt-types:mpls-label;
+ description "MPLS label value";
+ }
+ container nai {
+ presence "The segment has a Node or Adjacency Identifier";
+ leaf type {
+ description "NAI type";
+ mandatory true;
+ type enumeration {
+ enum ipv4_node {
+ value 1;
+ description "IPv4 node identifier";
+ }
+ enum ipv6_node {
+ value 2;
+ description "IPv6 node identifier";
+ }
+ enum ipv4_adjacency {
+ value 3;
+ description "IPv4 adjacency";
+ }
+ enum ipv6_adjacency {
+ value 4;
+ description "IPv6 adjacency";
+ }
+ enum ipv4_unnumbered_adjacency {
+ value 5;
+ description "IPv4 unnumbered adjacency";
+ }
+ enum ipv4_local_iface {
+ value 7;
+ description "IPv4 prefix with local interface id";
+ }
+ enum ipv6_local_iface {
+ value 8;
+ description "IPv6 prefix with local interface id";
+ }
+ enum ipv4_algo {
+ value 9;
+ description "IPv4 prefix with optional algorithm";
+ }
+ enum ipv6_algo {
+ value 10;
+ description "IPv6 prefix with optional algorithm";
+ }
+ }
+ }
+ leaf local-address {
+ type inet:ip-address;
+ mandatory true;
+ }
+ leaf local-prefix-len {
+ type uint8;
+ mandatory true;
+ when "../type = 'ipv4_local_iface' or ../type = 'ipv6_local_iface' or ../type = 'ipv4_algo' or ../type = 'ipv6_algo'";
+ }
+ leaf local-interface {
+ type uint32;
+ mandatory true;
+ when "../type = 'ipv4_local_iface' or ../type = 'ipv6_local_iface' or ../type = 'ipv4_unnumbered_adjacency'";
+ }
+ leaf remote-address {
+ type inet:ip-address;
+ mandatory true;
+ when "../type = 'ipv4_adjacency' or ../type = 'ipv6_adjacency' or ../type = 'ipv4_unnumbered_adjacency'";
+ }
+ leaf remote-interface {
+ type uint32;
+ mandatory true;
+ when "../type = 'ipv4_unnumbered_adjacency'";
+ }
+ leaf algorithm {
+ type uint8;
+ mandatory true;
+ when "../type = 'ipv4_algo' or ../type = 'ipv6_algo'";
+ }
+ }
+ }
+ }
+ list policy {
+ key "color endpoint";
+ unique "name";
+ leaf color {
+ type uint32;
+ description
+ "Color of the SR Policy.";
+ }
+ leaf endpoint {
+ type inet:ip-address;
+ description
+ "Indication for the endpoint of the SR Policy.";
+ }
+ leaf name {
+ type string {
+ length "1..64";
+ }
+ description
+ "Name of the SR Policy.";
+ }
+ leaf binding-sid {
+ type rt-types:mpls-label;
+ description
+ "BSID of the SR Policy.";
+ }
+ leaf is-operational {
+ type boolean;
+ config false;
+ description
+ "True if a valid candidate path of this policy is operational in zebra, False otherwise";
+ }
+ list candidate-path {
+ unique "name";
+ description
+ "List of Candidate Paths of the SR Policy.";
+ key "preference";
+ leaf preference {
+ type uint32;
+ description
+ "Administrative preference.";
+ }
+ leaf name {
+ type string {
+ length "1..64";
+ }
+ mandatory true;
+ description
+ "Symbolic Name of the Candidate Path.";
+ }
+ leaf is-best-candidate-path {
+ type boolean;
+ config false;
+ description
+ "True if the candidate path is the best candidate path, False otherwise";
+ }
+ leaf protocol-origin {
+ type protocol-origin-type;
+ mandatory true;
+ description
+ "Indication for the protocol origin of the Candidate Path.";
+ }
+ leaf originator {
+ type originator-type;
+ mandatory true;
+ description "Originator of the candidate path";
+ }
+ leaf discriminator {
+ type uint32;
+ config false;
+ description "Candidate path distinguisher";
+ }
+ leaf type {
+ description
+ "Type of the Candidate Path.";
+ mandatory true;
+ type enumeration {
+ enum explicit {
+ value 1;
+ }
+ enum dynamic {
+ value 2;
+ }
+ }
+ }
+ leaf segment-list-name {
+ type leafref {
+ path ../../../segment-list/name;
+ }
+ description
+ "The name of the Segment List to use as LSP.";
+ }
+ container constraints {
+ when "../type = 'dynamic'";
+ description
+ "Generic dynamic path constraints";
+ container bandwidth {
+ presence "If the candidate has a bandwidth constraint";
+ description
+ "The bandwidth needed by the candidate path.";
+ leaf required {
+ type boolean;
+ default "true";
+ description
+ "If the bandwidth limitation is a requirement or only a suggestion";
+ }
+ leaf value {
+ mandatory true;
+ type decimal64 {
+ fraction-digits 6;
+ }
+ }
+ }
+ container affinity {
+ description
+ "Affinity let you configure how the links should be used when calculating a path.";
+ leaf exclude-any {
+ type uint32;
+ description
+ "A 32-bit vector representing a set of attribute filters which renders a link unacceptable.";
+ }
+ leaf include-any {
+ type uint32;
+ description
+ "A 32-bit vector representing a set of attribute filters which renders a link acceptable. A null set (all bits set to zero) automatically passes.";
+ }
+ leaf include-all {
+ type uint32;
+ description
+ "A 32-bit vector representing a set of attribute filters which must be present for a link to be acceptable. A null set (all bits set to zero) automatically passes.";
+ }
+ }
+ list metrics {
+ key "type";
+ leaf type {
+ description
+ "Type of the metric.";
+ type enumeration {
+ enum igp {
+ value 1;
+ description "IGP metric";
+ }
+ enum te {
+ value 2;
+ description "TE metric";
+ }
+ enum hc {
+ value 3;
+ description "Hop Counts";
+ }
+ enum abc {
+ value 4;
+ description "Aggregate bandwidth consumption";
+ }
+ enum lmll {
+ value 5;
+ description "Load of the most loaded link";
+ }
+ enum cigp {
+ value 6;
+ description "Cumulative IGP cost";
+ }
+ enum cte {
+ value 7;
+ description "Cumulative TE cost";
+ }
+ enum pigp {
+ value 8;
+ description "P2MP IGP metric";
+ }
+ enum pte {
+ value 9;
+ description "P2MP TE metric";
+ }
+ enum phc {
+ value 10;
+ description "P2MP hop count metric";
+ }
+ enum msd {
+ value 11;
+ description "Segment-ID (SID) Depth";
+ }
+ enum pd {
+ value 12;
+ description "Path Delay metric";
+ }
+ enum pdv {
+ value 13;
+ description "Path Delay Variation metric";
+ }
+ enum pl {
+ value 14;
+ description "Path Loss metric";
+ }
+ enum ppd {
+ value 15;
+ description "P2MP Path Delay metric";
+ }
+ enum ppdv {
+ value 16;
+ description "P2MP Path Delay variation metric";
+ }
+ enum ppl {
+ value 17;
+ description "P2MP Path Loss metric";
+ }
+ enum nap {
+ value 18;
+ description "Number of adaptations on a path";
+ }
+ enum nlp {
+ value 19;
+ description "Number of layers on a path";
+ }
+ enum dc {
+ value 20;
+ description "Domain Count metric";
+ }
+ enum bnc {
+ value 21;
+ description "Border Node Count metric";
+ }
+ }
+ }
+ leaf required {
+ type boolean;
+ default "true";
+ description
+ "If the metric is a requirement, or if it is only a suggestion";
+ }
+ leaf is-bound {
+ type boolean;
+ description
+ "Defines if the value is a bound (a maximum) for the path metric that must not be exceeded.";
+ }
+ leaf is-computed {
+ type boolean;
+ description
+ "Defines if the value has been generated by the originator of the path.";
+ }
+ leaf value {
+ mandatory true;
+ type decimal64 {
+ fraction-digits 6;
+ }
+ }
+ }
+ container objective-function {
+ presence "If the candidate has an objective function constraint";
+ description
+ "Define objective function constraint as a list of preferred functions";
+ leaf required {
+ type boolean;
+ default "true";
+ description
+ "If an objective function is a requirement, or if it is only a suggestion";
+ }
+ leaf type {
+ description
+ "Type of objective function.";
+ mandatory true;
+ type enumeration {
+ enum mcp {
+ value 1;
+ description "Minimum Cost Path";
+ }
+ enum mlp {
+ value 2;
+ description "Minimum Load Path";
+ }
+ enum mbp {
+ value 3;
+ description "Maximum residual Bandwidth Path";
+ }
+ enum mbc {
+ value 4;
+ description "Minimize aggregate Bandwidth Consumption";
+ }
+ enum mll {
+ value 5;
+ description "Minimize the Load of the most loaded Link";
+ }
+ enum mcc {
+ value 6;
+ description "Minimize the Cumulative Cost of a set of paths";
+ }
+ enum spt {
+ value 7;
+ description "Shortest Path Tree";
+ }
+ enum mct {
+ value 8;
+ description "Minimum Cost Tree";
+ }
+ enum mplp {
+ value 9;
+ description "Minimum Packet Loss Path";
+ }
+ enum mup {
+ value 10;
+ description "Maximum Under-Utilized Path";
+ }
+ enum mrup {
+ value 11;
+ description "Maximum Reserved Under-Utilized Path";
+ }
+ enum mtd {
+ value 12;
+ description "Minimize the number of Transit Domains";
+ }
+ enum mbn {
+ value 13;
+ description "Minimize the number of Border Nodes";
+ }
+ enum mctd {
+ value 14;
+ description "Minimize the number of Common Transit Domains";
+ }
+ enum msl {
+ value 15;
+ description "Minimize the number of Shared Links";
+ }
+ enum mss {
+ value 16;
+ description "Minimize the number of Shared SRLGs";
+ }
+ enum msn {
+ value 17;
+ description "Minimize the number of Shared Nodes";
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-pim-rp.yang b/yang/frr-pim-rp.yang
new file mode 100644
index 0000000..4cc2141
--- /dev/null
+++ b/yang/frr-pim-rp.yang
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-pim-rp {
+ yang-version "1.1";
+ namespace "http://frrouting.org/yang/pim-rp";
+
+ prefix frr-pim-rp;
+
+ import ietf-inet-types {
+ prefix "inet";
+ }
+
+ import frr-routing {
+ prefix "frr-rt";
+ }
+
+ import frr-pim {
+ prefix "frr-pim";
+ }
+
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization
+ "FRRouting";
+
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+
+ description
+ "The module defines a collection of YANG definitions common for
+ all PIM (Protocol Independent Multicast) RP (Rendezvous Point) model.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2017-03-09 {
+ description
+ "Initial revision.";
+ reference
+ "RFC XXXX: A YANG Data Model for PIM RP";
+ }
+
+ typedef plist-ref {
+ type string;
+ }
+
+ /*
+ * Groupings
+ */
+ grouping static-rp-container {
+ description
+ "Grouping of static RP container.";
+
+ container static-rp {
+ description
+ "Containing static RP attributes.";
+
+ list rp-list {
+ key "rp-address";
+ description
+ "A list of RP addresses.";
+
+ leaf rp-address {
+ type inet:ip-address;
+ description
+ "Specifies a static RP address.";
+ }
+
+ choice group-list-or-prefix-list {
+ description "Use group-list or prefix-list";
+ case group-list {
+ leaf-list group-list{
+ type frr-route-types:ip-multicast-group-prefix;
+ description
+ "List of multicast group address.";
+ }
+ }
+ case prefix-list {
+ leaf prefix-list {
+ type plist-ref;
+ description
+ "Group prefix-list filter";
+ }
+ }
+ }
+ }
+ } // static-rp
+ } // static-rp-container
+
+ /*
+ * Configuration data nodes
+ */
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/"
+ + "frr-rt:control-plane-protocol/frr-pim:pim/"
+ + "frr-pim:address-family" {
+ description "PIM RP augmentation.";
+
+ container rp {
+ description
+ "PIM RP configuration data.";
+ uses static-rp-container;
+ } // rp
+ } // augment
+}
diff --git a/yang/frr-pim.yang b/yang/frr-pim.yang
new file mode 100644
index 0000000..e9b3f67
--- /dev/null
+++ b/yang/frr-pim.yang
@@ -0,0 +1,552 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-pim {
+ yang-version "1.1";
+ namespace "http://frrouting.org/yang/pim";
+
+ prefix frr-pim;
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ import frr-routing {
+ prefix "frr-rt";
+ }
+
+ import ietf-routing-types {
+ prefix "rt-types";
+ }
+
+ import ietf-inet-types {
+ prefix "inet";
+ }
+
+ organization
+ "FRRouting";
+
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+
+ description
+ "The module defines a collection of YANG definitions common for
+ PIM (Protocol Independent Multicast) model.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2021-11-22 {
+ description
+ "Initial revision.";
+ reference
+ "RFC XXXX: A YANG Data Model for PIM";
+ }
+
+ identity pimd {
+ base frr-rt:routing-protocol;
+ description
+ "'Pim' routing pseudo-protocol.";
+ }
+
+ typedef plist-ref {
+ type string;
+ }
+
+ /*
+ * Groupings
+ */
+
+ grouping msdp-timers {
+ leaf hold-time {
+ type uint16 {
+ range "1..max";
+ }
+ units seconds;
+ default 75;
+ description
+ "Hold period is started at the MSDP peer connection establishment
+ and is reset every new message. When the period expires the
+ connection is closed. This value should be greater than the
+ remote keep-alive time.";
+ }
+
+ leaf keep-alive {
+ type uint16 {
+ range "1..max";
+ }
+ units seconds;
+ default 60;
+ description
+ "To maintain a connection established it is necessary to send
+ keep alive messages in a certain frequency and this allows its
+ configuration. This value should be less than the remote
+ hold time.";
+ }
+
+ leaf connection-retry {
+ type uint16 {
+ range "1..max";
+ }
+ units seconds;
+ default 30;
+ description
+ "This period is used in the MSDP peer with the highest IP value
+ in the pair and configures the interval between TCP connection
+ attempts.";
+ }
+ }
+
+ grouping global-pim-config-attributes {
+ description
+ "A grouping defining per address family pim global attributes";
+
+ leaf ecmp {
+ type boolean;
+ default "false";
+ description
+ "Enable PIM ECMP.";
+ }
+
+ leaf ecmp-rebalance {
+ type boolean;
+ default "false";
+ description
+ "Enable PIM ECMP Rebalance.";
+ }
+
+ leaf keep-alive-timer {
+ type uint16 {
+ range "1..max";
+ }
+ default "210";
+ description
+ "Keep alive Timer in seconds.";
+ }
+
+ leaf rp-keep-alive-timer {
+ type uint16 {
+ range "1..max";
+ }
+ default "210";
+ description
+ "RP keep alive Timer in seconds.";
+ }
+
+ leaf send-v6-secondary {
+ when "../frr-pim:address-family = 'frr-rt:ipv4'" {
+ description
+ "Only applicable to IPv4 address family.";
+ }
+ type boolean;
+ default "true";
+ description
+ "Send v6 secondary addresses.";
+ }
+
+ container spt-switchover {
+ description
+ "SPT-Switchover.";
+
+ leaf spt-action {
+ type enumeration {
+ enum "PIM_SPT_IMMEDIATE" {
+ value 0;
+ description
+ "Immediate switch to SPT Tree.";
+ }
+ enum "PIM_SPT_INFINITY" {
+ value 1;
+ description
+ "Never switch to SPT Tree.";
+ }
+ }
+ default "PIM_SPT_IMMEDIATE";
+ description
+ "SPT-Switchover action";
+ }
+
+ leaf spt-infinity-prefix-list {
+ when "../spt-action = 'PIM_SPT_INFINITY'" {
+ description
+ "This leaf is only valid when the spt action
+ is PIM_SPT_INFINITY.";
+ }
+ type plist-ref;
+ description
+ "Prefix-List to control which groups to switch.";
+ }
+ }
+
+ leaf ssm-prefix-list {
+ type plist-ref;
+ description
+ "Prefix-list used to define Source-Specific Multicast address range.";
+ }
+
+ leaf-list ssm-pingd-source-ip {
+ type inet:ip-address;
+ description
+ "Enable ssmpingd operation.";
+ }
+
+ /* Global timers configuration. */
+ container msdp {
+ description "Global MSDP configuration.";
+ uses msdp-timers;
+ }
+
+ list msdp-mesh-groups {
+ key "name";
+ description
+ "RFC 3618 Section 10.2. MSDP mesh-group semantics
+
+ Groups multiple MSDP peers to reduce SA flooding typically used
+ in intra-domain settings.";
+
+ leaf name {
+ type string {
+ length 1..64;
+ }
+ description
+ "The mesh group name.";
+ }
+
+ leaf source {
+ type inet:ip-address;
+ description
+ "Source IP address for the TCP connections.";
+ }
+
+ list members {
+ key "address";
+
+ leaf address {
+ type inet:ip-address;
+ description
+ "Peer member IP address.";
+ }
+ }
+ }
+
+ list msdp-peer {
+ key "peer-ip";
+ description
+ "Configure MSDP peer.";
+
+ leaf peer-ip {
+ type inet:ip-address;
+ description
+ "MSDP peer IP address.";
+ }
+
+ leaf source-ip {
+ mandatory true;
+ type inet:ip-address;
+ description
+ "MSDP source IP address.";
+ }
+ }
+
+ container mlag {
+ presence
+ "Multi-chassis link aggregation.";
+
+ leaf peerlink-rif {
+ type frr-interface:interface-ref;
+ description
+ "Outgoing interface name.";
+ }
+
+ leaf reg-address {
+ type inet:ip-address;
+ description
+ "reg address.";
+ }
+
+ leaf my-role {
+ type enumeration {
+ enum "MLAG_ROLE_NONE" {
+ value 0;
+ description
+ "MLAG role none.";
+ }
+ enum "MLAG_ROLE_PRIMARY" {
+ value 1;
+ description
+ "MLAG role primary.";
+ }
+
+ enum "MLAG_ROLE_SECONDARY" {
+ value 2;
+ description
+ "MLAG role secondary.";
+ }
+ }
+ default "MLAG_ROLE_NONE";
+ description
+ "Mlag role.";
+ }
+
+ leaf peer-state {
+ type boolean;
+ default "false";
+ description
+ "Peer state";
+ }
+ }
+
+ leaf register-accept-list {
+ type plist-ref;
+ description
+ "Only accept registers from a specific source prefix list.";
+ }
+ } // global-pim-config-attributes
+
+ grouping interface-pim-config-attributes {
+ description
+ "A grouping defining pim interface attributes per address family.";
+
+ leaf pim-enable {
+ type boolean;
+ default "false";
+ description
+ "Enable PIM flag on the interface.";
+ }
+
+ leaf pim-passive-enable {
+ type boolean;
+ default "false";
+ description
+ "Disable exchange of protocol packets.";
+ }
+
+ leaf hello-interval {
+ type uint16 {
+ range "1..max";
+ }
+ default "30";
+ description
+ "Hello interval";
+ }
+
+ leaf hello-holdtime {
+ type uint16 {
+ range "1..max";
+ }
+ must ". > ./../hello-interval" {
+ error-message "HoldTime must be greater than Hello";
+ }
+ description
+ "Hello holdtime";
+ }
+
+ container bfd {
+ presence
+ "Enable BFD support on the interface.";
+
+ leaf min-rx-interval {
+ type uint16 {
+ range "1..max";
+ }
+ default "300";
+ description
+ "Required min receive interval";
+ }
+
+ leaf min-tx-interval {
+ type uint16 {
+ range "1..max";
+ }
+ default "300";
+ description
+ "Desired min transmit interval";
+ }
+
+ leaf detect_mult {
+ type uint8 {
+ range "2..255";
+ }
+ default "3";
+ description
+ "Detect Multiplier";
+ }
+
+ leaf profile {
+ type string;
+ description
+ "Use a preconfigure BFD profile.";
+ }
+ }
+
+ leaf bsm {
+ type boolean;
+ default "true";
+ description
+ "Enables BSM support on the interface.";
+ }
+
+ leaf unicast-bsm {
+ type boolean;
+ default "true";
+ description
+ "Accept/Send unicast BSM on the interface.";
+ }
+
+ leaf active-active {
+ type boolean;
+ default "false";
+ description
+ "Mark interface as Active-Active for MLAG operations.";
+ }
+
+ leaf dr-priority {
+ type uint32 {
+ range "1..max";
+ }
+ default 1;
+ description
+ "DR (Designated Router) priority";
+ }
+
+ leaf use-source {
+ type inet:ip-address;
+ description
+ "Primary address of the interface set by user.";
+ }
+
+ leaf multicast-boundary-oil {
+ type plist-ref;
+ description
+ "Prefix-List to define multicast boundary";
+ }
+
+ list mroute {
+ key "source-addr group-addr";
+ description
+ "Add multicast route.";
+
+ leaf oif {
+ type frr-interface:interface-ref;
+ description
+ "Outgoing interface name.";
+ }
+
+ leaf source-addr {
+ type inet:ip-address;
+ description
+ "Multicast source address.";
+ }
+
+ leaf group-addr {
+ type rt-types:ip-multicast-group-address;
+ description
+ "Multicast group address.";
+ }
+ }
+ } // interface-pim-config-attributes
+
+ grouping router-pim-config-attributes {
+ description
+ "A grouping defining pim router attributes per address family.";
+ leaf packets {
+ type uint8 {
+ range "1..max";
+ }
+ default "3";
+ description
+ "Number of packets to process at one time per fd.";
+ }
+ leaf join-prune-interval {
+ type uint16 {
+ range "1..max";
+ }
+ default "60";
+ description
+ "Join Prune Send Interval in seconds.";
+ }
+ leaf register-suppress-time {
+ type uint16 {
+ range "1..max";
+ }
+ default "60";
+ description
+ "Register Suppress Timer.";
+ }
+ }
+
+ /*
+ * Global Configuration data nodes
+ */
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/"
+ + "frr-rt:control-plane-protocol" {
+ container pim {
+ when "../frr-rt:type = 'frr-pim:pimd'" {
+ description
+ "This container is only valid for the 'pim' routing
+ protocol.";
+ }
+ description
+ "PIM configuration data.";
+ list address-family {
+ key "address-family";
+ description
+ "Each list entry for one address family.";
+ uses frr-rt:address-family;
+ uses global-pim-config-attributes;
+
+ } //address-family
+ } // pim
+ } // augment
+
+ /*
+ * Per-interface configuration data
+ */
+ augment "/frr-interface:lib/frr-interface:interface" {
+ container pim {
+ list address-family {
+ key "address-family";
+ description
+ "Each list entry for one address family.";
+ uses frr-rt:address-family;
+ uses interface-pim-config-attributes;
+ }
+ }
+ }
+
+ /*
+ * Router configuration data
+ */
+ container pim {
+ description
+ "PIM router parameters.";
+ list address-family {
+ key "address-family";
+ description
+ "Each list entry for one address family.";
+ uses frr-rt:address-family;
+ uses router-pim-config-attributes;
+ }
+ }
+}
diff --git a/yang/frr-ripd.yang b/yang/frr-ripd.yang
new file mode 100644
index 0000000..5f85a4c
--- /dev/null
+++ b/yang/frr-ripd.yang
@@ -0,0 +1,768 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-ripd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/ripd";
+ prefix frr-ripd;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import frr-if-rmap {
+ prefix frr-if-rmap;
+ }
+ import frr-bfdd {
+ prefix frr-bfdd;
+ }
+ import frr-interface {
+ prefix frr-interface;
+ }
+ import frr-nexthop {
+ prefix frr-nexthop;
+ }
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR ripd daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-09-09 {
+ description
+ "Changed interface references to use
+ frr-interface:interface-ref typedef";
+ reference "FRRouting";
+ }
+ revision 2017-12-06 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 1058: Routing Information Protocol.
+ RFC 2453: RIP Version 2.";
+ }
+
+ typedef rip-route-type {
+ type enumeration {
+ enum normal {
+ value 0;
+ description "Normal RIP route type.";
+ }
+ enum static {
+ value 1;
+ description "Static RIP route type.";
+ }
+ enum default {
+ value 2;
+ description "Default RIP route type.";
+ }
+ enum redistribute {
+ value 3;
+ description "Redistribute RIP route type.";
+ }
+ enum interface {
+ value 4;
+ description "Interface RIP route type.";
+ }
+ }
+ description
+ "Types of RIP routes.";
+ }
+
+ container ripd {
+ description "rip routing instance data";
+ list instance {
+ key "vrf";
+ description
+ "RIP routing instance.";
+
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "VRF name.";
+ }
+ leaf allow-ecmp {
+ type uint8;
+ default 0;
+ description
+ "Allow equal-cost multi-path.";
+ }
+ leaf default-information-originate {
+ type boolean;
+ default "false";
+ description
+ "Control distribution of default route.";
+ }
+ leaf default-metric {
+ type uint8 {
+ range "1..16";
+ }
+ default "1";
+ description
+ "Default metric of redistributed routes.";
+ }
+ container distance {
+ description
+ "Administrative distance.";
+ leaf default {
+ type uint8 {
+ range "0..255";
+ }
+ default "0";
+ description
+ "Default administrative distance.";
+ }
+ list source {
+ key "prefix";
+ description
+ "Custom administrative distance per IP prefix.";
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "Prefix.";
+ }
+ leaf distance {
+ type uint8 {
+ range "1..255";
+ }
+ mandatory true;
+ description
+ "Administrative distance.";
+ }
+ leaf access-list {
+ type string;
+ description
+ "Access-list name.";
+ }
+ }
+ }
+ leaf-list explicit-neighbor {
+ type inet:ipv4-address;
+ description
+ "Specifies the RIP neighbors. Useful for a
+ non-broadcast multiple access (NBMA) network.";
+ }
+ leaf-list network {
+ type inet:ipv4-prefix;
+ description
+ "Enable RIP on the specified IP network.";
+ }
+ leaf-list interface {
+ type frr-interface:interface-ref;
+ description
+ "Enable RIP on the specified interface.";
+ }
+ list offset-list {
+ key "interface direction";
+ description
+ "Offset-list to modify route metric.";
+ leaf interface {
+ type union {
+ type frr-interface:interface-ref;
+ type enumeration {
+ enum '*' {
+ description
+ "Match all interfaces.";
+ }
+ }
+ }
+ description
+ "Interface to match. Use '*' to match all interfaces.";
+ }
+ leaf direction {
+ type enumeration {
+ enum in {
+ value 0;
+ description
+ "Incoming updates.";
+ }
+ enum out {
+ value 1;
+ description
+ "Outgoing updates.";
+ }
+ }
+ description
+ "Incoming or outgoing updates.";
+ }
+ leaf access-list {
+ type string;
+ mandatory true;
+ description
+ "Access-list name.";
+ }
+ leaf metric {
+ type uint8 {
+ range "0..16";
+ }
+ mandatory true;
+ description
+ "Route metric.";
+ }
+ }
+ leaf passive-default {
+ type boolean;
+ default "false";
+ description
+ "Control whether interfaces are in the passive mode
+ by default or not.";
+ }
+ leaf-list passive-interface {
+ when "../passive-default = 'false'";
+ type frr-interface:interface-ref;
+ description
+ "A list of interfaces where the sending of RIP packets
+ is disabled.";
+ }
+ leaf-list non-passive-interface {
+ when "../passive-default = 'true'";
+ type frr-interface:interface-ref;
+ description
+ "A list of interfaces where the sending of RIP packets
+ is enabled.";
+ }
+ list redistribute {
+ key "protocol";
+ description
+ "Redistributes routes learned from other routing protocols.";
+ leaf protocol {
+ type frr-route-types:frr-route-types-v4;
+ must '. != "rip"';
+ description
+ "Routing protocol.";
+ }
+ leaf route-map {
+ type frr-route-map:route-map-ref;
+ description
+ "Applies the conditions of the specified route-map to
+ routes that are redistributed into the RIP routing
+ instance.";
+ }
+ leaf metric {
+ type uint8 {
+ range "0..16";
+ }
+ description
+ "Metric used for the redistributed route. If a metric is
+ not specified, the metric configured with the
+ default-metric attribute in RIP router configuration is
+ used. If the default-metric attribute has not been
+ configured, the default metric for redistributed routes
+ is 0.";
+ }
+ }
+
+ uses frr-if-rmap:if-route-maps-group;
+
+ leaf-list static-route {
+ type inet:ipv4-prefix;
+ description
+ "RIP static routes.";
+ }
+ container timers {
+ description
+ "Settings of basic timers";
+ leaf flush-interval {
+ type uint32 {
+ range "5..2147483647";
+ }
+ units "seconds";
+ default "120";
+ description
+ "Interval before a route is flushed from the routing
+ table.";
+ }
+ leaf holddown-interval {
+ type uint32 {
+ range "5..2147483647";
+ }
+ units "seconds";
+ default "180";
+ description
+ "Interval before better routes are released.";
+ }
+ leaf update-interval {
+ type uint32 {
+ range "5..2147483647";
+ }
+ units "seconds";
+ default "30";
+ description
+ "Interval at which RIP updates are sent.";
+ }
+ }
+ container version {
+ description "version of rip";
+ leaf receive {
+ type enumeration {
+ enum "1" {
+ value 1;
+ description
+ "Accept RIPv1 updates only.";
+ }
+ enum "2" {
+ value 2;
+ description
+ "Accept RIPv2 updates only.";
+ }
+ enum "1-2" {
+ value 3;
+ description
+ "Accept both RIPv1 and RIPv2 updates.";
+ }
+ }
+ must
+ '(. = "1" and ../send = "1") or ' +
+ '(. = "2" and ../send = "2") or ' +
+ '(. = "1-2" and ../send = "2")';
+ default "1-2";
+ description
+ "Advertisement reception - Version control.";
+ }
+ leaf send {
+ type enumeration {
+ enum "1" {
+ value 1;
+ description
+ "Send RIPv1 updates only.";
+ }
+ enum "2" {
+ value 2;
+ description
+ "Send RIPv2 updates only.";
+ }
+ }
+ must
+ '(../receive = "1" and . = "1") or ' +
+ '(../receive = "2" and . = "2") or ' +
+ '(../receive = "1-2" and . = "2")';
+ default "2";
+ description
+ "Advertisement transmission - Version control.";
+ }
+ }
+
+ leaf default-bfd-profile {
+ description
+ "Use this BFD profile for all peers by default.";
+ type frr-bfdd:profile-ref;
+ }
+
+ /*
+ * Operational data.
+ */
+ container state {
+ config false;
+ description
+ "Operational data.";
+
+ container neighbors {
+ description
+ "Neighbor information.";
+ list neighbor {
+ key "address";
+ description
+ "A RIP neighbor.";
+ leaf address {
+ type inet:ipv4-address;
+ description
+ "IP address that a RIP neighbor is using as its
+ source address.";
+ }
+ leaf last-update {
+ type yang:date-and-time;
+ description
+ "The time when the most recent RIP update was
+ received from this neighbor.";
+ }
+ leaf bad-packets-rcvd {
+ type yang:counter32;
+ description
+ "The number of RIP invalid packets received from
+ this neighbor which were subsequently discarded
+ for any reason (e.g. a version 0 packet, or an
+ unknown command type).";
+ }
+ leaf bad-routes-rcvd {
+ type yang:counter32;
+ description
+ "The number of routes received from this neighbor,
+ in valid RIP packets, which were ignored for any
+ reason (e.g. unknown address family, or invalid
+ metric).";
+ }
+ }
+ }
+ container routes {
+ description
+ "Route information.";
+ list route {
+ key "prefix";
+ description
+ "A RIP IPv4 route.";
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "IP address (in the form A.B.C.D) and prefix length,
+ separated by the slash (/) character. The range of
+ values for the prefix-length is 0 to 32.";
+ }
+ container nexthops {
+ description "container of nexthops";
+ list nexthop {
+ description "A list of nexthop objects.";
+ leaf nh-type {
+ type frr-nexthop:nexthop-type;
+ mandatory true;
+ description
+ "The nexthop type.";
+ }
+ leaf protocol {
+ type frr-route-types:frr-route-types-v4;
+ description
+ "The protocol originating this route.";
+ }
+ leaf rip-type {
+ type rip-route-type;
+ description
+ "The RIP type of route.";
+ }
+ leaf gateway {
+ type inet:ipv4-address;
+ description
+ "The nexthop gateway address.";
+ }
+ leaf interface {
+ type frr-interface:interface-ref;
+ description
+ "The nexthop egress interface.";
+ }
+ leaf from {
+ type inet:ipv4-address;
+ description
+ "The nexthop gateway address.";
+ }
+ leaf tag {
+ type uint32;
+ default "0";
+ description
+ "Route tag";
+ }
+ leaf external-metric {
+ type uint32;
+ description
+ "External metric if learned from external protocol.";
+ }
+ leaf expire-time {
+ type uint32;
+ description
+ "Seconds before route expires.";
+ }
+ }
+ }
+ leaf metric {
+ type uint8 {
+ range "0..16";
+ }
+ description
+ "Route metric.";
+ }
+ /*
+ * Replaced by container `nexthops` above.
+ */
+ leaf next-hop {
+ type inet:ipv4-address;
+ status deprecated;
+ description
+ "Next hop IPv4 address.";
+ }
+ leaf interface {
+ type frr-interface:interface-ref;
+ status deprecated;
+ description
+ "The interface that the route uses.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * Per-interface configuration data
+ */
+ augment "/frr-interface:lib/frr-interface:interface" {
+ description "rip interface data";
+ container rip {
+ description
+ "RIP interface parameters.";
+ leaf split-horizon {
+ type enumeration {
+ enum "disabled" {
+ value 0;
+ description
+ "Disables split-horizon processing.";
+ }
+ enum "simple" {
+ value 1;
+ description
+ "Enables simple split-horizon processing.";
+ }
+ enum "poison-reverse" {
+ value 2;
+ description
+ "Enables split-horizon processing with poison
+ reverse.";
+ }
+ }
+ default "simple";
+ description
+ "Controls RIP split-horizon processing on the specified
+ interface.";
+ }
+ leaf v2-broadcast {
+ type boolean;
+ default "false";
+ description
+ "Send IP broadcast v2 update.";
+ }
+ leaf version-receive {
+ type enumeration {
+ enum "unspecified" {
+ value 0;
+ description
+ "Inherit configuration from the routing instance.";
+ }
+ enum "1" {
+ value 1;
+ description
+ "Accept RIPv1 updates only.";
+ }
+ enum "2" {
+ value 2;
+ description
+ "Accept RIPv2 updates only.";
+ }
+ enum "both" {
+ value 3;
+ description
+ "Accept both RIPv1 and RIPv2 updates.";
+ }
+ enum "none" {
+ value 4;
+ description
+ "Do not accept neither RIPv1 nor RIPv2 updates.";
+ }
+ }
+ default "unspecified";
+ description
+ "Advertisement reception - Version control.";
+ }
+ leaf version-send {
+ type enumeration {
+ enum "unspecified" {
+ value 0;
+ description
+ "Inherit configuration from the routing instance.";
+ }
+ enum "1" {
+ value 1;
+ description
+ "Send RIPv1 updates only.";
+ }
+ enum "2" {
+ value 2;
+ description
+ "Send RIPv2 updates only.";
+ }
+ enum "both" {
+ value 3;
+ description
+ "Send both RIPv1 and RIPv2 updates.";
+ }
+ enum "none" {
+ value 4;
+ description
+ "Do not send neither RIPv1 nor RIPv2 updates.";
+ }
+ }
+ default "unspecified";
+ description
+ "Advertisement transmission - Version control.";
+ }
+ container authentication-scheme {
+ description
+ "Specify the authentication scheme for the RIP interface";
+ leaf mode {
+ type enumeration {
+ enum "none" {
+ value 0;
+ description
+ "No authentication.";
+ }
+ enum "plain-text" {
+ value 2;
+ description
+ "Plain-text authentication.";
+ }
+ enum "md5" {
+ value 3;
+ description
+ "MD5 authentication.";
+ }
+ }
+ default "none";
+ description
+ "Specify the authentication mode.";
+ }
+ leaf md5-auth-length {
+ when "../mode = 'md5'";
+ type enumeration {
+ enum "16" {
+ value 16;
+ description
+ "RFC compatible.";
+ }
+ enum "20" {
+ value 20;
+ description
+ "Old ripd compatible.";
+ }
+ }
+ default "20";
+ description
+ "MD5 authentication data length.";
+ }
+ }
+ choice authentication-data {
+ description
+ "Choose whether to use a simple password or a key-chain.";
+ leaf authentication-password {
+ type string {
+ length "1..16";
+ }
+ description
+ "Authentication string.";
+ }
+ leaf authentication-key-chain {
+ type string;
+ description
+ "Key-chain name.";
+ }
+ }
+
+ container bfd-monitoring {
+ presence
+ "Present if BFD is configured for RIP peers in this interface.";
+
+ leaf enable {
+ type boolean;
+ description
+ "Enable/disable BFD monitoring.";
+ default false;
+ }
+
+ leaf profile {
+ type frr-bfdd:profile-ref;
+ description
+ "BFD profile to use.";
+ }
+ }
+ }
+ }
+
+ /*
+ * RPCs
+ */
+ rpc clear-rip-route {
+ description
+ "Clears RIP routes from the IP routing table and routes
+ redistributed into the RIP protocol.";
+
+ input {
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "VRF name identifying a specific RIP instance.
+ This leaf is optional for the rpc.
+ If it is specified, the rpc will clear all routes in the
+ specified RIP instance;
+ if it is not specified, the rpc will clear all routes in
+ all RIP instances.";
+ }
+ }
+ }
+
+ /*
+ * Notifications
+ */
+ notification authentication-type-failure {
+ description
+ "This notification is sent when the system
+ receives a PDU with the wrong authentication type
+ field.";
+ leaf interface-name {
+ type frr-interface:interface-ref;
+ description
+ "Describes the name of the RIP interface.";
+ }
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+ }
+ notification authentication-failure {
+ description
+ "This notification is sent when the system
+ receives a PDU with the wrong authentication
+ information.";
+ leaf interface-name {
+ type frr-interface:interface-ref;
+ description
+ "Describes the name of the RIP interface.";
+ }
+ leaf raw-pdu {
+ type binary;
+ description
+ "Received raw PDU.";
+ }
+ }
+}
diff --git a/yang/frr-ripngd.yang b/yang/frr-ripngd.yang
new file mode 100644
index 0000000..4aeaf36
--- /dev/null
+++ b/yang/frr-ripngd.yang
@@ -0,0 +1,384 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-ripngd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/ripngd";
+ prefix frr-ripngd;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import frr-if-rmap {
+ prefix frr-if-rmap;
+ }
+ import frr-interface {
+ prefix frr-interface;
+ }
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR ripngd daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-09-09 {
+ description
+ "Changed interface references to use
+ frr-interface:interface-ref typedef";
+ }
+ revision 2018-11-27 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 2080: RIPng for IPv6.";
+ }
+
+ container ripngd {
+ /*
+ * Routing instance configuration.
+ */
+ list instance {
+ key "vrf";
+ description
+ "RIPng routing instance.";
+
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "VRF name.";
+ }
+ leaf allow-ecmp {
+ type uint8;
+ default 0;
+ description
+ "Allow equal-cost multi-path.";
+ }
+ leaf default-information-originate {
+ type boolean;
+ default "false";
+ description
+ "Control distribution of default route.";
+ }
+ leaf default-metric {
+ type uint8 {
+ range "1..16";
+ }
+ default "1";
+ description
+ "Default metric of redistributed routes.";
+ }
+ leaf-list network {
+ type inet:ipv6-prefix;
+ description
+ "Enable RIPng on the specified IPv6 network.";
+ }
+ leaf-list interface {
+ type frr-interface:interface-ref;
+ description
+ "Enable RIPng on the specified interface.";
+ }
+ list offset-list {
+ key "interface direction";
+ description
+ "Offset-list to modify route metric.";
+ leaf interface {
+ type union {
+ type frr-interface:interface-ref;
+ type enumeration {
+ enum '*' {
+ description
+ "Match all interfaces.";
+ }
+ }
+ }
+ description
+ "Interface to match. Use '*' to match all interfaces.";
+ }
+ leaf direction {
+ type enumeration {
+ enum in {
+ value 0;
+ description
+ "Incoming updates.";
+ }
+ enum out {
+ value 1;
+ description
+ "Outgoing updates.";
+ }
+ }
+ description
+ "Incoming or outgoing updates.";
+ }
+ leaf access-list {
+ type string;
+ mandatory true;
+ description
+ "Access-list name.";
+ }
+ leaf metric {
+ type uint8 {
+ range "0..16";
+ }
+ mandatory true;
+ description
+ "Route metric.";
+ }
+ }
+ leaf-list passive-interface {
+ type frr-interface:interface-ref;
+ description
+ "A list of interfaces where the sending of RIPng packets
+ is disabled.";
+ }
+ list redistribute {
+ key "protocol";
+ description
+ "Redistributes routes learned from other routing protocols.";
+ leaf protocol {
+ type frr-route-types:frr-route-types-v6;
+ description
+ "Routing protocol.";
+ must '. != "ripng"';
+ }
+ leaf route-map {
+ type frr-route-map:route-map-ref;
+ description
+ "Applies the conditions of the specified route-map to
+ routes that are redistributed into the RIPng routing
+ instance.";
+ }
+ leaf metric {
+ type uint8 {
+ range "0..16";
+ }
+ description
+ "Metric used for the redistributed route. If a metric is
+ not specified, the metric configured with the
+ default-metric attribute in RIPng router configuration is
+ used. If the default-metric attribute has not been
+ configured, the default metric for redistributed routes
+ is 0.";
+ }
+ }
+
+ uses frr-if-rmap:if-route-maps-group;
+
+ leaf-list static-route {
+ type inet:ipv6-prefix;
+ description
+ "RIPng static routes.";
+ }
+ leaf-list aggregate-address {
+ type inet:ipv6-prefix;
+ description
+ "RIPng aggregate route announcement.";
+ }
+ container timers {
+ description
+ "Settings of basic timers";
+ leaf flush-interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ default "120";
+ description
+ "Interval before a route is flushed from the routing
+ table.";
+ }
+ leaf holddown-interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ default "180";
+ description
+ "Interval before better routes are released.";
+ }
+ leaf update-interval {
+ type uint16 {
+ range "1..65535";
+ }
+ units "seconds";
+ default "30";
+ description
+ "Interval at which RIPng updates are sent.";
+ }
+ }
+
+ /*
+ * Operational data.
+ */
+ container state {
+ config false;
+ description
+ "Operational data.";
+
+ container neighbors {
+ description
+ "Neighbor information.";
+ list neighbor {
+ key "address";
+ description
+ "A RIPng neighbor.";
+ leaf address {
+ type inet:ipv6-address;
+ description
+ "IPv6 address that a RIPng neighbor is using as its
+ source address.";
+ }
+ leaf last-update {
+ type yang:date-and-time;
+ description
+ "The time when the most recent RIPng update was
+ received from this neighbor.";
+ }
+ leaf bad-packets-rcvd {
+ type yang:counter32;
+ description
+ "The number of RIPng invalid packets received from
+ this neighbor which were subsequently discarded
+ for any reason (e.g. a version 0 packet, or an
+ unknown command type).";
+ }
+ leaf bad-routes-rcvd {
+ type yang:counter32;
+ description
+ "The number of routes received from this neighbor,
+ in valid RIPng packets, which were ignored for any
+ reason (e.g. unknown address family, or invalid
+ metric).";
+ }
+ }
+ }
+ container routes {
+ description
+ "Route information.";
+ list route {
+ key "prefix";
+ description
+ "A RIPng IPv6 route.";
+ leaf prefix {
+ type inet:ipv6-prefix;
+ description
+ "IPv6 address and prefix length, in the format
+ specified in RFC6991.";
+ }
+ leaf next-hop {
+ type inet:ipv6-address;
+ description
+ "Next hop IPv6 address.";
+ }
+ leaf interface {
+ type frr-interface:interface-ref;
+ description
+ "The interface that the route uses.";
+ }
+ leaf metric {
+ type uint8 {
+ range "0..16";
+ }
+ description
+ "Route metric.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * Per-interface configuration data
+ */
+ augment "/frr-interface:lib/frr-interface:interface" {
+ container ripng {
+ description
+ "RIPng interface parameters.";
+ leaf split-horizon {
+ type enumeration {
+ enum "disabled" {
+ value 0;
+ description
+ "Disables split-horizon processing.";
+ }
+ enum "simple" {
+ value 1;
+ description
+ "Enables simple split-horizon processing.";
+ }
+ enum "poison-reverse" {
+ value 2;
+ description
+ "Enables split-horizon processing with poison
+ reverse.";
+ }
+ }
+ default "simple";
+ description
+ "Controls RIPng split-horizon processing on the specified
+ interface.";
+ }
+ }
+ }
+
+ /*
+ * RPCs
+ */
+ rpc clear-ripng-route {
+ description
+ "Clears RIPng routes from the IPv6 routing table and routes
+ redistributed into the RIPng protocol.";
+
+ input {
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "VRF name identifying a specific RIPng instance.
+ This leaf is optional for the rpc.
+ If it is specified, the rpc will clear all routes in the
+ specified RIPng instance;
+ if it is not specified, the rpc will clear all routes in
+ all RIPng instances.";
+ }
+ }
+ }
+}
diff --git a/yang/frr-route-map.yang b/yang/frr-route-map.yang
new file mode 100644
index 0000000..7cb13b6
--- /dev/null
+++ b/yang/frr-route-map.yang
@@ -0,0 +1,542 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-route-map {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/route-map";
+ prefix frr-route-map;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-filter {
+ prefix filter;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines route map settings
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-07-01 {
+ description
+ "Initial revision";
+ }
+
+ identity rmap-match-type {
+ description
+ "Base route-map match-condition";
+ }
+
+ identity interface {
+ base rmap-match-type;
+ description
+ "Match interface";
+ }
+
+ identity ipv4-address-list {
+ base rmap-match-type;
+ description
+ "Match an IPv4 access-list";
+ }
+
+ identity ipv4-prefix-list {
+ base rmap-match-type;
+ description
+ "Match an IPv4 prefix-list";
+ }
+
+ identity ipv4-next-hop-list {
+ base rmap-match-type;
+ description
+ "Match an IPv4 next-hop";
+ }
+
+ identity ipv4-next-hop-prefix-list {
+ base rmap-match-type;
+ description
+ "Match an IPv4 next-hop prefix list";
+ }
+
+ identity ipv4-next-hop-type {
+ base rmap-match-type;
+ description
+ "Match an IPv4 next-hop type";
+ }
+
+ identity ipv6-address-list {
+ base rmap-match-type;
+ description
+ "Match an IPv6 access-list";
+ }
+
+ identity ipv6-prefix-list {
+ base rmap-match-type;
+ description
+ "Match an IPv6 prefix-list";
+ }
+
+ identity ipv6-next-hop-list {
+ base rmap-match-type;
+ description
+ "Match an IPv6 next-hop";
+ }
+
+ identity ipv6-next-hop-prefix-list {
+ base rmap-match-type;
+ description
+ "Match an IPv6 next-hop prefix list";
+ }
+
+ identity ipv6-next-hop-type {
+ base rmap-match-type;
+ description
+ "Match an IPv6 next-hop type";
+ }
+
+ identity match-metric {
+ base rmap-match-type;
+ description
+ "Match a route metric";
+ }
+
+ identity match-tag {
+ base rmap-match-type;
+ description
+ "Match a route tag";
+ }
+
+ identity rmap-set-type {
+ description
+ "Base route-map set-action";
+ }
+
+ identity ipv4-next-hop {
+ base rmap-set-type;
+ description
+ "Set IPv4 address of the next hop";
+ }
+
+ identity ipv6-next-hop {
+ base rmap-set-type;
+ description
+ "Set IPv6 address of the next hop";
+ }
+
+ identity set-metric {
+ base rmap-set-type;
+ description
+ "Set prefix/route metric";
+ }
+
+ identity set-min-metric {
+ base rmap-set-type;
+ description
+ "Set minimum prefix/route metric";
+ }
+
+ identity set-max-metric {
+ base rmap-set-type;
+ description
+ "Set maximum prefix/route metric";
+ }
+
+ identity set-tag {
+ base rmap-set-type;
+ description
+ "Set tag";
+ }
+
+ identity set-sr-te-color {
+ base rmap-set-type;
+ description
+ "Set Color of the SR-TE";
+ }
+
+ typedef route-map-sequence {
+ type uint16 {
+ range "1..65535";
+ }
+ description
+ "Route map valid sequence numbers";
+ }
+
+ typedef route-map-name {
+ type string;
+ description
+ "Route map name format";
+ }
+
+ typedef route-map-ref {
+ type leafref {
+ path "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:name";
+ require-instance false;
+ }
+ description
+ "Reference to a route-map.";
+ }
+
+ grouping rmap-match-condition {
+ container rmap-match-condition {
+ choice match-condition {
+ description
+ "Value to match (interpretation depends on condition type)";
+ case interface {
+ when "derived-from-or-self(../condition, 'interface')";
+ leaf interface {
+ type frr-interface:interface-ref;
+ }
+ }
+
+ case list-name {
+ when "derived-from-or-self(../condition, 'ipv4-address-list') or "
+ + "derived-from-or-self(../condition, 'ipv4-prefix-list') or "
+ + "derived-from-or-self(../condition, 'ipv4-next-hop-list') or "
+ + "derived-from-or-self(../condition, 'ipv4-next-hop-prefix-list') or "
+ + "derived-from-or-self(../condition, 'ipv6-address-list') or "
+ + "derived-from-or-self(../condition, 'ipv6-next-hop-list') or "
+ + "derived-from-or-self(../condition, 'ipv6-next-hop-prefix-list') or "
+ + "derived-from-or-self(../condition, 'ipv6-prefix-list')";
+ leaf list-name {
+ type filter:access-list-name;
+ }
+ }
+
+ case ipv4-next-hop-type {
+ when "derived-from-or-self(../condition, 'ipv4-next-hop-type')";
+ leaf ipv4-next-hop-type {
+ type enumeration {
+ enum "blackhole" {
+ value 0;
+ }
+ }
+ }
+ }
+
+ case ipv6-next-hop-type {
+ when "derived-from-or-self(../condition, 'ipv6-next-hop-type')";
+ leaf ipv6-next-hop-type {
+ type enumeration {
+ enum "blackhole" {
+ value 0;
+ }
+ }
+ }
+ }
+
+ case match-metric {
+ when "derived-from-or-self(../condition, 'match-metric')";
+ leaf metric {
+ type uint32 {
+ range "1..4294967295";
+ }
+ }
+ }
+
+ case match-tag {
+ when "derived-from-or-self(../condition, 'match-tag')";
+ leaf tag {
+ type uint32 {
+ range "1..4294967295";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ grouping rmap-set-action {
+ container rmap-set-action {
+ choice set-action {
+ description
+ "Value to set (interpretation depends on action-type)";
+ case ipv4-address {
+ when "derived-from-or-self(../action, 'ipv4-next-hop')";
+ leaf ipv4-address {
+ type inet:ipv4-address;
+ description
+ "IPv4 address";
+ }
+ }
+
+ case ipv6-address {
+ when "derived-from-or-self(../action, 'ipv6-next-hop')";
+ leaf ipv6-address {
+ type inet:ipv6-address;
+ description
+ "IPv6 address";
+ }
+ }
+
+ case set-metric {
+ when "derived-from-or-self(../action, 'set-metric')";
+ choice metric-value {
+ description
+ "Metric to set or use";
+ case value {
+ leaf value {
+ type uint32 {
+ range "0..4294967295";
+ }
+ description
+ "Use the following metric value";
+ }
+ }
+
+ case add-metric {
+ leaf add-metric {
+ description "Add value to metric.";
+ type uint32 {
+ range "0..4294967295";
+ }
+ }
+ }
+
+ case subtract-metric {
+ leaf subtract-metric {
+ description "Subtract value from metric.";
+ type uint32 {
+ range "0..4294967295";
+ }
+ }
+ }
+
+ case use-round-trip-time {
+ leaf use-round-trip-time {
+ type boolean;
+ description
+ "Use the round trip time as metric";
+ }
+ }
+
+ case add-round-trip-time {
+ leaf add-round-trip-time {
+ type boolean;
+ description
+ "Add round trip time to metric";
+ }
+ }
+
+ case subtract-round-trip-time {
+ leaf subtract-round-trip-time {
+ type boolean;
+ description
+ "Subtract round trip time to metric";
+ }
+ }
+ }
+ }
+
+ case set-min-metric {
+ when "derived-from-or-self(../action, 'set-min-metric')";
+ choice minimun-metric-value {
+ description
+ "Mimimum metric to set or use";
+ case min-metric {
+ leaf min-metric {
+ type uint32 {
+ range "0..4294967295";
+ }
+ description
+ "Use the following mimumn metric value";
+ }
+ }
+ }
+ }
+
+ case set-max-metric {
+ when "derived-from-or-self(../action, 'set-max-metric')";
+ choice maximum-metric-value {
+ description
+ "Maximum metric to set or use";
+ case max-metric {
+ leaf max-metric {
+ type uint32 {
+ range "0..4294967295";
+ }
+ description
+ "Use the following maximum metric value";
+ }
+ }
+ }
+ }
+ case set-tag {
+ when "derived-from-or-self(../action, 'set-tag')";
+ leaf tag {
+ type uint32 {
+ range "0..4294967295";
+ }
+ description
+ "Tag value";
+ }
+ }
+
+ case set-sr-te-color {
+ when "derived-from-or-self(../action, 'set-sr-te-color')";
+ leaf policy {
+ type string;
+ description
+ "Color of the SR-TE Policies to match with";
+ }
+ }
+ }
+ }
+ }
+
+ container lib {
+ list route-map {
+ key "name";
+ description
+ "Route map instance";
+ leaf name {
+ type route-map-name;
+ description
+ "Route map instance name";
+ }
+ leaf optimization-disabled {
+ type boolean;
+ default false;
+ description "Disables or enables the optimization";
+ }
+
+ list entry {
+ key "sequence";
+ description
+ "Route map entry";
+ leaf sequence {
+ type route-map-sequence;
+ description
+ "Route map instance priority (low number means higher priority)";
+ }
+
+ leaf description {
+ type string;
+ description
+ "Route map description";
+ }
+
+ leaf action {
+ type enumeration {
+ enum "permit" {
+ value 0;
+ description
+ "Executes configured action and permits the prefix/route
+ if the conditions matched. An alternative exit action can
+ be configured to continue processing the route map list
+ or jump to process another route map.";
+ }
+ enum "deny" {
+ value 1;
+ description
+ "If all conditions are met the prefix/route is denied and
+ route map processing stops.";
+ }
+ }
+ mandatory true;
+ description
+ "Route map actions: permit (executes action), deny (quits evaluation)";
+ }
+
+ leaf call {
+ type route-map-name;
+ description
+ "Call another route map before calling `exit-policy`. If the
+ called route map returns deny then this route map will also
+ return deny";
+ }
+
+ leaf exit-policy {
+ type enumeration {
+ enum "permit-or-deny" {
+ value 0;
+ description
+ "End route map evaluation and return";
+ }
+ enum "next" {
+ value 1;
+ description
+ "Proceed evaluating next route map entry per sequence";
+ }
+ enum "goto" {
+ value 2;
+ description
+ "Go to route map entry with the provided sequence number";
+ }
+ }
+ default "permit-or-deny";
+ description
+ "What do to after route map successful match, set and call";
+ }
+
+ leaf goto-value {
+ when "../exit-policy = 'goto'";
+ type route-map-sequence;
+ mandatory true;
+ description
+ "Sequence number to jump (when using `goto` exit policy)";
+ }
+
+ list match-condition {
+ key "condition";
+ description
+ "Route map match conditions";
+ leaf condition {
+ type identityref {
+ base rmap-match-type;
+ }
+ description
+ "Match condition";
+ }
+
+ uses rmap-match-condition;
+ }
+
+ list set-action {
+ key "action";
+ description
+ "Route map set actions";
+ leaf action {
+ type identityref {
+ base rmap-set-type;
+ }
+ description
+ "Action to do when the route map matches";
+ }
+
+ uses rmap-set-action;
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-route-types.yang b/yang/frr-route-types.yang
new file mode 100644
index 0000000..728607c
--- /dev/null
+++ b/yang/frr-route-types.yang
@@ -0,0 +1,182 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-route-types {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/route-types";
+ prefix frr-route-types;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines typedefs for route types.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2018-03-28 {
+ description
+ "Initial revision.";
+ }
+
+ typedef frr-route-types-v4 {
+ type enumeration {
+ enum kernel {
+ value 1;
+ }
+ enum connected {
+ value 2;
+ }
+ enum static {
+ value 3;
+ }
+ enum rip {
+ value 4;
+ }
+ enum ospf {
+ value 6;
+ }
+ enum isis {
+ value 8;
+ }
+ enum bgp {
+ value 9;
+ }
+ enum eigrp {
+ value 11;
+ }
+ enum nhrp {
+ value 12;
+ }
+ enum table {
+ value 15;
+ }
+ enum vnc {
+ value 17;
+ }
+ enum vnc-direct {
+ value 18;
+ }
+ enum babel {
+ value 22;
+ }
+ enum sharp {
+ value 23;
+ }
+ enum openfabric {
+ value 26;
+ }
+ }
+ }
+
+ typedef frr-route-types-v6 {
+ type enumeration {
+ enum kernel {
+ value 1;
+ }
+ enum connected {
+ value 2;
+ }
+ enum static {
+ value 3;
+ }
+ enum ripng {
+ value 5;
+ }
+ enum ospf6 {
+ value 7;
+ }
+ enum isis {
+ value 8;
+ }
+ enum bgp {
+ value 9;
+ }
+ enum nhrp {
+ value 12;
+ }
+ enum table {
+ value 15;
+ }
+ enum vnc {
+ value 17;
+ }
+ enum vnc-direct {
+ value 18;
+ }
+ enum babel {
+ value 22;
+ }
+ enum sharp {
+ value 23;
+ }
+ enum openfabric {
+ value 26;
+ }
+ }
+ }
+
+ typedef frr-route-types {
+ description "Route types as enumerated in `lib/route_types.txt`";
+ type union {
+ type frr-route-types-v4;
+ type frr-route-types-v6;
+ }
+ }
+
+ typedef ipv4-multicast-group-prefix {
+ type inet:ipv4-prefix {
+ pattern '(2((2[4-9])|(3[0-9]))\.)(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(/(([4-9])|([1-2][0-9])|(3[0-2])))';
+ }
+ description
+ "This type represents an IPv4 multicast group prefix,
+ which is in the range from 224.0.0.0 to 239.255.255.255.";
+ }
+
+ typedef ipv6-multicast-group-prefix {
+ type inet:ipv6-prefix {
+ pattern
+ '(([fF]{2}[0-9a-fA-F]{2}):).*';
+ }
+ description
+ "This type represents an IPv6 multicast group prefix,
+ which is in the range of FF00::/8.";
+ }
+
+ typedef ip-multicast-group-prefix {
+ description "The IP-Multicast-Group-Address-Prefix type represents an IP multicast address
+ prefix and is IP version neutral. The format of the textual representations implies the IP
+ version. It includes a prefix-length, separated by a '/' sign.";
+ type union {
+ type ipv4-multicast-group-prefix;
+ type ipv6-multicast-group-prefix;
+ }
+ }
+}
diff --git a/yang/frr-routing.yang b/yang/frr-routing.yang
new file mode 100644
index 0000000..b304c24
--- /dev/null
+++ b/yang/frr-routing.yang
@@ -0,0 +1,260 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-routing {
+ yang-version "1.1";
+ namespace "http://frrouting.org/yang/routing";
+ prefix "frr-routing";
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+
+ organization
+ "FRRouting";
+
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+
+ description
+ "This YANG module defines essential components for the management
+ of a routing subsystem.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-08-15 {
+ description
+ "Initial revision.";
+ }
+
+ /* Identities */
+
+ identity address-family {
+ description
+ "Base identity from which identities describing address
+ families are derived.";
+ }
+
+ identity ipv4 {
+ base address-family;
+ description
+ "This identity represents an IPv4 address family.";
+ }
+
+ identity ipv6 {
+ base address-family;
+ description
+ "This identity represents an IPv6 address family.";
+ }
+
+ identity afi-safi-type {
+ description
+ "Base identity type (AFI,SAFI) tuples for RIB";
+ }
+
+ identity ipv4-unicast {
+ base afi-safi-type;
+ description
+ "This identity represents the IPv4 unicast address family.";
+ }
+
+ identity ipv6-unicast {
+ base afi-safi-type;
+ description
+ "This identity represents the IPv6 unicast address family.";
+ }
+
+ identity ipv4-multicast {
+ base afi-safi-type;
+ description
+ "This identity represents the IPv4 multicast address family.";
+ }
+
+ identity ipv6-multicast {
+ base afi-safi-type;
+ description
+ "This identity represents the IPv6 multicast address family.";
+ }
+
+ identity ipv4-labeled-unicast {
+ base afi-safi-type;
+ description
+ "This identity represents the IPv4 labeled unicast address family.";
+ }
+
+
+ identity ipv6-labeled-unicast {
+ base afi-safi-type;
+ description
+ "This identity represents the IPv6 labeled unicast address family.";
+ }
+
+
+ identity l3vpn-ipv4-unicast {
+ base afi-safi-type;
+ description
+ "This identity represents the L3vpn IPv4 unicast address family.";
+ }
+
+
+ identity l3vpn-ipv6-unicast {
+ base afi-safi-type;
+ description
+ "This identity represents the L3vpn IPv6 unicast address family.";
+ }
+
+
+ identity l3vpn-ipv4-multicast {
+ base afi-safi-type;
+ description
+ "This identity represents the L3vpn IPv4 multicast address family.";
+ }
+
+
+ identity l3vpn-ipv6-multicast {
+ base afi-safi-type;
+ description
+ "This identity represents the L3vpn IPv6 multicast address family.";
+ }
+
+
+ identity l2vpn-vpls {
+ base afi-safi-type;
+ description
+ "This identity represents the L2vpn VPLS address family.";
+ }
+
+
+ identity l2vpn-evpn {
+ base afi-safi-type;
+ description
+ "This identity represents the L2vpn EVPN address family.";
+ }
+
+
+ identity ipv4-flowspec {
+ base afi-safi-type;
+ description
+ "This identity represents the IPv4 flowspec address family.";
+ }
+
+
+ identity ipv6-flowspec {
+ base afi-safi-type;
+ description
+ "This identity represents the IPv6 flowspec address family.";
+ }
+
+
+ identity control-plane-protocol {
+ description
+ "Base identity from which control-plane protocol identities are
+ derived.";
+ }
+
+ identity routing-protocol {
+ base control-plane-protocol;
+ description
+ "Identity from which Layer 3 routing protocol identities are
+ derived.";
+ }
+
+ /* Type Definitions */
+
+ typedef administrative-distance {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Admin distance associated with the route.";
+ }
+
+ /* Groupings */
+
+ grouping address-family {
+ description
+ "This grouping provides a leaf identifying an address
+ family.";
+ leaf address-family {
+ type identityref {
+ base address-family;
+ }
+ mandatory true;
+ description
+ "Address family.";
+ }
+ }
+
+ grouping router-id {
+ description
+ "This grouping provides a router ID.";
+ leaf router-id {
+ type yang:dotted-quad;
+ description
+ "A 32-bit number in the form of a dotted quad that is used by
+ some routing protocols identifying a router.";
+ reference
+ "RFC 2328: OSPF Version 2";
+ }
+ }
+
+ /* Data nodes */
+
+ container routing {
+ description
+ "Configuration parameters for the routing subsystem.";
+ container control-plane-protocols {
+ description
+ "Support for control-plane protocol instances.";
+ list control-plane-protocol {
+ key "type name vrf";
+ description
+ "Each entry contains a control-plane protocol instance.";
+ leaf type {
+ type identityref {
+ base control-plane-protocol;
+ }
+ description
+ "Type of the control-plane protocol";
+ }
+ leaf name {
+ type string;
+ description
+ "An arbitrary name of the control-plane protocol
+ instance.";
+ }
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "vrf for control-plane protocol";
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-staticd.yang b/yang/frr-staticd.yang
new file mode 100644
index 0000000..1e6c54c
--- /dev/null
+++ b/yang/frr-staticd.yang
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-staticd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/staticd";
+ prefix frr-staticd;
+
+ import frr-routing {
+ prefix frr-rt;
+ }
+
+ import frr-nexthop {
+ prefix frr-nexthop;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-bfdd {
+ prefix frr-bfdd;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR staticd information.
+ This YANG module augments the ietf-routing with additional
+ nexthop information
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-03 {
+ description
+ "Initial revision.";
+ }
+
+ identity staticd {
+ base frr-rt:routing-protocol;
+ description
+ "'Staticd' routing pseudo-protocol.";
+ }
+
+ grouping staticd-prefix-attributes {
+ list path-list {
+ key "table-id distance";
+ leaf table-id {
+ type uint32;
+ description
+ "Table-id";
+ }
+
+ leaf distance {
+ type frr-rt:administrative-distance;
+ description
+ "Admin distance associated with this route.";
+ }
+
+ leaf tag {
+ type uint32;
+ default "0";
+ description
+ "Route tag";
+ }
+
+ uses frr-nexthop:frr-nexthop;
+ }
+ }
+
+ augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol" {
+ container staticd {
+ when "../frr-rt:type = 'frr-staticd:staticd'" {
+ description
+ "This container is only valid for the 'staticd' routing
+ protocol.";
+ }
+ description
+ "Support for a 'staticd' pseudo-protocol instance
+ consists of a list of routes.";
+ list route-list {
+ key "prefix afi-safi";
+ description
+ "List of staticd IP routes.";
+ leaf prefix {
+ type inet:ip-prefix;
+ description
+ "IP prefix.";
+ }
+ leaf afi-safi {
+ type identityref {
+ base frr-rt:afi-safi-type;
+ }
+ description
+ "AFI-SAFI type.";
+ }
+
+ uses staticd-prefix-attributes {
+ augment "path-list/frr-nexthops/nexthop" {
+ container bfd-monitoring {
+ description "BFD monitoring options.";
+ presence
+ "Present if BFD configuration is available.";
+
+ when "../nh-type = 'ip4' or ../nh-type = 'ip4-ifindex' or
+ ../nh-type = 'ip6' or ../nh-type = 'ip6-ifindex'";
+ uses frr-bfdd:bfd-monitoring;
+ }
+ }
+ }
+
+ list src-list {
+ key "src-prefix";
+ leaf src-prefix {
+ type inet:ipv6-prefix;
+ description
+ "IPv6 source prefix";
+ }
+
+ uses staticd-prefix-attributes;
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-test-module.yang b/yang/frr-test-module.yang
new file mode 100644
index 0000000..d6e7188
--- /dev/null
+++ b/yang/frr-test-module.yang
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-test-module {
+ yang-version 1.1;
+ namespace "urn:frr-test-module";
+ prefix frr-test-module;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ description
+ "FRRouting internal testing module.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2018-11-26 {
+ description
+ "Initial revision.";
+ }
+
+ container frr-test-module {
+ config false;
+ container vrfs {
+ list vrf {
+ key "name";
+
+ leaf name {
+ type string;
+ }
+ container interfaces {
+ leaf-list interface {
+ type frr-interface:interface-ref;
+ }
+ }
+ container routes {
+ list route {
+ leaf prefix {
+ type inet:ipv4-prefix;
+ }
+ leaf next-hop {
+ type inet:ipv4-address;
+ }
+ leaf interface {
+ type frr-interface:interface-ref;
+ }
+ leaf metric {
+ type uint8;
+ }
+ leaf active {
+ type empty;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-vrf.yang b/yang/frr-vrf.yang
new file mode 100644
index 0000000..39123b7
--- /dev/null
+++ b/yang/frr-vrf.yang
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-vrf {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/vrf";
+ prefix frr-vrf;
+
+ organization
+ "Free Range Routing";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR VRF.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-12-06 {
+ description
+ "Initial revision.";
+ }
+
+ typedef vrf-ref {
+ type leafref {
+ path "/frr-vrf:lib/frr-vrf:vrf/frr-vrf:name";
+ require-instance false;
+ }
+ description
+ "Reference to a VRF";
+ }
+
+ container lib {
+ list vrf {
+ key "name";
+ description
+ "VRF.";
+ leaf name {
+ type string {
+ length "1..36";
+ }
+ description
+ "VRF name.";
+ }
+
+ container state {
+ config false;
+ leaf id {
+ type uint32 {
+ range "0..4294967295";
+ }
+ description
+ "VRF Id.";
+ }
+
+ leaf active {
+ type boolean;
+ default "false";
+ description
+ "VRF active in kernel.";
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-vrrpd.yang b/yang/frr-vrrpd.yang
new file mode 100644
index 0000000..ad9f139
--- /dev/null
+++ b/yang/frr-vrrpd.yang
@@ -0,0 +1,293 @@
+// SPDX-License-Identifier: BSD-2-Clause
+module frr-vrrpd {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/vrrpd";
+ prefix frr-vrrpd;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing FRR vrrpd daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-09-09 {
+ description
+ "Initial revision.";
+ }
+
+ grouping ip-vrrp-config {
+ description
+ "Configuration data for VRRP on IP interfaces";
+ leaf virtual-router-id {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Set the virtual router id for use by the VRRP group. This
+ usually also determines the virtual MAC address that is
+ generated for the VRRP group";
+ }
+
+ leaf version {
+ type enumeration {
+ enum "2" {
+ value 2;
+ description
+ "VRRP version 2.";
+ }
+ enum "3" {
+ value 3;
+ description
+ "VRRP version 3.";
+ }
+ }
+ default "3";
+ }
+
+ leaf priority {
+ type uint8 {
+ range "1..254";
+ }
+ default "100";
+ description
+ "Specifies the sending VRRP interface's priority
+ for the virtual router. Higher values equal higher
+ priority";
+ }
+
+ leaf preempt {
+ type boolean;
+ default "true";
+ description
+ "When set to true, enables preemption by a higher
+ priority backup router of a lower priority master router";
+ }
+
+ leaf accept-mode {
+ type boolean;
+ default "true";
+ description
+ "Configure whether packets destined for
+ virtual addresses are accepted even when the virtual
+ address is not owned by the router interface";
+ }
+
+ leaf checksum-with-ipv4-pseudoheader {
+ type boolean;
+ default "true";
+ description
+ "Enabled if VRRPv3 checksum for IPv4 involves pseudoheader";
+ }
+
+ leaf advertisement-interval {
+ type uint16 {
+ range "1..4095";
+ }
+ units "centiseconds";
+ default "100";
+ description
+ "Sets the interval between successive VRRP
+ advertisements -- RFC 5798 defines this as a 12-bit
+ value expressed as 0.1 seconds, with default 100, i.e.,
+ 1 second. Several implementation express this in units of
+ seconds";
+ }
+
+ leaf shutdown {
+ type boolean;
+ default "false";
+ description
+ "Administrative shutdown for this VRRP group.";
+ }
+ }
+
+ grouping ip-vrrp-state {
+ description
+ "Grouping for operational state data for a virtual router";
+ leaf current-priority {
+ type uint8;
+ config false;
+ description
+ "Operational value of the priority for the
+ interface in the VRRP group.";
+ }
+
+ leaf vrrp-interface {
+ type frr-interface:interface-ref;
+ config false;
+ description
+ "The interface used to transmit VRRP traffic.";
+ }
+
+ leaf source-address {
+ type inet:ip-address;
+ config false;
+ description
+ "The source IP address used for VRRP advertisements.";
+ }
+
+ leaf state {
+ type enumeration {
+ enum "Initialize" {
+ description
+ "State when virtual router is waiting for a Startup event.";
+ }
+ enum "Master" {
+ description
+ "State when virtual router is functioning as the forwarding router
+ for the virtual addresses.";
+ }
+ enum "Backup" {
+ description
+ "State when virtual router is monitoring the availability and state
+ of the Master router.";
+ }
+ }
+ config false;
+ }
+
+ leaf master-advertisement-interval {
+ type uint16 {
+ range "0..4095";
+ }
+ units "centiseconds";
+ config false;
+ description
+ "Advertisement interval contained in advertisements received from the Master.";
+ }
+
+ leaf skew-time {
+ type uint16;
+ units "centiseconds";
+ config false;
+ description
+ "Time to skew Master_Down_Interval.";
+ }
+
+ container counter {
+ config false;
+ leaf state-transition {
+ type yang:zero-based-counter32;
+ description
+ "Number of state transitions the virtual router has experienced.";
+ }
+
+ container tx {
+ leaf advertisement {
+ type yang:zero-based-counter32;
+ description
+ "Number of sent VRRP advertisements.";
+ }
+ }
+
+ container rx {
+ leaf advertisement {
+ type yang:zero-based-counter32;
+ description
+ "Number of received VRRP advertisements.";
+ }
+ }
+ }
+ }
+
+ grouping ip-vrrp-top {
+ description
+ "Top-level grouping for Virtual Router Redundancy Protocol";
+ container vrrp {
+ description
+ "Enclosing container for VRRP groups handled by this
+ IP interface";
+ reference
+ "RFC 5798 - Virtual Router Redundancy Protocol
+ (VRRP) Version 3 for IPv4 and IPv6";
+ list vrrp-group {
+ key "virtual-router-id";
+ description
+ "List of VRRP groups, keyed by virtual router id";
+ uses ip-vrrp-config;
+
+ container v4 {
+ leaf-list virtual-address {
+ type inet:ipv4-address;
+ description
+ "Configure one or more IPv4 virtual addresses for the
+ VRRP group";
+ }
+
+ uses ip-vrrp-state {
+ augment "counter/tx" {
+ leaf gratuitous-arp {
+ type yang:zero-based-counter32;
+ description
+ "Number of sent gratuitous ARP requests.";
+ }
+ }
+ }
+ }
+
+ container v6 {
+ when "../version = 3";
+ leaf-list virtual-address {
+ type inet:ipv6-address;
+ description
+ "Configure one or more IPv6 virtual addresses for the
+ VRRP group";
+ }
+
+ uses ip-vrrp-state {
+ augment "counter/tx" {
+ leaf neighbor-advertisement {
+ type yang:zero-based-counter32;
+ description
+ "Number of sent unsolicited Neighbor Advertisements.";
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ augment "/frr-interface:lib/frr-interface:interface" {
+ uses ip-vrrp-top;
+ }
+}
diff --git a/yang/frr-zebra-route-map.yang b/yang/frr-zebra-route-map.yang
new file mode 100644
index 0000000..de0f64d
--- /dev/null
+++ b/yang/frr-zebra-route-map.yang
@@ -0,0 +1,136 @@
+module frr-zebra-route-map {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/zebra-route-map";
+ prefix frr-zebra-route-map;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization
+ "Free Range Routing";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines zebra route map settings";
+
+ revision 2020-01-02 {
+ description
+ "Initial revision";
+ }
+
+ identity ipv4-prefix-length {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match IPv4 address prefix length";
+ }
+
+ identity ipv4-next-hop-prefix-length {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match IPv4 next-hop address prefix length";
+ }
+
+ identity ipv6-prefix-length {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match IPv6 address prefix length";
+ }
+
+ identity source-instance {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match the protocol's instance number";
+ }
+
+ identity source-protocol {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match protocol via which the route was learnt";
+ }
+
+ identity src-address {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set IPv4/IPv6 source address for route";
+ }
+
+ augment "/frr-route-map:lib"
+ + "/frr-route-map:route-map"
+ + "/frr-route-map:entry"
+ + "/frr-route-map:match-condition"
+ + "/frr-route-map:rmap-match-condition"
+ + "/frr-route-map:match-condition" {
+ case ipv4-prefix-length {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv4-prefix-length') or "
+ + "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv4-next-hop-prefix-length')";
+ leaf ipv4-prefix-length {
+ type uint8 {
+ range "0..32";
+ }
+ }
+ }
+
+ case ipv6-prefix-length {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv6-prefix-length')";
+ leaf ipv6-prefix-length {
+ type uint8 {
+ range "0..128";
+ }
+ }
+ }
+
+ case source-instance {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:source-instance')";
+ leaf source-instance {
+ type uint8 {
+ range "0..255";
+ }
+ }
+ }
+
+ case source-protocol {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:source-protocol')";
+ leaf source-protocol {
+ type frr-route-types:frr-route-types;
+ }
+ }
+ }
+
+ augment "/frr-route-map:lib"
+ + "/frr-route-map:route-map"
+ + "/frr-route-map:entry"
+ + "/frr-route-map:set-action"
+ + "/frr-route-map:rmap-set-action"
+ + "/frr-route-map:set-action" {
+ case src-address {
+ when "derived-from-or-self(../frr-route-map:action, 'frr-zebra-route-map:src-address')";
+ choice src-address {
+ description
+ "Value of the source address";
+ case ipv4-src-address {
+ leaf ipv4-src-address {
+ type inet:ipv4-address;
+ mandatory true;
+ }
+ }
+
+ case ipv6-src-address {
+ leaf ipv6-src-address {
+ type inet:ipv6-address;
+ mandatory true;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/yang/frr-zebra.yang b/yang/frr-zebra.yang
new file mode 100644
index 0000000..3c6e451
--- /dev/null
+++ b/yang/frr-zebra.yang
@@ -0,0 +1,2236 @@
+module frr-zebra {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/zebra";
+ prefix frr-zebra;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-affinity-map {
+ prefix frr-affinity-map;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ import ietf-routing-types {
+ prefix rt-types;
+ }
+
+ import frr-nexthop {
+ prefix frr-nh;
+ }
+
+ import frr-routing {
+ prefix frr-rt;
+ }
+
+ import frr-interface {
+ prefix frr-interface;
+ }
+
+ import frr-vrf {
+ prefix frr-vrf;
+ }
+
+ organization
+ "FRRouting";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines a model for managing the FRR zebra daemon.
+
+ Copyright 2020 FRRouting
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+ revision 2019-06-01 {
+ description
+ "Initial revision.";
+ }
+
+ typedef unix-timestamp {
+ type uint32;
+ units "seconds";
+ description
+ "An absolute time in seconds since the unix epoch.";
+ }
+
+ identity zebra-interface-type {
+ description
+ "zebra interface type.";
+ }
+
+ identity zif-other {
+ base zebra-interface-type;
+ description
+ "Zebra interface type other.";
+ }
+
+ identity zif-bridge {
+ base zebra-interface-type;
+ description
+ "Zebra interface type bridge.";
+ }
+
+ identity zif-vlan {
+ base zebra-interface-type;
+ description
+ "Zebra interface type vlan.";
+ }
+
+ identity zif-vxlan {
+ base zebra-interface-type;
+ description
+ "Zebra interface type vxlan.";
+ }
+
+ identity zif-vrf {
+ base zebra-interface-type;
+ description
+ "Zebra interface type vrf.";
+ }
+
+ identity zif-veth {
+ base zebra-interface-type;
+ description
+ "Zebra interface type veth.";
+ }
+
+ identity zif-bond {
+ base zebra-interface-type;
+ description
+ "Zebra interface type bond.";
+ }
+
+ identity zif-bond-slave {
+ base zebra-interface-type;
+ description
+ "Zebra interface type bond slave.";
+ }
+
+ identity zif-macvlan {
+ base zebra-interface-type;
+ description
+ "Zebra interface type macvlan.";
+ }
+
+ /*
+ * Multicast RPF mode configurable type
+ */
+
+ typedef mcast-rpf-lookup-mode {
+ type enumeration {
+ enum "none" {
+ value 0;
+ description
+ "No mode set.";
+ }
+ enum "mrib-only" {
+ value 1;
+ description
+ "Lookup in unicast RIB only.";
+ }
+ enum "urib-only" {
+ value 2;
+ description
+ "Lookup in multicast RIB only.";
+ }
+ enum "mrib-then-urib" {
+ value 3;
+ description
+ "Try multicast RIB first, fall back to unicast RIB.";
+ }
+ enum "lower-distance" {
+ value 4;
+ description
+ "Lookup both unicast and mcast, use entry with lower distance.";
+ }
+ enum "longer-prefix" {
+ value 5;
+ description
+ "Lookup both unicast and mcast, use entry with longer prefix.";
+ }
+ }
+ description
+ "Multicast RPF lookup behavior";
+ }
+
+ // End of ip6-route
+ /*
+ * VxLAN Network Identifier type
+ */
+
+ typedef vni-id-type {
+ type uint32 {
+ range "0..16777215";
+ }
+ description
+ "A VxLAN network identifier value.";
+ }
+
+ typedef vni-vtep-flood-type {
+ type enumeration {
+ enum "head-end-repl" {
+ value 0;
+ description
+ "Head-end replication.";
+ }
+ enum "disabled" {
+ value 1;
+ description
+ "Flooding disabled.";
+ }
+ enum "pim-sm" {
+ value 2;
+ description
+ "Multicast PIM-SM.";
+ }
+ }
+ }
+
+ /*
+ * Common route data, shared by v4 and v6 routes.
+ */
+
+ grouping route-common {
+ description
+ "Common information about a route.";
+
+ leaf distance {
+ type uint8;
+ description
+ "Admin distance based on routing protocol.";
+ }
+
+ leaf metric {
+ type uint32;
+ description
+ "Route metric value.";
+ }
+
+ leaf tag {
+ type uint32 {
+ range "1..4294967295";
+ }
+ description
+ "Route tag value.";
+ }
+
+ leaf selected {
+ type empty;
+ description
+ "Route is the selected or preferred route for the prefix.";
+ }
+
+ leaf installed {
+ type empty;
+ description
+ "Route is installed in the FIB.";
+ }
+
+ leaf failed {
+ type empty;
+ description
+ "Route installation in FIB has failed.";
+ }
+
+ leaf queued {
+ type empty;
+ description
+ "Route has a pending FIB operation that has not completed.";
+ }
+
+ leaf internal-flags {
+ type int32;
+ description
+ "Internal flags for the route.";
+ }
+
+ leaf internal-status {
+ type int32;
+ description
+ "Internal status for the route.";
+ }
+
+ leaf uptime {
+ type yang:date-and-time;
+ description
+ "Uptime for the route.";
+ }
+
+ uses frr-nh:frr-nexthop-group-operational;
+ }
+
+ // End of route-common
+ /*
+ * IPv4 Route object.
+ */
+
+ grouping ip4-route {
+ description
+ "An IPv4 route.";
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "IP address (in the form A.B.C.D) and prefix length,
+ separated by the slash (/) character. The range of
+ values for the prefix-length is 0 to 32.";
+ }
+
+ leaf protocol {
+ type frr-route-types:frr-route-types-v4;
+ description
+ "The protocol owning the route.";
+ }
+
+ uses route-common;
+ }
+
+ // End of ip4-route
+ /*
+ * IPv6 Route object.
+ */
+
+ grouping ip6-route {
+ description
+ "An IPv6 route.";
+ leaf prefix {
+ type inet:ipv6-prefix;
+ description
+ "The route's IPv6 prefix.";
+ }
+
+ leaf protocol {
+ type frr-route-types:frr-route-types-v6;
+ description
+ "The protocol owning the route.";
+ }
+
+ uses route-common;
+ }
+ // End of ip6-route
+
+ /*
+ * Information about EVPN VNIs
+ */
+
+ grouping vni-information {
+ choice type-choice {
+ case l2 {
+ leaf is-layer2 {
+ type empty;
+ description
+ "Information about an L2 VNI.";
+ }
+
+ leaf vtep-count {
+ type uint32;
+ description
+ "Number of VTEPs.";
+ }
+ }
+
+ case l3 {
+ leaf is-layer3 {
+ type empty;
+ description
+ "Information about an L3 VNI.";
+ }
+ }
+ }
+
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "The VNI identifier.";
+ }
+
+ leaf vxlan-ifname {
+ type frr-interface:interface-ref;
+ description
+ "The VxLAN interface name.";
+ }
+
+ leaf mac-count {
+ type uint32;
+ description
+ "Number of valid MACs.";
+ }
+
+ leaf neighbor-count {
+ type uint32;
+ description
+ "Number of neighbors.";
+ }
+
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "The tenant VRF.";
+ }
+
+ leaf local-vtep-addr {
+ type inet:ipv4-address;
+ description
+ "The local VTEP IP address.";
+ }
+ }
+
+ /*
+ * Detailed EVPN VNI information for L2.
+ */
+
+ grouping vni-l2-detail {
+ leaf if-index {
+ type uint32;
+ description
+ "The VxLAN ifindex.";
+ }
+
+ leaf advertise-gw {
+ type empty;
+ description
+ "The gateway MAC-IP is being advertised.";
+ }
+
+ leaf mcast-group {
+ type rt-types:ipv4-multicast-group-address;
+ description
+ "The VNI multicast group for BUM traffic.";
+ }
+
+ list remote-vtep-list {
+ leaf remote-vtep {
+ type inet:ipv4-address;
+ description
+ "The remote VTEP IP address.";
+ }
+
+ leaf vtep-flood {
+ type vni-vtep-flood-type;
+ }
+ }
+ }
+
+ /*
+ * Detailed EVPN VNI information for L3.
+ */
+
+ grouping vni-l3-detail {
+ leaf svi-interface {
+ type frr-interface:interface-ref;
+ description
+ "The SVI interface.";
+ }
+
+ leaf is-up {
+ type empty;
+ description
+ "The state is active.";
+ }
+
+ leaf prefix-only {
+ type empty;
+ description
+ "Prefix routes only";
+ }
+
+ leaf router-mac {
+ type yang:mac-address;
+ description
+ "The VNI Router MAC address.";
+ }
+
+ list vni-list {
+ description
+ "A list of the associated L2 VNIs.";
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "An L2 VNI identifier.";
+ }
+ }
+ }
+
+ /*
+ * Debug options
+ */
+
+ grouping zebra-debugs {
+ leaf debug-events {
+ type boolean;
+ description
+ "Debug ZAPI events.";
+ }
+
+ leaf debug-zapi-send {
+ type boolean;
+ description
+ "Debug ZAPI messages sent.";
+ }
+
+ leaf debug-zapi-recv {
+ type boolean;
+ description
+ "Debug ZAPI messages received.";
+ }
+
+ leaf debug-zapi-detail {
+ type boolean;
+ description
+ "Debug ZAPI details.";
+ }
+
+ leaf debug-kernel {
+ type boolean;
+ description
+ "Debug kernel events.";
+ }
+
+ leaf debug-kernel-msg-send {
+ type boolean;
+ description
+ "Debug kernel messages sent.";
+ }
+
+ leaf debug-kernel-msg-recv {
+ type boolean;
+ description
+ "Debug kernel messages received.";
+ }
+
+ leaf debug-rib {
+ type boolean;
+ description
+ "Debug RIB processing.";
+ }
+
+ leaf debug-rib-detail {
+ type boolean;
+ description
+ "Debug RIB processing details.";
+ }
+
+ leaf debug-fpm {
+ type boolean;
+ description
+ "Debug the FIB Push Interface subsystem.";
+ }
+
+ leaf debug-nht {
+ type boolean;
+ description
+ "Debug Nexthop-tracking.";
+ }
+
+ leaf debug-nht-detail {
+ type boolean;
+ description
+ "Debug Nexthop-tracking details.";
+ }
+
+ leaf debug-mpls {
+ type boolean;
+ description
+ "Debug MPLS.";
+ }
+
+ leaf debug-vxlan {
+ type boolean;
+ description
+ "Debug VxLAN.";
+ }
+
+ leaf debug-pw {
+ type boolean;
+ description
+ "Debug pseudowires.";
+ }
+
+ leaf debug-dplane {
+ type boolean;
+ description
+ "Debug the dataplane subsystem.";
+ }
+
+ leaf debug-dplane-detail {
+ type boolean;
+ description
+ "Debug dataplane subsystem details.";
+ }
+
+ leaf debug-mlag {
+ type boolean;
+ description
+ "Debug MLAG.";
+ }
+ }
+
+ grouping ribs {
+ container ribs {
+ config false;
+ description
+ "RIBs supported by FRR.";
+ list rib {
+ key "afi-safi-name table-id";
+ leaf afi-safi-name {
+ type identityref {
+ base frr-rt:afi-safi-type;
+ }
+ description
+ "AFI, SAFI name.";
+ }
+
+ leaf table-id {
+ type uint32;
+ description
+ "Routing Table id (default id - 254).";
+ }
+
+ list route {
+ key "prefix";
+ leaf prefix {
+ type inet:ip-prefix;
+ description
+ "The route's prefix.";
+ }
+
+ list route-entry {
+ key "protocol";
+ leaf protocol {
+ type frr-route-types:frr-route-types;
+ description
+ "The protocol owning the route.";
+ }
+
+ leaf instance {
+ type uint16;
+ must "../protocol = \"ospf\"";
+ description
+ "Retrieve routes from a specific OSPF instance.";
+ }
+
+ uses route-common;
+ }
+ }
+ }
+ }
+ }
+
+ grouping vrf-vni-mapping {
+ description
+ "EVPN L3-VNI mapping corresponding to a VRF.";
+ leaf l3vni-id {
+ type vni-id-type;
+ description
+ "EVPN L3-VNI id to map to the VRF.";
+ }
+
+ leaf prefix-only {
+ type boolean;
+ default "false";
+ description
+ "EVPN asymmetric mode advertise prefix routes only.";
+ }
+ }
+
+ // End of zebra container
+ /*
+ * RPCs
+ */
+
+ rpc get-route-information {
+ description
+ "Retrieve IPv4 or IPv6 unicast routes.";
+ input {
+ choice ip-type {
+ case v4 {
+ leaf ipv4 {
+ type empty;
+ mandatory true;
+ description
+ "Retrieve IPv4 routes.";
+ }
+
+ leaf prefix-v4 {
+ type inet:ipv4-prefix;
+ description
+ "Retrieve routes matching a specific prefix.";
+ }
+
+ leaf supernets-only {
+ type empty;
+ description
+ "Skip routes that are subnets of classful prefix sizes.";
+ }
+ }
+
+ case v6 {
+ leaf ipv6 {
+ type empty;
+ mandatory true;
+ description
+ "Retrieve IPv6 routes.";
+ }
+
+ leaf prefix-v6 {
+ type inet:ipv6-prefix;
+ description
+ "Retrieve routes matching a specific prefix.";
+ }
+ }
+ }
+
+ choice vrf-choice {
+ case single {
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "Retrieve routes in a non-default vrf.";
+ }
+ }
+
+ case all {
+ leaf all-vrfs {
+ type empty;
+ description
+ "Retrieve routes from all vrfs.";
+ }
+ }
+ }
+
+ leaf fib-routes {
+ type empty;
+ description
+ "Retrieve FIB routes rather than RIB routes.";
+ }
+
+ leaf table-id {
+ type uint32 {
+ range "1..4294967295";
+ }
+ description
+ "Routing table id to retrieve.";
+ }
+
+ leaf protocol {
+ type frr-route-types:frr-route-types-v4;
+ description
+ "Retrieve routes from a specific protocol daemon.";
+ }
+
+ leaf ospf-instance {
+ type uint32 {
+ range "1..65535";
+ }
+ must "../protocol = \"ospf\"";
+ description
+ "Retrieve routes from a specific OSPF instance.";
+ }
+
+ choice detail {
+ case det {
+ leaf include-detail {
+ type empty;
+ description
+ "Include detailed information.";
+ }
+ }
+
+ case summ {
+ leaf summary {
+ type empty;
+ description
+ "Include summary information only.";
+ }
+ }
+ }
+ }
+ // End of input
+ output {
+ choice route-list {
+ case v4 {
+ container routes-v4 {
+ description
+ "IPv4 route information.";
+ list route {
+ uses ip4-route;
+ }
+ }
+ }
+
+ case v6 {
+ container routes-v6 {
+ description
+ "IPv6 route information.";
+ list route {
+ uses ip6-route;
+ }
+ }
+ }
+ }
+ }
+ // End of output
+ }
+
+ // End get-route-information
+
+ rpc get-v6-mroute-info {
+ description
+ "Retrieve IPv6 multicast routes.";
+ input {
+ choice vrf-choice {
+ case single {
+ leaf vrf {
+ type frr-vrf:vrf-ref;
+ description
+ "Retrieve routes in a non-default vrf.";
+ }
+ }
+
+ case all {
+ leaf all-vrfs {
+ type empty;
+ description
+ "Retrieve routes from all vrfs.";
+ }
+ }
+ }
+ }
+
+ output {
+ container routes {
+ description
+ "IPv6 mcast route information.";
+ list route {
+ uses ip6-route;
+ }
+ }
+ }
+ }
+
+ // End get-v6-mroute-info
+
+ rpc get-vrf-info {
+ description
+ "Retrieve VRF information; the default VRF is elided.";
+ // Note: no input clause.
+ output {
+ list vrf-list {
+ leaf name {
+ type frr-vrf:vrf-ref;
+ description
+ "The VRF name";
+ }
+
+ leaf is-user-config {
+ type empty;
+ description
+ "The VRF was configured by an admin.";
+ }
+
+ leaf vrf-id {
+ type uint32;
+ description
+ "The VRF id.";
+ }
+
+ choice vrf-type {
+ case inactive {
+ leaf is-inactive {
+ type empty;
+ description
+ "The VRF is inactive.";
+ }
+ }
+
+ case netns {
+ leaf netns-name {
+ type string;
+ description
+ "The net namespace name associated with the VRF.";
+ }
+ }
+
+ case table {
+ leaf table-id {
+ type uint32;
+ description
+ "The table-id associated with the VRF.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // End get-vrf-info
+
+ rpc get-vrf-vni-info {
+ description
+ "Retrieve mappings between EVPN VNI and VRF.";
+ // Note: no input clause.
+ output {
+ list vrf-vni-list {
+ leaf vrf-name {
+ type frr-vrf:vrf-ref;
+ description
+ "The VRF name.";
+ }
+
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "The EVPN VNI.";
+ }
+
+ leaf vxlan-if-name {
+ type frr-interface:interface-ref;
+ description
+ "The VxLAN interface name.";
+ }
+
+ leaf svi-if-name {
+ type frr-interface:interface-ref;
+ description
+ "The SVI interface name.";
+ }
+
+ leaf router-mac-addr {
+ type yang:mac-address;
+ description
+ "Router MAC address.";
+ }
+
+ leaf is-up {
+ type empty;
+ description
+ "The state is active.";
+ }
+ }
+ }
+ }
+
+ // End get-vrf-vni-info
+
+ rpc get-evpn-info {
+ description
+ "Retrieve global information about EVPN.";
+ // Note: No input clause.
+ output {
+ leaf l2vni-count {
+ type uint32;
+ description
+ "Number of L2 VNIs.";
+ }
+
+ leaf l3vni-count {
+ type uint32;
+ description
+ "Number of L3 VNIs.";
+ }
+
+ leaf advertise-gateway {
+ type empty;
+ description
+ "Advertise the gateway MAC-IP.";
+ }
+
+ leaf advertise-svi {
+ type empty;
+ description
+ "Advertise SVI MAC-IP.";
+ }
+
+ leaf dup-detect {
+ type empty;
+ description
+ "Duplicate address detection is enabled.";
+ }
+
+ leaf dad-max-moves {
+ type uint32;
+ description
+ "Maximum moves allowed before address is considered duplicate.";
+ }
+
+ leaf dad-timeout {
+ type uint32;
+ units "seconds";
+ description
+ "Duplicate address detection timeout.";
+ }
+
+ leaf dad-freeze {
+ type empty;
+ description
+ "Duplicate address detection freeze enabled.";
+ }
+
+ choice dad-freeze-choice {
+ case freeze-permanent {
+ leaf dad-freeze-perm {
+ type empty;
+ description
+ "Duplicate address detection freeze is permanent.";
+ }
+ }
+
+ case freeze-time {
+ leaf dad-freeze-time {
+ type uint32;
+ units "seconds";
+ description
+ "Duplicate address detection freeze timer.";
+ }
+ }
+ }
+ }
+ }
+
+ // End get-evpn-info
+
+ rpc get-vni-info {
+ // If no vni is specified, retrieve global list.
+ input {
+ choice vni-choice {
+ default "all-vnis";
+ case all-vnis {
+ leaf all-vnis {
+ type empty;
+ description
+ "Retrieve information about all VNIs.";
+ }
+ }
+
+ case single-vni {
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "Retrieve information about a specific EVPN VNI.";
+ }
+ }
+ }
+
+ leaf detailed-info {
+ type empty;
+ description
+ "Retrieve detailed information.";
+ }
+ }
+
+ output {
+ list vni-list {
+ description
+ "Information about EVPN VNI objects.";
+ uses vni-information;
+
+ choice detail-choice {
+ case l2 {
+ description
+ "Detailed L2 information.";
+ uses vni-l2-detail;
+ }
+
+ case l3 {
+ description
+ "Detailed L3 information.";
+ uses vni-l3-detail;
+ }
+ }
+ }
+ }
+ }
+
+ // End get-vni-info
+
+ rpc get-evpn-vni-rmac {
+ description
+ "Retrieve information about VxLAN VNI RMACs.";
+ input {
+ choice vni-choice {
+ default "all-vnis";
+ case all-vnis {
+ leaf all-vnis {
+ type empty;
+ description
+ "Retrieve information about all VNIs.";
+ }
+ }
+
+ case single-vni {
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "Retrieve information about a specific EVPN VNI.";
+ }
+
+ leaf vni-rmac {
+ type yang:mac-address;
+ description
+ "A single RMAC address.";
+ }
+ }
+ }
+ }
+
+ output {
+ list rmac-info-list {
+ leaf rmac {
+ type yang:mac-address;
+ description
+ "The RMAC address.";
+ }
+
+ leaf remote-vtep {
+ type inet:ipv4-address;
+ description
+ "The remote VTEP IP address.";
+ }
+
+ leaf refcount {
+ type uint32;
+ description
+ "The refcount of the RMAC.";
+ }
+
+ list prefix-list {
+ leaf prefix-item {
+ type inet:ip-prefix;
+ description
+ "IP prefixes associated with the RMAC.";
+ }
+ }
+ }
+ }
+ }
+
+ // End get-evpn-vni-rmac
+
+ rpc get-evpn-vni-nexthops {
+ description
+ "Retrieve information about EVPN nexthops.";
+ input {
+ choice vni-choice {
+ default "all-vnis";
+ case all-vnis {
+ leaf all-vnis {
+ type empty;
+ description
+ "Retrieve information about all VNIs.";
+ }
+ }
+
+ case single-vni {
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "Retrieve information about a specific EVPN VNI.";
+ }
+
+ leaf vni-ipaddr {
+ type inet:ip-address;
+ description
+ "A single host IP address (v4 or v6).";
+ }
+ }
+ }
+ }
+
+ output {
+ list nh-info-list {
+ leaf ip-addr {
+ type inet:ip-address;
+ description
+ "The nexthop IP address.";
+ }
+
+ leaf mac-addr {
+ type yang:mac-address;
+ description
+ "The nexthop MAC address.";
+ }
+
+ leaf refcount {
+ type uint32;
+ description
+ "The refcount of the RMAC.";
+ }
+
+ list prefix-list {
+ leaf prefix-item {
+ type inet:ip-prefix;
+ description
+ "IP prefixes associated with the RMAC.";
+ }
+ }
+ }
+ }
+ }
+
+ // End get-evpn-vni-vteps
+
+ rpc clear-evpn-dup-addr {
+ description
+ "Clear duplicate address detection state for one or all VNIs.";
+ input {
+ choice clear-dup-choice {
+ case all-case {
+ leaf all-vnis {
+ type empty;
+ description
+ "Clear all VNIs.";
+ }
+ }
+
+ case single-case {
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "Clear state for a single EVPN VNI.";
+ }
+
+ choice ip-mac-choice {
+ description
+ "Clear state for a specific MAC or IP address.";
+ case ip-case {
+ leaf vni-ipaddr {
+ type inet:ip-address;
+ description
+ "A specific IP address (v4 or v6).";
+ }
+ }
+
+ case mac-case {
+ leaf mac-addr {
+ type yang:mac-address;
+ description
+ "A specific MAC address.";
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // End clear-evpn-dup-addr
+
+ rpc get-evpn-macs {
+ description
+ "Retrieve information about EVPN MAC addresses.";
+ input {
+ choice all-choice {
+ default "all-vni";
+ case all-vni {
+ leaf all-vnis {
+ type empty;
+ description
+ "Retrieve information for all VNIs.";
+ }
+
+ choice all-choices {
+ case detail-case {
+ leaf all-detail {
+ type empty;
+ description
+ "Include detailed results.";
+ }
+ }
+
+ case vtep-case {
+ leaf all-vtep-addr {
+ type inet:ipv4-address;
+ description
+ "A single VTEP address.";
+ }
+ }
+
+ case dup-case {
+ leaf all-dup {
+ type empty;
+ description
+ "Show duplicate addresses.";
+ }
+ }
+ }
+ }
+
+ case single-vni {
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "Retrieve information for a single VNI.";
+ }
+
+ choice single-choices {
+ case detail-case {
+ leaf single-detail {
+ type empty;
+ description
+ "Include detailed results.";
+ }
+ }
+
+ case mac-case {
+ leaf single-mac {
+ type yang:mac-address;
+ description
+ "A specific MAC address.";
+ }
+ }
+
+ case vtep-case {
+ leaf single-vtep {
+ type inet:ipv4-address;
+ description
+ "A single VTEP address.";
+ }
+ }
+
+ case dup-case {
+ leaf single-dup {
+ type empty;
+ description
+ "Show duplicate addresses.";
+ }
+ }
+ }
+ }
+ }
+ }
+ // End of input section
+ output {
+ list mac-list {
+ leaf mac-addr {
+ type yang:mac-address;
+ description
+ "The MAC address.";
+ }
+
+ leaf vni {
+ type vni-id-type;
+ description
+ "The VNI value.";
+ }
+
+ leaf local-sequence {
+ type uint32;
+ description
+ "Local sequence number.";
+ }
+
+ leaf remote-sequence {
+ type uint32;
+ description
+ "Remote sequence number.";
+ }
+
+ leaf dad-count {
+ type uint32;
+ description
+ "Duplicate detection counter.";
+ }
+
+ leaf is-duplicate {
+ type empty;
+ description
+ "Duplicate MAC detected.";
+ }
+
+ leaf dup-detect-time {
+ type unix-timestamp;
+ description
+ "If a duplicate, the detection time.";
+ }
+
+ container dup-detect-started {
+ leaf dup-detect-start {
+ type unix-timestamp;
+ description
+ "Duplicate detection process start time.";
+ }
+
+ leaf dup-count {
+ type uint32;
+ description
+ "Duplicate detection count.";
+ }
+ }
+
+ leaf is-auto {
+ type empty;
+ description
+ "This is an Auto MAC.";
+ }
+
+ leaf is-sticky {
+ type empty;
+ description
+ "This is a sticky MAC.";
+ }
+
+ leaf is-default-gw {
+ type empty;
+ description
+ "This is a default-gateway MAC.";
+ }
+
+ leaf is-remote-gw {
+ type empty;
+ description
+ "This is a remote-gateway MAC.";
+ }
+
+ list neighbor-list {
+ leaf neighbor-addr {
+ type inet:ip-address;
+ description
+ "Neighbor address.";
+ }
+
+ leaf is-active {
+ type empty;
+ description
+ "Neighbor is active.";
+ }
+ }
+
+ leaf mac-count {
+ type uint32;
+ description
+ "Number of MACs (local and remote).";
+ }
+
+ choice local-rem-choice {
+ case local-case {
+ leaf intf {
+ type frr-interface:interface-ref;
+ description
+ "The local interface name.";
+ }
+
+ leaf vlan {
+ type uint32;
+ description
+ "A VLAN id.";
+ }
+ }
+
+ case remote-case {
+ leaf vtep-addr {
+ type inet:ipv4-address;
+ description
+ "The remote VTEP IP address.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // End get-evpn-macs
+
+ rpc get-evpn-arp-cache {
+ description
+ "Retrieve information about EVPN neighbor cache entries.";
+ input {
+ choice all-choice {
+ default "all-vni";
+ case all-vni {
+ leaf all-vnis {
+ type empty;
+ description
+ "Retrieve information for all VNIs.";
+ }
+
+ choice all-choices {
+ case detail-case {
+ leaf all-detail {
+ type empty;
+ description
+ "Include detailed results.";
+ }
+ }
+
+ case dup-case {
+ leaf all-dup {
+ type empty;
+ description
+ "Show duplicates.";
+ }
+ }
+ }
+ }
+
+ case single-vni {
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "Retrieve information for a single VNI.";
+ }
+
+ choice single-choices {
+ case vtep-case {
+ leaf single-vtep {
+ type inet:ipv4-address;
+ description
+ "A single VTEP address.";
+ }
+ }
+
+ case neighbor-case {
+ leaf neighbor-addr {
+ type inet:ip-address;
+ description
+ "A single neighbor address.";
+ }
+ }
+
+ case dup-case {
+ leaf single-dup {
+ type empty;
+ description
+ "Show duplicates.";
+ }
+ }
+ }
+ }
+ }
+ }
+ // End input section
+ output {
+ list vni-list {
+ container vni-container {
+ description
+ "Information for one VNI.";
+ leaf vni-id {
+ type vni-id-type;
+ description
+ "The VNI id.";
+ }
+
+ list neigh-list {
+ description
+ "Information about a VNI's neighbor cache.";
+ leaf mac-addr {
+ type yang:mac-address;
+ description
+ "A neighbor MAC address.";
+ }
+
+ leaf ip-addr {
+ type inet:ip-address;
+ description
+ "A neighbor IP address.";
+ }
+
+ leaf state-active {
+ type empty;
+ description
+ "Indicates whether the entry is active.";
+ }
+
+ choice local-remote-choice {
+ case local-case {
+ leaf is-local {
+ type empty;
+ description
+ "The entry is local.";
+ }
+ }
+
+ case remote-case {
+ leaf is-remote {
+ type empty;
+ description
+ "The entry is remote.";
+ }
+ }
+ }
+
+ leaf is-dup {
+ type empty;
+ description
+ "The entry is a detected duplicate.";
+ }
+
+ leaf is-default-gw {
+ type empty;
+ description
+ "The entry is a default gateway.";
+ }
+
+ leaf is-router {
+ type empty;
+ description
+ "The entry is a router.";
+ }
+
+ leaf local-sequence {
+ type uint32;
+ description
+ "The local sequence number.";
+ }
+
+ leaf remote-sequence {
+ type uint32;
+ description
+ "The remote sequence number.";
+ }
+
+ leaf remote-vtep {
+ type inet:ipv4-address;
+ description
+ "The remote VTEP address.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // End get-evpn-arp-cache
+
+ rpc get-pbr-ipset {
+ input {
+ leaf name {
+ type string {
+ length "1..32";
+ }
+ description
+ "An optional specific IPset name.";
+ }
+ }
+
+ output {
+ list ipset-list {
+ leaf name {
+ type string {
+ length "1..32";
+ }
+ description
+ "The IPset name.";
+ }
+
+ leaf ipset-type {
+ type enumeration {
+ enum "net-net" {
+ value 1;
+ description
+ "";
+ }
+ enum "net-port-net" {
+ value 2;
+ description
+ "";
+ }
+ enum "net-port" {
+ value 3;
+ description
+ "";
+ }
+ enum "net" {
+ value 4;
+ description
+ "";
+ }
+ }
+ }
+
+ leaf src-prefix {
+ type inet:ip-prefix;
+ description
+ "";
+ }
+
+ leaf dest-prefix {
+ type inet:ip-prefix;
+ description
+ "";
+ }
+
+ leaf src-port {
+ type inet:port-number;
+ description
+ "";
+ }
+
+ leaf dest-port {
+ type inet:port-number;
+ description
+ "";
+ }
+
+ choice proto-choice {
+ description
+ "Filter UDP/TCP only, or a specific protocol number.";
+ case udp-tcp-case {
+ leaf is-udp-tcp {
+ type empty;
+ description
+ "Filter TCP/UDP ports only.";
+ }
+ }
+
+ case proto-case {
+ leaf proto {
+ type uint32;
+ description
+ "Filter a specific protocol number.";
+ }
+ }
+ }
+
+ container icmp-info {
+ description
+ "Additional information for ICMP filters.";
+ leaf type-min {
+ type uint8;
+ description
+ "";
+ }
+
+ leaf type-max {
+ type uint8;
+ description
+ "";
+ }
+
+ leaf code-min {
+ type uint8;
+ description
+ "";
+ }
+
+ leaf code-max {
+ type uint8;
+ description
+ "";
+ }
+ }
+
+ container ipset-stats {
+ leaf is-unique {
+ type empty;
+ description
+ "";
+ }
+
+ leaf packet-counter {
+ type uint64;
+ description
+ "";
+ }
+
+ leaf bytes-counter {
+ type uint64;
+ description
+ "";
+ }
+ }
+ }
+ }
+ }
+
+ // End get-pbr-ipset
+
+ rpc get-pbr-iptable {
+ input {
+ leaf name {
+ type string {
+ length "1..32";
+ }
+ description
+ "An optional single IPtable name.";
+ }
+ }
+
+ output {
+ list iptable-list {
+ leaf name {
+ type string {
+ length "1..32";
+ }
+ description
+ "The IPtable name.";
+ }
+
+ leaf unique-val {
+ type uint32;
+ description
+ "";
+ }
+
+ choice action-choice {
+ description
+ "The table action.";
+ case drop-case {
+ leaf action-drop {
+ type empty;
+ description
+ "";
+ }
+ }
+
+ case redirect-case {
+ leaf action-redirect {
+ type empty;
+ description
+ "";
+ }
+ }
+ }
+
+ leaf min-packet {
+ type uint32;
+ description
+ "";
+ }
+
+ leaf max-packet {
+ type uint32;
+ description
+ "";
+ }
+
+ leaf lookup-src-port {
+ type empty;
+ description
+ "";
+ }
+
+ leaf lookup-dst-port {
+ type empty;
+ description
+ "";
+ }
+
+ leaf tcp-flags {
+ type uint16;
+ description
+ "";
+ }
+
+ leaf tcp-flags-mask {
+ type uint16;
+ description
+ "";
+ }
+
+ leaf protocol-val {
+ type uint32;
+ description
+ "An IP protocol number.";
+ }
+
+ container dscp-info {
+ leaf dscp-value {
+ type uint32;
+ description
+ "A DSCP value to match.";
+ }
+
+ leaf invert-match {
+ type empty;
+ description
+ "If set, exclude the specified value";
+ }
+ }
+
+ container fragment-info {
+ leaf fragment-val {
+ type uint32;
+ description
+ "An IP fragment value.";
+ }
+
+ leaf invert-match {
+ type empty;
+ description
+ "If set, exclude the specified value.";
+ }
+ }
+
+ container iptable-stats {
+ leaf packet-counter {
+ type uint64;
+ description
+ "";
+ }
+
+ leaf bytes-counter {
+ type uint64;
+ description
+ "";
+ }
+ }
+
+ container rule-info {
+ description
+ "Information about a rule, for redirect tables.";
+ leaf table-id {
+ type uint32;
+ description
+ "The rule table id.";
+ }
+
+ leaf table-fwmark {
+ type uint32;
+ description
+ "The firewall mark for the rule.";
+ }
+ }
+ }
+ }
+ }
+
+ // End get-pbr-iptable
+ /*
+ * Handy 'all-at-once' api to retrieve debugs
+ */
+
+ rpc get-debugs {
+ output {
+ uses zebra-debugs;
+ }
+ }
+
+ // End get-debugs
+
+ augment "/frr-interface:lib/frr-interface:interface" {
+ description
+ "Extends interface model with Zebra-related parameters.";
+ container zebra {
+ list ip-addrs {
+ key "address-family ip-prefix";
+ description
+ "IP prefixes for an interface.";
+ uses frr-rt:address-family {
+ description
+ "Address family of the RIB.";
+ }
+
+ leaf ip-prefix {
+ type inet:ip-prefix;
+ description
+ "IP address prefix.";
+ }
+
+ leaf label {
+ type string;
+ description
+ "Optional string label for the address.";
+ }
+
+ leaf ip4-peer {
+ when "derived-from-or-self(../address-family, 'frr-rt:ipv4')";
+ type inet:ipv4-prefix;
+ description
+ "Peer prefix, for peer-to-peer interfaces.";
+ }
+ }
+
+ leaf multicast {
+ type boolean;
+ description
+ "Multicast flag for the interface.";
+ }
+
+ leaf link-detect {
+ type boolean;
+ description
+ "Link-detection for the interface.";
+ }
+
+ leaf shutdown {
+ type boolean;
+ description
+ "Interface admin status.";
+ }
+
+ leaf mpls {
+ type boolean;
+ description
+ "Interface MPLS status.";
+ }
+
+ leaf bandwidth {
+ type uint32 {
+ range "1..100000";
+ }
+ description
+ "Link bandwidth informational parameter, in megabits.";
+ }
+ container link-params {
+ description
+ "link-params for Traffic-Engineering (TE) use in IGP extensions.";
+ choice admin-group-mode {
+ description "Admin-group mode";
+ case legacy {
+ description
+ "Legacy mode. Only support standard admin-group (RFC3630/5305/5329)";
+ leaf legacy-admin-group {
+ description "Admin-Group value";
+ type uint32;
+ }
+ }
+ case affinity {
+ container affinities {
+ leaf-list affinity {
+ type string;
+ max-elements "256";
+ description
+ "Array of Attribute Names";
+ }
+ }
+ }
+ }
+ leaf affinity-mode {
+ description
+ "Affinity mode";
+ default "extended";
+ type enumeration {
+ enum extended {
+ value 0;
+ description
+ "Extended Admin-Group only (RFC7308)";
+ }
+ enum standard {
+ value 1;
+ description
+ "Standard Admin-Group only (RFC3630/5305/5329)";
+ }
+ enum both {
+ value 2;
+ description
+ "Standard and extended Admin-Group";
+ }
+ }
+ }
+ // TODO -- other link-params options
+ // for (experimental/partial TE use in IGP extensions)
+ }
+ container state {
+ config false;
+ description
+ "Operational data.";
+ leaf up-count {
+ type uint16;
+ description
+ "Interface Up count.";
+ }
+
+ leaf down-count {
+ type uint16;
+ description
+ "Interface Down count.";
+ }
+
+ leaf zif-type {
+ type identityref {
+ base zebra-interface-type;
+ }
+ description
+ "zebra interface type.";
+ }
+
+ leaf ptm-status {
+ type string;
+ default "disabled";
+ description
+ "Interface PTM status.";
+ }
+
+ leaf vlan-id {
+ type uint16 {
+ range "1..4094";
+ }
+ description
+ "A VLAN id.";
+ }
+
+ leaf vni-id {
+ type vni-id-type;
+ }
+
+ leaf remote-vtep {
+ type inet:ipv4-address;
+ description
+ "The remote VTEP IP address.";
+ }
+
+ leaf mcast-group {
+ type rt-types:ipv4-multicast-group-address;
+ description
+ "The VNI multicast group for BUM traffic.";
+ }
+ }
+ }
+ }
+
+ augment "/frr-vrf:lib/frr-vrf:vrf" {
+ description
+ "Extends VRF model with Zebra-related parameters.";
+ container zebra {
+ description
+ "Zebra's vrf specific configuration and operational model.";
+ uses ribs;
+
+ uses vrf-vni-mapping;
+ }
+ }
+
+ augment "/frr-vrf:lib/frr-vrf:vrf/frr-zebra:zebra/ribs/rib/route/route-entry/nexthop-group/nexthop" {
+ uses frr-nh:frr-nexthop-operational;
+ }
+
+ /*
+ * Main zebra container
+ */
+
+ container zebra {
+ description
+ "Data model for the Zebra daemon.";
+ leaf mcast-rpf-lookup {
+ type frr-zebra:mcast-rpf-lookup-mode;
+ default "mrib-then-urib";
+ description
+ "Multicast RPF lookup behavior.";
+ }
+ leaf ip-forwarding {
+ type boolean;
+ description
+ "IP forwarding status.";
+ }
+ leaf ipv6-forwarding {
+ type enumeration {
+ enum unknown {
+ value -1;
+ description
+ "Unknown state.";
+ }
+ enum off {
+ value 0;
+ description
+ "IPv6 forwarding disabled.";
+ }
+ enum on {
+ value 1;
+ description
+ "IPv6 forwarding enabled.";
+ }
+ }
+ description
+ "IPv6 forwarding status.";
+ }
+ leaf workqueue-hold-timer {
+ type uint32 {
+ range "0..10000";
+ }
+ units "milliseconds";
+ default "10";
+ description
+ "Work-queue processing hold timer, in milliseconds.";
+ }
+ leaf zapi-packets {
+ type uint32 {
+ range "1..10000";
+ }
+ default "1000";
+ description
+ "Number of ZAPI packets to process before relinquishing
+ the main thread.";
+ }
+ container import-kernel-table {
+ description
+ "Parameters to use when importing IPv4 routes from a non-main kernel
+ routing table.";
+ leaf table-id {
+ type uint32 {
+ range "1..252";
+ }
+ description
+ "The kernel table id.";
+ }
+ leaf distance {
+ type uint32 {
+ range "1..255";
+ }
+ default "15";
+ description
+ "The admin distance to use for imported routes.";
+ }
+ leaf route-map {
+ type frr-route-map:route-map-ref;
+ description
+ "A route-map to filter imported routes.";
+ }
+ }
+ leaf allow-external-route-update {
+ type empty;
+ description
+ "Allow FRR-controlled routes to be overwritten by external processes";
+ }
+ leaf dplane-queue-limit {
+ type uint32 {
+ range "0..10000";
+ }
+ default "200";
+ description
+ "Limit on the number of updates queued to the dataplane subsystem.";
+ }
+ /*
+ * Debug options
+ */
+ container debugs {
+ uses zebra-debugs;
+ }
+ /* End of debugs */
+ /*
+ * End of configuration attributes
+ */
+ /*
+ * Operational data.
+ */
+ container state {
+ config false;
+ description
+ "Operational data.";
+ }
+ // End of operational / state container
+ }
+}
diff --git a/yang/ietf/frr-deviations-ietf-interfaces.yang b/yang/ietf/frr-deviations-ietf-interfaces.yang
new file mode 100644
index 0000000..704839f
--- /dev/null
+++ b/yang/ietf/frr-deviations-ietf-interfaces.yang
@@ -0,0 +1,72 @@
+module frr-deviations-ietf-interfaces {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/frr-deviations-ietf-interfaces";
+ prefix frr-deviations-ietf-interfaces;
+
+ import ietf-interfaces {
+ prefix ietf-interfaces;
+ }
+
+ organization
+ "FRRouting";
+
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+
+ description
+ "This module defines deviation statements for the ietf-interfaces
+ module.";
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:type" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:enabled" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:link-up-down-trap-enable" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:admin-status" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:oper-status" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:last-change" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:if-index" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:phys-address" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:higher-layer-if" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:lower-layer-if" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:speed" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:statistics" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-interfaces:interfaces-state" {
+ deviate not-supported;
+ }
+}
diff --git a/yang/ietf/frr-deviations-ietf-rip.yang b/yang/ietf/frr-deviations-ietf-rip.yang
new file mode 100644
index 0000000..39a1d7e
--- /dev/null
+++ b/yang/ietf/frr-deviations-ietf-rip.yang
@@ -0,0 +1,197 @@
+module frr-deviations-ietf-rip {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/frr-deviations-ietf-rip";
+ prefix frr-deviations-ietf-rip;
+
+ import ietf-routing {
+ prefix ietf-routing;
+ }
+
+ import ietf-rip {
+ prefix ietf-rip;
+ }
+
+ organization
+ "FRRouting";
+
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+
+ description
+ "This module defines deviation statements for the ietf-rip
+ module.";
+
+ deviation "/ietf-rip:clear-rip-route/ietf-rip:input" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:originate-default-route/ietf-rip:route-policy" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:distance" {
+ deviate replace {
+ type uint8 {
+ range 0..255;
+ }
+ }
+ deviate replace {
+ default "0";
+ }
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:triggered-update-threshold" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:maximum-paths" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:output-delay" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:distribute-list" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:redistribute" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers" {
+ deviate delete {
+ must "invalid-interval >= (update-interval * 3)";
+ }
+ deviate delete {
+ must "flush-interval > invalid-interval";
+ }
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers/ietf-rip:update-interval" {
+ deviate replace {
+ type uint32;
+ }
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers/ietf-rip:invalid-interval" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers/ietf-rip:holddown-interval" {
+ deviate replace {
+ type uint32;
+ }
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers/ietf-rip:flush-interval" {
+ deviate replace {
+ default "120";
+ }
+ deviate replace {
+ type uint32;
+ }
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:authentication" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:bfd" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:cost" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:neighbors" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:no-listen" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:passive" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:originate-default-route" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:summary-address" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:timers" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:oper-status" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:next-full-update" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:valid-address" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:statistics" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:next-triggered-update" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:num-of-routes" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:redistributed" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:route-type" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:expire-time" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:deleted" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:holddown" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:need-triggered-update" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:inactive" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:flush-expire-before-holddown" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv6" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:statistics" {
+ deviate not-supported;
+ }
+}
diff --git a/yang/ietf/frr-deviations-ietf-routing.yang b/yang/ietf/frr-deviations-ietf-routing.yang
new file mode 100644
index 0000000..15ceb6b
--- /dev/null
+++ b/yang/ietf/frr-deviations-ietf-routing.yang
@@ -0,0 +1,53 @@
+module frr-deviations-ietf-routing {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/frr-deviations-ietf-routing";
+ prefix frr-deviations-ietf-routing;
+
+ import ietf-routing {
+ prefix ietf-routing;
+ }
+
+ organization
+ "FRRouting";
+
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+
+ description
+ "This module defines deviation statements for the ietf-routing
+ module.";
+
+ deviation "/ietf-routing:routing/ietf-routing:router-id" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:interfaces" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol" {
+ deviate add {
+ must '(type != "ietf-rip:ripv2") or (name = "main")' {
+ description
+ "ripd supports one RIP instance only";
+ }
+ }
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-routing:description" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-routing:static-routes" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing/ietf-routing:ribs" {
+ deviate not-supported;
+ }
+
+ deviation "/ietf-routing:routing-state" {
+ deviate not-supported;
+ }
+}
diff --git a/yang/ietf/frr-ietf-translator.json b/yang/ietf/frr-ietf-translator.json
new file mode 100644
index 0000000..36d6ddc
--- /dev/null
+++ b/yang/ietf/frr-ietf-translator.json
@@ -0,0 +1,99 @@
+{
+ "frr-module-translator:frr-module-translator": {
+ "family": "ietf",
+ "module": [
+ {
+ "name": "ietf-routing@2018-01-25",
+ "deviations": "frr-deviations-ietf-routing",
+ "mappings": [
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']",
+ "native": "/frr-ripd:ripd/instance[vrf='default']"
+ }
+ ]
+ },
+ {
+ "name": "ietf-rip@2018-02-03",
+ "deviations": "frr-deviations-ietf-rip",
+ "mappings": [
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/default-metric",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/default-metric"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/distance",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/distance/default"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/originate-default-route/enabled",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/default-information-originate"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/timers/update-interval",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/timers/update-interval"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/timers/holddown-interval",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/timers/holddown-interval"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/timers/flush-interval",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/timers/flush-interval"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/interfaces/interface[interface='KEY1']",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/interface[.='KEY1']"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/interfaces/interface[interface='KEY1']/split-horizon",
+ "native": "/frr-interface:lib/interface[name='KEY1']/frr-ripd:rip/split-horizon"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/neighbors/neighbor[address='KEY1']"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']/ipv4-address",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/neighbors/neighbor[address='KEY1']/address"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']/last-update",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/neighbors/neighbor[address='KEY1']/last-update"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']/bad-packets-rcvd",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/neighbors/neighbor[address='KEY1']/bad-packets-rcvd"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']/bad-routes-rcvd",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/neighbors/neighbor[address='KEY1']/bad-routes-rcvd"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/routes/route[prefix='KEY1']"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']/ipv4-prefix",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/routes/route[prefix='KEY1']/prefix"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']/next-hop",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/routes/route[prefix='KEY1']/next-hop"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']/interface",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/routes/route[prefix='KEY1']/interface"
+ },
+ {
+ "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']/metric",
+ "native": "/frr-ripd:ripd/instance[vrf='default']/state/routes/route[prefix='KEY1']/metric"
+ },
+ {
+ "custom": "/ietf-rip:clear-rip-route",
+ "native": "/frr-ripd:clear-rip-route"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/yang/ietf/ietf-bgp-types.yang b/yang/ietf/ietf-bgp-types.yang
new file mode 100644
index 0000000..9c7a6af
--- /dev/null
+++ b/yang/ietf/ietf-bgp-types.yang
@@ -0,0 +1,525 @@
+module ietf-bgp-types {
+ yang-version "1.1";
+ namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-types";
+
+ prefix "bt";
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ // meta
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com),
+ Jeffrey Haas (jhaas at pfrc.org).";
+ description
+ "This module contains general data definitions for use in BGP
+ policy. It can be imported by modules that make use of BGP
+ attributes";
+
+ revision 2019-10-03 {
+ description
+ "Initial Version";
+ reference
+ "RFC XXX, BGP Model for Service Provider Network.";
+ }
+
+ identity bgp-capability {
+ description "Base identity for a BGP capability";
+ }
+
+ identity mp-bgp {
+ base bgp-capability;
+ description
+ "Multi-protocol extensions to BGP";
+ reference
+ "RFC 4760";
+ }
+
+ identity route-refresh {
+ base bgp-capability;
+ description
+ "The BGP route-refresh functionality";
+ reference
+ "RFC2918";
+ }
+
+ identity asn32 {
+ base bgp-capability;
+ description
+ "4-byte (32-bit) AS number functionality";
+ reference
+ "RFC6793";
+ }
+
+ identity graceful-restart {
+ base bgp-capability;
+ description
+ "Graceful restart functionality";
+ reference
+ "RFC4724";
+ }
+
+ identity add-paths {
+ base bgp-capability;
+ description
+ "BGP add-paths";
+ reference
+ "RFC 7911.";
+ }
+
+ identity afi-safi-type {
+ description
+ "Base identity type for AFI,SAFI tuples for BGP-4";
+ reference
+ "RFC4760 - multi-protocol extensions for BGP-4";
+ }
+
+ identity ipv4-unicast {
+ base afi-safi-type;
+ description
+ "IPv4 unicast (AFI,SAFI = 1,1)";
+ reference
+ "RFC4760";
+ }
+
+ identity ipv6-unicast {
+ base afi-safi-type;
+ description
+ "IPv6 unicast (AFI,SAFI = 2,1)";
+ reference
+ "RFC4760";
+ }
+
+ identity ipv4-labeled-unicast {
+ base afi-safi-type;
+ description
+ "Labeled IPv4 unicast (AFI,SAFI = 1,4)";
+ reference
+ "RFC3107";
+ }
+
+ identity ipv6-labeled-unicast {
+ base afi-safi-type;
+ description
+ "Labeled IPv6 unicast (AFI,SAFI = 2,4)";
+ reference
+ "RFC3107";
+ }
+
+ identity l3vpn-ipv4-unicast {
+ base afi-safi-type;
+ description
+ "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)";
+ reference
+ "RFC4364";
+ }
+
+ identity l3vpn-ipv6-unicast {
+ base afi-safi-type;
+ description
+ "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)";
+ reference
+ "RFC4659";
+ }
+
+ identity l3vpn-ipv4-multicast {
+ base afi-safi-type;
+ description
+ "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)";
+ reference
+ "RFC6514";
+ }
+
+ identity l3vpn-ipv6-multicast {
+ base afi-safi-type;
+ description
+ "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)";
+ reference
+ "RFC6514";
+ }
+
+ identity l2vpn-vpls {
+ base afi-safi-type;
+ description
+ "BGP-signalled VPLS (AFI,SAFI = 25,65)";
+ reference
+ "RFC4761";
+ }
+
+ identity l2vpn-evpn {
+ base afi-safi-type;
+ description
+ "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)";
+ }
+
+ identity bgp-well-known-std-community {
+ description
+ "Base identity for reserved communities within the standard
+ community space defined by RFC1997. These communities must
+ fall within the range 0xFFFF0000 to 0xFFFFFFFF";
+ reference
+ "RFC 1997: BGP Communities Attribute.";
+ }
+
+ identity no-export {
+ base bgp-well-known-std-community;
+ description
+ "Do not export NLRI received carrying this community outside
+ the bounds of this autonomous system, or this confederation if
+ the local autonomous system is a confederation member AS. This
+ community has a value of 0xFFFFFF01.";
+ reference
+ "RFC 1997: BGP Communities Attribute.";
+ }
+
+ identity no-advertise {
+ base bgp-well-known-std-community;
+ description
+ "All NLRI received carrying this community must not be
+ advertised to other BGP peers. This community has a value of
+ 0xFFFFFF02.";
+ reference
+ "RFC 1997: BGP Communities Attribute.";
+ }
+
+ identity no-export-subconfed {
+ base bgp-well-known-std-community;
+ description
+ "All NLRI received carrying this community must not be
+ advertised to external BGP peers - including over confederation
+ sub-AS boundaries. This community has a value of 0xFFFFFF03.";
+ reference
+ "RFC 1997: BGP Communities Attribute.";
+ }
+
+ identity no-peer {
+ base bgp-well-known-std-community;
+ description
+ "An autonomous system receiving NLRI tagged with this community
+ is advised not to re-advertise the NLRI to external bi-lateral
+ peer autonomous systems. An AS may also filter received NLRI
+ from bilateral peer sessions when they are tagged with this
+ community value";
+ reference
+ "RFC 3765: NOPEER Community for BGP.";
+ }
+ identity as-path-segment-type {
+ description
+ "Base AS Path Segment Type. In [BGP-4], the path segment type
+ is a 1-octet field with the following values defined.";
+ reference
+ "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
+ }
+
+ identity as-set {
+ base as-path-segment-type;
+ description
+ "Unordered set of autonomous systems that a route in the UPDATE
+ message has traversed.";
+ reference
+ "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
+ }
+
+ identity as-sequence {
+ base as-path-segment-type;
+ description
+ "Ordered set of autonomous systems that a route in the UPDATE
+ message has traversed.";
+ reference
+ "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
+ }
+
+ identity as-confed-sequence {
+ base as-path-segment-type;
+ description
+ "Ordered set of Member Autonomous Systems in the local
+ confederation that the UPDATE message has traversed.";
+ reference
+ "RFC 5065, Autonomous System Configuration for BGP.";
+ }
+
+ identity as-confed-set {
+ base as-path-segment-type;
+ description
+ "Unordered set of Member Autonomous Systems in the local
+ confederation that the UPDATE message has traversed.";
+ reference
+ "RFC 5065, Autonomous System Configuration for BGP.";
+ }
+
+ /*
+ * Features.
+ */
+ feature send-communities {
+ description
+ "Enable the propogation of communities.";
+ }
+
+ feature ttl-security {
+ description
+ "BGP Time To Live (TTL) security check support.";
+ reference
+ "RFC 5082, The Generalized TTL Security Mechanism (GTSM)";
+ }
+
+ feature bfd {
+ description
+ "Support for BFD detection of BGP neighbor reachability.";
+ reference
+ "RFC 5880, Bidirectional Forward Detection (BFD),
+ RFC 5881, Bidirectional Forward Detection for IPv4 and IPv6
+ (Single Hop).
+ RFC 5883, Bidirectional Forwarding Detection (BFD) for Multihop
+ Paths";
+ }
+
+ typedef bgp-session-direction {
+ type enumeration {
+ enum INBOUND {
+ description
+ "Refers to all NLRI received from the BGP peer";
+ }
+ enum OUTBOUND {
+ description
+ "Refers to all NLRI advertised to the BGP peer";
+ }
+ }
+ description
+ "Type to describe the direction of NLRI transmission";
+ }
+
+ typedef bgp-well-known-community-type {
+ type identityref {
+ base bgp-well-known-std-community;
+ }
+ description
+ "Type definition for well-known IETF community attribute
+ values";
+ reference
+ "IANA Border Gateway Protocol (BGP) Well Known Communities";
+ }
+
+ typedef bgp-std-community-type {
+ // TODO: further refine restrictions and allowed patterns
+ // 4-octet value:
+ // <as number> 2 octets
+ // <community value> 2 octets
+ type union {
+ type uint32 {
+ // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 -
+ // 0xFFFFFFFF are reserved
+ range "65536..4294901759"; // 0x00010000..0xFFFEFFFF
+ }
+ type string {
+ pattern '([0-9]+:[0-9]+)';
+ }
+ }
+ description
+ "Type definition for standard community attributes";
+ reference
+ "RFC 1997 - BGP Communities Attribute";
+ }
+
+ typedef bgp-ext-community-type {
+ // TODO: needs more work to make this more precise given the
+ // variability of extended community attribute specifications
+ // 8-octet value:
+ // <type> 2 octects
+ // <value> 6 octets
+
+ type union {
+ type string {
+ // Type 1: 2-octet global and 4-octet local
+ // (AS number) (Integer)
+ pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
+ '[1-9][0-9]{1,4}|[0-9]):' +
+ '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
+ '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
+ }
+ type string {
+ // Type 2: 4-octet global and 2-octet local
+ // (ipv4-address) (integer)
+ pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
+ '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
+ '2[0-4][0-9]|25[0-5]):' +
+ '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
+ '[1-9][0-9]{1,4}|[0-9])';
+ }
+ type string {
+ // route-target with Type 1
+ // route-target:(ASN):(local-part)
+ pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' +
+ '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' +
+ '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
+ '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
+ }
+ type string {
+ // route-target with Type 2
+ // route-target:(IPv4):(local-part)
+ pattern 'route\-target:' +
+ '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
+ '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
+ '2[0-4][0-9]|25[0-5]):' +
+ '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
+ '[1-9][0-9]{1,4}|[0-9])';
+ }
+ type string {
+ // route-origin with Type 1
+ pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' +
+ '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' +
+ '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
+ '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
+ }
+ type string {
+ // route-origin with Type 2
+ pattern 'route\-origin:' +
+ '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
+ '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
+ '2[0-4][0-9]|25[0-5]):' +
+ '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
+ '[1-9][0-9]{1,4}|[0-9])';
+ }
+ }
+ description
+ "Type definition for extended community attributes";
+ reference
+ "RFC 4360 - BGP Extended Communities Attribute";
+ }
+
+ typedef bgp-community-regexp-type {
+ // TODO: needs more work to decide what format these regexps can
+ // take.
+ type string;
+ description
+ "Type definition for communities specified as regular
+ expression patterns";
+ }
+
+ typedef bgp-origin-attr-type {
+ type enumeration {
+ enum igp {
+ description "Origin of the NLRI is internal";
+ }
+ enum egp {
+ description "Origin of the NLRI is EGP";
+ }
+ enum incomplete {
+ description "Origin of the NLRI is neither IGP or EGP";
+ }
+ }
+ description
+ "Type definition for standard BGP origin attribute";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), Sec 4.3";
+ }
+
+ typedef peer-type {
+ type enumeration {
+ enum internal {
+ description
+ "internal (iBGP) peer";
+ }
+ enum external {
+ description
+ "external (eBGP) peer";
+ }
+ enum confederation {
+ description
+ "Confederation as peer";
+ }
+ }
+ description
+ "Labels a peer or peer group as explicitly internal,
+ external or confederation.";
+ }
+
+ identity REMOVE_PRIVATE_AS_OPTION {
+ description
+ "Base identity for options for removing private autonomous
+ system numbers from the AS_PATH attribute";
+ }
+
+ identity PRIVATE_AS_REMOVE_ALL {
+ base REMOVE_PRIVATE_AS_OPTION;
+ description
+ "Strip all private autonomous system numbers from the AS_PATH.
+ This action is performed regardless of the other content of the
+ AS_PATH attribute, and for all instances of private AS numbers
+ within that attribute.";
+ }
+
+ identity PRIVATE_AS_REPLACE_ALL {
+ base REMOVE_PRIVATE_AS_OPTION;
+ description
+ "Replace all instances of private autonomous system numbers in
+ the AS_PATH with the local BGP speaker's autonomous system
+ number. This action is performed regardless of the other
+ content of the AS_PATH attribute, and for all instances of
+ private AS number within that attribute.";
+ }
+
+ typedef remove-private-as-option {
+ type identityref {
+ base REMOVE_PRIVATE_AS_OPTION;
+ }
+ description
+ "Set of options for configuring how private AS path numbers
+ are removed from advertisements";
+ }
+
+ typedef percentage {
+ type uint8 {
+ range "0..100";
+ }
+ description
+ "Integer indicating a percentage value";
+ }
+
+ typedef rr-cluster-id-type {
+ type union {
+ type uint32;
+ type inet:ipv4-address;
+ }
+ description
+ "Union type for route reflector cluster ids:
+ option 1: 4-byte number
+ option 2: IP address";
+ }
+
+ typedef community-type {
+ type bits {
+ bit standard {
+ position 0;
+ description
+ "Send only standard communities.";
+ reference
+ "RFC 1997: BGP Communities Attribute.";
+ }
+ bit extended {
+ description
+ "Send only extended communities.";
+ reference
+ "RFC 4360: BGP Extended Communities Attribute.";
+ }
+ bit large {
+ description
+ "Send only large communities.";
+ reference
+ "RFC 8092: BGP Large Communities Attribute.";
+ }
+ }
+ description
+ "Type describing variations of community attributes.
+ The community types can be combined and a value of 0
+ implies 'none'";
+ }
+}
diff --git a/yang/ietf/ietf-interfaces.yang b/yang/ietf/ietf-interfaces.yang
new file mode 100644
index 0000000..f66c205
--- /dev/null
+++ b/yang/ietf/ietf-interfaces.yang
@@ -0,0 +1,1123 @@
+module ietf-interfaces {
+ yang-version 1.1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
+ prefix if;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization
+ "IETF NETMOD (Network Modeling) Working Group";
+
+ contact
+ "WG Web: <https://datatracker.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ Editor: Martin Bjorklund
+ <mailto:mbj@tail-f.com>";
+
+ description
+ "This module contains a collection of YANG definitions for
+ managing network interfaces.
+
+ Copyright (c) 2018 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (https://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 8343; see
+ the RFC itself for full legal notices.";
+
+ revision 2018-02-20 {
+ description
+ "Updated to support NMDA.";
+ reference
+ "RFC 8343: A YANG Data Model for Interface Management";
+ }
+
+ revision 2014-05-08 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 7223: A YANG Data Model for Interface Management";
+ }
+
+ /*
+ * Typedefs
+ */
+
+ typedef interface-ref {
+ type leafref {
+ path "/if:interfaces/if:interface/if:name";
+ }
+ description
+ "This type is used by data models that need to reference
+ interfaces.";
+ }
+
+ /*
+ * Identities
+ */
+
+ identity interface-type {
+ description
+ "Base identity from which specific interface types are
+ derived.";
+ }
+
+ /*
+ * Features
+ */
+
+ feature arbitrary-names {
+ description
+ "This feature indicates that the device allows user-controlled
+ interfaces to be named arbitrarily.";
+ }
+ feature pre-provisioning {
+ description
+ "This feature indicates that the device supports
+ pre-provisioning of interface configuration, i.e., it is
+ possible to configure an interface whose physical interface
+ hardware is not present on the device.";
+ }
+ feature if-mib {
+ description
+ "This feature indicates that the device implements
+ the IF-MIB.";
+ reference
+ "RFC 2863: The Interfaces Group MIB";
+ }
+
+ /*
+ * Data nodes
+ */
+
+ container interfaces {
+ description
+ "Interface parameters.";
+
+ list interface {
+ key "name";
+
+ description
+ "The list of interfaces on the device.
+
+ The status of an interface is available in this list in the
+ operational state. If the configuration of a
+ system-controlled interface cannot be used by the system
+ (e.g., the interface hardware present does not match the
+ interface type), then the configuration is not applied to
+ the system-controlled interface shown in the operational
+ state. If the configuration of a user-controlled interface
+ cannot be used by the system, the configured interface is
+ not instantiated in the operational state.
+
+ System-controlled interfaces created by the system are
+ always present in this list in the operational state,
+ whether or not they are configured.";
+
+ leaf name {
+ type string;
+ description
+ "The name of the interface.
+
+ A device MAY restrict the allowed values for this leaf,
+ possibly depending on the type of the interface.
+ For system-controlled interfaces, this leaf is the
+ device-specific name of the interface.
+
+ If a client tries to create configuration for a
+ system-controlled interface that is not present in the
+ operational state, the server MAY reject the request if
+ the implementation does not support pre-provisioning of
+ interfaces or if the name refers to an interface that can
+ never exist in the system. A Network Configuration
+ Protocol (NETCONF) server MUST reply with an rpc-error
+ with the error-tag 'invalid-value' in this case.
+
+ If the device supports pre-provisioning of interface
+ configuration, the 'pre-provisioning' feature is
+ advertised.
+
+ If the device allows arbitrarily named user-controlled
+ interfaces, the 'arbitrary-names' feature is advertised.
+
+ When a configured user-controlled interface is created by
+ the system, it is instantiated with the same name in the
+ operational state.
+
+ A server implementation MAY map this leaf to the ifName
+ MIB object. Such an implementation needs to use some
+ mechanism to handle the differences in size and characters
+ allowed between this leaf and ifName. The definition of
+ such a mechanism is outside the scope of this document.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifName";
+ }
+
+ leaf description {
+ type string;
+ description
+ "A textual description of the interface.
+
+ A server implementation MAY map this leaf to the ifAlias
+ MIB object. Such an implementation needs to use some
+ mechanism to handle the differences in size and characters
+ allowed between this leaf and ifAlias. The definition of
+ such a mechanism is outside the scope of this document.
+
+ Since ifAlias is defined to be stored in non-volatile
+ storage, the MIB implementation MUST map ifAlias to the
+ value of 'description' in the persistently stored
+ configuration.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAlias";
+ }
+
+ leaf type {
+ type identityref {
+ base interface-type;
+ }
+ mandatory true;
+ description
+ "The type of the interface.
+
+ When an interface entry is created, a server MAY
+ initialize the type leaf with a valid value, e.g., if it
+ is possible to derive the type from the name of the
+ interface.
+
+ If a client tries to set the type of an interface to a
+ value that can never be used by the system, e.g., if the
+ type is not supported or if the type does not match the
+ name of the interface, the server MUST reject the request.
+ A NETCONF server MUST reply with an rpc-error with the
+ error-tag 'invalid-value' in this case.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifType";
+ }
+
+ leaf enabled {
+ type boolean;
+ default "true";
+ description
+ "This leaf contains the configured, desired state of the
+ interface.
+
+ Systems that implement the IF-MIB use the value of this
+ leaf in the intended configuration to set
+ IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
+ has been initialized, as described in RFC 2863.
+
+ Changes in this leaf in the intended configuration are
+ reflected in ifAdminStatus.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+ }
+
+ leaf link-up-down-trap-enable {
+ if-feature if-mib;
+ type enumeration {
+ enum enabled {
+ value 1;
+ description
+ "The device will generate linkUp/linkDown SNMP
+ notifications for this interface.";
+ }
+ enum disabled {
+ value 2;
+ description
+ "The device will not generate linkUp/linkDown SNMP
+ notifications for this interface.";
+ }
+ }
+ description
+ "Controls whether linkUp/linkDown SNMP notifications
+ should be generated for this interface.
+
+ If this node is not configured, the value 'enabled' is
+ operationally used by the server for interfaces that do
+ not operate on top of any other interface (i.e., there are
+ no 'lower-layer-if' entries), and 'disabled' otherwise.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifLinkUpDownTrapEnable";
+ }
+
+ leaf admin-status {
+ if-feature if-mib;
+ type enumeration {
+ enum up {
+ value 1;
+ description
+ "Ready to pass packets.";
+ }
+ enum down {
+ value 2;
+ description
+ "Not ready to pass packets and not in some test mode.";
+ }
+ enum testing {
+ value 3;
+ description
+ "In some test mode.";
+ }
+ }
+ config false;
+ mandatory true;
+ description
+ "The desired state of the interface.
+
+ This leaf has the same read semantics as ifAdminStatus.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+ }
+
+ leaf oper-status {
+ type enumeration {
+ enum up {
+ value 1;
+ description
+ "Ready to pass packets.";
+ }
+ enum down {
+ value 2;
+
+ description
+ "The interface does not pass any packets.";
+ }
+ enum testing {
+ value 3;
+ description
+ "In some test mode. No operational packets can
+ be passed.";
+ }
+ enum unknown {
+ value 4;
+ description
+ "Status cannot be determined for some reason.";
+ }
+ enum dormant {
+ value 5;
+ description
+ "Waiting for some external event.";
+ }
+ enum not-present {
+ value 6;
+ description
+ "Some component (typically hardware) is missing.";
+ }
+ enum lower-layer-down {
+ value 7;
+ description
+ "Down due to state of lower-layer interface(s).";
+ }
+ }
+ config false;
+ mandatory true;
+ description
+ "The current operational state of the interface.
+
+ This leaf has the same semantics as ifOperStatus.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOperStatus";
+ }
+
+ leaf last-change {
+ type yang:date-and-time;
+ config false;
+ description
+ "The time the interface entered its current operational
+ state. If the current state was entered prior to the
+ last re-initialization of the local network management
+ subsystem, then this node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifLastChange";
+ }
+
+ leaf if-index {
+ if-feature if-mib;
+ type int32 {
+ range "1..2147483647";
+ }
+ config false;
+ mandatory true;
+ description
+ "The ifIndex value for the ifEntry represented by this
+ interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifIndex";
+ }
+
+ leaf phys-address {
+ type yang:phys-address;
+ config false;
+ description
+ "The interface's address at its protocol sub-layer. For
+ example, for an 802.x interface, this object normally
+ contains a Media Access Control (MAC) address. The
+ interface's media-specific modules must define the bit
+ and byte ordering and the format of the value of this
+ object. For interfaces that do not have such an address
+ (e.g., a serial line), this node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifPhysAddress";
+ }
+
+ leaf-list higher-layer-if {
+ type interface-ref;
+ config false;
+ description
+ "A list of references to interfaces layered on top of this
+ interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifStackTable";
+ }
+
+ leaf-list lower-layer-if {
+ type interface-ref;
+ config false;
+
+ description
+ "A list of references to interfaces layered underneath this
+ interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifStackTable";
+ }
+
+ leaf speed {
+ type yang:gauge64;
+ units "bits/second";
+ config false;
+ description
+ "An estimate of the interface's current bandwidth in bits
+ per second. For interfaces that do not vary in
+ bandwidth or for those where no accurate estimation can
+ be made, this node should contain the nominal bandwidth.
+ For interfaces that have no concept of bandwidth, this
+ node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifSpeed, ifHighSpeed";
+ }
+
+ container statistics {
+ config false;
+ description
+ "A collection of interface-related statistics objects.";
+
+ leaf discontinuity-time {
+ type yang:date-and-time;
+ mandatory true;
+ description
+ "The time on the most recent occasion at which any one or
+ more of this interface's counters suffered a
+ discontinuity. If no such discontinuities have occurred
+ since the last re-initialization of the local management
+ subsystem, then this node contains the time the local
+ management subsystem re-initialized itself.";
+ }
+
+ leaf in-octets {
+ type yang:counter64;
+ description
+ "The total number of octets received on the interface,
+ including framing characters.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
+ }
+
+ leaf in-unicast-pkts {
+ type yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were not addressed to a
+ multicast or broadcast address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
+ }
+
+ leaf in-broadcast-pkts {
+ type yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were addressed to a broadcast
+ address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCInBroadcastPkts";
+ }
+
+ leaf in-multicast-pkts {
+ type yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were addressed to a multicast
+ address at this sub-layer. For a MAC-layer protocol,
+ this includes both Group and Functional addresses.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCInMulticastPkts";
+ }
+
+ leaf in-discards {
+ type yang:counter32;
+ description
+ "The number of inbound packets that were chosen to be
+ discarded even though no errors had been detected to
+ prevent their being deliverable to a higher-layer
+ protocol. One possible reason for discarding such a
+ packet could be to free up buffer space.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInDiscards";
+ }
+
+ leaf in-errors {
+ type yang:counter32;
+ description
+ "For packet-oriented interfaces, the number of inbound
+ packets that contained errors preventing them from being
+ deliverable to a higher-layer protocol. For character-
+ oriented or fixed-length interfaces, the number of
+ inbound transmission units that contained errors
+ preventing them from being deliverable to a higher-layer
+ protocol.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInErrors";
+ }
+
+ leaf in-unknown-protos {
+ type yang:counter32;
+
+ description
+ "For packet-oriented interfaces, the number of packets
+ received via the interface that were discarded because
+ of an unknown or unsupported protocol. For
+ character-oriented or fixed-length interfaces that
+ support protocol multiplexing, the number of
+ transmission units received via the interface that were
+ discarded because of an unknown or unsupported protocol.
+ For any interface that does not support protocol
+ multiplexing, this counter is not present.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
+ }
+
+ leaf out-octets {
+ type yang:counter64;
+ description
+ "The total number of octets transmitted out of the
+ interface, including framing characters.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
+ }
+
+ leaf out-unicast-pkts {
+ type yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted and that were not addressed
+ to a multicast or broadcast address at this sub-layer,
+ including those that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
+ }
+
+ leaf out-broadcast-pkts {
+ type yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted and that were addressed to a
+ broadcast address at this sub-layer, including those
+ that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCOutBroadcastPkts";
+ }
+
+ leaf out-multicast-pkts {
+ type yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted and that were addressed to a
+ multicast address at this sub-layer, including those
+ that were discarded or not sent. For a MAC-layer
+ protocol, this includes both Group and Functional
+ addresses.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCOutMulticastPkts";
+ }
+
+ leaf out-discards {
+ type yang:counter32;
+ description
+ "The number of outbound packets that were chosen to be
+ discarded even though no errors had been detected to
+ prevent their being transmitted. One possible reason
+ for discarding such a packet could be to free up buffer
+ space.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
+ }
+
+ leaf out-errors {
+ type yang:counter32;
+ description
+ "For packet-oriented interfaces, the number of outbound
+ packets that could not be transmitted because of errors.
+ For character-oriented or fixed-length interfaces, the
+ number of outbound transmission units that could not be
+ transmitted because of errors.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOutErrors";
+ }
+ }
+
+ }
+ }
+
+ /*
+ * Legacy typedefs
+ */
+
+ typedef interface-state-ref {
+ type leafref {
+ path "/if:interfaces-state/if:interface/if:name";
+ }
+ status deprecated;
+ description
+ "This type is used by data models that need to reference
+ the operationally present interfaces.";
+ }
+
+ /*
+ * Legacy operational state data nodes
+ */
+
+ container interfaces-state {
+ config false;
+ status deprecated;
+ description
+ "Data nodes for the operational state of interfaces.";
+
+ list interface {
+ key "name";
+ status deprecated;
+
+ description
+ "The list of interfaces on the device.
+
+ System-controlled interfaces created by the system are
+ always present in this list, whether or not they are
+ configured.";
+
+ leaf name {
+ type string;
+ status deprecated;
+ description
+ "The name of the interface.
+
+ A server implementation MAY map this leaf to the ifName
+ MIB object. Such an implementation needs to use some
+ mechanism to handle the differences in size and characters
+ allowed between this leaf and ifName. The definition of
+ such a mechanism is outside the scope of this document.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifName";
+ }
+
+ leaf type {
+ type identityref {
+ base interface-type;
+ }
+ mandatory true;
+ status deprecated;
+ description
+ "The type of the interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifType";
+ }
+
+ leaf admin-status {
+ if-feature if-mib;
+ type enumeration {
+ enum up {
+ value 1;
+ description
+ "Ready to pass packets.";
+ }
+ enum down {
+ value 2;
+ description
+ "Not ready to pass packets and not in some test mode.";
+ }
+ enum testing {
+ value 3;
+ description
+ "In some test mode.";
+ }
+ }
+ mandatory true;
+ status deprecated;
+ description
+ "The desired state of the interface.
+
+ This leaf has the same read semantics as ifAdminStatus.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+ }
+
+ leaf oper-status {
+ type enumeration {
+ enum up {
+ value 1;
+ description
+ "Ready to pass packets.";
+ }
+ enum down {
+ value 2;
+ description
+ "The interface does not pass any packets.";
+ }
+ enum testing {
+ value 3;
+ description
+ "In some test mode. No operational packets can
+ be passed.";
+ }
+ enum unknown {
+ value 4;
+ description
+ "Status cannot be determined for some reason.";
+ }
+ enum dormant {
+ value 5;
+ description
+ "Waiting for some external event.";
+ }
+ enum not-present {
+ value 6;
+ description
+ "Some component (typically hardware) is missing.";
+ }
+ enum lower-layer-down {
+ value 7;
+ description
+ "Down due to state of lower-layer interface(s).";
+ }
+ }
+ mandatory true;
+ status deprecated;
+ description
+ "The current operational state of the interface.
+
+ This leaf has the same semantics as ifOperStatus.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOperStatus";
+ }
+
+ leaf last-change {
+ type yang:date-and-time;
+ status deprecated;
+ description
+ "The time the interface entered its current operational
+ state. If the current state was entered prior to the
+ last re-initialization of the local network management
+ subsystem, then this node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifLastChange";
+ }
+
+ leaf if-index {
+ if-feature if-mib;
+ type int32 {
+ range "1..2147483647";
+ }
+ mandatory true;
+ status deprecated;
+ description
+ "The ifIndex value for the ifEntry represented by this
+ interface.";
+
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifIndex";
+ }
+
+ leaf phys-address {
+ type yang:phys-address;
+ status deprecated;
+ description
+ "The interface's address at its protocol sub-layer. For
+ example, for an 802.x interface, this object normally
+ contains a Media Access Control (MAC) address. The
+ interface's media-specific modules must define the bit
+ and byte ordering and the format of the value of this
+ object. For interfaces that do not have such an address
+ (e.g., a serial line), this node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifPhysAddress";
+ }
+
+ leaf-list higher-layer-if {
+ type interface-state-ref;
+ status deprecated;
+ description
+ "A list of references to interfaces layered on top of this
+ interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifStackTable";
+ }
+
+ leaf-list lower-layer-if {
+ type interface-state-ref;
+ status deprecated;
+ description
+ "A list of references to interfaces layered underneath this
+ interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifStackTable";
+ }
+
+ leaf speed {
+ type yang:gauge64;
+ units "bits/second";
+ status deprecated;
+ description
+ "An estimate of the interface's current bandwidth in bits
+ per second. For interfaces that do not vary in
+ bandwidth or for those where no accurate estimation can
+
+ be made, this node should contain the nominal bandwidth.
+ For interfaces that have no concept of bandwidth, this
+ node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifSpeed, ifHighSpeed";
+ }
+
+ container statistics {
+ status deprecated;
+ description
+ "A collection of interface-related statistics objects.";
+
+ leaf discontinuity-time {
+ type yang:date-and-time;
+ mandatory true;
+ status deprecated;
+ description
+ "The time on the most recent occasion at which any one or
+ more of this interface's counters suffered a
+ discontinuity. If no such discontinuities have occurred
+ since the last re-initialization of the local management
+ subsystem, then this node contains the time the local
+ management subsystem re-initialized itself.";
+ }
+
+ leaf in-octets {
+ type yang:counter64;
+ status deprecated;
+ description
+ "The total number of octets received on the interface,
+ including framing characters.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
+ }
+
+ leaf in-unicast-pkts {
+ type yang:counter64;
+ status deprecated;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were not addressed to a
+ multicast or broadcast address at this sub-layer.
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
+ }
+
+ leaf in-broadcast-pkts {
+ type yang:counter64;
+ status deprecated;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were addressed to a broadcast
+ address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCInBroadcastPkts";
+ }
+
+ leaf in-multicast-pkts {
+ type yang:counter64;
+ status deprecated;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were addressed to a multicast
+ address at this sub-layer. For a MAC-layer protocol,
+ this includes both Group and Functional addresses.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCInMulticastPkts";
+ }
+
+ leaf in-discards {
+ type yang:counter32;
+ status deprecated;
+
+ description
+ "The number of inbound packets that were chosen to be
+ discarded even though no errors had been detected to
+ prevent their being deliverable to a higher-layer
+ protocol. One possible reason for discarding such a
+ packet could be to free up buffer space.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInDiscards";
+ }
+
+ leaf in-errors {
+ type yang:counter32;
+ status deprecated;
+ description
+ "For packet-oriented interfaces, the number of inbound
+ packets that contained errors preventing them from being
+ deliverable to a higher-layer protocol. For character-
+ oriented or fixed-length interfaces, the number of
+ inbound transmission units that contained errors
+ preventing them from being deliverable to a higher-layer
+ protocol.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInErrors";
+ }
+
+ leaf in-unknown-protos {
+ type yang:counter32;
+ status deprecated;
+ description
+ "For packet-oriented interfaces, the number of packets
+ received via the interface that were discarded because
+ of an unknown or unsupported protocol. For
+ character-oriented or fixed-length interfaces that
+ support protocol multiplexing, the number of
+ transmission units received via the interface that were
+ discarded because of an unknown or unsupported protocol.
+ For any interface that does not support protocol
+ multiplexing, this counter is not present.
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
+ }
+
+ leaf out-octets {
+ type yang:counter64;
+ status deprecated;
+ description
+ "The total number of octets transmitted out of the
+ interface, including framing characters.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
+ }
+
+ leaf out-unicast-pkts {
+ type yang:counter64;
+ status deprecated;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted and that were not addressed
+ to a multicast or broadcast address at this sub-layer,
+ including those that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
+ }
+
+ leaf out-broadcast-pkts {
+ type yang:counter64;
+ status deprecated;
+
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted and that were addressed to a
+ broadcast address at this sub-layer, including those
+ that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCOutBroadcastPkts";
+ }
+
+ leaf out-multicast-pkts {
+ type yang:counter64;
+ status deprecated;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted and that were addressed to a
+ multicast address at this sub-layer, including those
+ that were discarded or not sent. For a MAC-layer
+ protocol, this includes both Group and Functional
+ addresses.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCOutMulticastPkts";
+ }
+
+ leaf out-discards {
+ type yang:counter32;
+ status deprecated;
+ description
+ "The number of outbound packets that were chosen to be
+ discarded even though no errors had been detected to
+ prevent their being transmitted. One possible reason
+ for discarding such a packet could be to free up buffer
+ space.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
+ }
+
+ leaf out-errors {
+ type yang:counter32;
+ status deprecated;
+ description
+ "For packet-oriented interfaces, the number of outbound
+ packets that could not be transmitted because of errors.
+ For character-oriented or fixed-length interfaces, the
+ number of outbound transmission units that could not be
+ transmitted because of errors.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOutErrors";
+ }
+ }
+ }
+ }
+}
diff --git a/yang/ietf/ietf-routing-types.yang b/yang/ietf/ietf-routing-types.yang
new file mode 100644
index 0000000..a30427e
--- /dev/null
+++ b/yang/ietf/ietf-routing-types.yang
@@ -0,0 +1,751 @@
+module ietf-routing-types {
+ namespace "urn:ietf:params:xml:ns:yang:ietf-routing-types";
+ prefix rt-types;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ organization
+ "IETF RTGWG - Routing Area Working Group";
+ contact
+ "WG Web: <https://datatracker.ietf.org/wg/rtgwg/>
+ WG List: <mailto:rtgwg@ietf.org>
+ Editors: Xufeng Liu
+ <mailto:Xufeng_Liu@jabail.com>
+ Yingzhen Qu
+ <mailto:yingzhen.qu@huawei.com>
+ Acee Lindem
+ <mailto:acee@cisco.com>
+ Christian Hopps
+ <mailto:chopps@chopps.org>
+ Lou Berger
+ <mailto:lberger@labn.com>";
+
+ description
+ "This module contains a collection of YANG data types
+ considered generally useful for routing protocols.
+ Copyright (c) 2017 IETF Trust and the persons
+ identified as authors of the code. All rights reserved.
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (https://trustee.ietf.org/license-info).
+ This version of this YANG module is part of RFC 8294; see
+ the RFC itself for full legal notices.";
+ revision 2017-12-04 {
+ description "Initial revision.";
+ reference
+ "RFC 8294: Common YANG Data Types for the Routing Area.
+ Section 3.";
+ }
+
+ /*** Identities related to MPLS/GMPLS ***/
+
+ identity mpls-label-special-purpose-value {
+ description
+ "Base identity for deriving identities describing
+ special-purpose Multiprotocol Label Switching (MPLS) label
+ values.";
+ reference
+ "RFC 7274: Allocating and Retiring Special-Purpose MPLS
+ Labels.";
+ }
+
+ identity ipv4-explicit-null-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the IPv4 Explicit NULL Label.";
+ reference
+ "RFC 3032: MPLS Label Stack Encoding. Section 2.1.";
+ }
+
+ identity router-alert-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Router Alert Label.";
+ reference
+ "RFC 3032: MPLS Label Stack Encoding. Section 2.1.";
+ }
+
+ identity ipv6-explicit-null-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the IPv6 Explicit NULL Label.";
+ reference
+ "RFC 3032: MPLS Label Stack Encoding. Section 2.1.";
+ }
+
+ identity implicit-null-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Implicit NULL Label.";
+ reference
+ "RFC 3032: MPLS Label Stack Encoding. Section 2.1.";
+ }
+
+ identity entropy-label-indicator {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Entropy Label Indicator.";
+ reference
+ "RFC 6790: The Use of Entropy Labels in MPLS Forwarding.
+ Sections 3 and 10.1.";
+ }
+
+ identity gal-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Generic Associated Channel
+ (G-ACh) Label (GAL).";
+ reference
+ "RFC 5586: MPLS Generic Associated Channel.
+ Sections 4 and 10.";
+ }
+
+ identity oam-alert-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the OAM Alert Label.";
+ reference
+ "RFC 3429: Assignment of the 'OAM Alert Label' for
+ Multiprotocol Label Switching Architecture (MPLS)
+ Operation and Maintenance (OAM) Functions.
+ Sections 3 and 6.";
+ }
+
+ identity extension-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Extension Label.";
+ reference
+ "RFC 7274: Allocating and Retiring Special-Purpose MPLS
+ Labels. Sections 3.1 and 5.";
+ }
+
+ /*** Collection of types related to routing ***/
+
+ typedef router-id {
+ type yang:dotted-quad;
+ description
+ "A 32-bit number in the dotted-quad format assigned to each
+ router. This number uniquely identifies the router within
+ an Autonomous System.";
+ }
+
+ /*** Collection of types related to VPNs ***/
+
+ typedef route-target {
+ type string {
+ pattern
+ '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+ + '42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+ + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
+ + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+ + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+ + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+ + '655[0-2][0-9]|'
+ + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(6(:[a-fA-F0-9]{2}){6})|'
+ + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
+ + '[0-9a-fA-F]{1,12})';
+ }
+
+ description
+ "A Route Target is an 8-octet BGP extended community
+ initially identifying a set of sites in a BGP VPN
+ (RFC 4364). However, it has since taken on a more general
+ role in BGP route filtering. A Route Target consists of two
+ or three fields: a 2-octet Type field, an administrator
+ field, and, optionally, an assigned number field.
+ According to the data formats for types 0, 1, 2, and 6 as
+ defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
+ pattern is defined as:
+ 0:2-octet-asn:4-octet-number
+ 1:4-octet-ipv4addr:2-octet-number
+ 2:4-octet-asn:2-octet-number
+ 6:6-octet-mac-address
+ Additionally, a generic pattern is defined for future
+ Route Target types:
+ 2-octet-other-hex-number:6-octet-hex-number
+ Some valid examples are 0:100:100, 1:1.1.1.1:100,
+ 2:1234567890:203, and 6:26:00:08:92:78:00.";
+ reference
+ "RFC 4360: BGP Extended Communities Attribute.
+ RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
+ RFC 5668: 4-Octet AS Specific BGP Extended Community.
+ RFC 7432: BGP MPLS-Based Ethernet VPN.";
+ }
+
+ typedef ipv6-route-target {
+ type string {
+ pattern
+ '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+ + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+ + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}'
+ + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))'
+ + ':'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
+ pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+ + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))'
+ + ':'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
+ }
+ description
+ "An IPv6 Route Target is a 20-octet BGP IPv6 Address
+ Specific Extended Community serving the same function
+ as a standard 8-octet Route Target, except that it only
+ allows an IPv6 address as the global administrator.
+ The format is <ipv6-address:2-octet-number>.
+ Two valid examples are 2001:db8::1:6544 and
+ 2001:db8::5eb1:791:6b37:17958.";
+ reference
+ "RFC 5701: IPv6 Address Specific BGP Extended Community
+ Attribute.";
+ }
+
+ typedef route-target-type {
+ type enumeration {
+ enum import {
+ value 0;
+ description
+ "The Route Target applies to route import.";
+ }
+ enum export {
+ value 1;
+ description
+ "The Route Target applies to route export.";
+ }
+
+ enum both {
+ value 2;
+ description
+ "The Route Target applies to both route import and
+ route export.";
+ }
+ }
+ description
+ "Indicates the role a Route Target takes in route filtering.";
+ reference
+ "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).";
+ }
+
+ typedef route-distinguisher {
+ type string {
+ pattern
+ '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+ + '42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+ + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
+ + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+ + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+ + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+ + '655[0-2][0-9]|'
+ + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(6(:[a-fA-F0-9]{2}){6})|'
+ + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
+ + '[0-9a-fA-F]{1,12})';
+ }
+
+ description
+ "A Route Distinguisher is an 8-octet value used to
+ distinguish routes from different BGP VPNs (RFC 4364).
+ A Route Distinguisher will have the same format as a
+ Route Target as per RFC 4360 and will consist of
+ two or three fields: a 2-octet Type field, an administrator
+ field, and, optionally, an assigned number field.
+ According to the data formats for types 0, 1, 2, and 6 as
+ defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
+ pattern is defined as:
+ 0:2-octet-asn:4-octet-number
+ 1:4-octet-ipv4addr:2-octet-number
+ 2:4-octet-asn:2-octet-number
+ 6:6-octet-mac-address
+ Additionally, a generic pattern is defined for future
+ route discriminator types:
+ 2-octet-other-hex-number:6-octet-hex-number
+ Some valid examples are 0:100:100, 1:1.1.1.1:100,
+ 2:1234567890:203, and 6:26:00:08:92:78:00.";
+ reference
+ "RFC 4360: BGP Extended Communities Attribute.
+ RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
+ RFC 5668: 4-Octet AS Specific BGP Extended Community.
+ RFC 7432: BGP MPLS-Based Ethernet VPN.";
+ }
+
+ typedef route-origin {
+ type string {
+ pattern
+ '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+ + '42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+ + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
+ + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+ + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+ + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+ + '655[0-2][0-9]|'
+ + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(6(:[a-fA-F0-9]{2}){6})|'
+ + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
+ + '[0-9a-fA-F]{1,12})';
+ }
+ description
+ "A Route Origin is an 8-octet BGP extended community
+ identifying the set of sites where the BGP route
+ originated (RFC 4364). A Route Origin will have the same
+ format as a Route Target as per RFC 4360 and will consist
+ of two or three fields: a 2-octet Type field, an
+ administrator field, and, optionally, an assigned number
+ field.
+ According to the data formats for types 0, 1, 2, and 6 as
+ defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
+ pattern is defined as:
+ 0:2-octet-asn:4-octet-number
+ 1:4-octet-ipv4addr:2-octet-number
+ 2:4-octet-asn:2-octet-number
+ 6:6-octet-mac-address
+ Additionally, a generic pattern is defined for future
+ Route Origin types:
+ 2-octet-other-hex-number:6-octet-hex-number
+ Some valid examples are 0:100:100, 1:1.1.1.1:100,
+ 2:1234567890:203, and 6:26:00:08:92:78:00.";
+ reference
+ "RFC 4360: BGP Extended Communities Attribute.
+ RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
+ RFC 5668: 4-Octet AS Specific BGP Extended Community.
+ RFC 7432: BGP MPLS-Based Ethernet VPN.";
+ }
+
+ typedef ipv6-route-origin {
+ type string {
+ pattern
+ '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+ + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+ + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}'
+ + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))'
+ + ':'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
+ pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+ + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))'
+ + ':'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
+ }
+ description
+ "An IPv6 Route Origin is a 20-octet BGP IPv6 Address
+ Specific Extended Community serving the same function
+ as a standard 8-octet route, except that it only allows
+ an IPv6 address as the global administrator. The format
+ is <ipv6-address:2-octet-number>.
+ Two valid examples are 2001:db8::1:6544 and
+ 2001:db8::5eb1:791:6b37:17958.";
+ reference
+ "RFC 5701: IPv6 Address Specific BGP Extended Community
+ Attribute.";
+ }
+
+ /*** Collection of types common to multicast ***/
+
+ typedef ipv4-multicast-group-address {
+ type inet:ipv4-address {
+ pattern '(2((2[4-9])|(3[0-9]))\.).*';
+ }
+ description
+ "This type represents an IPv4 multicast group address,
+ which is in the range of 224.0.0.0 to 239.255.255.255.";
+ reference
+ "RFC 1112: Host Extensions for IP Multicasting.";
+ }
+
+ typedef ipv6-multicast-group-address {
+ type inet:ipv6-address {
+ pattern '(([fF]{2}[0-9a-fA-F]{2}):).*';
+ }
+ description
+ "This type represents an IPv6 multicast group address,
+ which is in the range of ff00::/8.";
+ reference
+ "RFC 4291: IP Version 6 Addressing Architecture. Section 2.7.
+ RFC 7346: IPv6 Multicast Address Scopes.";
+ }
+
+ typedef ip-multicast-group-address {
+ type union {
+ type ipv4-multicast-group-address;
+ type ipv6-multicast-group-address;
+ }
+ description
+ "This type represents a version-neutral IP multicast group
+ address. The format of the textual representation implies
+ the IP version.";
+ }
+
+ typedef ipv4-multicast-source-address {
+ type union {
+ type enumeration {
+ enum * {
+ description
+ "Any source address.";
+ }
+ }
+ type inet:ipv4-address;
+ }
+ description
+ "Multicast source IPv4 address type.";
+ }
+
+ typedef ipv6-multicast-source-address {
+ type union {
+ type enumeration {
+ enum * {
+ description
+ "Any source address.";
+ }
+ }
+ type inet:ipv6-address;
+ }
+ description
+ "Multicast source IPv6 address type.";
+ }
+
+ /*** Collection of types common to protocols ***/
+
+ typedef bandwidth-ieee-float32 {
+ type string {
+ pattern
+ '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
+ + '1(\.([0-9a-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
+ + '1[01][0-9]|0?[0-9]?[0-9])?)';
+ }
+ description
+ "Bandwidth in IEEE 754 floating-point 32-bit binary format:
+ (-1)**(S) * 2**(Exponent-127) * (1 + Fraction),
+ where Exponent uses 8 bits and Fraction uses 23 bits.
+ The units are octets per second.
+ The encoding format is the external hexadecimal-significant
+ character sequences specified in IEEE 754 and ISO/IEC C99.
+ The format is restricted to be normalized, non-negative, and
+ non-fraction: 0x1.hhhhhhp{+}d, 0X1.HHHHHHP{+}D, or 0x0p0,
+ where 'h' and 'H' are hexadecimal digits and 'd' and 'D' are
+ integers in the range of [0..127].
+ When six hexadecimal digits are used for 'hhhhhh' or
+ 'HHHHHH', the least significant digit must be an even
+ number. 'x' and 'X' indicate hexadecimal; 'p' and 'P'
+ indicate a power of two. Some examples are 0x0p0, 0x1p10,
+ and 0x1.abcde2p+20.";
+ reference
+ "IEEE Std 754-2008: IEEE Standard for Floating-Point
+ Arithmetic.
+ ISO/IEC C99: Information technology - Programming
+ Languages - C.";
+ }
+
+ typedef link-access-type {
+ type enumeration {
+ enum broadcast {
+ description
+ "Specify broadcast multi-access network.";
+ }
+ enum non-broadcast-multiaccess {
+ description
+ "Specify Non-Broadcast Multi-Access (NBMA) network.";
+ }
+ enum point-to-multipoint {
+ description
+ "Specify point-to-multipoint network.";
+ }
+ enum point-to-point {
+ description
+ "Specify point-to-point network.";
+ }
+ }
+ description
+ "Link access type.";
+ }
+
+ typedef timer-multiplier {
+ type uint8;
+ description
+ "The number of timer value intervals that should be
+ interpreted as a failure.";
+ }
+
+ typedef timer-value-seconds16 {
+ type union {
+ type uint16 {
+ range "1..65535";
+ }
+ type enumeration {
+ enum infinity {
+ description
+ "The timer is set to infinity.";
+ }
+ enum not-set {
+ description
+ "The timer is not set.";
+ }
+ }
+ }
+ units "seconds";
+ description
+ "Timer value type, in seconds (16-bit range).";
+ }
+
+ typedef timer-value-seconds32 {
+ type union {
+ type uint32 {
+ range "1..4294967295";
+ }
+ type enumeration {
+ enum infinity {
+ description
+ "The timer is set to infinity.";
+ }
+ enum not-set {
+ description
+ "The timer is not set.";
+ }
+ }
+ }
+ units "seconds";
+ description
+ "Timer value type, in seconds (32-bit range).";
+ }
+
+ typedef timer-value-milliseconds {
+ type union {
+ type uint32 {
+ range "1..4294967295";
+ }
+ type enumeration {
+ enum infinity {
+ description
+ "The timer is set to infinity.";
+ }
+ enum not-set {
+ description
+ "The timer is not set.";
+ }
+ }
+ }
+ units "milliseconds";
+ description
+ "Timer value type, in milliseconds.";
+ }
+
+ typedef percentage {
+ type uint8 {
+ range "0..100";
+ }
+ description
+ "Integer indicating a percentage value.";
+ }
+
+ typedef timeticks64 {
+ type uint64;
+ description
+ "This type is based on the timeticks type defined in
+ RFC 6991, but with 64-bit width. It represents the time,
+ modulo 2^64, in hundredths of a second between two epochs.";
+ reference
+ "RFC 6991: Common YANG Data Types.";
+ }
+
+ typedef uint24 {
+ type uint32 {
+ range "0..16777215";
+ }
+ description
+ "24-bit unsigned integer.";
+ }
+
+ /*** Collection of types related to MPLS/GMPLS ***/
+
+ typedef generalized-label {
+ type binary;
+ description
+ "Generalized Label. Nodes sending and receiving the
+ Generalized Label are aware of the link-specific
+ label context and type.";
+ reference
+ "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS)
+ Signaling Functional Description. Section 3.2.";
+ }
+
+ typedef mpls-label-special-purpose {
+ type identityref {
+ base mpls-label-special-purpose-value;
+ }
+ description
+ "This type represents the special-purpose MPLS label values.";
+ reference
+ "RFC 3032: MPLS Label Stack Encoding.
+ RFC 7274: Allocating and Retiring Special-Purpose MPLS
+ Labels.";
+ }
+
+ typedef mpls-label-general-use {
+ type uint32 {
+ range "16..1048575";
+ }
+ description
+ "The 20-bit label value in an MPLS label stack as specified
+ in RFC 3032. This label value does not include the
+ encodings of Traffic Class and TTL (Time to Live).
+ The label range specified by this type is for general use,
+ with special-purpose MPLS label values excluded.";
+ reference
+ "RFC 3032: MPLS Label Stack Encoding.";
+ }
+
+ typedef mpls-label {
+ type union {
+ type mpls-label-special-purpose;
+ type mpls-label-general-use;
+ }
+ description
+ "The 20-bit label value in an MPLS label stack as specified
+ in RFC 3032. This label value does not include the
+ encodings of Traffic Class and TTL.";
+ reference
+ "RFC 3032: MPLS Label Stack Encoding.";
+ }
+
+ /*** Groupings **/
+
+ grouping mpls-label-stack {
+ description
+ "This grouping specifies an MPLS label stack. The label
+ stack is encoded as a list of label stack entries. The
+ list key is an identifier that indicates the relative
+ ordering of each entry, with the lowest-value identifier
+ corresponding to the top of the label stack.";
+ container mpls-label-stack {
+ description
+ "Container for a list of MPLS label stack entries.";
+ list entry {
+ key "id";
+ description
+ "List of MPLS label stack entries.";
+ leaf id {
+ type uint8;
+ description
+ "Identifies the entry in a sequence of MPLS label
+ stack entries. An entry with a smaller identifier
+ value precedes an entry with a larger identifier
+ value in the label stack. The value of this ID has
+ no semantic meaning other than relative ordering
+ and referencing the entry.";
+ }
+ leaf label {
+ type rt-types:mpls-label;
+ description
+ "Label value.";
+ }
+
+ leaf ttl {
+ type uint8;
+ description
+ "Time to Live (TTL).";
+ reference
+ "RFC 3032: MPLS Label Stack Encoding.";
+ }
+ leaf traffic-class {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "Traffic Class (TC).";
+ reference
+ "RFC 5462: Multiprotocol Label Switching (MPLS) Label
+ Stack Entry: 'EXP' Field Renamed to 'Traffic Class'
+ Field.";
+ }
+ }
+ }
+ }
+
+ grouping vpn-route-targets {
+ description
+ "A grouping that specifies Route Target import-export rules
+ used in BGP-enabled VPNs.";
+ reference
+ "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
+ RFC 4664: Framework for Layer 2 Virtual Private Networks
+ (L2VPNs).";
+ list vpn-target {
+ key "route-target";
+ description
+ "List of Route Targets.";
+ leaf route-target {
+ type rt-types:route-target;
+ description
+ "Route Target value.";
+ }
+ leaf route-target-type {
+ type rt-types:route-target-type;
+ mandatory true;
+ description
+ "Import/export type of the Route Target.";
+ }
+ }
+ }
+}
diff --git a/yang/libyang_plugins/frr_user_types.c b/yang/libyang_plugins/frr_user_types.c
new file mode 100644
index 0000000..70a8da3
--- /dev/null
+++ b/yang/libyang_plugins/frr_user_types.c
@@ -0,0 +1,122 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2018 NetDEF, Inc.
+ * Renato Westphal
+ */
+
+#include <zebra.h>
+
+#include "prefix.h"
+#include "ipaddr.h"
+
+#include <libyang/user_types.h>
+
+static int ipv4_address_store_clb(const char *type_name, const char *value_str,
+ lyd_val *value, char **err_msg)
+{
+ value->ptr = malloc(sizeof(struct in_addr));
+ if (!value->ptr)
+ return 1;
+
+ if (inet_pton(AF_INET, value_str, value->ptr) != 1) {
+ free(value->ptr);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int ipv6_address_store_clb(const char *type_name, const char *value_str,
+ lyd_val *value, char **err_msg)
+{
+ value->ptr = malloc(INET6_ADDRSTRLEN);
+ if (!value->ptr)
+ return 1;
+
+ if (inet_pton(AF_INET6, value_str, value->ptr) != 1) {
+ free(value->ptr);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int ip_address_store_clb(const char *type_name, const char *value_str,
+ lyd_val *value, char **err_msg)
+{
+ value->ptr = malloc(sizeof(struct ipaddr));
+ if (!value->ptr)
+ return 1;
+
+ if (str2ipaddr(value_str, value->ptr)) {
+ free(value->ptr);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int ipv4_prefix_store_clb(const char *type_name, const char *value_str,
+ lyd_val *value, char **err_msg)
+{
+ value->ptr = malloc(sizeof(struct prefix_ipv4));
+ if (!value->ptr)
+ return 1;
+
+ if (str2prefix_ipv4(value_str, value->ptr) == 0) {
+ free(value->ptr);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int ipv6_prefix_store_clb(const char *type_name, const char *value_str,
+ lyd_val *value, char **err_msg)
+{
+ value->ptr = malloc(sizeof(struct prefix_ipv6));
+ if (!value->ptr)
+ return 1;
+
+ if (str2prefix_ipv6(value_str, value->ptr) == 0) {
+ free(value->ptr);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int ip_prefix_store_clb(const char *type_name, const char *value_str,
+ lyd_val *value, char **err_msg)
+{
+ value->ptr = malloc(sizeof(struct prefix));
+ if (!value->ptr)
+ return 1;
+
+ if (str2prefix(value_str, value->ptr) == 0) {
+ free(value->ptr);
+ return 1;
+ }
+
+ return 0;
+}
+
+struct lytype_plugin_list frr_user_types[] = {
+ {"ietf-inet-types", "2013-07-15", "ipv4-address",
+ ipv4_address_store_clb, free},
+ {"ietf-inet-types", "2013-07-15", "ipv4-address-no-zone",
+ ipv4_address_store_clb, free},
+ {"ietf-inet-types", "2013-07-15", "ipv6-address",
+ ipv6_address_store_clb, free},
+ {"ietf-inet-types", "2013-07-15", "ipv6-address-no-zone",
+ ipv6_address_store_clb, free},
+ {"ietf-inet-types", "2013-07-15", "ip-address", ip_address_store_clb,
+ free},
+ {"ietf-inet-types", "2013-07-15", "ipv4-prefix", ipv4_prefix_store_clb,
+ free},
+ {"ietf-inet-types", "2013-07-15", "ipv6-prefix", ipv6_prefix_store_clb,
+ free},
+ {"ietf-inet-types", "2013-07-15", "ip-prefix", ip_prefix_store_clb,
+ free},
+ {NULL, NULL, NULL, NULL, NULL} /* terminating item */
+};
diff --git a/yang/libyang_plugins/subdir.am b/yang/libyang_plugins/subdir.am
new file mode 100644
index 0000000..837908a
--- /dev/null
+++ b/yang/libyang_plugins/subdir.am
@@ -0,0 +1,7 @@
+#
+# libyang user types
+#
+
+# XXX: disable support for libyang custom user types temporarily to facilitate
+# the transition from libyang 0.x to libyang 1.x.
+#lib_libfrr_la_SOURCES += yang/libyang_plugins/frr_user_types.c
diff --git a/yang/subdir.am b/yang/subdir.am
new file mode 100644
index 0000000..eb17c38
--- /dev/null
+++ b/yang/subdir.am
@@ -0,0 +1,131 @@
+SUFFIXES += .yang .yang.c .yin .yin.c
+EXTRA_DIST += yang/embedmodel.py
+
+.yang.yang.c:
+ $(AM_V_GEN)$(PYTHON) $(top_srcdir)/yang/embedmodel.py $^ $@
+.yin.yin.c:
+ $(AM_V_GEN)$(PYTHON) $(top_srcdir)/yang/embedmodel.py $^ $@
+
+# use .yang.c files like this:
+#
+# ripd_ripd_SOURCES = \
+# ...
+# nodist_ripd_ripd_SOURCES = \
+# yang/frr-ripd.yang.c \
+# # end
+#
+# Note that putting the .yang.c file into a static library.a will NOT work
+# because the entire file is "optimized out" since it does not contain any
+# global symbols :(. Just put it in the daemon. Dynamic libraries.so work
+# without problems, as seen in libfrr.
+
+dist_yangmodels_DATA += yang/frr-affinity-map.yang
+dist_yangmodels_DATA += yang/frr-filter.yang
+dist_yangmodels_DATA += yang/frr-module-translator.yang
+dist_yangmodels_DATA += yang/frr-nexthop.yang
+dist_yangmodels_DATA += yang/frr-test-module.yang
+dist_yangmodels_DATA += yang/frr-if-rmap.yang
+dist_yangmodels_DATA += yang/frr-interface.yang
+dist_yangmodels_DATA += yang/frr-route-map.yang
+dist_yangmodels_DATA += yang/frr-zebra-route-map.yang
+dist_yangmodels_DATA += yang/frr-ospf-route-map.yang
+dist_yangmodels_DATA += yang/frr-ospf6-route-map.yang
+dist_yangmodels_DATA += yang/frr-bgp-filter.yang
+dist_yangmodels_DATA += yang/frr-bgp-route-map.yang
+dist_yangmodels_DATA += yang/frr-vrf.yang
+dist_yangmodels_DATA += yang/frr-route-types.yang
+dist_yangmodels_DATA += yang/frr-routing.yang
+dist_yangmodels_DATA += yang/ietf/ietf-routing-types.yang
+dist_yangmodels_DATA += yang/ietf/ietf-interfaces.yang
+dist_yangmodels_DATA += yang/ietf/ietf-bgp-types.yang
+
+if BFDD
+dist_yangmodels_DATA += yang/frr-bfdd.yang
+endif
+
+if EIGRPD
+dist_yangmodels_DATA += yang/frr-eigrpd.yang
+endif
+
+if RIPD
+dist_yangmodels_DATA += yang/frr-ripd.yang
+endif
+
+if RIPNGD
+dist_yangmodels_DATA += yang/frr-ripngd.yang
+endif
+
+if ISISD
+dist_yangmodels_DATA += yang/frr-isisd.yang
+endif
+
+if VRRPD
+dist_yangmodels_DATA += yang/frr-vrrpd.yang
+endif
+
+if STATICD
+dist_yangmodels_DATA += yang/frr-staticd.yang
+endif
+
+if ZEBRA
+dist_yangmodels_DATA += yang/frr-zebra.yang
+endif
+
+if PIMD
+dist_yangmodels_DATA += yang/frr-gmp.yang
+dist_yangmodels_DATA += yang/frr-pim.yang
+dist_yangmodels_DATA += yang/frr-pim-rp.yang
+endif
+
+if BGPD
+dist_yangmodels_DATA += yang/frr-bgp-common-structure.yang
+dist_yangmodels_DATA += yang/frr-bgp-common.yang
+dist_yangmodels_DATA += yang/frr-bgp-common-multiprotocol.yang
+dist_yangmodels_DATA += yang/frr-bgp-neighbor.yang
+dist_yangmodels_DATA += yang/frr-bgp-peer-group.yang
+dist_yangmodels_DATA += yang/frr-deviations-bgp-datacenter.yang
+dist_yangmodels_DATA += yang/frr-bgp-rpki.yang
+dist_yangmodels_DATA += yang/frr-bgp-bmp.yang
+dist_yangmodels_DATA += yang/frr-bgp-types.yang
+dist_yangmodels_DATA += yang/frr-bgp.yang
+endif
+
+if OSPFD
+dist_yangmodels_DATA += yang/frr-ospfd.yang
+endif
+
+if PATHD
+dist_yangmodels_DATA += yang/frr-pathd.yang
+endif
+
+CLEANFILES += \
+ yang/*.c \
+ yang/ietf/*.c \
+ yang/confd/*.c \
+ #
+
+if CONFD
+
+SUBMODULES = $(shell cd $(top_srcdir); grep -l belongs-to $(dist_yangmodels_DATA))
+EXCLUDED_MODULES = $(SUBMODULES) yang/frr-module-translator.yang
+YANG_MODULES = $(filter-out $(EXCLUDED_MODULES),$(dist_yangmodels_DATA))
+
+fxsdir = $(sysconfdir)/confd
+fxs_DATA = $(YANG_MODULES:.yang=.fxs)
+
+SUFFIXES += .fxs
+CLEANFILES += $(fxs_DATA)
+
+AM_V_CONFDC = $(AM_V_CONFDC_@AM_V@)
+AM_V_CONFDC_ = $(AM_V_CONFDC_@AM_DEFAULT_V@)
+AM_V_CONFDC_0 = @echo " CONFDC " $@;
+
+CONFDC_FLAGS = --yangpath $(srcdir)/yang --yangpath $(srcdir)/yang/ietf
+
+yang/%.fxs: yang/%.yang yang/confd/confd.%.yang
+ $(AM_V_CONFDC)$(CONFDC) $(CONFDC_FLAGS) -c -o $@ -a $(srcdir)/yang/confd/confd.$*.yang -- $<
+
+yang/%.fxs: yang/%.yang
+ $(AM_V_CONFDC)$(CONFDC) $(CONFDC_FLAGS) -c -o $@ -- $<
+
+endif