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