Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
131 changes: 130 additions & 1 deletion release/models/local-routing/openconfig-local-routing.yang
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module openconfig-local-routing {
// import some basic types
import openconfig-inet-types { prefix inet; }
import openconfig-policy-types { prefix oc-pt; }
import openconfig-routing-policy { prefix oc-rpol; }
import openconfig-extensions { prefix oc-ext; }
import openconfig-interfaces { prefix oc-if; }
import openconfig-bfd { prefix oc-bfd; }
Expand Down Expand Up @@ -43,7 +44,13 @@ module openconfig-local-routing {
protocol-specific policy after importing the route into the
protocol for distribution (again via routing policy).";

oc-ext:openconfig-version "4.1.0";
oc-ext:openconfig-version "4.2.0";

revision "2026-08-12" {
description
"Add conditional-routes for injecting local routes conditionally.";
reference "4.2.0";
}

revision "2025-07-29" {
description
Expand Down Expand Up @@ -163,6 +170,26 @@ module openconfig-local-routing {
bandwidth expressed in bps.";
}

identity CONDITIONAL_ROUTES_ACTION {
description
"Base identity type of actions for conditional routes.";
}

identity NO_ACTION {
base CONDITIONAL_ROUTES_ACTION;
description
"No action to be taken when the conditions for the conditional routes
are resulted to true. The prefixes are NOT injected as routes.";
}

identity INSTALL_DROP_NEXTHOP {
base CONDITIONAL_ROUTES_ACTION;
description
"Install the conditional routes with a discard next-hop.
Traffic destined to the prefix will be discarded with no
ICMP message generated.";
}

// typedef statements

typedef local-defined-next-hop {
Expand Down Expand Up @@ -513,4 +540,106 @@ module openconfig-local-routing {
}
}

grouping conditional-prefix-set-ref-config {
description
"Grouping of configuration data for conditional prefix set reference";

leaf name {
type leafref {
path "/oc-rpol:routing-policy/oc-rpol:defined-sets/oc-rpol:conditional-prefix-sets/oc-rpol:conditional-prefix-set/oc-rpol:name";
}

description
"Reference to the conditional prefix set whose prefixes may be injected as routes.
If the condition is satisfied, routes may be injected for each prefix in the
target prefix-set.";
}

leaf action {
type identityref {
base CONDITIONAL_ROUTES_ACTION;
}
default NO_ACTION;
description
"The action to take when the conditions for the prefix set results in true.
The default behavior is to take no actions and will not inject the prefixes
as routes.";
}

leaf preference {
type uint32;
description
"Administrative Distance (preference) of the entry. The
preference defines the order of selection when multiple
sources (protocols, static, etc.) contribute to the same
prefix entry. The lower the preference, the more preferable the
prefix is. When this value is not specified, the preference is
inherited from the default preference of the implementation for
static routes.";
}
}

grouping conditional-prefix-set-ref-state {
description
"Grouping of operational state data for conditional prefix set reference";

leaf condition-matched {
type boolean;
description
"When true, the match-policy has been resolved to ACCEPT_ROUTE and the
routes in the referenced conditional prefix set are currently injected
into the RIB.";
}
}

grouping conditional-prefix-list {
description
"Grouping for the list of conditional prefix set references.";

container conditional-prefix-set-refs {
description
"Enclosing container for conditional prefix set references.";

list conditional-prefix-set-ref {
key "name";
description
"List of conditional prefix set references.";

leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the configured prefix set name for this conditional prefix set";
}

container config {
description
"Configuration data for conditional prefix set reference";

uses conditional-prefix-set-ref-config;
}

container state {
config false;
description
"Operational state for conditional prefix set reference";

uses conditional-prefix-set-ref-config;
uses conditional-prefix-set-ref-state;
}
}
}
}

grouping conditional-routes-top {
description
"Top-level grouping for the list of conditional route configurations";
container conditional-routes {
description
"Protocol container for conditional local routes";

uses conditional-prefix-list;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ module openconfig-network-instance {
virtual switch instance (VSI). Mixed Layer 2 and Layer 3
instances are also supported.";

oc-ext:openconfig-version "4.7.0";
oc-ext:openconfig-version "4.8.0";

revision "2026-08-12" {
description
"Add conditional-routes protocol.";
reference "4.8.0";
}

revision "2026-03-17" {
description
Expand Down Expand Up @@ -952,6 +958,17 @@ module openconfig-network-instance {
locally generated aggregate routes";
}

uses oc-loc-rt:conditional-routes-top {
when "./config/identifier = 'oc-pol-types:CONDITIONAL_ROUTES'" {
description
"Include conditional route configuration when the protocol is of type
CONDITIONAL_ROUTES";
}
description
"Configuration and state parameters relating to the
Conditional Routes.";
}

uses oc-bgp:bgp-top {
when "./config/identifier = 'oc-pol-types:BGP'" {
description
Expand Down Expand Up @@ -1012,7 +1029,7 @@ module openconfig-network-instance {
Group Management Protocol (IGMP).";
}

uses oc-pcep:pcep-top {
uses oc-pcep:pcep-top {
when "./config/identifier = 'oc-pol-types:PCEP'" {
description
"Include PCEP configuration when the protocol is of type
Expand Down
2 changes: 2 additions & 0 deletions release/models/policy/.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
- yang/isis/openconfig-isis-types.yang
- yang/ospf/openconfig-ospf-types.yang
- yang/policy/openconfig-routing-policy.yang
- yang/policy/openconfig-policy-network-instance.yang
- yang/network-instance/openconfig-network-instance-policy.yang
- yang/bgp/openconfig-bgp-policy.yang
- yang/isis/openconfig-isis-policy.yang
- yang/ospf/openconfig-ospf-policy.yang
build:
- yang/policy/openconfig-routing-policy.yang
- yang/policy/openconfig-policy-network-instance.yang
- yang/network-instance/openconfig-network-instance-policy.yang
- yang/bgp/openconfig-bgp-policy.yang
- yang/isis/openconfig-isis-policy.yang
Expand Down
70 changes: 70 additions & 0 deletions release/models/policy/openconfig-policy-network-instance.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
module openconfig-policy-network-instance {

yang-version "1";

// namespace
namespace "http://openconfig.net/yang/policy-netinst";

prefix "oc-rpol-netinst";

import openconfig-extensions { prefix "oc-ext"; }
import openconfig-network-instance { prefix "oc-ni"; }
import openconfig-routing-policy { prefix "oc-rpol"; }

// meta
organization "OpenConfig working group";

contact
"OpenConfig working group
www.openconfig.net";

description
"This module adds leaves that relate to network-instances
to the routing-policy subtree.";

oc-ext:openconfig-version "1.0.0";

revision "2026-08-12" {
description
"Add leaves that relate to network-instances to the
routing policy module.";
reference "1.0.0";
}

// OpenConfig specific extensions for module metadata.
oc-ext:regexp-posix;
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";

grouping conditional-prefix-set-network-instance {
description
"This grouping define leaves that need references to the network-instance
subtree within the routing policy module. It is used to augment the
/routing-policy/defined-sets/conditional-prefix-sets/conditional-prefix-set/config/
containers.";

leaf match-policy-network-instance {
type leafref {
path "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:name";
}

description
"The specific network instance of which routes from the RIB that will be used
for matching the configured match-policy.";
}
}

augment "/oc-rpol:routing-policy/oc-rpol:defined-sets/oc-rpol:conditional-prefix-sets/oc-rpol:conditional-prefix-set/oc-rpol:config" {
description
"Add network-instance leaves to conditional-prefix-set container.";

uses conditional-prefix-set-network-instance;
}

augment "/oc-rpol:routing-policy/oc-rpol:defined-sets/oc-rpol:conditional-prefix-sets/oc-rpol:conditional-prefix-set/oc-rpol:state" {
description
"Add network-instance leaves to conditional-prefix-set container.";

uses conditional-prefix-set-network-instance;
}
}
21 changes: 19 additions & 2 deletions release/models/policy/openconfig-policy-types.yang
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@ module openconfig-policy-types {
policy. It can be imported by modules that contain protocol-
specific policy conditions and actions.";

oc-ext:openconfig-version "3.3.0";
oc-ext:openconfig-version "3.4.0";

revision "2026-08-12" {
description
"Add CONDITIONAL_ROUTES to INSTALL_PROTOCOL_TYPE identity.";
reference "3.4.0";
}

revision "2024-05-14" {
description
"Add hex-string-prefixed to typedef tag-type.";
reference "3.3.0";
}

revision "2022-11-08" {
revision "2022-11-08" {
description
"Add INSTALL_PROTOCOL_TYPE local.";
reference "3.2.3";
Expand Down Expand Up @@ -294,4 +300,15 @@ revision "2022-11-08" {

10.244.136.79/32.";
}

identity CONDITIONAL_ROUTES {
base INSTALL_PROTOCOL_TYPE;
description
"Conditional local route.

A conditional local route is a locally defined prefix-set that can be
conditionally injected when the configured policy action results in
ACCEPT_ROUTE when that policy is applied against the set of routes
that are currently installed in the RIB.";
}
}
Loading
Loading