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