summaryrefslogtreecommitdiffstats
path: root/yang
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-01-22 15:52:45 +0100
committerGitHub <noreply@github.com>2024-01-22 15:52:45 +0100
commit22d1ad786f6961bf4f685599b5fb16a84b802346 (patch)
tree345dfb75b81fa4a7115c9751a9e3bd63b6e1901b /yang
parentMerge pull request #15052 from louis-6wind/rpki-vrf-92 (diff)
parentripngd: use new distribute-list northbound code. (diff)
downloadfrr-22d1ad786f6961bf4f685599b5fb16a84b802346.tar.xz
frr-22d1ad786f6961bf4f685599b5fb16a84b802346.zip
Merge pull request #15185 from LabNConsulting/chopps/distlist
add northbound support to distribute-list code.
Diffstat (limited to 'yang')
-rw-r--r--yang/frr-filter.yang194
-rw-r--r--yang/frr-ripd.yang11
-rw-r--r--yang/frr-ripngd.yang11
3 files changed, 145 insertions, 71 deletions
diff --git a/yang/frr-filter.yang b/yang/frr-filter.yang
index a1946d834..9b65fcc02 100644
--- a/yang/frr-filter.yang
+++ b/yang/frr-filter.yang
@@ -10,6 +10,9 @@ module frr-filter {
import ietf-yang-types {
prefix yang;
}
+ import frr-interface {
+ prefix frr-interface;
+ }
organization "FRRouting";
contact
@@ -45,35 +48,95 @@ module frr-filter {
revision 2019-07-04 {
description "Initial revision";
+ reference "FRRouting";
}
/*
* Types.
*/
typedef access-list-name {
- description "Access list name formatting";
type string {
length 1..128;
}
+ description "Access list name formatting";
}
typedef access-list-sequence {
- description "Access list sequence number";
type uint32 {
range "1..4294967295";
}
+ description "Access list sequence number";
}
typedef access-list-action {
- description "Access list return action on match";
type enumeration {
enum deny {
- description "Deny an entry";
value 0;
+ description "Deny an entry";
}
enum permit {
- description "Accept an entry";
value 1;
+ description "Accept an entry";
+ }
+ }
+ description "Access list return action on match";
+ }
+
+ typedef access-list-ref {
+ type leafref {
+ path "/frr-filter:lib/frr-filter:access-list/frr-filter:name";
+ require-instance false;
+ }
+ description "IPv4 or IPv6 access list reference";
+ }
+
+ typedef prefix-list-ref {
+ type leafref {
+ path "/frr-filter:lib/frr-filter:prefix-list/frr-filter:name";
+ require-instance false;
+ }
+ description "IPv4 or IPv6 prefix list reference";
+ }
+
+ /*
+ * Grouping.
+ */
+ grouping distribute-list-group {
+ description "Distribute list grouping";
+ list distribute-list {
+ key "interface";
+ description "Distribute list configuration";
+
+ leaf interface {
+ type union {
+ type frr-interface:interface-ref;
+ type empty;
+ }
+ description
+ "Interface to attach list to or empty for global.";
+ }
+
+ container in {
+ description "Inbound filter list";
+ leaf access-list {
+ type access-list-ref;
+ description "inbound access list";
+ }
+ leaf prefix-list {
+ type prefix-list-ref;
+ description "inbound prefix list";
+ }
+ }
+ container out {
+ description "Outbound filter list";
+ leaf access-list {
+ type access-list-ref;
+ description "outbound access list";
+ }
+ leaf prefix-list {
+ type prefix-list-ref;
+ description "outbound prefix list";
+ }
}
}
}
@@ -82,77 +145,74 @@ module frr-filter {
* Configuration data.
*/
container lib {
+ description "Filter library";
list access-list {
- description "Access list instance";
-
key "type name";
+ description "Access list instance";
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;
+ value 0;
+ description "Internet Protocol address version 4";
+ }
+ enum ipv6 {
+ value 1;
+ description "Internet Protocol address version 6";
}
enum mac {
- description "Media Access Control address";
value 2;
+ description "Media Access Control address";
}
}
+ description "Access list content type";
}
leaf name {
- description "Access list name";
type access-list-name;
+ description "Access list name";
}
leaf remark {
- description "Access list remark";
type string;
+ description "Access list remark";
}
list entry {
- description "Access list entry";
-
key "sequence";
-
+ description "Access list entry";
leaf sequence {
- description "Access list sequence value";
type access-list-sequence;
+ description "Access list sequence value";
}
-
leaf action {
- description "Access list action on match";
type access-list-action;
mandatory true;
+ description "Access list action on match";
}
choice value {
- description "Access list value to match";
mandatory true;
+ description "Access list value to match";
case ipv4-prefix {
when "../type = 'ipv4'";
choice style {
- description "Access list entry style selection: zebra or cisco.";
mandatory true;
+ description "Access list entry style selection: zebra or cisco.";
case zebra {
leaf ipv4-prefix {
- description "Configure IPv4 prefix to match";
type inet:ipv4-prefix;
mandatory true;
+ description "Configure IPv4 prefix to match";
}
leaf ipv4-exact-match {
- description "Exact match of prefix";
type boolean;
default false;
+ description "Exact match of prefix";
}
}
case cisco {
@@ -160,19 +220,20 @@ module frr-filter {
description "Source value to match";
leaf host {
- description "Host to match";
type inet:ipv4-address;
+ description "Host to match";
}
container network {
+ description "Network to match";
leaf address {
+ type inet:ipv4-address;
mandatory true;
description "Network address part.";
- type inet:ipv4-address;
}
leaf mask {
+ type inet:ipv4-address;
mandatory true;
description "Network mask/wildcard part.";
- type inet:ipv4-address;
}
}
leaf source-any {
@@ -180,8 +241,8 @@ module frr-filter {
* Was `any`, however it conflicts with `any` leaf
* outside this choice.
*/
- description "Match any";
type empty;
+ description "Match any";
}
}
@@ -189,24 +250,25 @@ module frr-filter {
description "Destination value to match";
leaf destination-host {
- description "Host to match";
type inet:ipv4-address;
+ description "Host to match";
}
container destination-network {
+ description "Destination network to match";
leaf address {
+ type inet:ipv4-address;
mandatory true;
description "Network address part.";
- type inet:ipv4-address;
}
leaf mask {
+ type inet:ipv4-address;
mandatory true;
description "Network mask/wildcard part.";
- type inet:ipv4-address;
}
}
leaf destination-any {
- description "Match any";
type empty;
+ description "Match any";
}
}
}
@@ -216,29 +278,29 @@ module frr-filter {
when "../type = 'ipv6'";
leaf ipv6-prefix {
- description "Configure IPv6 prefix to match";
type inet:ipv6-prefix;
mandatory true;
+ description "Configure IPv6 prefix to match";
}
leaf ipv6-exact-match {
- description "Exact match of prefix";
type boolean;
default false;
+ description "Exact match of prefix";
}
}
case mac {
when "../type = 'mac'";
leaf mac {
- description "Configure MAC address to match";
type yang:mac-address;
+ description "Configure MAC address to match";
}
}
case any {
leaf any {
- description "Match anything";
type empty;
+ description "Match anything";
}
}
}
@@ -246,108 +308,104 @@ module frr-filter {
}
list prefix-list {
- description "Prefix list instance";
-
key "type name";
-
+ description "Prefix list instance";
leaf type {
- description "Prefix list type";
type enumeration {
enum ipv4 {
- description "Internet Protocol address version 4";
value 0;
+ description "Internet Protocol address version 4";
}
enum ipv6 {
- description "Internet Protocol address version 6";
value 1;
+ description "Internet Protocol address version 6";
}
}
+ description "Prefix list type";
}
leaf name {
- description "Prefix list name";
type access-list-name;
+ description "Prefix list name";
}
leaf remark {
- description "Prefix list user description";
type string;
+ description "Prefix list user description";
}
list entry {
- description "Prefix list entry";
-
key "sequence";
-
+ description "Prefix list entry";
leaf sequence {
- description "Prefix list sequence value";
type access-list-sequence;
+ description "Prefix list sequence value";
}
leaf action {
- description "Prefix list action on match";
type access-list-action;
mandatory true;
+ description "Prefix list action on match";
}
choice value {
- description "Prefix list value to match";
mandatory true;
+ description "Prefix list value to match";
case ipv4-prefix {
leaf ipv4-prefix {
- description "Configure IPv4 prefix to match";
type inet:ipv4-prefix;
mandatory true;
+ description "Configure IPv4 prefix to match";
}
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";
}
+ description
+ "Specifies if matching prefixes with length greater than
+ or equal to value";
}
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";
}
+ description
+ "Specifies if matching prefixes with length lesser than
+ or equal to value";
}
}
case ipv6-prefix {
leaf ipv6-prefix {
- description "Configure IPv6 prefix to match";
type inet:ipv6-prefix;
mandatory true;
+ description "Configure IPv6 prefix to match";
}
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";
}
+ description
+ "Specifies if matching prefixes with length greater than
+ or equal to value";
}
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";
}
+ description
+ "Specifies if matching prefixes with length lesser than
+ or equal to value";
}
}
case any {
leaf any {
- description "Match anything";
type empty;
+ description "Match anything";
}
}
}
diff --git a/yang/frr-ripd.yang b/yang/frr-ripd.yang
index 5f85a4cab..d65ee4896 100644
--- a/yang/frr-ripd.yang
+++ b/yang/frr-ripd.yang
@@ -16,6 +16,9 @@ module frr-ripd {
import frr-bfdd {
prefix frr-bfdd;
}
+ import frr-filter {
+ prefix frr-filter;
+ }
import frr-interface {
prefix frr-interface;
}
@@ -258,6 +261,9 @@ module frr-ripd {
"A list of interfaces where the sending of RIP packets
is enabled.";
}
+
+ uses frr-filter:distribute-list-group;
+
list redistribute {
key "protocol";
description
@@ -380,9 +386,9 @@ module frr-ripd {
}
leaf default-bfd-profile {
+ type frr-bfdd:profile-ref;
description
"Use this BFD profile for all peers by default.";
- type frr-bfdd:profile-ref;
}
/*
@@ -691,12 +697,13 @@ module frr-ripd {
container bfd-monitoring {
presence
"Present if BFD is configured for RIP peers in this interface.";
+ description "Configure BFD use in RIPD";
leaf enable {
type boolean;
+ default false;
description
"Enable/disable BFD monitoring.";
- default false;
}
leaf profile {
diff --git a/yang/frr-ripngd.yang b/yang/frr-ripngd.yang
index 4aeaf3640..383b45fa4 100644
--- a/yang/frr-ripngd.yang
+++ b/yang/frr-ripngd.yang
@@ -13,6 +13,9 @@ module frr-ripngd {
import frr-if-rmap {
prefix frr-if-rmap;
}
+ import frr-filter {
+ prefix frr-filter;
+ }
import frr-interface {
prefix frr-interface;
}
@@ -63,6 +66,7 @@ module frr-ripngd {
description
"Changed interface references to use
frr-interface:interface-ref typedef";
+ reference "FRRouting";
}
revision 2018-11-27 {
description
@@ -72,6 +76,7 @@ module frr-ripngd {
}
container ripngd {
+ description "ripng routing instance data";
/*
* Routing instance configuration.
*/
@@ -169,15 +174,18 @@ module frr-ripngd {
"A list of interfaces where the sending of RIPng packets
is disabled.";
}
+
+ uses frr-filter:distribute-list-group;
+
list redistribute {
key "protocol";
description
"Redistributes routes learned from other routing protocols.";
leaf protocol {
type frr-route-types:frr-route-types-v6;
+ must '. != "ripng"';
description
"Routing protocol.";
- must '. != "ripng"';
}
leaf route-map {
type frr-route-map:route-map-ref;
@@ -330,6 +338,7 @@ module frr-ripngd {
* Per-interface configuration data
*/
augment "/frr-interface:lib/frr-interface:interface" {
+ description "RIPng interface augmentation.";
container ripng {
description
"RIPng interface parameters.";