summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2020-05-29 06:44:37 +0200
committerChirag Shah <chirag@cumulusnetworks.com>2020-06-11 01:25:18 +0200
commit9670b0b399ed479a81c6b201778f266853562ffb (patch)
tree45c0e0a7a0534c26b6551b626a164b11ed2be9ed
parentMerge pull request #6471 from volta-networks/fix_zebra_register_rnh_pseudowire (diff)
downloadfrr-9670b0b399ed479a81c6b201778f266853562ffb.tar.xz
frr-9670b0b399ed479a81c6b201778f266853562ffb.zip
yang: redefine nexthop operational model
Separate out nexthop config and operational models. nexthop-group config model has list of nexthop-groups where else operational nexthop group is single entity underneath list of nexthops. The common code is fectored into grouping to use among config and operational model. nexthop operational model caters to RIB operational model. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
-rw-r--r--yang/frr-nexthop.yang56
-rw-r--r--yang/frr-zebra.yang4
2 files changed, 41 insertions, 19 deletions
diff --git a/yang/frr-nexthop.yang b/yang/frr-nexthop.yang
index ce6f21a66..779c56df7 100644
--- a/yang/frr-nexthop.yang
+++ b/yang/frr-nexthop.yang
@@ -137,6 +137,13 @@ module frr-nexthop {
"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.
*/
@@ -147,6 +154,7 @@ module frr-nexthop {
description
"The nexthop type.";
}
+
leaf vrf {
type frr-vrf:vrf-ref;
description
@@ -157,17 +165,20 @@ module frr-nexthop {
description
"The nexthop gateway address.";
}
+
leaf interface {
type frr-interface:interface-ref;
description
"The nexthop egress interface.";
}
+
leaf bh-type {
when "../nh-type = 'blackhole'";
type blackhole-type;
description
"A blackhole sub-type, if the nexthop is a blackhole type.";
}
+
leaf onlink {
when "../nh-type = 'ip4-ifindex' or
../nh-type = 'ip6-ifindex'";
@@ -223,6 +234,15 @@ module frr-nexthop {
}
}
+ grouping nexthop-grouping {
+ list nexthop {
+ key "nh-type gateway interface";
+ description
+ "A list of nexthop objects.";
+ uses frr-nexthop-attributes;
+ }
+ }
+
/*
* Single nexthop grouping.
*/
@@ -230,12 +250,7 @@ module frr-nexthop {
container frr-nexthops {
description
"FRR nexthop object.";
- list nexthop {
- key "nh-type gateway interface";
- description
- "A list of nexthop objects.";
- uses frr-nexthop-attributes;
- }
+ uses nexthop-grouping;
}
}
@@ -244,11 +259,10 @@ module frr-nexthop {
* Container for FRR nexthop group.
*/
grouping frr-nexthop-grouping {
- list nexthop-group {
+ list nexthop-groups {
key "name";
description
- "A group of nexthops.";
-
+ "List of nexthop groups, each contains group of nexthops";
leaf name {
type string;
description
@@ -259,23 +273,31 @@ module 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;
+ }
+ }
+
container frr-nexthop-group {
description
"A nexthop-group, represented as a list of nexthop objects.";
uses frr-nexthop-grouping;
}
- typedef nexthop-group-ref {
- type leafref {
- require-instance false;
- path "/frr-nexthop:frr-nexthop-group/frr-nexthop:nexthop-group/frr-nexthop:name";
- }
- }
-
/*
* Augment weight attributes to nexthop group.
*/
- augment "/frr-nexthop-group/nexthop-group/frr-nexthops/nexthop" {
+ augment "/frr-nexthop-group/nexthop-groups/frr-nexthops/nexthop" {
leaf weight {
type uint8;
description
diff --git a/yang/frr-zebra.yang b/yang/frr-zebra.yang
index 4aeba1412..159dd8f79 100644
--- a/yang/frr-zebra.yang
+++ b/yang/frr-zebra.yang
@@ -316,7 +316,7 @@ module frr-zebra {
"Uptime for the route.";
}
- uses frr-nh:frr-nexthop-grouping;
+ uses frr-nh:frr-nexthop-group-operational;
}
// End of route-common
@@ -2074,7 +2074,7 @@ module frr-zebra {
}
}
- augment "/frr-vrf:lib/frr-vrf:vrf/frr-zebra:zebra/ribs/rib/route/route-entry/nexthop-group/frr-nexthops/nexthop" {
+ augment "/frr-vrf:lib/frr-vrf:vrf/frr-zebra:zebra/ribs/rib/route/route-entry/nexthop-group/nexthop" {
uses frr-nh:frr-nexthop-operational;
}