aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-ospf-policy.yang
blob: 35b915a052fa0de8fda03365445a115c49dded95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
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;
  }

}