Thomas Vachuska | 6655bee | 2017-08-24 16:12:59 -0700 | [diff] [blame] | 1 | module openconfig-ospf-policy { |
| 2 | yang-version "1"; |
| 3 | |
| 4 | namespace "http://openconfig.net/yang/ospf-policy"; |
| 5 | |
| 6 | prefix "oc-ospf-pol"; |
| 7 | |
| 8 | import openconfig-routing-policy { prefix "oc-rpol"; } |
| 9 | import openconfig-extensions { prefix "oc-ext"; } |
| 10 | import openconfig-ospf-types { prefix "oc-ospf-types"; } |
| 11 | |
| 12 | organization |
| 13 | "OpenConfig working group"; |
| 14 | |
| 15 | contact |
| 16 | "OpenConfig working group |
| 17 | www.openconfig.net"; |
| 18 | |
| 19 | description |
| 20 | "This module defines extensions to the OpenConfig policy |
| 21 | model to add extensions for OSPF. This module is intended |
| 22 | to be generic for both OSPFv2 and OSPFv3."; |
| 23 | |
| 24 | oc-ext:openconfig-version "0.0.1"; |
| 25 | |
| 26 | revision "2016-08-22" { |
| 27 | description |
| 28 | "Initial revision"; |
| 29 | reference "0.0.1"; |
| 30 | } |
| 31 | |
| 32 | grouping ospf-match-config { |
| 33 | description |
| 34 | "Configuration parameters for OSPF match conditions"; |
| 35 | |
| 36 | leaf area-eq { |
| 37 | type oc-ospf-types:ospf-area-identifier; |
| 38 | description |
| 39 | "Match prefixes which are within a particular OSPF area"; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | grouping ospf-match-conditions { |
| 44 | description |
| 45 | "Match conditions that are added by OSPF"; |
| 46 | |
| 47 | container ospf-conditions { |
| 48 | description |
| 49 | "Match conditions specific to OSPF"; |
| 50 | |
| 51 | container config { |
| 52 | description |
| 53 | "Configuration parameters relating to OSPF match conditions"; |
| 54 | |
| 55 | uses ospf-match-config; |
| 56 | } |
| 57 | |
| 58 | container state { |
| 59 | config false; |
| 60 | description |
| 61 | "Operational state parameters relating to OSPF match conditions"; |
| 62 | |
| 63 | uses ospf-match-config; |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | grouping ospf-actions-config { |
| 69 | description |
| 70 | "Configuration parameters for OSPF policy actions"; |
| 71 | |
| 72 | leaf set-area { |
| 73 | type oc-ospf-types:ospf-area-identifier; |
| 74 | description |
| 75 | "Set the area for the matched route. This action is typically |
| 76 | used when importing prefixes into OSPF, such that a route can |
| 77 | be imported into a specific area within the instance."; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | grouping ospf-actions-set-metric-config { |
| 82 | description |
| 83 | "Configuration parameters relating to setting the OSPF metric"; |
| 84 | |
| 85 | leaf metric-type { |
| 86 | type enumeration { |
| 87 | enum EXTERNAL_TYPE_1 { |
| 88 | description |
| 89 | "Set the external type 1 metric"; |
| 90 | } |
| 91 | enum EXTERNAL_TYPE_2 { |
| 92 | description |
| 93 | "Set the external type 2 metric"; |
| 94 | } |
| 95 | } |
| 96 | default "EXTERNAL_TYPE_2"; |
| 97 | description |
| 98 | "Specify the type of metric which is to be set by the policy"; |
| 99 | } |
| 100 | |
| 101 | leaf metric { |
| 102 | type oc-ospf-types:ospf-metric; |
| 103 | description |
| 104 | "Set the metric of the routes matching the policy to the value |
| 105 | specified by this leaf."; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | grouping ospf-actions { |
| 110 | description |
| 111 | "Actions that are added by OSPF to the action framework"; |
| 112 | |
| 113 | container ospf-actions { |
| 114 | description |
| 115 | "Actions specific to OSPF"; |
| 116 | |
| 117 | container config { |
| 118 | description |
| 119 | "Configuration parameters for OSPF actions"; |
| 120 | |
| 121 | uses ospf-actions-config; |
| 122 | } |
| 123 | |
| 124 | container state { |
| 125 | config false; |
| 126 | description |
| 127 | "Operational state parameters for OSPF actions"; |
| 128 | |
| 129 | uses ospf-actions-config; |
| 130 | } |
| 131 | |
| 132 | container set-metric { |
| 133 | description |
| 134 | "Configuration and state parameters relating to manipulating |
| 135 | the OSPF metric"; |
| 136 | |
| 137 | container config { |
| 138 | description |
| 139 | "Configuration parameters relating to setting the OSPF metric"; |
| 140 | uses ospf-actions-set-metric-config; |
| 141 | } |
| 142 | |
| 143 | container state { |
| 144 | config false; |
| 145 | description |
| 146 | "Operational state parameters relating to setting the OSPF |
| 147 | metric"; |
| 148 | |
| 149 | uses ospf-actions-set-metric-config; |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | // augment the groupings into the routing policy model |
| 156 | |
| 157 | // TODO: discuss whether igp-actions should be used or whether this should |
| 158 | // be removed. |
| 159 | |
| 160 | augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + |
| 161 | "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + |
| 162 | "oc-rpol:conditions" { |
| 163 | description |
| 164 | "Add OSPF specific match conditions to the routing policy model"; |
| 165 | uses ospf-match-conditions; |
| 166 | } |
| 167 | |
| 168 | augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + |
| 169 | "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + |
| 170 | "oc-rpol:actions" { |
| 171 | description |
| 172 | "Add OSPF specific actions to the routing policy model"; |
| 173 | uses ospf-actions; |
| 174 | } |
| 175 | |
| 176 | } |