Update DAO API
[lispflowmapping.git] / mappingservice / lisp-proto / src / main / yang / lisp-proto.yang
1 module 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-yang-types { prefix yang; revision-date 2010-09-24; }
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-08-20" {
20         description "Renamed the module to lisp-proto.";
21         reference "https://tools.ietf.org/html/rfc6830";
22     }
23
24     grouping TransportAddress {
25         container TransportAddress {
26             leaf ipAddress {
27                 type inet:ip-address;
28                 reference "http://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml";
29             }
30             leaf port {
31                 type inet:port-number;
32             }
33         }
34     }
35
36     grouping LispAFIAddress {
37         leaf afi {
38             type int16;
39             reference "http://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml";
40         }
41     }
42
43     grouping LispNoAddress {
44         uses LispAFIAddress {
45             refine afi {
46                 default 0;
47             }
48         }
49     }
50
51     grouping LispIpv4Address {
52         uses LispAFIAddress {
53             refine afi {
54                 default 1;
55             }
56         }
57         leaf Ipv4Address {
58             type inet:ipv4-address;
59             reference "https://tools.ietf.org/html/rfc3209#section-4.6.2.1";
60         }
61         leaf mask {
62             type uint8;
63         }
64     }
65
66     grouping LispIpv6Address {
67         uses LispAFIAddress {
68             refine afi {
69                 default 2;
70             }
71         }
72         leaf Ipv6Address {
73             type inet:ipv6-address;
74         }
75         leaf mask {
76             type uint8;
77         }
78     }
79
80     grouping LispMacAddress {
81         uses LispAFIAddress {
82             refine afi {
83                 default 16389;
84             }
85         }
86         leaf MacAddress {
87             type yang:mac-address;
88         }
89     }
90
91     grouping LispDistinguishedNameAddress {
92         uses LispAFIAddress {
93             refine afi {
94                 default 17;
95             }
96         }
97         leaf distinguishedName {
98             type string;
99         }
100     }
101
102     grouping LispASAddress {
103         uses LispAFIAddress {
104             refine afi {
105                 default 18;
106             }
107         }
108         leaf AS {
109             type int32;
110         }
111     }
112
113     grouping LispSimpleAddress {
114         choice primitiveAddress {
115             case No {
116                 container NoAddress {
117                     uses LispNoAddress;
118                 }
119             }
120             case Ipv4 {
121                 container Ipv4Address {
122                     uses LispIpv4Address;
123                 }
124             }
125             case Ipv6 {
126                 container Ipv6Address {
127                     uses LispIpv6Address;
128                 }
129             }
130             case Mac {
131                 container MacAddress {
132                     uses LispMacAddress;
133                 }
134             }
135             case DistinguishedName {
136                 container DistinguishedNameAddress {
137                     uses LispDistinguishedNameAddress;
138                 }
139             }
140             case AS {
141                 container ASAddress {
142                     uses LispASAddress;
143                 }
144             }
145         }
146     }
147
148     grouping ReencapHop {
149         container hop {
150             uses LispSimpleAddress;
151         }
152         leaf lookup {
153             type boolean;
154         }
155         leaf RLOCProbe {
156             type boolean;
157         }
158         leaf strict {
159             type boolean;
160         }
161     }
162
163     grouping LispLcafAddress {
164         uses LispAFIAddress {
165             refine afi {
166                     default 16387;
167             }
168         }
169         leaf lcafType {
170             type uint8;
171             reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-03";
172         }
173     }
174
175     grouping LcafSegmentAddress {
176         reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-08#section-4.1";
177         uses LispLcafAddress {
178             refine lcafType {
179                 default 2;
180             }
181         }
182         leaf instanceId {
183             type uint32 {
184                 range "0 .. 16777215";
185             }
186         }
187         leaf iidMaskLength {
188             type uint8;
189         }
190         container Address {
191             uses LispSimpleAddress;
192         }
193     }
194
195     grouping LcafTrafficEngineeringAddress {
196         reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-09#section-4.9";
197         uses LispLcafAddress {
198             refine lcafType {
199                 default 10;
200             }
201         }
202         list Hops {
203             key "name";
204             ordered-by user;
205             leaf name {
206                 type string;
207             }
208             uses ReencapHop;
209         }
210     }
211
212     grouping LcafListAddress {
213         reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-08#section-4.15.1";
214         uses LispLcafAddress {
215             refine lcafType {
216                 default 1;
217             }
218         }
219         list Addresses {
220             key "name";
221             leaf name {
222                 type string;
223             }
224             uses LispSimpleAddress;
225         }
226     }
227
228     grouping LcafSourceDestAddress {
229         reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-08#section-4.11";
230         uses LispLcafAddress {
231             refine lcafType {
232                 default 12;
233             }
234         }
235         container srcAddress {
236             uses LispSimpleAddress;
237         }
238         container dstAddress {
239             uses LispSimpleAddress;
240         }
241         leaf srcMaskLength {
242             type uint8;
243         }
244         leaf dstMaskLength {
245             type uint8;
246         }
247     }
248
249     grouping LcafKeyValueAddress {
250         reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-08#section-4.14";
251         uses LispLcafAddress {
252             refine lcafType {
253                 default 15;
254             }
255         }
256         container key {
257             uses LispSimpleAddress;
258         }
259         container value {
260             uses LispSimpleAddress;
261         }
262     }
263
264     grouping LcafApplicationDataAddress {
265         reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-08#section-4.3";
266         uses LispLcafAddress {
267             refine lcafType {
268                 default 4;
269             }
270         }
271         container Address {
272             uses LispSimpleAddress;
273         }
274         leaf protocol {
275             type uint8;
276         }
277         leaf ipTos {
278             type int32;
279         }
280         leaf localPortLow {
281             type inet:port-number;
282         }
283         leaf localPortHigh {
284             type inet:port-number;
285         }
286         leaf remotePortLow {
287             type inet:port-number;
288         }
289         leaf remotePortHigh {
290             type inet:port-number;
291         }
292     }
293
294
295     grouping LispAddress {
296         container LispAddressContainer {
297             choice Address {
298                 case No {
299                     container NoAddress {
300                         uses LispNoAddress;
301                     }
302                 }
303                 case Ipv4 {
304                     container Ipv4Address {
305                         uses LispIpv4Address;
306                     }
307                 }
308                 case Ipv6 {
309                     container Ipv6Address {
310                         uses LispIpv6Address;
311                     }
312                 }
313                 case Mac {
314                     container MacAddress {
315                         uses LispMacAddress;
316                     }
317                 }
318                 case DistinguishedName {
319                     container distinguishedName {
320                         uses LispDistinguishedNameAddress;
321                     }
322                 }
323                 case AS {
324                     container AS {
325                         uses LispASAddress;
326                     }
327                 }
328                 case LcafSegment {
329                     container LcafSegmentAddr {
330                         uses LcafSegmentAddress;
331                     }
332                 }
333                 case LcafSourceDest {
334                     container LcafSourceDestAddr {
335                         uses LcafSourceDestAddress;
336                     }
337                 }
338                 case LcafKeyValue {
339                     container LcafKeyValueAddressAddr {
340                         uses LcafKeyValueAddress;
341                     }
342                 }
343                 case LcafList {
344                     container LcafListAddr {
345                         uses LcafListAddress;
346                     }
347                 }
348                 case LcafApplicationData {
349                     container LcafApplicationDataAddr {
350                         uses LcafApplicationDataAddress;
351                     }
352                 }
353                 case LcafTrafficEngineering {
354                     container LcafTrafficEngineeringAddr {
355                         uses LcafTrafficEngineeringAddress;
356                     }
357                 }
358             }
359         }
360     }
361
362     grouping EidRecords {
363         list EidRecord {
364             uses LispAddress;
365             leaf mask {
366                 type uint8;
367             }
368         }
369     }
370
371     grouping LocatorRecords {
372         list LocatorRecord {
373             key "name";
374             leaf name {
375                 type string;
376             }
377             leaf priority {
378                 type uint8;
379             }
380             leaf weight {
381                 type uint8;
382             }
383             leaf multicastPriority {
384                 type uint8;
385             }
386             leaf multicastWeight {
387                 type uint8;
388             }
389             leaf localLocator {
390                 type boolean;
391             }
392             leaf rlocProbed {
393                 type boolean;
394             }
395             leaf routed {
396                 type boolean;
397             }
398
399             //locator address
400             uses LispAddress;
401         }
402     }
403
404     grouping EidToLocatorRecord {
405         leaf recordTtl {
406             type int32;
407         }
408         leaf maskLength {
409             type uint8;
410         }
411         leaf mapVersion {
412             type int16;
413         }
414         leaf action {
415             type enumeration {
416                 enum NoAction;
417                 enum NativelyForward;
418                 enum SendMapRequest;
419                 enum Drop;
420             }
421         }
422         leaf authoritative {
423             type boolean;
424         }
425         // EID prefix
426         uses LispAddress;
427
428         // locator record list
429         uses LocatorRecords;
430     }
431
432     grouping EidToLocatorRecords {
433         list eidToLocatorRecord {
434             uses EidToLocatorRecord;
435         }
436     }
437
438     grouping xtrSiteId {
439         leaf xtrId {
440             type binary;
441         }
442         leaf siteId {
443             type binary;
444         }
445     }
446
447     grouping MapRegister {
448         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";
449         leaf proxyMapReply {
450             type boolean;
451         }
452         leaf xtrSiteIdPresent {
453             type boolean;
454         }
455         leaf wantMapNotify {
456             type boolean;
457         }
458         leaf nonce {
459             type int64;
460         }
461         leaf keyId {
462             type int16;
463         }
464         leaf authenticationData {
465             type binary;
466         }
467         uses EidToLocatorRecords;
468         uses xtrSiteId;
469     }
470
471     grouping MapNotify {
472         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";
473         leaf xtrSiteIdPresent {
474             type boolean;
475         }
476         leaf nonce {
477             type int64;
478         }
479         leaf keyId {
480             type int16;
481         }
482         leaf authenticationData {
483             type binary;
484         }
485         uses EidToLocatorRecords;
486         uses xtrSiteId;
487     }
488
489     grouping MapRequest {
490         reference "http://tools.ietf.org/html/rfc6830#section-6.1.2";
491         leaf authoritative {
492             type boolean;
493         }
494         leaf mapDataPresent {
495             type boolean;
496         }
497         leaf probe {
498             type boolean;
499         }
500         leaf smr {
501             type boolean;
502         }
503         leaf pitr {
504             type boolean;
505         }
506         leaf smrInvoked {
507             type boolean;
508         }
509         leaf nonce {
510             type int64;
511         }
512         container SourceEid {
513             uses LispAddress;
514         }
515         list itrRloc {
516             uses LispAddress;
517         }
518         uses EidRecords;
519         container MapReply{
520             uses EidToLocatorRecord;
521         }
522     }
523
524     grouping MapReply {
525         reference "http://tools.ietf.org/html/rfc6830#section-6.1.4";
526         leaf probe {
527             type boolean;
528         }
529         leaf nonce {
530             type int64;
531         }
532         leaf echoNonceEnabled {
533             type boolean;
534         }
535         leaf securityEnabled {
536             type boolean;
537         }
538         uses EidToLocatorRecords;
539     }
540
541     grouping MapRegisterMessage {
542         container MapRegister {
543             uses MapRegister;
544         }
545         uses TransportAddress;
546     }
547
548     grouping MapRegisterNotification {
549         container MapRegister {
550             uses MapRegister;
551         }
552         uses TransportAddress;
553     }
554
555     grouping MapNotifyMessage {
556         container MapNotify {
557             uses MapNotify;
558         }
559         uses TransportAddress;
560     }
561
562     grouping MapNotifyNotification {
563         container MapNotify {
564             uses MapNotify;
565         }
566         uses TransportAddress;
567     }
568
569     grouping MapRequestMessage {
570         container MapRequest {
571             uses MapRequest;
572         }
573         uses TransportAddress;
574     }
575
576     grouping MapRequestNotification {
577         container MapRequest {
578             uses MapRequest;
579         }
580         uses TransportAddress;
581     }
582
583     grouping MapReplyMessage {
584         container MapReply {
585             uses MapReply;
586         }
587         uses TransportAddress;
588     }
589
590     grouping MapReplyNotification {
591         container MapReply {
592             uses MapReply;
593         }
594         uses TransportAddress;
595     }
596
597     rpc sendMapRegister {
598         input {
599             uses MapRegisterMessage;
600         }
601     }
602
603     rpc sendMapNotify {
604         input {
605             uses MapNotifyMessage;
606         }
607     }
608
609     rpc sendMapRequest {
610         input {
611             uses MapRequestMessage;
612         }
613     }
614
615     rpc sendMapReply {
616         input {
617             uses MapReplyMessage;
618         }
619     }
620
621     notification addMapping {
622         uses MapRegisterNotification;
623     }
624
625     notification gotMapNotify {
626         uses MapNotifyNotification;
627     }
628
629     notification requestMapping {
630         uses MapRequestNotification;
631     }
632
633     notification gotMapReply {
634         uses MapReplyNotification;
635     }
636
637     notification xtrRequestMapping {
638         uses MapRequestNotification;
639     }
640
641     notification xtrReplyMapping {
642         uses MapReplyNotification;
643     }
644 }