Allow multiple NTS Manager instances to run on the same machine.
[sim/o1-interface.git] / ntsimulator / yang / o-ran-lbm.yang
1 module o-ran-lbm {
2   yang-version 1.1;
3   namespace "urn:o-ran:lbm:1.0";
4   prefix "o-ran-lbm";
5
6   import ietf-yang-types {
7     prefix yang;
8     revision-date 2013-07-15;
9   }
10
11   import ietf-interfaces {
12     prefix if;
13   }
14
15   import o-ran-interfaces {
16     prefix "o-ran-int";
17   }
18
19   organization "O-RAN Alliance";
20
21   contact
22     "www.o-ran.org";
23
24   description
25     "This module defines the module capabilities for
26     the O-RAN Radio loop-back protocol (IEEE 802.1ag).
27     It is derived from MEF-38 (Service OAM Fault Management YANG Modules, April 2012)
28
29     Copyright 2019 the O-RAN Alliance.
30
31     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
32     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
35     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41     POSSIBILITY OF SUCH DAMAGE.
42
43     Redistribution and use in source and binary forms, with or without
44     modification, are permitted provided that the following conditions are met:
45
46     * Redistributions of source code must retain the above copyright notice,
47     this list of conditions and the above disclaimer.
48     * Redistributions in binary form must reproduce the above copyright notice,
49     this list of conditions and the above disclaimer in the documentation
50     and/or other materials provided with the distribution.
51     * Neither the Members of the O-RAN Alliance nor the names of its
52     contributors may be used to endorse or promote products derived from
53     this software without specific prior written permission.";
54
55   revision "2019-02-04" {
56     description
57       "version 1.0.0
58
59       1) imported model from xRAN
60       2) changed namespace and reference from xran to o-ran";
61
62     reference "ORAN-WG4.M.0-v01.00";
63   }
64
65   typedef priority-type {
66     type uint32 {
67       range "0..7";
68     }
69     description
70       "A 3 bit priority value to be used in the VLAN tag, if present
71        in the transmitted frame.";
72     reference "[802.1q] 12.14.7.3.2:e";
73   }
74
75   typedef mep-id-type {
76     type uint16 {
77       range "1..8191";
78     }
79     description
80       "Maintenance association End Point Identifier (MEPID): A small integer,
81        unique over a given Maintenance Association, identifying a
82        specific MEP.";
83     reference "[802.1q] 3.19 and 19.2.1";
84   }
85
86   typedef vlan-id-type {
87     type uint16 {
88       range "1..4094";
89     }
90     description
91       "The VLAN-ID that uniquely identifies a VLAN.  This is the 12-bit VLAN-ID
92        used in the VLAN Tag header.";
93     reference "[802.1q] 9.6";
94   }
95
96   typedef md-level-type {
97     type int32 {
98       range "0..7";
99     }
100     description
101       "Maintenance Domain Level (MD Level) identifier.  Higher numbers
102        correspond to higher Maintenance Domains, those with the greatest
103        physical reach, with the highest values for customers' CFM PDUs.
104        Lower numbers correspond to lower Maintenance Domains, those with
105        more limited physical reach, with the lowest values for CFM PDUs
106        protecting single bridges or physical links.";
107     reference "[802.1q] 18.3, 21.4.1, IEEE8021-CFM-MIB.Dot1agCfmMDLevel";
108   }
109
110   typedef lbm-transaction-id-type {
111     type uint32;
112     description
113       "A loopback transaction identifier";
114     reference "[802.1q] 21.7.3";
115   }
116
117 // grouping
118
119   grouping md-group {
120     list maintenance-domain {
121       key "id";
122       description
123         "A Maintenance Domain managed object is required in order to create an MA
124          with a MAID that includes that Maintenance Domain's Name. From
125          this Maintenance Domain managed object, all Maintenance
126          Association managed objects associated with that Maintenance
127          Domain managed object can be accessed, and thus controlled.";
128       reference "[802.1q] 12.14.5";
129
130       leaf id {
131         type string;
132         description
133           "A unique identifier of a Maintenance Domain";
134         reference "[802.1q] 12.14.5";
135       }
136
137       leaf name {
138         type string;
139         description
140           "The value for the Maintenance Domain Name. Only the name-type
141           'character-string' is supported";
142         reference "[802.1q] 21.6.5.1 (Table 21-19), 12.14.5.3.2:a";
143       }
144
145       leaf md-level {
146         type md-level-type;
147         default 0;
148         description
149           "Integer identifying the Maintenance Domain Level (MD Level).  Higher
150            numbers correspond to higher Maintenance Domains, those with the
151            greatest physical reach, with the highest values for customers'
152            CFM PDUs.  Lower numbers correspond to lower Maintenance
153            Domains, those with more limited physical reach, with the lowest
154            values for CFM PDUs protecting single bridges or physical links.";
155         reference "[802.1q] 12.14.5.1.3:b";
156       }
157
158       list maintenance-association {
159         key "id";
160         description
161           "This list represents Maintenance Entity Groups (Y.1731) or
162            Maintenance Associations (802.1ag). MEGs/MAs are sets of
163            MEPs, each configured to the same service inside a common
164            OAM domain.";
165         leaf id {
166           type string;
167           description
168             "A unique identifier of a Maintenance Association";
169           reference "[802.1q] 12.14.6";
170         }
171         leaf name {
172           type string;
173
174           description
175             "The value for the Maintenance Association Name. Only the name-type
176             'character-string' is supported";
177           reference "[802.1q] 12.14.5.3.2:b, Table 21-20";
178         }
179
180         list component-list {
181           key "component-id";
182           description
183             "A list of components each of which can be managed in a manner
184              essentially equivalent to an 802.1Q bridge.";
185           reference "[802.1q] IEEE8021-CFM-V2-MIB.ieee8021CfmMaCompTable";
186
187           leaf component-id {
188             type uint32;
189             description
190               "The bridge component within the system to which the information
191                in this maintenance-association applies";
192             reference "[802.1q] IEEE8021-CFM-V2-MIB.ieee8021CfmMaComponentId";
193           }
194
195           leaf name {
196             type string;
197
198             description
199               "The value for the Maintenance Association Name. Only the name-type
200               'character-string' is supported";
201             reference "[802.1q] 12.14.5.3.2:b, Table 21-20";
202           }
203
204           leaf-list vid {
205             type leafref {
206               path "/if:interfaces/if:interface/o-ran-int:vlan-id";
207             }
208             min-elements 1;
209             ordered-by user;
210             description
211               "The VID(s) monitored by this MA, or 0, if the MA is not attached to any
212                VID. The first VID returned is the MA's Primary VID";
213             reference "[802.1q] 12.14.5.3.2:b";
214           }
215
216           leaf-list remote-meps {
217             type mep-id-type;
218             description
219               "A list of the MEPIDs of the MEPs in the MA.";
220             reference "[802.1q] 12.14.6.1.3:g";
221           }
222
223           list maintenance-association-end-point {
224             key "mep-identifier";
225             description
226               "The list of Maintenance association End Points in a specific Maintance
227               Association.";
228
229             leaf mep-identifier {
230               type mep-id-type;
231               description
232                 "Integer that is unique among all the MEPs in the same MA. Other
233                 definition is: a small integer, unique over a given
234                 Maintenance Association, identifying a specific Maintenance
235                 association End Point.";
236               reference "[802.1q] 12.14.6.3.2:b";
237             }
238
239             leaf interface {
240               type leafref {
241                 path "/if:interfaces/if:interface/if:name";
242               }
243               mandatory true;
244               description
245               "An interface, either a Bridge Port or an aggregated IEEE 802.3 port
246                within a Bridge Port, to which the MEP is attached. Each interface in
247                the system is uniquely identified by an interface-name. The structure
248                and content of the name is outside the scope of this specification.";
249               reference "[802.1q] 12.14.7.1.3:b";
250             }
251
252             leaf primary-vid {
253               type leafref {
254                 path "/if:interfaces/if:interface/o-ran-int:vlan-id";
255               }
256               mandatory true;
257               description
258               "The Primary VID of the MEP. The value 0 indicates that either the
259                Primary VID is that of the MEP's MA or that the MEP's MA is
260                associated with no VID";
261               reference "[802.1q] 12.14.7.1.3:d";
262             }
263
264             leaf administrative-state {
265               type boolean;
266               mandatory true;
267               description
268                 "The administrative state of the MEP";
269               reference "[802.1q] 12.14.7.1.3:e";
270             }
271
272             leaf mac-address {
273               type leafref {
274                 path "/if:interfaces/if:interface/o-ran-int:mac-address";
275               }
276               config false;
277               description
278                 "The MAC address of the MEP";
279               reference "[802.1q] 12.14.7.1.3:i";
280             }
281
282             container loopback {
283               config false;
284               description
285                 "Data definitions related to the Loopback function.";
286               leaf replies-transmitted {
287                 type yang:counter32;
288                 config false;
289                 mandatory true;
290                 description
291                   "The total number of LBRs transmitted.";
292                 reference "[802.1q] 12.14.7.1.3:ad";
293               }
294             }
295           }
296         }
297       }
298     }
299   }
300
301 // top level container
302   container md-data-definitions {
303     description
304       "Data definitions related to the maineance domains used for supporting
305       Ethernet loopback connectivity checks";
306     uses md-group;
307   }
308 }