Sync Common folder
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-lldp@2016-10-14.yang
1 module org-openroadm-lldp {
2   namespace "http://org/openroadm/lldp";
3   prefix org-openroadm-lldp;
4
5   import ietf-inet-types {
6     prefix inet;
7   }
8   import org-openroadm-device {
9     prefix org-openroadm-device;
10     revision-date 2017-02-06;
11   }
12   import iana-afn-safi {
13     prefix ianaaf;
14   }
15   import org-openroadm-resource-types {
16     prefix org-openroadm-resource-types;
17     revision-date 2016-10-14;
18   }
19   import ietf-yang-types {
20     prefix yang;
21   }
22
23   organization "Open ROADM MSA";
24   contact
25     "OpenROADM.org";
26   description
27     "YANG definitions for lldp protocol.
28      
29      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
30      AT&T Intellectual Property.  All other rights reserved.
31      
32      Redistribution and use in source and binary forms, with or without modification, 
33      are permitted provided that the following conditions are met:
34      
35      * Redistributions of source code must retain the above copyright notice, this 
36        list of conditions and the following disclaimer.
37      * Redistributions in binary form must reproduce the above copyright notice, 
38        this list of conditions and the following disclaimer in the documentation and/or 
39        other materials provided with the distribution.
40      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
41        contributors may be used to endorse or promote products derived from this software 
42        without specific prior written permission.
43      
44      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
45      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
46      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
47      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
48      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
49      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
50      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
51      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
52      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
53      POSSIBILITY OF SUCH DAMAGE.";
54
55   revision 2016-10-14 {
56     description
57       "Version 1.2";
58   }
59   grouping nbr-info-grp { 
60     description
61       "Display LLDP Neighbour ";
62
63     leaf remoteSysName {
64       type string;
65       description
66         "remote neighbour system name";
67     }
68     leaf remoteMgmtAddressSubType {
69       type ianaaf:address-family;
70       description
71         "remote neighbour Management Address Subtype Enumeration";
72     }
73     leaf remoteMgmtAddress {
74       type inet:ip-address;
75       description
76         "remote neighbour management address";
77     }
78     leaf remotePortIdSubType {
79       type enumeration {
80         enum "other" {
81           value 0;
82           description
83             "reserved";
84         }
85         enum "ifalias" {
86           value 1;
87           description
88             "Interface Alias (IfAlias - IETF RFC 2863) ";
89         }
90         enum "portcomponent" {
91           value 2;
92           description
93             "Port component (EntPhysicalAlias IETF RFC 4133)";
94         }
95         enum "macaddress" {
96           value 3;
97           description
98             "MAC address (IEEE Std 802) ";
99         }
100         enum "networkaddress" {
101           value 4;
102           description
103             "Network Address";
104         }
105         enum "ifname" {
106           value 5;
107           description
108             "Interface Name (ifName - IETF RFC 2863)";
109         }
110         enum "agentcircuitid" {
111           value 6;
112           description
113             "Agent Circuit Id (IETF RFC 3046)";
114         }
115         enum "local" {
116           value 7;
117           description
118             "Locally assigned";
119         }
120       }
121       description
122         "remote neighbour Port ID Subtype Enumeration";
123     }
124     leaf remotePortId {
125       type string;
126       description
127         "remote neighbour port Id";
128     }
129     leaf remoteChassisIdSubType {
130       type enumeration {
131         enum "reserved" {
132           value 0;
133           description
134             "reserved";
135         }
136         enum "chassiscomponent" {
137           value 1;
138           description
139             "Chassis component (EntPhysicalAlias IETF RFC 4133)";
140         }
141         enum "ifalias" {
142           value 2;
143           description
144             "Interface Alias (IfAlias - IETF RFC 2863) ";
145         }
146         enum "portcomponent" {
147           value 3;
148           description
149             "Port component (EntPhysicalAlias IETF RFC 4133)";
150         }
151         enum "macaddress" {
152           value 4;
153           description
154             "MAC address (IEEE Std 802) ";
155         }
156         enum "networkaddress" {
157           value 5;
158           description
159             "Network Address";
160         }
161         enum "ifname" {
162           value 6;
163           description
164             "Interface Name (ifName - IETF RFC 2863)";
165         }
166         enum "local" {
167           value 7;
168           description
169             "Locally assigned";
170         }
171       }
172       description
173         "Chassis ID Subtype Enumeration";
174     }    
175     leaf remoteChassisId {
176       type string;
177       description
178         "remote neighbour Chassis Id";
179     }                                         
180   }           
181
182   grouping lldp-container {
183     container lldp {
184       description
185         "LLDP configurable and retrievable";
186       container global-config {
187         description
188           "LLDP global configurations";
189         leaf adminStatus {
190           type enumeration {
191             enum "disable" {
192               value 0;
193               description
194                 "Disable the LLDP feature per NE";
195             }
196             enum "enable" {
197               value 1;
198               description
199                 "Enable the LLDP feature per NE";
200             }
201           }
202           description
203             "LLDP feature Enable/Disable per NE";
204           default "enable";
205         }
206         leaf msgTxInterval {
207           type uint16 {
208             range "5..32768";
209           }
210           description
211             "LLDP frame Retransmit Interval in seconds";
212           default "30";
213         }
214         leaf msgTxHoldMultiplier {
215           type uint8 {
216             range "2..10";
217           }
218           description
219             "TTL value for the TLVs transmitter over wire in seconds";
220           default "4";
221         }
222       }
223       list port-config {
224         description
225           "LLDP port configurations";
226         key "ifName";
227         leaf ifName {
228           type leafref {
229             path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
230           }
231           description
232             "Ethernet interface name where LLDP runs";
233         }
234         leaf adminStatus {
235           type enumeration {
236             enum "disable" {
237               value 0;
238               description
239                 "Disables the LLDP frames transmit and receive on specific interface";
240             }
241             enum "txandrx" {
242               value 1;
243               description
244                 "Enable Transmit and Receive LLDP frames on specific interface";
245             }
246           }
247           description
248             "LLDP enable per port basis";
249           default "txandrx";
250         }
251       }
252       container nbr-list {
253         description
254           "LLDP Oper data - Neighbour List information";
255         config false;
256         list if-name {
257           key "ifName";
258           leaf ifName {
259             type string;
260             description
261               "Ethernet interface name where LLDP runs";
262           }                               
263           uses nbr-info-grp;
264         }                             
265       }
266     }
267   }
268
269   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protocols" {
270     when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:info/org-openroadm-device:node-type='rdm'";
271     uses lldp-container;
272   }
273
274   notification lldp-nbr-info-change {
275     description "LLDP: Neighbor Information Changed
276             remoteSysName
277             remoteSysMgmtAddressSubType
278             remoteSysMgmtAddress
279             remotePortIdSubType
280             remotePortId
281             remoteChassisIdSubType
282             remoteChassisId
283             All of the above attributes are sent in event";
284     leaf notification-type {
285       type org-openroadm-resource-types:resource-notification-type; 
286     }
287     leaf resource-type {
288       type org-openroadm-resource-types:resource-type-enum;
289       description  
290         "resource-type for this notification is interface";  
291     }
292     leaf resource {         
293       type string;
294       description  
295         "resource interface-name";  
296     }
297     container nbr-info {
298       uses nbr-info-grp;
299     }
300     leaf event-time {
301       type yang:date-and-time;
302     }
303   }                    
304 }