yang: add weight in nexthop operational model

add weight field to operational model.
add leafref to nexthopgroup.
format according to yanglint.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
This commit is contained in:
Chirag Shah 2020-04-03 23:08:58 -07:00 committed by Santosh P K
parent 8f86689091
commit d9d6232fb6

View File

@ -16,7 +16,7 @@ module frr-nexthop {
} }
import frr-vrf { import frr-vrf {
prefix "frr-vrf"; prefix frr-vrf;
} }
organization organization
@ -33,13 +33,12 @@ module frr-nexthop {
} }
typedef optional-ip-address { typedef optional-ip-address {
type union { type union {
type inet:ip-address; type inet:ip-address;
type string { type string {
pattern pattern '';
''; }
} }
}
} }
/* /*
@ -148,10 +147,11 @@ module frr-nexthop {
when "../nh-type = 'ip4-ifindex' or when "../nh-type = 'ip4-ifindex' or
../nh-type = 'ip6-ifindex'"; ../nh-type = 'ip6-ifindex'";
type boolean; type boolean;
default false; default "false";
description description
"Nexthop is directly connected."; "Nexthop is directly connected.";
} }
uses rt-types:mpls-label-stack { uses rt-types:mpls-label-stack {
description description
"Nexthop's MPLS label stack."; "Nexthop's MPLS label stack.";
@ -163,29 +163,39 @@ module frr-nexthop {
*/ */
grouping frr-nexthop-operational { grouping frr-nexthop-operational {
leaf duplicate { leaf duplicate {
config false;
type empty; type empty;
config false;
description description
"Duplicate nexthop"; "Duplicate nexthop";
} }
leaf recursive { leaf recursive {
config false;
type empty; type empty;
config false;
description description
"Nexthop resolved through another gateway."; "Nexthop resolved through another gateway.";
} }
leaf active { leaf active {
config false;
type empty; type empty;
config false;
description description
"Nexthop is active."; "Nexthop is active.";
} }
leaf fib { leaf fib {
config false;
type empty; type empty;
config false;
description description
"Nexthop is installed in fib."; "Nexthop is installed in fib.";
} }
leaf weight {
type uint8;
config false;
description
"Weight to be used by the nexthop for purposes of ECMP";
}
} }
/* /*
@ -199,7 +209,6 @@ module frr-nexthop {
key "nh-type gateway interface"; key "nh-type gateway interface";
description description
"A list of nexthop objects."; "A list of nexthop objects.";
uses frr-nexthop-attributes; uses frr-nexthop-attributes;
} }
} }
@ -228,12 +237,18 @@ module frr-nexthop {
container frr-nexthop-group { container frr-nexthop-group {
description description
"A nexthop-group, represented as a list of nexthop objects."; "A nexthop-group, represented as a list of nexthop objects.";
uses frr-nexthop-grouping; 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";
}
}
/* /*
* Agument weight attributes to nexthop group. * Augment weight attributes to nexthop group.
*/ */
augment "/frr-nexthop-group/nexthop-group/frr-nexthops/nexthop" { augment "/frr-nexthop-group/nexthop-group/frr-nexthops/nexthop" {
leaf weight { leaf weight {