diff options
| author | Russ White <russ@riw.us> | 2023-03-21 10:12:01 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-21 10:12:01 -0400 | 
| commit | 2c50f65f1cd205de75c3235066e36bbf60cdf9d1 (patch) | |
| tree | df8cc99008dfe0538a7d3a818bbf107c81dfa332 /yang | |
| parent | 2e1ea892220dccb8a4c72e438cb3bbd4cac22b2b (diff) | |
| parent | 5b498ae7ecc58ff6e9afa74bbf3715aee1332d52 (diff) | |
Merge pull request #12968 from pguibert6WIND/asn_aggregator_counter_prop
yang: Fix "aggregator-asn" to support asdot
Diffstat (limited to 'yang')
| -rw-r--r-- | yang/frr-bgp-route-map.yang | 27 | 
1 files changed, 22 insertions, 5 deletions
diff --git a/yang/frr-bgp-route-map.yang b/yang/frr-bgp-route-map.yang index 8e288194ec..90163f125e 100644 --- a/yang/frr-bgp-route-map.yang +++ b/yang/frr-bgp-route-map.yang @@ -474,6 +474,27 @@ module frr-bgp-route-map {        "ext-community link bandwidth types.";    } +  typedef asn-type { +    type union { +      type uint32 { +        range "1..4294967295"; +      } +      type string { +        pattern '(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|' +        +  '6[0-4][0-9]{3}|65[0-4][0-9]{2}|' +        +  '655[0-2][0-9]|6553[0-5])\.' +        +  '(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|' +        +  '65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])' { +          error-message "AS dot should be in the form [0..65535].[0..65535]."; +        } +        pattern '^0\.0$' { +          modifier "invert-match"; +          error-message "AS dot can't be equal to 0.0."; +        } +      } +    } +  } +    augment "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:rmap-match-condition/frr-route-map:match-condition" {      case local-preference {        when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-local-preference')"; @@ -1004,16 +1025,12 @@ module frr-bgp-route-map {        when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:aggregator')";        container aggregator {          leaf aggregator-asn { -          type uint32 { -            range "1..4294967295"; -          } +          type asn-type;            description              "ASN of the aggregator";          }          leaf aggregator-address { -          when "../aggregator-asn > 0 or " -             + "../aggregator-asn <= 4294967295";            type inet:ipv4-address;            description              "IPv4 address of the aggregator";  | 
