Vidyashree Rama | a5ba656 | 2017-03-08 11:23:28 +0530 | [diff] [blame] | 1 | module simple-data-types { |
2 | namespace "simple:data:types"; | ||||
3 | |||||
4 | prefix "smpdtp"; | ||||
5 | revision 2013-11-12 { | ||||
6 | } | ||||
7 | |||||
8 | identity iden { | ||||
9 | } | ||||
10 | |||||
11 | typedef tpdfempty { | ||||
12 | type empty; | ||||
13 | } | ||||
14 | |||||
15 | typedef tpdfbit { | ||||
16 | type bits { | ||||
17 | bit b1; | ||||
18 | bit b2; | ||||
19 | bit b3; | ||||
20 | } | ||||
21 | } | ||||
22 | |||||
23 | typedef tpdfun4 { | ||||
24 | type boolean; | ||||
25 | } | ||||
26 | |||||
27 | typedef tpdfun3 { | ||||
28 | type union { | ||||
29 | type tpdfbit; | ||||
30 | type tpdfempty; | ||||
31 | } | ||||
32 | } | ||||
33 | |||||
34 | typedef tpdfun2 { | ||||
35 | type union { | ||||
36 | type tpdfun3; | ||||
37 | type tpdfun4; | ||||
38 | } | ||||
39 | } | ||||
40 | |||||
41 | typedef tpdfun1 { | ||||
42 | type union { | ||||
43 | type uint8; | ||||
44 | type decimal64 { | ||||
45 | fraction-digits 2; | ||||
46 | } | ||||
47 | } | ||||
48 | } | ||||
49 | |||||
Vidyashree Rama | 114ae46 | 2017-03-16 20:01:16 +0530 | [diff] [blame] | 50 | typedef tpdfun0 { |
51 | type enumeration { | ||||
52 | enum "successful exit" { | ||||
53 | value 1; | ||||
54 | } | ||||
55 | enum "grace period expired" { | ||||
56 | value 2; | ||||
57 | } | ||||
58 | } | ||||
59 | } | ||||
60 | |||||
Vidyashree Rama | a5ba656 | 2017-03-08 11:23:28 +0530 | [diff] [blame] | 61 | container cont { |
62 | leaf lfnint8Min { | ||||
63 | type int8; | ||||
64 | } | ||||
65 | leaf lfnint8Max { | ||||
66 | type int8; | ||||
67 | } | ||||
68 | leaf lfnint16Min { | ||||
69 | type int16; | ||||
70 | } | ||||
71 | leaf lfnint16Max { | ||||
72 | type int16; | ||||
73 | } | ||||
74 | leaf lfnint32Min { | ||||
75 | type int32; | ||||
76 | } | ||||
77 | leaf lfnint32Max { | ||||
78 | type int32; | ||||
79 | } | ||||
80 | leaf lfnint64Min { | ||||
81 | type int64; | ||||
82 | } | ||||
83 | leaf lfnint64Max { | ||||
84 | type int64; | ||||
85 | } | ||||
86 | leaf lfnuint8Max { | ||||
87 | type uint8; | ||||
88 | } | ||||
89 | leaf lfnuint16Max { | ||||
90 | type uint16; | ||||
91 | } | ||||
92 | leaf lfnuint32Max { | ||||
93 | type uint32; | ||||
94 | } | ||||
95 | leaf lfuint64Max { | ||||
96 | type uint64; | ||||
97 | } | ||||
98 | leaf lfstr { | ||||
99 | type string; | ||||
100 | } | ||||
101 | leaf lfstr1 { | ||||
102 | type string; | ||||
103 | } | ||||
104 | leaf lfbool1 { | ||||
105 | type boolean; | ||||
106 | } | ||||
107 | leaf lfbool2 { | ||||
108 | type boolean; | ||||
109 | } | ||||
110 | leaf lfbool3 { | ||||
111 | type boolean; | ||||
112 | } | ||||
113 | leaf lfdecimal1 { | ||||
114 | type decimal64 { | ||||
115 | fraction-digits 1; | ||||
116 | } | ||||
117 | } | ||||
118 | leaf lfdecimal2 { | ||||
119 | type decimal64 { | ||||
120 | fraction-digits 2; | ||||
121 | } | ||||
122 | } | ||||
123 | leaf lfdecimal3 { | ||||
124 | type decimal64 { | ||||
125 | fraction-digits 3; | ||||
126 | } | ||||
127 | } | ||||
128 | |||||
129 | leaf lfdecimal4 { | ||||
130 | type decimal64 { | ||||
131 | fraction-digits 4; | ||||
132 | } | ||||
133 | } | ||||
134 | |||||
135 | leaf lfdecimal6 { | ||||
136 | type decimal64 { | ||||
137 | fraction-digits 6; | ||||
138 | } | ||||
139 | } | ||||
140 | |||||
141 | leaf lfenum { | ||||
142 | type enumeration { | ||||
143 | enum enum1; | ||||
144 | enum enum2; | ||||
145 | enum enum3; | ||||
146 | enum enum4; | ||||
147 | } | ||||
148 | } | ||||
149 | |||||
150 | leaf lfbits { | ||||
151 | type bits { | ||||
152 | bit bit1; | ||||
153 | bit bit2; | ||||
154 | bit bit3; | ||||
155 | bit bit4; | ||||
156 | } | ||||
157 | } | ||||
158 | |||||
159 | leaf lfbinary { | ||||
160 | type binary; | ||||
161 | } | ||||
162 | |||||
163 | leaf lfref1 { //reference to string type | ||||
164 | type leafref { | ||||
165 | path "../lfstr"; | ||||
166 | } | ||||
167 | } | ||||
168 | |||||
169 | leaf lfref2 { //reference to number type | ||||
170 | type leafref { | ||||
171 | path "../lfnint8Max"; | ||||
172 | } | ||||
173 | } | ||||
174 | |||||
175 | leaf lfempty { | ||||
176 | type empty; | ||||
177 | } | ||||
178 | |||||
179 | leaf lfunion1 { | ||||
180 | type union { | ||||
181 | type uint16; | ||||
182 | type string; | ||||
183 | } | ||||
184 | } | ||||
185 | leaf lfunion2 { | ||||
186 | type union { | ||||
187 | type decimal64 { | ||||
188 | fraction-digits 2; | ||||
189 | } | ||||
190 | type string; | ||||
191 | } | ||||
192 | } | ||||
193 | |||||
194 | leaf lfunion4 { | ||||
195 | type union { | ||||
196 | type boolean; | ||||
197 | type string; | ||||
198 | } | ||||
199 | } | ||||
200 | |||||
201 | leaf lfunion5 { | ||||
202 | type union { | ||||
203 | type uint16; | ||||
204 | type string; | ||||
205 | } | ||||
206 | } | ||||
207 | |||||
208 | leaf lfunion7 { | ||||
209 | type tpdfun3; | ||||
210 | } | ||||
211 | |||||
212 | leaf lfunion8 { | ||||
213 | type union { | ||||
214 | type uint16; | ||||
215 | type string; | ||||
216 | } | ||||
217 | } | ||||
218 | |||||
219 | leaf lfunion9 { | ||||
220 | type union { | ||||
221 | type uint16; | ||||
222 | type boolean; | ||||
223 | } | ||||
224 | } | ||||
225 | |||||
226 | leaf lfunion10 { | ||||
227 | type union { | ||||
228 | type bits { | ||||
229 | bit bt1; | ||||
230 | bit bt2; | ||||
231 | } | ||||
232 | type boolean; | ||||
233 | } | ||||
234 | } | ||||
235 | |||||
236 | leaf lfunion11 { | ||||
237 | type union { | ||||
238 | type tpdfun1; | ||||
239 | type tpdfun2; | ||||
240 | } | ||||
241 | } | ||||
242 | |||||
243 | leaf lfunion12 { | ||||
244 | type tpdfun2; | ||||
245 | } | ||||
246 | |||||
247 | leaf lfunion13 { | ||||
248 | type tpdfbit; | ||||
249 | } | ||||
250 | |||||
251 | leaf lfunion14 { | ||||
252 | type union { | ||||
253 | type enumeration { | ||||
254 | enum zero; | ||||
255 | enum one; | ||||
256 | } | ||||
257 | type uint16; | ||||
258 | } | ||||
259 | } | ||||
260 | |||||
261 | leaf identityref1 { | ||||
262 | type identityref { | ||||
263 | base iden; | ||||
264 | } | ||||
265 | } | ||||
Vidyashree Rama | 114ae46 | 2017-03-16 20:01:16 +0530 | [diff] [blame] | 266 | |
267 | leaf lfenum1 { | ||||
268 | type tpdfun0; | ||||
269 | } | ||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 270 | |
271 | leaf inst-iden { | ||||
272 | type instance-identifier; | ||||
273 | } | ||||
Vidyashree Rama | a5ba656 | 2017-03-08 11:23:28 +0530 | [diff] [blame] | 274 | } |
275 | } |