blob: da80fae9193d9e3fffcbedbf23b90b8bc13bf66a [file] [log] [blame]
module openconfig-ospf-policy {
yang-version "1";
namespace "http://openconfig.net/yang/ospf-policy";
prefix "oc-ospf-pol";
import openconfig-routing-policy { prefix "oc-rpol"; }
import openconfig-extensions { prefix "oc-ext"; }
import openconfig-ospf-types { prefix "oc-ospf-types"; }
organization
"OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module defines extensions to the OpenConfig policy
model to add extensions for OSPF. This module is intended
to be generic for both OSPFv2 and OSPFv3.";
oc-ext:openconfig-version "0.0.1";
revision "2016-08-22" {
description
"Initial revision";
reference "0.0.1";
}
grouping ospf-match-config {
description
"Configuration parameters for OSPF match conditions";
leaf area-eq {
type oc-ospf-types:ospf-area-identifier;
description
"Match prefixes which are within a particular OSPF area";
}
}
grouping ospf-match-conditions {
description
"Match conditions that are added by OSPF";
container ospf-conditions {
description
"Match conditions specific to OSPF";
container config {
description
"Configuration parameters relating to OSPF match conditions";
uses ospf-match-config;
}
container state {
config false;
description
"Operational state parameters relating to OSPF match conditions";
uses ospf-match-config;
}
}
}
grouping ospf-actions-config {
description
"Configuration parameters for OSPF policy actions";
leaf set-area {
type oc-ospf-types:ospf-area-identifier;
description
"Set the area for the matched route. This action is typically
used when importing prefixes into OSPF, such that a route can
be imported into a specific area within the instance.";
}
}
grouping ospf-actions-set-metric-config {
description
"Configuration parameters relating to setting the OSPF metric";
leaf metric-type {
type enumeration {
enum EXTERNAL_TYPE_1 {
description
"Set the external type 1 metric";
}
enum EXTERNAL_TYPE_2 {
description
"Set the external type 2 metric";
}
}
default "EXTERNAL_TYPE_2";
description
"Specify the type of metric which is to be set by the policy";
}
leaf metric {
type oc-ospf-types:ospf-metric;
description
"Set the metric of the routes matching the policy to the value
specified by this leaf.";
}
}
grouping ospf-actions {
description
"Actions that are added by OSPF to the action framework";
container ospf-actions {
description
"Actions specific to OSPF";
container config {
description
"Configuration parameters for OSPF actions";
uses ospf-actions-config;
}
container state {
config false;
description
"Operational state parameters for OSPF actions";
uses ospf-actions-config;
}
container set-metric {
description
"Configuration and state parameters relating to manipulating
the OSPF metric";
container config {
description
"Configuration parameters relating to setting the OSPF metric";
uses ospf-actions-set-metric-config;
}
container state {
config false;
description
"Operational state parameters relating to setting the OSPF
metric";
uses ospf-actions-set-metric-config;
}
}
}
}
// augment the groupings into the routing policy model
// TODO: discuss whether igp-actions should be used or whether this should
// be removed.
augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" +
"oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" +
"oc-rpol:conditions" {
description
"Add OSPF specific match conditions to the routing policy model";
uses ospf-match-conditions;
}
augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" +
"oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" +
"oc-rpol:actions" {
description
"Add OSPF specific actions to the routing policy model";
uses ospf-actions;
}
}