mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 00:56:19 +00:00
yang: add zebra specific route map options
* Extend the route map yang model to have zebra enumerations; * Add zebra route map specific match/set values; Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
fe362bf415
commit
bc77245fa1
@ -179,17 +179,27 @@ module frr-route-map {
|
||||
description "Match a route tag";
|
||||
value 10;
|
||||
}
|
||||
|
||||
/*
|
||||
* Protocol YANG models should augment the parent node to
|
||||
* contain the routing protocol specific value. The protocol
|
||||
* must also augment `condition-value` to include its specific
|
||||
* values or expand the `when` statement on the existing cases.
|
||||
*/
|
||||
enum routing-protocol-specific {
|
||||
description "Match a routing protocol specific type";
|
||||
/* zebra specific conditions. */
|
||||
enum ipv4-prefix-length {
|
||||
description "Match IPv4 prefix length";
|
||||
value 100;
|
||||
}
|
||||
enum ipv6-prefix-length {
|
||||
description "Match IPv6 prefix length";
|
||||
value 101;
|
||||
}
|
||||
enum ipv4-next-hop-prefix-length {
|
||||
description "Match next-hop prefix length";
|
||||
value 102;
|
||||
}
|
||||
enum source-protocol {
|
||||
description "Match prefix length";
|
||||
value 103;
|
||||
}
|
||||
enum source-instance {
|
||||
description "Match prefix length";
|
||||
value 104;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -291,15 +301,9 @@ module frr-route-map {
|
||||
description "Set tag";
|
||||
value 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Protocol YANG models should augment the parent node to
|
||||
* contain the routing protocol specific value. The protocol
|
||||
* must also augment `action-value` to include its specific
|
||||
* values or expand the `when` statement on the existing cases.
|
||||
*/
|
||||
enum routing-protocol-specific {
|
||||
description "Set a routing protocol specific action";
|
||||
/* zebra specific conditions. */
|
||||
enum source {
|
||||
description "Set source address for route";
|
||||
value 100;
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,10 @@ module frr-zebra {
|
||||
prefix inet;
|
||||
}
|
||||
|
||||
import frr-route-map {
|
||||
prefix frr-route-map;
|
||||
}
|
||||
|
||||
import frr-route-types {
|
||||
prefix frr-route-types;
|
||||
}
|
||||
@ -1985,4 +1989,63 @@ module frr-zebra {
|
||||
}
|
||||
|
||||
// End interface model augmentation
|
||||
|
||||
augment "/frr-route-map:lib"
|
||||
+ "/frr-route-map:route-map"
|
||||
+ "/frr-route-map:entry"
|
||||
+ "/frr-route-map:match-condition"
|
||||
+ "/frr-route-map:condition-value" {
|
||||
case ipv4-prefix-length {
|
||||
when "./condition = 'ipv4-prefix-length' or
|
||||
./condition = 'ipv4-next-hop-prefix-length'";
|
||||
leaf ipv4-prefix-length {
|
||||
type uint8 {
|
||||
range "0..32";
|
||||
}
|
||||
}
|
||||
}
|
||||
case ipv6-prefix-length {
|
||||
when "./condition = 'ipv6-prefix-length'";
|
||||
leaf ipv6-prefix-length {
|
||||
type uint8 {
|
||||
range "0..128";
|
||||
}
|
||||
}
|
||||
}
|
||||
case source-protocol {
|
||||
when "./condition = 'source-protocol'";
|
||||
leaf source-protocol {
|
||||
type frr-route-types:frr-route-types;
|
||||
}
|
||||
}
|
||||
case source-instance {
|
||||
when "./condition = 'source-instance'";
|
||||
leaf source-instance {
|
||||
type uint8 {
|
||||
range "0..255";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
augment "/frr-route-map:lib"
|
||||
+ "/frr-route-map:route-map"
|
||||
+ "/frr-route-map:entry"
|
||||
+ "/frr-route-map:set-action"
|
||||
+ "/frr-route-map:action-value" {
|
||||
case source-v4 {
|
||||
when "./action = 'source'";
|
||||
leaf source-v4 {
|
||||
description "IPv4 address";
|
||||
type inet:ipv4-address;
|
||||
}
|
||||
}
|
||||
case source-v6 {
|
||||
when "./action = 'source'";
|
||||
leaf source-v6 {
|
||||
description "IPv6 address";
|
||||
type inet:ipv6-address;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user