Bug 5005: Send Map-Notify to all affected xTRs
[lispflowmapping.git] / mappingservice / lisp-proto / src / main / yang / odl-lisp-proto.yang
1 module odl-lisp-proto {
2
3     yang-version 1;
4     namespace "urn:opendaylight:lfm:lisp-proto";
5     prefix "lisp-proto";
6
7     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
8     import ietf-lisp-address-types { prefix lisp-address; revision-date 2015-11-05; }
9
10     organization "LISP Flow Mapping";
11
12     contact
13         "David Goldberg <david.goldberg@contextream.com>
14         Vina Ermagan <vermagan@cisco.com>";
15
16     description
17         "YANG representation of LISP (RFC6830) protocol.";
18
19     revision "2015-11-05" {
20         description "Renamed the module to lisp-proto.";
21         reference "https://tools.ietf.org/html/rfc6830";
22     }
23
24     typedef ipv4-address-binary {
25         type binary {
26             length "4";
27         }
28         description
29             "The ipv4-address-binary type represents an IPv4 address in binary
30              in network byte order.";
31     }
32
33     typedef ipv6-address-binary {
34         type binary {
35             length "16";
36         }
37         description
38             "The ipv6-address-binary type represents an IPv6 address in binary
39              in network byte order.";
40     }
41
42     typedef ip-address-binary {
43         type union {
44             type ipv4-address-binary;
45             type ipv6-address-binary;
46         }
47         description
48             "The ip-address-binary type represents an IP address in binary
49              in network byte order, and is IP version neutral.  The length of
50              the byte array implies the IP version.";
51     }
52
53     grouping transport-address {
54         container transport-address {
55             leaf ipAddress {
56                 type inet:ip-address;
57                 reference "http://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml";
58             }
59             leaf port {
60                 type inet:port-number;
61             }
62         }
63     }
64
65     grouping eid-container {
66         container eid {
67             uses lisp-address:lisp-address;
68         }
69     }
70
71     grouping rloc-container {
72         container rloc {
73             uses lisp-address:lisp-address;
74         }
75     }
76
77     grouping eid-list {
78         list eid-item {
79             key "eid-item-id";
80             leaf eid-item-id {
81                 type string;
82             }
83             uses eid-container;
84         }
85     }
86
87     grouping LocatorRecords {
88         list LocatorRecord {
89             key "locator-id";
90             leaf locator-id {
91                 type string;
92             }
93             leaf priority {
94                 type uint8;
95             }
96             leaf weight {
97                 type uint8;
98             }
99             leaf multicastPriority {
100                 type uint8;
101             }
102             leaf multicastWeight {
103                 type uint8;
104             }
105             leaf localLocator {
106                 type boolean;
107             }
108             leaf rlocProbed {
109                 type boolean;
110             }
111             leaf routed {
112                 type boolean;
113             }
114
115             //locator address
116             uses rloc-container;
117         }
118     }
119
120     grouping mapping-record-metadata {
121         leaf xtr-id {
122             type binary {
123                 length "16";
124             }
125             description
126                 "128 bit xTR identifier.";
127         }
128         leaf site-id {
129             type binary {
130                 length "8";
131             }
132             description
133                 "64 bit site identifier.";
134         }
135         leaf source-rloc {
136             type inet:ip-address;
137             description
138                 "The Source IP address used for sending the enclosing control
139                  packet in RLOC space.";
140         }
141         leaf timestamp {
142             type int64;
143             description
144                 "Milliseconds since January 1, 1970, 00:00:00 GMT";
145         }
146         description
147             "This is a collection of fields which are not present in the actual
148             mapping record defined in RFC 6830, but are used internally in
149             OpenDaylight";
150     }
151
152     grouping mapping-record-container {
153         container mapping-record {
154             leaf recordTtl {
155                 type int32;
156             }
157             leaf maskLength {
158                 type uint8;
159             }
160             leaf mapVersion {
161                 type int16;
162             }
163             leaf action {
164                 type enumeration {
165                     enum NoAction;
166                     enum NativelyForward;
167                     enum SendMapRequest;
168                     enum Drop;
169                 }
170             }
171             leaf authoritative {
172                 type boolean;
173             }
174             // EID prefix
175             uses eid-container;
176
177             // locator record list
178             uses LocatorRecords;
179
180             // metadata
181             uses mapping-record-metadata;
182         }
183     }
184
185     grouping mapping-record-list {
186         list mapping-record-item {
187             key "mapping-record-item-id";
188             leaf mapping-record-item-id {
189                 type string;
190             }
191             uses mapping-record-container;
192         }
193     }
194
195     grouping xtrSiteId {
196         leaf xtrId {
197             type binary {
198                 length "16";
199             }
200         }
201         leaf siteId {
202             type binary {
203                 length "8";
204             }
205         }
206     }
207
208     grouping MapRegister {
209         reference "http://tools.ietf.org/html/rfc6830#section-6.1.6 , http://tools.ietf.org/html/draft-ermagan-lisp-nat-traversal-05#section-4.3";
210         leaf proxyMapReply {
211             type boolean;
212         }
213         leaf xtrSiteIdPresent {
214             type boolean;
215         }
216         leaf wantMapNotify {
217             type boolean;
218         }
219         leaf nonce {
220             type int64;
221         }
222         leaf keyId {
223             type int16;
224         }
225         leaf authenticationData {
226             type binary;
227         }
228         uses mapping-record-list;
229         uses xtrSiteId;
230     }
231
232     grouping MapNotify {
233         reference "http://tools.ietf.org/html/rfc6830#section-6.1.7 , http://tools.ietf.org/html/draft-ermagan-lisp-nat-traversal-05#section-4.3";
234         leaf xtrSiteIdPresent {
235             type boolean;
236         }
237         leaf nonce {
238             type int64;
239         }
240         leaf keyId {
241             type int16;
242         }
243         leaf authenticationData {
244             type binary;
245         }
246         uses mapping-record-list;
247         uses xtrSiteId;
248     }
249
250     grouping MapRequest {
251         reference "http://tools.ietf.org/html/rfc6830#section-6.1.2";
252         leaf authoritative {
253             type boolean;
254         }
255         leaf mapDataPresent {
256             type boolean;
257         }
258         leaf probe {
259             type boolean;
260         }
261         leaf smr {
262             type boolean;
263         }
264         leaf pitr {
265             type boolean;
266         }
267         leaf smrInvoked {
268             type boolean;
269         }
270         leaf nonce {
271             type int64;
272         }
273         container SourceEid {
274             uses eid-container;
275         }
276         list itrRloc {
277             key "itr-rloc-id";
278             leaf itr-rloc-id {
279                 type string;
280             }
281             uses rloc-container;
282         }
283         uses eid-list;
284         container MapReply {
285             uses mapping-record-container;
286         }
287     }
288
289     grouping MapReply {
290         reference "http://tools.ietf.org/html/rfc6830#section-6.1.4";
291         leaf probe {
292             type boolean;
293         }
294         leaf nonce {
295             type int64;
296         }
297         leaf echoNonceEnabled {
298             type boolean;
299         }
300         leaf securityEnabled {
301             type boolean;
302         }
303         uses mapping-record-list;
304     }
305
306     typedef message-type {
307         type enumeration {
308             enum reserved {
309                 value 0;
310                 description
311                     "Reserved";
312             }
313             enum map-request {
314                 value 1;
315                 description
316                     "Map-Request control packet";
317             }
318             enum map-reply {
319                 value 2;
320                 description
321                     "Map-Reply control packet";
322             }
323             enum map-register {
324                 value 3;
325                 description
326                     "Map-Register control packet";
327             }
328             enum map-notify {
329                 value 4;
330                 description
331                     "Map-Notify control packet";
332             }
333             enum map-referral {
334                 value 6;
335                 description
336                     "Map-Referral control packet";
337             }
338             enum info {
339                 value 7;
340                 description
341                     "Info control packet";
342             }
343             enum encapsulated-control-message {
344                 value 8;
345                 description
346                     "Encapsulated control packet";
347             }
348         }
349         description
350             "Defines the LISP control message types";
351         reference "https://tools.ietf.org/html/rfc6830#section-6.1.1";
352     }
353
354     grouping MapRegisterMessage {
355         container MapRegister {
356             uses MapRegister;
357         }
358         uses transport-address;
359     }
360
361     grouping MapRegisterNotification {
362         container MapRegister {
363             uses MapRegister;
364         }
365         uses transport-address;
366     }
367
368     grouping MapNotifyMessage {
369         container MapNotify {
370             uses MapNotify;
371         }
372         uses transport-address;
373     }
374
375     grouping MapNotifyNotification {
376         container MapNotify {
377             uses MapNotify;
378         }
379         uses transport-address;
380     }
381
382     grouping MapRequestMessage {
383         container MapRequest {
384             uses MapRequest;
385         }
386         uses transport-address;
387     }
388
389     grouping MapRequestNotification {
390         container MapRequest {
391             uses MapRequest;
392         }
393         uses transport-address;
394     }
395
396     grouping MapReplyMessage {
397         container MapReply {
398             uses MapReply;
399         }
400         uses transport-address;
401     }
402
403     grouping MapReplyNotification {
404         container MapReply {
405             uses MapReply;
406         }
407         uses transport-address;
408     }
409
410     notification addMapping {
411         uses MapRegisterNotification;
412     }
413
414     notification gotMapNotify {
415         uses MapNotifyNotification;
416     }
417
418     notification requestMapping {
419         uses MapRequestNotification;
420     }
421
422     notification gotMapReply {
423         uses MapReplyNotification;
424     }
425
426     notification xtrRequestMapping {
427         uses MapRequestNotification;
428     }
429
430     notification xtrReplyMapping {
431         uses MapReplyNotification;
432     }
433 }