You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.5 KiB

  1. From bec0aa85b1f404ac9800c7524070fcf8582e82bc Mon Sep 17 00:00:00 2001
  2. From: Rafael Zalamena <rzalamena@opensourcerouting.org>
  3. Date: Thu, 1 Aug 2019 19:56:46 -0300
  4. Subject: [PATCH] yang: simplify filter choice by removing cases
  5. Based on @rwestphal feedback, lets remove `case`s where we don't expect
  6. to add more items or items with more than one `leaf`.
  7. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
  8. ---
  9. yang/frr-filter.yang | 48 +++++++++++++++++---------------------------
  10. 1 file changed, 18 insertions(+), 30 deletions(-)
  11. diff --git a/yang/frr-filter.yang b/yang/frr-filter.yang
  12. index 92af6aebfd..e79ede87b7 100644
  13. --- a/yang/frr-filter.yang
  14. +++ b/yang/frr-filter.yang
  15. @@ -107,23 +107,17 @@ module frr-filter {
  16. Extended access list: source value to match.";
  17. mandatory true;
  18. - case host {
  19. - leaf host {
  20. - description "Host to match";
  21. - type inet:ipv4-address;
  22. - }
  23. + leaf host {
  24. + description "Host to match";
  25. + type inet:ipv4-address;
  26. }
  27. - case network {
  28. - leaf network {
  29. - description "Network to match";
  30. - type inet:ipv4-prefix;
  31. - }
  32. + leaf network {
  33. + description "Network to match";
  34. + type inet:ipv4-prefix;
  35. }
  36. - case any {
  37. - leaf any {
  38. - description "Match any";
  39. - type empty;
  40. - }
  41. + leaf any {
  42. + description "Match any";
  43. + type empty;
  44. }
  45. }
  46. @@ -132,23 +126,17 @@ module frr-filter {
  47. ./sequence >= 2000 and ./sequence <= 2699";
  48. description "Destination value to match";
  49. - case destination-host {
  50. - leaf destination-host {
  51. - description "Host to match";
  52. - type inet:ipv4-address;
  53. - }
  54. + leaf destination-host {
  55. + description "Host to match";
  56. + type inet:ipv4-address;
  57. }
  58. - case destination-network {
  59. - leaf destination-network {
  60. - description "Network to match";
  61. - type inet:ipv4-prefix;
  62. - }
  63. + leaf destination-network {
  64. + description "Network to match";
  65. + type inet:ipv4-prefix;
  66. }
  67. - case destination-any {
  68. - leaf destination-any {
  69. - description "Match any";
  70. - type empty;
  71. - }
  72. + leaf destination-any {
  73. + description "Match any";
  74. + type empty;
  75. }
  76. }
  77. }