aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-policy-types@2018-06-05.yang
blob: ef47f33fb9ef1be0fa83a7e63d0fca599010dfbb (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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
module openconfig-policy-types {

  yang-version "1";

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

  prefix "oc-pol-types";

  // import some basic types
  import ietf-yang-types { prefix yang; }
  import openconfig-extensions { prefix oc-ext; }

  // meta
  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    netopenconfig@googlegroups.com";

  description
    "This module contains general data definitions for use in routing
    policy.  It can be imported by modules that contain protocol-
    specific policy conditions and actions.";

  oc-ext:openconfig-version "3.1.0";

  revision "2018-06-05" {
    description
      "Add PIM, IGMP to INSTALL_PROTOCOL_TYPES identity";
    reference "3.1.0";
  }

  revision "2017-07-14" {
    description
      "Replace policy choice node/type with policy-result
      enumeration;simplified defined set naming;removed generic
      IGP actions; migrate to OpenConfig types; added mode for
      prefix sets";
    reference "3.0.0";
  }

  revision "2016-05-12" {
    description
      "OpenConfig public release";
    reference "2.0.1";
  }

  // identity statements

  identity ATTRIBUTE_COMPARISON {
    description
      "base type for supported comparison operators on route
      attributes";
  }

  identity ATTRIBUTE_EQ {
    base ATTRIBUTE_COMPARISON;
    description "== comparison";
  }

  identity ATTRIBUTE_GE {
    base ATTRIBUTE_COMPARISON;
    description ">= comparison";
  }

  identity ATTRIBUTE_LE {
    base ATTRIBUTE_COMPARISON;
    description "<= comparison";
  }

  typedef match-set-options-type {
    type enumeration {
      enum ANY {
        description "match is true if given value matches any member
        of the defined set";
      }
      enum ALL {
        description "match is true if given value matches all
        members of the defined set";
      }
      enum INVERT {
        description "match is true if given value does not match any
        member of the defined set";
      }
    }
    default ANY;
    description
      "Options that govern the behavior of a match statement.  The
      default behavior is ANY, i.e., the given value matches any
      of the members of the defined set";
  }

  typedef match-set-options-restricted-type {
    type enumeration {
      enum ANY {
        description "match is true if given value matches any member
        of the defined set";
      }
      enum INVERT {
        description "match is true if given value does not match any
        member of the defined set";
      }
    }
    default ANY;
    description
      "Options that govern the behavior of a match statement.  The
      default behavior is ANY, i.e., the given value matches any
      of the members of the defined set.  Note this type is a
      restricted version of the match-set-options-type.";
      //TODO: restriction on enumerated types is only allowed in
      //YANG 1.1.  Until then, we will require this additional type
  }

  grouping attribute-compare-operators {
    description "common definitions for comparison operations in
    condition statements";

    leaf operator {
        type identityref {
          base ATTRIBUTE_COMPARISON;
        }
        description
          "type of comparison to be performed";
      }

    leaf value {
      type uint32;
      description
        "value to compare with the community count";
    }
  }

  typedef tag-type {
    type union {
      type uint32;
      type yang:hex-string;
    }
    description "type for expressing route tags on a local system,
    including IS-IS and OSPF; may be expressed as either decimal or
    hexidecimal integer";
    reference
      "RFC 2178 OSPF Version 2
      RFC 5130 A Policy Control Mechanism in IS-IS Using
      Administrative Tags";
  }

  identity INSTALL_PROTOCOL_TYPE {
    description
      "Base type for routing protocols, including those which may
      install prefixes into the RIB";
  }

  identity BGP {
    base INSTALL_PROTOCOL_TYPE;
    description
      "BGP";
    reference
      "RFC 4271";
  }

  identity ISIS {
    base INSTALL_PROTOCOL_TYPE;
    description
      "IS-IS";
    reference
      "ISO/IEC 10589";
  }

  identity OSPF {
    base INSTALL_PROTOCOL_TYPE;
    description
      "OSPFv2";
    reference
      "RFC 2328";
  }

  identity OSPF3 {
    base INSTALL_PROTOCOL_TYPE;
    description
      "OSPFv3";
    reference
      "RFC 5340";
  }

  identity STATIC {
    base INSTALL_PROTOCOL_TYPE;
    description
      "Locally-installed static route";
  }

  identity DIRECTLY_CONNECTED {
    base INSTALL_PROTOCOL_TYPE;
    description
      "A directly connected route";
  }

  identity LOCAL_AGGREGATE {
    base INSTALL_PROTOCOL_TYPE;
    description
      "Locally defined aggregate route";
  }

  identity PIM {
    base INSTALL_PROTOCOL_TYPE;
    description
      "Protocol Independent Multicast";
    reference
      "RFC 7761";
  }

  identity IGMP {
    base INSTALL_PROTOCOL_TYPE;
    description
      "Internet Group Management Protocol";
    reference
      "RFC 3376";
  }
}