From 639509ad42f8bd6baf9b6f5b668a9bbfb05108d4 Mon Sep 17 00:00:00 2001 From: Andrej Kozemcak Date: Thu, 20 Dec 2018 17:49:33 +0100 Subject: Add Openconfig YANG modules. Change-Id: I7e98bf1ca7196cff042a35b8bf096d2ea9d80028 Signed-off-by: Andrej Kozemcak --- .../yang/openconfig/openconfig-ospf-policy.yang | 188 +++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 src/plugins/yang/openconfig/openconfig-ospf-policy.yang (limited to 'src/plugins/yang/openconfig/openconfig-ospf-policy.yang') diff --git a/src/plugins/yang/openconfig/openconfig-ospf-policy.yang b/src/plugins/yang/openconfig/openconfig-ospf-policy.yang new file mode 100644 index 0000000..35b915a --- /dev/null +++ b/src/plugins/yang/openconfig/openconfig-ospf-policy.yang @@ -0,0 +1,188 @@ +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.1.2"; + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.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; + } + +} \ No newline at end of file -- cgit 1.2.3-korg