Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bgp comm regex-match #1043

Merged
merged 26 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
86ab3d7
add bgp comm regex-match
dplore Feb 1, 2024
0cf0984
update comm member union types
dplore Feb 1, 2024
20ba4b9
trim whitespace
dplore Feb 1, 2024
a0bd6b2
remove unused/legacy bgp regex type
dplore Feb 2, 2024
9b123ad
update version
dplore Feb 2, 2024
5ad0231
expand community-member description
dplore Feb 2, 2024
4d35e3f
trim whitespace
dplore Feb 2, 2024
86a8eef
bump bgp-errors version
dplore Feb 2, 2024
e1c0945
remove unused import
dplore Feb 2, 2024
ce76765
Test with new branch of CI that should provide more debug info
wenovus Feb 3, 2024
bf53314
Retrigger CI
wenovus Feb 3, 2024
af9b511
Make ygnmi wait for pyangbind to complete
wenovus Feb 3, 2024
537a3f0
fix ordering
wenovus Feb 3, 2024
6f9966b
Merge branch 'master' into dplore/bgp-comm-regex
wenovus Feb 5, 2024
4ba5373
Revert cloudbuild.yaml
wenovus Feb 5, 2024
9ce5a9c
fix ext community type
dplore Feb 24, 2024
620bc2c
separate std and ext community descriptions
dplore Feb 24, 2024
60d7f93
Merge branch 'master' into dplore/bgp-comm-regex
dplore Feb 24, 2024
e63c012
Merge branch 'master' into dplore/bgp-comm-regex
dplore Mar 5, 2024
3c517ee
Merge branch 'master' into dplore/bgp-comm-regex
dplore Mar 7, 2024
3a88610
Merge branch 'master' into dplore/bgp-comm-regex
dplore Mar 8, 2024
91e8ece
update linkbw community type description
dplore Mar 8, 2024
f951ce5
introduce constraints for the regex value
dplore Mar 8, 2024
bbddb1a
fix import
dplore Mar 8, 2024
7ddc858
Add period
dplore Mar 12, 2024
38d0ccd
fix community-member union type
dplore Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion release/models/bgp/openconfig-bgp-errors.yang
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ submodule openconfig-bgp-errors {
"This module defines BGP NOTIFICATION message error codes
and subcodes";

oc-ext:openconfig-version "5.6.0";
oc-ext:openconfig-version "6.0.0";

revision "2024-01-31" {
description
"Update community-sets/members/member union type by replacing
the bgp-regex type with posix-eregexp.";
reference "6.0.0";
}

revision "2023-12-26" {
description
Expand Down
42 changes: 32 additions & 10 deletions release/models/bgp/openconfig-bgp-policy.yang
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module openconfig-bgp-policy {
import openconfig-policy-types { prefix oc-pol-types; }
import openconfig-bgp-types { prefix oc-bgp-types; }
import openconfig-extensions { prefix oc-ext; }

import openconfig-types { prefix oc-types; }

// meta
organization
Expand All @@ -28,7 +28,14 @@ module openconfig-bgp-policy {
It augments the base routing-policy module with BGP-specific
options for conditions and actions.";

oc-ext:openconfig-version "6.4.0";
oc-ext:openconfig-version "7.0.0";

revision "2024-01-31" {
description
"Update community-sets/members/member union type by replacing
the bgp-regex type with posix-eregexp.";
reference "7.0.0";
}

revision "2023-12-19" {
description
Expand Down Expand Up @@ -589,17 +596,24 @@ module openconfig-bgp-policy {
leaf-list community-member {
type union {
type oc-bgp-types:bgp-std-community-type;
type oc-bgp-types:bgp-community-regexp-type;
type oc-types:posix-eregexp;
type oc-bgp-types:bgp-well-known-community-type;
}
description
"members of the community set.
For an ADD operation these are the communities that will be added;
the regexp type is not valid in this operation.
"Members of the community set.
For an ADD operation these are the communities that will be
added. The regexp type is not valid in this operation.

For REMOVE or REPLACE operations then matching communities will
be removed unless match-set-options is INVERT which will
reverse this to mean that anything that does not match will be
removed.";
removed.

For MATCH operations the posix-eregexp type should be evaluated
against each community associated with a prefix one community
at a time. Communities must be represented as strings in formats
conforming to oc-bgp-types:bgp-std-community-type. For example:
`1000:1000` for a standard community";
}

leaf match-set-options {
Expand Down Expand Up @@ -672,16 +686,24 @@ module openconfig-bgp-policy {
leaf-list ext-community-member {
type union {
type oc-bgp-types:bgp-ext-community-type;
type oc-bgp-types:bgp-community-regexp-type;
type oc-types:posix-eregexp;
}
description
"members of the extended community set
"Members of the extended community set.
For an ADD operation these are the communities that will be added;
the regexp type is not valid in this operation.

For REMOVE or REPLACE operations then matching communities will
be removed unless match-set-options is INVERT which will
reverse this to mean that anything that does not match will be
removed.";
removed.

For MATCH operations the posix-eregexp type should be evaluated
against each community associated with a prefix one community
at a time. Communities must be represented as strings in formats
conforming to oc-bgp-types:bgp-ext-community-type. For example:
`route-origin:1000:1000` for the origin type extended community,
and so on.";
}

leaf match-set-options {
Expand Down
28 changes: 20 additions & 8 deletions release/models/bgp/openconfig-bgp-types.yang
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module openconfig-bgp-types {
namespace "http://openconfig.net/yang/bgp-types";

prefix "oc-bgp-types";

import openconfig-types { prefix "oc-types"; }
import openconfig-inet-types { prefix "oc-inet"; }
import openconfig-extensions { prefix "oc-ext"; }
Expand All @@ -25,7 +24,13 @@ module openconfig-bgp-types {
policy. It can be imported by modules that make use of BGP
attributes";

oc-ext:openconfig-version "5.6.0";
oc-ext:openconfig-version "6.0.0";

revision "2024-02-01" {
description
"Modify bgp-community-regexp-type.";
reference "6.0.0";
}

revision "2023-12-26" {
description
Expand Down Expand Up @@ -635,11 +640,15 @@ module openconfig-bgp-types {
- route-origin:<2b ASN>:<4b value> per RFC4360 section 5
- route-origin:<4b IPv4>:<2b value> per RFC4360 section 5
- color:<CO bits>:<4b value> per draft-ietf-idr-segment-routing-te-policy
section 3";
section 3
- link-bandwidth:<2 byte asn>:<bandwidth_value> per
draft-ietf-idr-link-bandwidth-07";

reference
"RFC 4360 - BGP Extended Communities Attribute
RFC 5668 - 4-Octet AS Specific BGP Extended Community
draft-ietf-idr-segment-routing-te-policy";
draft-ietf-idr-segment-routing-te-policy
draft-ietf-idr-link-bandwidth-07";
}

typedef bgp-ext-community-recv-type {
Expand Down Expand Up @@ -673,12 +682,15 @@ module openconfig-bgp-types {
}

typedef bgp-community-regexp-type {
// TODO: needs more work to decide what format these regexps can
// take.
type oc-types:std-regexp;
type oc-types:posix-eregexp;
description
"Type definition for communities specified as regular
expression patterns";
expression patterns. The regular expression must be a
POSIX extended regular expression with some limitations
which are commonly found in device implementations described
in draft-ietf-idr-bgp-model.";
reference
"draft-ietf-idr-bgp-model";
}

typedef bgp-origin-attr-type {
Expand Down
16 changes: 15 additions & 1 deletion release/models/types/openconfig-types.yang
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ module openconfig-types {
are used across OpenConfig models. It can be imported by modules
that make use of these types.";

oc-ext:openconfig-version "0.6.0";
oc-ext:openconfig-version "1.0.0";

revision "2024-01-31" {
description
"Add posix-eregexp type and promote model to version 1.0.0.";
reference "1.0.0";
}

revision "2019-04-16" {
description
Expand Down Expand Up @@ -101,6 +107,14 @@ module openconfig-types {
supported. An initial proposal is POSIX compatible.";
}

typedef posix-eregexp {
type string;
description
"This is a string which represents an extended POSIX
regular expression.";
reference "IEEE Std 1003.1-2017";
}

typedef timeticks64 {
type uint64;
units "nanoseconds";
Expand Down
Loading