mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 05:18:47 +00:00
yang: update filter yang model
Important changes: * Limit the access-list name length according to header definition; * Add another list (sequence) inside instances to avoid repeated fields; Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
ce49c4255d
commit
a4d7621fc8
@ -73,7 +73,9 @@ module frr-filter {
|
||||
|
||||
typedef access-list-name {
|
||||
description "Access list name formatting";
|
||||
type string;
|
||||
type string {
|
||||
length 1..128;
|
||||
}
|
||||
}
|
||||
|
||||
typedef access-list-sequence {
|
||||
@ -100,17 +102,27 @@ module frr-filter {
|
||||
/*
|
||||
* Configuration data.
|
||||
*/
|
||||
container filter-list {
|
||||
container lib {
|
||||
list access-list-legacy {
|
||||
description "Access list legacy instance";
|
||||
|
||||
key "number sequence";
|
||||
key "number";
|
||||
|
||||
leaf number {
|
||||
description "Access list sequence value";
|
||||
type access-list-legacy;
|
||||
}
|
||||
|
||||
leaf remark {
|
||||
description "Access list remark";
|
||||
type string;
|
||||
}
|
||||
|
||||
list entry {
|
||||
description "Access list legacy entry";
|
||||
|
||||
key "sequence";
|
||||
|
||||
leaf sequence {
|
||||
description "Access list sequence value";
|
||||
type access-list-sequence;
|
||||
@ -122,11 +134,6 @@ module frr-filter {
|
||||
mandatory true;
|
||||
}
|
||||
|
||||
leaf remark {
|
||||
description "Access list remark";
|
||||
type string;
|
||||
}
|
||||
|
||||
choice value {
|
||||
description
|
||||
"Standard access list: value to match.
|
||||
@ -148,9 +155,10 @@ module frr-filter {
|
||||
}
|
||||
|
||||
choice extended-value {
|
||||
when "./sequence >= 100 and ./sequence <= 199 or
|
||||
./sequence >= 2000 and ./sequence <= 2699";
|
||||
when "../number >= 100 and ../number <= 199 or
|
||||
../number >= 2000 and ../number <= 2699";
|
||||
description "Destination value to match";
|
||||
mandatory true;
|
||||
|
||||
leaf destination-host {
|
||||
description "Host to match";
|
||||
@ -166,11 +174,12 @@ module frr-filter {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list access-list {
|
||||
description "Access list instance";
|
||||
|
||||
key "type identifier sequence";
|
||||
key "type name";
|
||||
|
||||
leaf type {
|
||||
description "Access list content type";
|
||||
@ -187,25 +196,24 @@ module frr-filter {
|
||||
description "Media Access Control address";
|
||||
value 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Protocol YANG models should augment the parent node to
|
||||
* contain the routing protocol specific value. The protocol
|
||||
* must also augment `value` leaf to include its specific
|
||||
* values or expand the `when` statement on the existing cases.
|
||||
*/
|
||||
enum custom {
|
||||
description "Custom data type";
|
||||
value 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
leaf identifier {
|
||||
description "Access list identifier";
|
||||
leaf name {
|
||||
description "Access list name";
|
||||
type access-list-name;
|
||||
}
|
||||
|
||||
leaf remark {
|
||||
description "Access list remark";
|
||||
type string;
|
||||
}
|
||||
|
||||
list entry {
|
||||
description "Access list entry";
|
||||
|
||||
key "sequence";
|
||||
|
||||
leaf sequence {
|
||||
description "Access list sequence value";
|
||||
type access-list-sequence;
|
||||
@ -217,17 +225,12 @@ module frr-filter {
|
||||
mandatory true;
|
||||
}
|
||||
|
||||
leaf remark {
|
||||
description "Access list remark";
|
||||
type string;
|
||||
}
|
||||
|
||||
choice value {
|
||||
description "Access list value to match";
|
||||
mandatory true;
|
||||
|
||||
case ipv4-prefix {
|
||||
when "./type = 'ipv4'";
|
||||
when "../type = 'ipv4'";
|
||||
|
||||
leaf ipv4-prefix {
|
||||
description "Configure IPv4 prefix to match";
|
||||
@ -241,7 +244,7 @@ module frr-filter {
|
||||
}
|
||||
}
|
||||
case ipv6-prefix {
|
||||
when "./type = 'ipv6'";
|
||||
when "../type = 'ipv6'";
|
||||
|
||||
leaf ipv6-prefix {
|
||||
description "Configure IPv6 prefix to match";
|
||||
@ -255,7 +258,7 @@ module frr-filter {
|
||||
}
|
||||
}
|
||||
case mac {
|
||||
when "./type = 'mac'";
|
||||
when "../type = 'mac'";
|
||||
|
||||
leaf mac {
|
||||
description "Configure MAC address to match";
|
||||
@ -270,11 +273,12 @@ module frr-filter {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list prefix-list {
|
||||
description "Prefix list instance";
|
||||
|
||||
key "type name sequence";
|
||||
key "type name";
|
||||
|
||||
leaf type {
|
||||
description "Prefix list type";
|
||||
@ -295,6 +299,16 @@ module frr-filter {
|
||||
type access-list-name;
|
||||
}
|
||||
|
||||
leaf description {
|
||||
description "Prefix list user description";
|
||||
type string;
|
||||
}
|
||||
|
||||
list entry {
|
||||
description "Prefix list entry";
|
||||
|
||||
key "sequence";
|
||||
|
||||
leaf sequence {
|
||||
description "Access list sequence value";
|
||||
type access-list-sequence;
|
||||
@ -306,17 +320,12 @@ module frr-filter {
|
||||
mandatory true;
|
||||
}
|
||||
|
||||
leaf description {
|
||||
description "Prefix list user description";
|
||||
type string;
|
||||
}
|
||||
|
||||
choice value {
|
||||
description "Prefix list value to match";
|
||||
mandatory true;
|
||||
|
||||
case ipv4-prefix {
|
||||
when "./type = 'ipv4'";
|
||||
when "../type = 'ipv4'";
|
||||
|
||||
leaf ipv4-prefix {
|
||||
description "Configure IPv4 prefix to match";
|
||||
@ -342,7 +351,7 @@ module frr-filter {
|
||||
}
|
||||
}
|
||||
case ipv6-prefix {
|
||||
when "./type = 'ipv6'";
|
||||
when "../type = 'ipv6'";
|
||||
|
||||
leaf ipv6-prefix {
|
||||
description "Configure IPv6 prefix to match";
|
||||
@ -377,3 +386,4 @@ module frr-filter {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user