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