Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / schemas / yang / rw-yang-types.yang.src
1
2 /*
3  * 
4  *   Copyright 2016 RIFT.IO Inc
5  *
6  *   Licensed under the Apache License, Version 2.0 (the "License");
7  *   you may not use this file except in compliance with the License.
8  *   You may obtain a copy of the License at
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *   Unless required by applicable law or agreed to in writing, software
13  *   distributed under the License is distributed on an "AS IS" BASIS,
14  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *   See the License for the specific language governing permissions and
16  *   limitations under the License.
17  *
18  */
19
20
21
22 /**
23  * @file rw-yang-types.yang
24  * @author Tom Seidenberg
25  * @date 2014/04/01
26  * @brief RiftWare yang type overrides
27  *
28  * These typedefs exist to allow RiftWare to specify special extensions
29  * to the types.
30  */
31
32 module rw-yang-types
33 {
34   namespace "http://riftio.com/ns/riftware-1.0/rw-yang-types";
35   prefix "rwt";
36
37   import ietf-inet-types {
38     prefix "inet";
39     revision-date 2013-07-15;
40   }
41
42   import ietf-yang-types {
43     prefix "ietf-yang-types";
44     revision-date 2013-07-15;
45   }
46
47   description
48    "This module contains redefinitions of the ietf-yang-types and
49    ietf-inet-types modules, which allows customized extensions to be
50    defined for these types when used in RiftWare applications.";
51
52   revision 2014-04-01 {
53     description
54       "Initial revision.";
55     reference
56       "RIFT yang types that redefine the IETF types.";
57   }
58
59
60   /* ietf-inet-types */
61
62   typedef ip-version {
63     type inet:ip-version;
64   }
65
66   typedef dscp {
67     type inet:dscp;
68   }
69
70   typedef ipv6-flow-label {
71     type inet:ipv6-flow-label;
72   }
73
74   typedef port-number {
75     type inet:port-number;
76   }
77
78   typedef as-number {
79     type inet:as-number;
80   }
81
82   typedef ip-address {
83     type inet:ip-address;
84   }
85
86   typedef ipv4-address {
87     type inet:ipv4-address;
88   }
89
90   typedef ipv6-address {
91     type inet:ipv6-address;
92   }
93
94   typedef ip-address-no-zone {
95     type inet:ip-address-no-zone;
96   }
97
98   typedef ipv4-address-no-zone {
99     type inet:ipv4-address-no-zone;
100   }
101
102   typedef ipv6-address-no-zone {
103     type inet:ipv6-address-no-zone;
104   }
105
106   typedef ip-prefix {
107     type inet:ip-prefix;
108   }
109
110   typedef ip-prefix-non-canonical {
111     type union {
112       type rwt:ipv4-prefix-non-canonical;
113       type rwt:ipv6-prefix-non-canonical;
114     }
115     description
116       "The ip-prefix type represents an IP prefix and is IP
117       version neutral.  The format of the textual representations
118       implies the IP version.";
119   }
120
121   typedef ipv4-prefix {
122     type inet:ipv4-prefix;
123   }
124
125   typedef ipv4-prefix-non-canonical {
126     type string {
127       pattern
128          '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
129        +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
130        + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
131     }
132     description
133      "The ipv4-prefix type represents an IPv4 address prefix.
134       The prefix length is given by the number following the
135       slash character and must be less than or equal to 32.
136
137       A prefix length value of n corresponds to an IP address
138       mask that has n contiguous 1-bits from the most
139       significant bit (MSB) and all other bits set to 0.";
140   }
141
142   typedef ipv6-prefix {
143     type inet:ipv6-prefix;
144   }
145
146   typedef ipv6-prefix-non-canonical {
147     type string {
148       pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
149             + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
150             + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
151             + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
152             + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
153       pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
154             + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
155             + '(/.+)';
156     }
157     description
158      "The ipv6-prefix type represents an IPv6 address prefix.
159       The prefix length is given by the number following the
160       slash character and must be less than or equal to 128.
161
162       A prefix length value of n corresponds to an IP address
163       mask that has n contiguous 1-bits from the most
164       significant bit (MSB) and all other bits set to 0.
165
166       The IPv6 address should have all bits that do not belong
167       to the prefix set to zero.";
168   }
169
170
171   typedef domain-name {
172     type inet:domain-name;
173   }
174
175   typedef host {
176     type inet:host;
177   }
178
179   typedef uri {
180     type inet:uri;
181   }
182
183
184   /* ietf-yang-types */
185
186   typedef counter32 {
187     type ietf-yang-types:counter32;
188   }
189
190   typedef zero-based-counter32 {
191     type ietf-yang-types:zero-based-counter32;
192   }
193
194   typedef counter64 {
195     type ietf-yang-types:counter64;
196   }
197
198   typedef zero-based-counter64 {
199     type ietf-yang-types:zero-based-counter64;
200   }
201
202   typedef gauge32 {
203     type ietf-yang-types:gauge32;
204   }
205
206   typedef gauge64 {
207     type ietf-yang-types:gauge64;
208   }
209
210   typedef object-identifier {
211     type ietf-yang-types:object-identifier;
212   }
213
214   typedef object-identifier-128 {
215     type ietf-yang-types:object-identifier-128;
216   }
217
218   typedef yang-identifier {
219     type ietf-yang-types:yang-identifier;
220   }
221
222   typedef date-and-time {
223     type ietf-yang-types:date-and-time;
224   }
225
226   typedef timeticks {
227     type ietf-yang-types:timeticks;
228   }
229
230   typedef timestamp {
231     type ietf-yang-types:timestamp;
232   }
233
234   typedef phys-address {
235     type ietf-yang-types:phys-address;
236   }
237
238   typedef mac-address {
239     type ietf-yang-types:mac-address;
240   }
241
242   typedef xpath1.0 {
243     type ietf-yang-types:xpath1.0;
244   }
245
246   typedef hex-string {
247     type ietf-yang-types:hex-string;
248   }
249
250   typedef uuid {
251     type ietf-yang-types:uuid;
252   }
253
254   typedef dotted-quad {
255     type ietf-yang-types:dotted-quad;
256   }
257
258   typedef call-id {
259     type string {
260       pattern '[0-9]{1,20}:[0-9]{1,20}';
261     }
262   }
263
264   typedef base64-binary {
265     type string {
266       pattern '[0-9a-zA-Z+/]{4,}[=]{0,2}';
267     }
268   }
269   typedef hex-binary {
270     type string {
271       pattern '[0-9A-Fa-f]{2}([0-9A-Fa-f]{2})*';
272     }
273
274   }
275
276   typedef rw-ip-protocol{
277       type enumeration {
278           enum icmp { value 1; }
279           enum tcp  { value 6; }
280           enum udp  { value 17; }
281           enum gre  { value 47; }
282       }
283   }
284 }