From: Chirag Shah Date: Sat, 4 Apr 2020 06:08:58 +0000 (-0700) Subject: yang: add weight in nexthop operational model X-Git-Tag: base_7.4~70^2~3 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d9d6232fb612a01e40cef93b8ff8d9ddfeffa538;p=mirror%2Ffrr.git 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 --- diff --git a/yang/frr-nexthop.yang b/yang/frr-nexthop.yang index 17c3eaa403..07e15eb774 100644 --- a/yang/frr-nexthop.yang +++ b/yang/frr-nexthop.yang @@ -16,7 +16,7 @@ module frr-nexthop { } import frr-vrf { - prefix "frr-vrf"; + prefix frr-vrf; } organization @@ -33,13 +33,12 @@ module frr-nexthop { } typedef optional-ip-address { - type union { - type inet:ip-address; - type string { - pattern - ''; - } - } + type union { + type inet:ip-address; + type string { + pattern ''; + } + } } /* @@ -148,10 +147,11 @@ module frr-nexthop { when "../nh-type = 'ip4-ifindex' or ../nh-type = 'ip6-ifindex'"; type boolean; - default false; + default "false"; description "Nexthop is directly connected."; } + uses rt-types:mpls-label-stack { description "Nexthop's MPLS label stack."; @@ -163,29 +163,39 @@ module frr-nexthop { */ grouping frr-nexthop-operational { leaf duplicate { - config false; type empty; + config false; description "Duplicate nexthop"; } + leaf recursive { - config false; type empty; + config false; description "Nexthop resolved through another gateway."; } + leaf active { - config false; type empty; + config false; description "Nexthop is active."; } + leaf fib { - config false; 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"; + } } /* @@ -199,7 +209,6 @@ module frr-nexthop { key "nh-type gateway interface"; description "A list of nexthop objects."; - uses frr-nexthop-attributes; } } @@ -228,12 +237,18 @@ module frr-nexthop { 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"; + } + } + /* - * Agument weight attributes to nexthop group. + * Augment weight attributes to nexthop group. */ augment "/frr-nexthop-group/nexthop-group/frr-nexthops/nexthop" { leaf weight {