refactoring to support delete\update of servics.
[unimgr.git] / legato-api / src / main / yang / mef-interfaces.yang
1 module mef-interfaces {
2   namespace "http://metroethernetforum.org/ns/yang/mef-interfaces";
3   prefix mef-interfaces;
4   import ietf-inet-types { prefix inet; }
5   import ietf-yang-types { prefix yang; }
6   import mef-types { prefix mef-types; }
7   import mef-global { prefix mef-global; }
8   import mef-topology { prefix mef-topology; }
9   import yang-ext {prefix ext; revision-date "2013-07-09";}
10
11   import opendaylight-l2-types { prefix ethertype; }
12   // revision-date "2013-08-27";
13
14   organization "Metro Ethernet Forum";
15   contact
16     "Web URL: http://metroethernetforum.org/ E-mail: mibs@metroethernetforum.org
17     Postal: Metro Ethernet Forum 6033 W. Century Boulevard, Suite
18     1107 Los Angeles, CA 90045 U.S.A. Phone: +1 310-642-2800 Fax:
19     +1 310-642-2808";
20   description
21     "This module implements the UNI functionality specified in MEF
22     10.3, MEF 6.2, and MEF 7.2. Reference Overview: A number of base
23     documents have been used to create the MEF Interfaces YANG Module.
24     The following are the abbreviations for the baseline documents:
25     [RFC 6991] refers to IETF RFC 6991 'Common YANG Data Types', 2013-07-15
26     [RFC 6643] refers to IETF RFC 6643 'Translation of Structure of
27     Management Information Version 2 (SMIv2) MIB Modules to YANG Modules',
28     2011-11-25 [802.1AB] refers to 'Station and Media Access Control
29     Connectivity Discovery', IEEE 802.1AB-2009, September 2009 [802.1q]
30     refers to IEEE 802.1Q-2011 'IEEE Standard for Local and metropolitan
31     area networks --Media Access Control (MAC) Bridges and Virtual
32     Bridged Local Area Networks, August 2011 [802-2001] refers to
33     'IEEE Standard for Local and Metropolitan Area Networks: Overview
34     and Architecture', IEEE 802-2001, February 2002 [MEF10.3] refers
35     to MEF 10.3 'Ethernet Services Attributes Phase 3', October 2013
36     [MEF6.2] refers to MEF 6.2 'EVC Ethernet Services Defintions Phase
37     3', August 2014 [MEF40] refers to MEF 40 'UNI and EVC Definition
38     of Managed Objects', April 2013 [MEF45] refers to MEF 45 'Multi-CEN
39     L2CP', August 2014 [MEF7.2] refers to MEF 7.2 'Carrier Ethernet
40     Management Information Model', April 2013 [MEF7.3] refers to MEF
41     7.3 'Carrier Ethernet Management Information Model', Working Draft
42     #1 2015 [RFC 2737] refers to IETF RFC 2737 'Entity MIB (Version
43     2)', December 1999 [RFC 2863] refers to IETF RFC 2863 'The Interfaces
44     Group MIB', June 2000 [RFC 3419] refers to IETF RFC 3419 'Textual
45     Conventions for Transport Addresses', December 2002 [Y.1731] refers
46     to ITU-T Y.1731 'OAM functions and mechanisms for Ethernet based
47     networks', July 2011 [Q.840.1] refers to ITU-T Q.840.1 'Requirements
48     and analysis for NMS-EMS management interface of Ethernet over
49     Transport and Metro Ethernet Network(EoT/MEN)' March 2007";
50   revision 2015-05-26 {
51     description
52         "Formal Project Review Draft 1.";
53     reference "EVC Ethernet Services Definitions YANG Modules " +
54         "(MEF XX), TBD";
55   }
56   container mef-interfaces {
57     description
58         "MEF Interfaces";
59     container unis {
60       description
61             "User Network Interface(UNI).";
62       list uni {
63         must "not(./ingress-bw-profile-per-uni) or " +
64                 "((./ingress-bw-profile-per-uni) and " +
65                 "not(./ingress-envelopes))" {
66           error-message "If there is a per UNI Ingress Bandwidth " +
67                     "Profile, then there cannot be any other Ingress " +
68                     "Bandwidth Profiles at that UNI.";
69           description
70                     "If there is a per UNI Ingress Bandwidth Profile, " +
71                     "then there cannot be any other Ingress Bandwidth " +
72                     "Profiles at that UNI.";
73         }
74         must "not(./egress-bw-profile-per-uni) or " +
75                 "((./egress-bw-profile-per-uni) and " +
76                 "not(./egress-envelopes))" {
77           error-message "If there is a per UNI Egress Bandwidth " +
78                     "Profile, then there cannot be any other Egress " +
79                     "Bandwidth Profiles at that UNI.";
80           description
81                     "If there is a per UNI Egress Bandwidth Profile, " +
82                     "then there cannot be any other Egress Bandwidth " +
83                     "Profiles at that UNI.";
84         }
85         must "(not(/mef-global:mef-global/mef-global:" +
86                 "subscribers) and " +
87                 "not(./subscriber)) or " +
88                 "(/mef-global:mef-global/mef-global:" +
89                 "subscribers and " +
90                 "./subscriber)" {
91           error-message "If the Subscribers list has been " +
92                     "populated, a UNI must be configured for " +
93                     "a single Subscriber.";
94           description
95                     "[MEF103] [R1] A UNI must be dedicated to a single " +
96                     "Subscriber. This must statement is effectively " +
97                     "a 'mandatory true' when the Global Subscribers " +
98                     "list is being used.";
99         }
100         must "(not(/mef-global:mef-global/mef-global:cens) and " +
101                 "not(./cen-id)) or " +
102                 "(/mef-global:mef-global/mef-global:cens and " +
103                 "./cen-id)" {
104           error-message "If the CENs list has been populated, " +
105                     "a UNI must be configured for a single CEN.";
106           description
107                     "[MEF103] [R57] A UNI must be dedicated to a " +
108                     "single CEN. This must statement is effectively " +
109                     "a 'mandatory true' when the Global CENs list " +
110                     "is being used.";
111         }
112         key "uni-id";
113         description
114                 "MEF UNI List.";
115         reference "[MEF6.2] Section 8.2.2.";
116         container ip-unis {
117           list ip-uni {
118             key "ip-uni-id";
119             leaf ip-uni-id {
120               type mef-types:identifier45;
121             }
122             leaf ip-address {
123               type inet:ip-prefix;
124             }
125             leaf vlan {
126               type ethertype:vlan-id;
127             }
128           }
129         }
130         container physical-layers {
131           description
132                     "The Physical Layer MUST operate in a full duplex " +
133                     "mode. It is not configurable.";
134           reference "[MEF10.3] Section 9.2, [R61], [R62]";
135           container links {
136             presence "A UNI must have links.";
137             description
138                         "The Physical Layer for each physical link " +
139                         "implementing the UNI MUST be one of the " +
140                         "PHYs listed in IEEE Std 802.3–2012 but " +
141                         "excluding 1000BASE-PX-D and 1000BASE-PX-U.";
142             reference "[MEF10.3] Section 9.2 [R60]";
143             list link {
144               must "count(.) >= 1" {
145                 error-message "A UNI must have at least one " +
146                                 "physical link configured.";
147                 description
148                                 "A UNI must have at least one physical link " +
149                                 "configured.";
150               }
151               key "device interface";
152               description
153                             "A list of all the physical ports associated " +
154                             "with this Link Layer.";
155               leaf device {
156                 type leafref {
157                   path "/mef-topology:mef-topology/mef-topology:" +
158                                     "devices/mef-topology:device/" +
159                                     "mef-topology:dev-id";
160                 }
161                 description
162                                 "The Physical Layer for each physical link " +
163                                 "implementing the UNI MUST be one of the " +
164                                 "PHYs listed in IEEE Std 802.3–2012 but " +
165                                 "excluding 1000BASE-PX-D and 1000BASE-PX-U.";
166                 reference "[MEF10.3] Section 9.2 [R60]";
167               }
168               leaf interface {
169                 type leafref {
170                   path "/mef-topology:mef-topology/mef-topology:" +
171                                     "devices/mef-topology:device" +
172                                     "[mef-topology:dev-id = " +
173                                     "current()/../device]" +
174                                     "/mef-topology:interfaces/mef-topology:" +
175                                     "interface/mef-topology:phy";
176                 }
177                 description
178                                 "The Physical Layer for each physical link " +
179                                 "implementing the UNI MUST be one of the " +
180                                 "PHYs listed in IEEE Std 802.3–2012 but " +
181                                 "excluding 1000BASE-PX-D and 1000BASE-PX-U.";
182                 reference "[MEF10.3] Section 9.2 [R60]";
183               }
184               leaf ieee8023-phy {
185                 type identityref {
186                   base mef-types:ieee-8023-interface-type;
187                 }
188                 must "(. != 'mef-types:" +
189                                 "ieee8023-1000BASE-PX-D') and " +
190                                 "(. != 'mef-types:ieee8023-1000BASE-PX-U')" {
191                   error-message "The Physical Layer for each " +
192                                     "physical link implementing the UNI " +
193                                     "cannot be 1000BASE-PX-D and 1000BASE-PX-U.";
194                   description
195                                     "The Physical Layer for each physical " +
196                                     "link implementing the UNI cannot be " +
197                                     "1000BASE-PX-D and 1000BASE-PX-U.";
198                 }
199                 description
200                                 "The Physical Layer for each physical link " +
201                                 "implementing the UNI MUST be one of the " +
202                                 "PHYs listed in IEEE Std 802.3–2012 but " +
203                                 "excluding 1000BASE-PX-D and 1000BASE-PX-U.";
204                 reference "[MEF10.3] Section 9.2 [R60]";
205               }
206               leaf connection-speed {
207                 type mef-types:ext-if-physical-layer-type;
208                 units "bits-per-second";
209                 default "1G";
210                 description
211                                 "Physical Layer Connection Speed (Max Data Rate).";
212                 reference "[MEF10.3] Section 9.2. [MEF6.2] " +
213                                 "Section 8.2.2. [MEF20] [R80].";
214               }
215               leaf phy-auto-neg {
216                 type mef-types:auto-negotiation-type;
217                 default "on";
218                 description
219                                 "Auto-Negotiation ON/OFF/Auto.";
220                 reference "[MEF6.2] Section 8.2.2. [MEF20] [R80]. " +
221                                 "[MEF7.3] Section 10.2.2.";
222               }
223               leaf sync-mode-enabled {
224                 type boolean;
225                 must ".='false' or (.='true' and " +
226                                 "../clock-accuracy)" {
227                   error-message "The quality of the clock " +
228                                     "reference must be set if Synchronous " +
229                                     "Mode is enabled.";
230                   description
231                                     "The quality of the clock reference must " +
232                                     "be set if Synchronous Mode is enabled.";
233                 }
234                 default "false";
235                 description
236                                 "Enabled or Disabled for each physical link " +
237                                 "implementing the UNI.";
238                 reference "[MEF10.3] Section 9.3. [MEF6.2] " +
239                                 "Section 8.2.2. [MEF7.3] Section 10.2.2.";
240               }
241               leaf clock-accuracy {
242                 type decimal64 {
243                   fraction-digits 3;
244                 }
245                 units "ppm";
246                 description
247                                 "ESMC:Ethernet Equipment Slave Clock Accuracy " +
248                                 "in PPM. IEEE 802.3 standard specifies " +
249                                 "that Ethernet clock accuracy is to be less " +
250                                 "than or equal to +- 4.6 PPM.";
251                 reference "[MEF10.3] Section 9.3, [R62]. " +
252                                 "[MEF22.1], [IEEE802.3].";
253               }
254             }
255           }
256           leaf number-of-links {
257             type uint32 {
258               range "1..max";
259             }
260             must ". = count(../links/link)" {
261               error-message "The UNI Number of Links value " +
262                             "must match to the number of interfaces " +
263                             "in the link list.";
264               description
265                             "The UNI Number of Links value must match " +
266                             "to the number of interfaces in the link list.";
267             }
268             default "1";
269             description
270                         "The number of links configured in the links list.";
271             reference "[MEF10.3] [R63]. [MEF7.3] Section 10.2.2.";
272           }
273         }
274         container ce-vlans {
275           description
276                     "Each Device (and by extension UNIs) MUST have list " +
277                     "of the CE-VLAN ID including mappings to configured " +
278                     "EVCs if assigned. This list of ce-vlans is a " +
279                     "complete list of all VLANs associated with this " +
280                     "UNI. At the Service Module level, there are two " +
281                     "lists: This one and the list of CE-VLAN IDs " +
282                     "associated with the EVC's UNI List as part of " +
283                     "the MEF Service Definition. ";
284           reference "[MEF10.3] Section 9.10, [R77], [R78]. " +
285                     "[MEF7.3] Section 10.2.2.";
286           list ce-vlan {
287             key "vid";
288             description
289                         "A list of all EC-VLANs allowed ingres or egress " +
290                         "on the UNI. This is the UNI-specific CE-VLAN ID " +
291                         "listing as part of the Service Level " +
292                         "CE-VLAN ID / EVC Map.";
293             reference "[MEF10.3] Section 9.10.1.";
294             leaf vid {
295               type mef-types:vlan-id-type;
296               description
297                             "The Customer Edge VLAN ID is equivalent " +
298                             "to a Static VLAN allowed on that port " +
299                             "(ie. Port is not Forbidden). The " +
300                             "association with the EVC is part of " +
301                             "the EVC configuration.";
302               reference "[MEF10.3] Section 9.10.";
303             }
304           }
305         }
306         container ingress-envelopes {
307           presence "Ingress Bandwidth Profile Envelopes " +
308                     "configured.";
309           description
310                     "UNI Bandwidth Profile Flow Envelopes.";
311           reference "[MEF10.3] Section 9.15, Section 12.1. " +
312                     "[MEF6.2] Section 8.2.1: [R3]. " +
313                     "[MEF7.3] Section 10.2.2.";
314           list envelope {
315             key "env-id";
316             description
317                         "UNI Bandwidth Profile Flow Envelope List.";
318             reference "[MEF10.3] Section 9.15, Section 12.1. " +
319                         "[MEF6.2] Section 8.2.1, [R3], " +
320                         "Section 8.2.2, [R4]. [MEF7.3] " +
321                         "Section 10.2.2.";
322             container bwp-flows {
323               presence "Bandwidth Profile configured for " +
324                             "this envelope.";
325               description
326                             "UNI Bandwidth Profile Flows per Envelope.";
327               reference "[MEF10.3] Section 12.1. " +
328                             "[MEF6.2] Section 10.1.";
329               list bwp-flow {
330                 key "bw-profile";
331                 ordered-by user;
332                 description
333                                 "UNI Bandwidth Profile Flow List per Envelope. " +
334                                 "The order of entries in the list is user " +
335                                 "controlled. The first element of the list " +
336                                 "has the lowest priority and the last " +
337                                 "element will have the highest priority.";
338                 reference "[MEF10.3] Section 12.1. " +
339                                 "[MEF6.2] Section 10.1. " +
340                                 "[MEF6.2] Section 8.2.1, [R3]. ";
341                 leaf bw-profile {
342                   type leafref {
343                     path "/mef-global:mef-global/mef-global:" +
344                                         "profiles/mef-global:" +
345                                         "ingress-bwp-flows/mef-global:" +
346                                         "bwp-flow/mef-global:bw-profile";
347                   }
348                   must "(../../../../../token-share-enabled = " +
349                                     "'true') or " +
350                                     "((../../../../../token-share-enabled = " +
351                                     "'false') and " +
352                                     "(count(../../bwp-flow) = 1))" {
353                     error-message "A UNI with Token Share " +
354                                         "Disabled MUST have exactly one " +
355                                         "Bandwidth Profile Flow per envelope.";
356                     description
357                                         "A UNI with Token Share Disabled MUST " +
358                                         "have exactly one Bandwidth Profile Flow " +
359                                         "per envelope.";
360                   }
361                   must "(../../../coupling-enabled = 'false') or " +
362                                     "(/mef-global:mef-global/mef-global:" +
363                                     "profiles/mef-global:" +
364                                     "ingress-bwp-flows/mef-global:bwp-flow" +
365                                     "[mef-global:bw-profile = current()]/" +
366                                     "mef-global:coupling-enabled = 'false')" {
367                     error-message "If an Ingress Envelope's " +
368                                         "Coupling Flag is Enabled, then " +
369                                         "the Coupling Flags must be disabled " +
370                                         "for all Bandwidth Profile Flows " +
371                                         "mapped to the Envelope.";
372                     description
373                                         "If an Ingress Envelope's Coupling Flag is " +
374                                         "Enabled, then the Coupling Flags must " +
375                                         "be disabled for all Bandwidth Profile " +
376                                         "Flows mapped to the Envelope.";
377                   }
378                   description
379                                     "If no Ingress Bandwidth Profile per UNI " +
380                                     "has been defined (ie. 'No'), then the " +
381                                     "behavior has been defined at the Service " +
382                                     "Level of the configuration.";
383                   reference "[MEF10.3] Section 9.14, " +
384                                     "Section 12.1, [R84], [R134]. " +
385                                     "[MEF6.2] Section 8.2.1,[R3],[R136]. " +
386                                     "Section 8.2.2, 10.1, [R6]. [MEF7.3] " +
387                                     "Section 10.2.2.";
388                 }
389               }
390             }
391             leaf env-id {
392               type mef-types:identifier45;
393               description
394                             "This attribute identifies the Envelope of " +
395                             "Bandwidth Profile Parameters.";
396               reference "[MEF10.3] Section 12.1.";
397             }
398             leaf coupling-enabled {
399               type boolean;
400               must "not(../bwp-flows) or " +
401                             "(../bwp-flows/bwp-flow[2]) or " +
402                             "(. = 'false')" {
403                 error-message "When only one Bandwidth Profile " +
404                                 "Flow is mapped to an envelope, Envelope " +
405                                 "Coupling must be Disabled.";
406                 description
407                                 "When only one Bandwidth Profile Flow is " +
408                                 "mapped to an envelope, Envelope " +
409                                 "Coupling must be Disabled.";
410               }
411               default "false";
412               description
413                             "The Envelope Coupling Flag (CF) attribute.";
414               reference "[MEF10.3] Section 12.1.";
415             }
416           }
417         }
418         container egress-envelopes {
419           presence "Egress Bandwidth Profile Envelopes configured.";
420           description
421                     "UNI Bandwidth Profile Flow Envelopes.";
422           reference "[MEF10.3] Section 9.15, Section 12.1. " +
423                     "[MEF6.2] Section 8.2.1: [R3]. " +
424                     "[MEF7.3] Section 10.2.2.";
425           list envelope {
426             key "env-id";
427             description
428                         "UNI Bandwidth Profile Flow Envelope List.";
429             reference "[MEF10.3] Section 9.15, Section 12.1. " +
430                         "[MEF6.2] Section 8.2.1, [R3], " +
431                         "Section 8.2.2, [R4]. [MEF7.3] " +
432                         "Section 10.2.2.";
433             container bwp-flows {
434               presence "Bandwidth Profile configured for " +
435                             "this envelope.";
436               description
437                             "UNI Bandwidth Profile Flows per Envelope.";
438               reference "[MEF10.3] Section 12.1. [MEF6.2] " +
439                             "Section 10.1.";
440               list bwp-flow {
441                 key "bw-profile";
442                 ordered-by user;
443                 description
444                                 "UNI Bandwidth Profile Flow List per Envelope. " +
445                                 "The order of entries in the list is user " +
446                                 "controlled. The first element of the list " +
447                                 "has the lowest priority and the last element " +
448                                 "will have the highest priority.";
449                 reference "[MEF10.3] Section 12.1. " +
450                                 "[MEF6.2] Section 10.1. " +
451                                 "[MEF6.2] Section 8.2.1, [R3]. ";
452                 leaf bw-profile {
453                   type leafref {
454                     path "/mef-global:mef-global/mef-global:" +
455                                         "profiles/mef-global:egress-bwp-flows" +
456                                         "/mef-global:bwp-flow/" +
457                                         "mef-global:bw-profile";
458                   }
459                   must "(../../../../../token-share-enabled = " +
460                                     "'true') or " +
461                                     "((../../../../../token-share-enabled = " +
462                                     "'false') and " +
463                                     "(count(../../bwp-flow) = 1))" {
464                     error-message "A UNI with Token Share " +
465                                         "Disabled must have exactly one " +
466                                         "Bandwidth Profile Flow per envelope.";
467                     description
468                                         "A UNI with Token Share Disabled must have " +
469                                         "exactly one Bandwidth Profile Flow per " +
470                                         "envelope.";
471                   }
472                   must "(../../../coupling-enabled = 'false') or " +
473                                     "(/mef-global:mef-global/mef-global:" +
474                                     "profiles/mef-global:" +
475                                     "egress-bwp-flows/mef-global:bwp-flow" +
476                                     "[mef-global:bw-profile = current()]/" +
477                                     "mef-global:coupling-enabled = 'false')" {
478                     error-message "If an Egress Envelope's " +
479                                         "Coupling Flag is Enabled, then the " +
480                                         "Coupling Flags must be disabled " +
481                                         "for all Bandwidth Profile Flows " +
482                                         "mapped to the Envelope.";
483                     description
484                                         "If an Egress Envelope's Coupling Flag " +
485                                         "is Enabled, then the Coupling Flags must " +
486                                         "be disabled for all Bandwidth Profile " +
487                                         "Flows mapped to the Envelope.";
488                   }
489                   description
490                                     "UNI Bandwidth Profile Flow per Envelope.";
491                   reference "[MEF10.3] Section 12.1. " +
492                                     "[MEF6.2] Section 10.1. " +
493                                     "[MEF6.2] Section 8.2.1, [R3], [R136]. ";
494                 }
495               }
496             }
497             leaf env-id {
498               type mef-types:identifier45;
499               description
500                             "This attribute identifies the Envelope of " +
501                             "Bandwidth Profile Parameters.";
502               reference "[MEF10.3] Section 12.1.";
503             }
504             leaf coupling-enabled {
505               type boolean;
506               must "not(../bwp-flows) or " +
507                             "(../bwp-flows/bwp-flow[2]) or " +
508                             "(. = 'false')" {
509                 error-message "When only one Bandwidth Profile " +
510                                 "Flow is mapped to an envelope, " +
511                                 "Envelope Coupling must be Disabled.";
512                 description
513                                 "When only one Bandwidth Profile Flow is " +
514                                 "mapped to an envelope, Envelope Coupling " +
515                                 "must be Disabled.";
516               }
517               default "false";
518               description
519                             "The Envelope Coupling Flag (CF) attribute.";
520               reference "[MEF10.3] Section 12.1.";
521             }
522           }
523         }
524         container status {
525           description
526                     "This group is related to the MEF 7.3 External " +
527                     "Network Interface";
528           leaf oper-state-enabled {
529             type boolean;
530             default "false";
531             config false;
532             description
533                         "Operational Status of the Link as " +
534                         "Enabled/Disabled.";
535             reference "[MEF15]. [MEF7.3] Section 10.1.1.";
536           }
537           leaf available-status {
538             type mef-types:ext-if-availability-type;
539             default "not-installed";
540             config false;
541             description
542                         "Availability Status of the Link.";
543             reference "[MEF15]. [MEF7.3] Section 10.1.1.";
544           }
545           leaf physical-layer {
546             type mef-types:ext-if-physical-layer-type;
547             default "1G";
548             config false;
549             description
550                         "Physical Layer Connection Speed.";
551             reference "[MEF15]. [MEF7.3] Section 10.1.1.";
552           }
553           leaf number-of-links {
554             type uint32;
555             default "0";
556             config false;
557             description
558                         "A count of the number of physical links in this " +
559                         "physical layer.";
560             reference "[MEF15]. [MEF7.3] Section 10.1.1.";
561           }
562           leaf svc-frame-format {
563             type mef-types:svc-frame-format-type;
564             default "ctag";
565             config false;
566             description
567                         "The format must be that of a MAC Frame specified " +
568                         "in IEEE Std 802.3-2012 Clause 3.";
569             reference "[MEF10.3] Section 9.6. [MEF15]. " +
570                         "[MEF7.2]. [MEF7.3] Section 10.1.1.";
571           }
572         }
573         leaf cen-id {
574           when "/mef-global:mef-global/mef-global:cens" {
575             description
576                         "Only configure when the Global CENs list " +
577                         "has been populated.";
578           }
579           type leafref {
580             path "/mef-global:mef-global/mef-global:cens/" +
581                         "mef-global:cen/mef-global:cen-id";
582           }
583           description
584                     "A CEN is defined as a network from a Service " +
585                     "Provider (SP). The CEN ID must be unique for " +
586                     "a specific Service Provider.";
587           reference "[MEF10.3] Section 7.";
588         }
589         leaf uni-id {
590           type mef-types:identifier45;
591           description
592                     " The UNI IDs must be be unique within a specific CEN.";
593           reference "[MEF10.3] Section 9.1, [R1], [R57], [R58], " +
594                     "[R59]. [MEF7.3] Section 10.2.2.";
595         }
596         leaf uni-type {
597           type mef-types:uni-mode-type;
598           default "uni";
599           description
600                     " The UNI Type must be one of {UNI, VUNI}.";
601           reference "[MEF10.3] Section 9.1, [R1], [R57], [R58], " +
602                     "[R59]. [MEF7.3] Section 10.2.2.";
603         }
604         leaf subscriber {
605           when "/mef-global:mef-global/mef-global:subscribers" {
606             description
607                         "UNI Subscriber Attribute is only configurable " +
608                         "when multiple Global Subscribers have been " +
609                         "configured.";
610           }
611           type leafref {
612             path "/mef-global:mef-global/mef-global:subscribers/" +
613                         "mef-global:subscriber/mef-global:sub-id";
614           }
615           description
616                     "A UNI MUST be dedicated to a single Subscriber. " +
617                     "This value can only be configured if the " +
618                     "'/mef-global/subscribers/subscriber' list " +
619                     "has been populated.";
620           reference "[MEF10.3] Section 7.";
621         }
622         leaf admin-state-enabled {
623           type boolean;
624           default "true";
625           description
626                     "Locked/Unlocked is inconsistent with Oper Status " +
627                     "and will be confusing.";
628           reference "MEF 15. MEF 7.3 Section 10.1.1.";
629         }
630         leaf mac-address {
631           type yang:mac-address;
632           description
633                     "MAC Address.";
634           reference "[MEF15]. [MEF7.3] Section 10.1.1.";
635         }
636         leaf uni-resiliency {
637           type mef-types:uni-resiliency-type;
638           must "(. != 'none') or ((. = 'none') and " +
639                     "(../physical-layers/number-of-links = 1))" {
640             error-message "If uni-resiliency is 'none', " +
641                         "number-of-links must be 1.";
642             description
643                         "If uni-resiliency is 'none', number-of-links " +
644                         "must be 1.";
645           }
646           must "(. != 'dual-link-aggregation') or " +
647                     "((. = 'dual-link-aggregation') and " +
648                     "(../physical-layers/number-of-links = 2))" {
649             error-message "If uni-resiliency is " +
650                         "'dual-link-aggregation', " +
651                         "number-of-links must be 2.";
652             description
653                         "If uni-resiliency is 'dual-link-aggregation', " +
654                         "number-of-links must be 2.";
655           }
656           must "(. != 'other') or " +
657                     "((. = 'other') and " +
658                     "(../physical-layers/number-of-links > 2))" {
659             error-message "If uni-resiliency is 'other', " +
660                         "number-of-links must be 3 or greater.";
661             description
662                         "If uni-resiliency is 'other', number-of-links " +
663                         "must be 3 or greater.";
664           }
665           default "none";
666           description
667                     "UNI Resiliency.";
668           reference "[MEF10.3] Section 9.5 [R64], [R65], [R66], " +
669                     "[R67]. [MEF6.2] Section 8.2.2.";
670         }
671         leaf max-svc-frame-size {
672           type mef-types:max-svc-frame-size-type;
673           default "1600";
674           description
675                     "This attribute describes the maximum service frame " +
676                     "size for the UNI.";
677           reference "[MEF10.3] Section 9.7, [R71], MEF 6.2 " +
678                     "Section 8.2.2 and MEF 22.1: [D2]. " +
679                     "[MEF7.3] Section 10.2.2.";
680         }
681         leaf svc-mux-enabled {
682           type boolean;
683           default "false";
684           description
685                     "Service Multiplexing Enable - Enable if to support " +
686                     "multiple EVCs per UNI.";
687           reference "[MEF10.3] Section 9.8. " +
688                     "[MEF7.3] Section 10.2.2.";
689         }
690         leaf bundling-enabled {
691           type boolean;
692           default "false";
693           description
694                     "When a UNI has Bundling Enabled, it MUST be able to " +
695                     "support more than one CE-VLAN ID mapping to a " +
696                     "particular EVC at the UNI.  When more than one " +
697                     "CE-VLAN-ID is mapped to an EVC at a UNI, the " +
698                     "EVC have CE-VLAN ID Preservation enabled";
699           reference "[MEF10.3] Section 9.12, [R25], [R77], " +
700                     "[R78], [R80]. [MEF7.3] Section 10.2.2.";
701         }
702         leaf all-to-one-bundling-enabled {
703           type boolean;
704           default "false";
705           description
706                     "When all-to-one-bundling-enabled = true, all " +
707                     "CE-VLAN IDs MUST map to a single EVC at the " +
708                     "UNI. This also means that the UNI cannot " +
709                     "have svc-mux-enabled = true. When " +
710                     "all-to-one-bundling-enabled = true, " +
711                     "all other UNIs in the EVC associating this UNI " +
712                     "must have all-to-one-bundling-enabled = true. " +
713                     "If this values is true, the value of " +
714                     "ce-vlan-id-for-untagged-and-priority is not " +
715                     "applicable.";
716           reference "[MEF10.3] Section 9.13, Table 12 " +
717                     "(5 valid combinations), [R82], [R83]. " +
718                     "[MEF7.3] Section 10.2.2.";
719         }
720         leaf ce-vlan-id-for-untagged-and-priority {
721           type mef-types:vlan-id-type;
722           default "1";
723           description
724                     "The ce-vlan-id-for-untagged-and-priority is " +
725                     "equivalent to the Layer 2 PVID (Port VLAN ID) " +
726                     "with the Q-BRIDGE-MIB option for frame admitance set " +
727                     "to admitAll. With AdmitAll set, all Untagged and " +
728                     "Priority Tagged Service Frames are treated with " +
729                     "the CE-VLAN-ID tag on ingress. It is not applicable " +
730                     "if All in One Bundling is enabled.";
731           reference "[MEF10.3] Section 9.9, [R73], [R74], " +
732                     "[R75]. [MEF7.3] Section 10.2.2.";
733         }
734         leaf max-evc-count {
735           type uint32 {
736             range "1..max";
737           }
738           default "1";
739           description
740                     "The Maximum Number of EVCs that can be supported " +
741                     "by this UNI (Default 1).";
742           reference "[MEF10.3] Section 9.11, [R79]. " +
743                     "[MEF7.3] Section 10.2.2.";
744         }
745         leaf token-share-enabled {
746           type boolean;
747           default "false";
748           description
749                     "Token Share Enabled/Disabled is used to indicate " +
750                     "whether a given UNI is capable of sharing tokens " +
751                     "across Bandwidth Profile Flows in an envelope.";
752           reference "[MEF6.2] Section 8.2.1, [R2], [D1], [R3]. " +
753                     "[MEF7.3] Section 10.2.2.";
754         }
755         leaf ingress-bw-profile-per-uni {
756           type leafref {
757             path "/mef-global:mef-global/mef-global:profiles/" +
758                         "mef-global:ingress-bwp-flows/mef-global:" +
759                         "bwp-flow/mef-global:bw-profile";
760           }
761           description
762                     "Ingress Bandwidth Profile for this UNI.";
763           reference "[MEF10.3] Section 9.15, Section 12.1. " +
764                     "[MEF6.2] Section 8.2.1: [R3]. " +
765                     "[MEF7.3] Section 10.2.2.";
766         }
767         leaf egress-bw-profile-per-uni {
768           type leafref {
769             path "/mef-global:mef-global/mef-global:profiles/" +
770                         "mef-global:egress-bwp-flows/mef-global:" +
771                         "bwp-flow/mef-global:bw-profile";
772           }
773           description
774                     "Egress Bandwidth Profile Flow for this UNI.";
775           reference "[MEF10.3] Section 9.15, Section 12.1. " +
776                     "[MEF6.2] Section 8.2.1: [R3]. " +
777                     "[MEF7.3] Section 10.2.2.";
778         }
779         leaf link-oam-enabled {
780           type boolean;
781           default "false";
782           description
783                     "Link OAM Enabled/Disabled.";
784           reference "[MEF10.3] Section 9.16, [R86]. " +
785                     "[MEF6.2] Section 8.2.2, [D3]. " +
786                     "[MEF7.3] Section 10.2.2.";
787         }
788         leaf uni-meg-enabled {
789           type boolean;
790           default "false";
791           description
792                     "Enables / Disables the Maintenance Entity Group (MEG).";
793           reference "[MEF10.3] Section 9.17, [R87]. " +
794                     "[MEF30.1] Section 7.9. [MEF6.2] Section 8.2.2, " +
795                     "[D4]. [MEF7.3] Section 10.2.2.";
796         }
797         leaf elmi-enabled {
798           type boolean;
799           must "(. = 'false') or " +
800                     "(. = 'true' and " +
801                     "(../elmi-profile))" {
802             error-message "ELMI Profile must be set if " +
803                         "ELMI is Enabled.";
804             description
805                         "Ethernet Local Management Interface(ELMI) " +
806                         "Profile ID must be set if ELMI is Enabled.";
807           }
808           default "false";
809           description
810                     "Ethernet Local Management Interface(ELMI) " +
811                     "Enabled / Disabled.";
812           reference "[MEF10.3] Section 9.18, [R88]. " +
813                     "[MEF16]. [MEF6.2] Section 8.2.2, [D5]. " +
814                     "[MEF7.3] Section 10.2.2.";
815         }
816         leaf elmi-profile {
817           type leafref {
818             path "/mef-global:mef-global/mef-global:profiles/" +
819                         "mef-global:elmi/mef-global:elmi-profile/" +
820                         "mef-global:id";
821           }
822           description
823                     "The ELMI Profile is only applicable when ELMI " +
824                     "is enabled. The E-LMI protocol is based on " +
825                     "ITU-T Q.933, X.36 and other relevant " +
826                     "recommendations as well as Frame Relay " +
827                     "Local Management Interface (FR-LMI) " +
828                     "Implementation Agreement document defined " +
829                     "by the Frame Relay Forum and related " +
830                     "ITU-T recommendations.";
831           reference "[MEF10.3] Section 9.18. " +
832                     "[MEF7.3] Section 10.2.2.";
833         }
834         leaf l2cp-address-set {
835           type mef-types:l2cp-address-set-type;
836           default "aware-cta";
837           description
838                     "The L2CP Address Set Service Attribute specifies " +
839                     "the subset of the Bridge Reserved Addresses " +
840                     "that are filtered (i.e. L2CP Frames with " +
841                     "this destination address are Peered or " +
842                     "Discarded but not Passed) at a L2CP Decision Point.";
843           reference "[MEF10.3] Section 9.19. " +
844                     "[MEF45] Section 8.1, [R2] through [R9]. " +
845                     "[MEF6.2] Section 8.2.2, [R1]. " +
846                     "[MEF45] Section 8.1.";
847         }
848         leaf l2cp-peering-profile {
849           type leafref {
850             path "/mef-global:mef-global/mef-global:profiles/" +
851                         "mef-global:l2cp-peering/mef-global:" +
852                         "l2cp-profile/mef-global:id";
853           }
854           description
855                     "L2CP Peering Profile for this UNI. This profile " +
856                     "may contain groups of L2CP Destination " +
857                     "MAC Addresses and protocols to be peered at " +
858                     "the UNI (as opposed to being passed or discarded).";
859           reference "[MEF10.3] Section 9.19. " +
860                     "[MEF45] Section 8.2. " +
861                     "[MEF7.3] Section 10.2.2.";
862         }
863         leaf tenant-id {
864           type leafref {
865             path "/mef-global:mef-global/mef-global:tenants-instances/mef-global:tenant-list/mef-global:name";
866           }
867         }
868       }
869     }
870
871     container subnets {
872       list subnet {
873         key "uni-id ip-uni-id subnet";
874         leaf uni-id {
875           type leafref {
876             path "/mef-interfaces:mef-interfaces/mef-interfaces:unis/mef-interfaces:uni/mef-interfaces:uni-id";
877           }
878         }
879         leaf ip-uni-id {
880           type leafref {
881             path "/mef-interfaces:mef-interfaces/mef-interfaces:unis/mef-interfaces:uni/" +
882                  "mef-interfaces:ip-unis/mef-interfaces:ip-uni/mef-interfaces:ip-uni-id";
883           }
884         }
885         leaf subnet {type inet:ip-prefix;}
886         leaf gateway {type inet:ip-address;}
887       }
888     }
889
890   }
891
892   augment "/mef-interfaces:mef-interfaces/mef-interfaces:unis/mef-interfaces:uni" {
893     ext:augment-identifier "port-vlan-mapping";
894     list vlan-to-port {
895       key "vlan";
896       leaf vlan {
897         type mef-types:vlan-id-or-none-type;
898       }
899       leaf vlan-port-id {
900         type string;
901       }
902     }
903   }
904
905 }