35334a3ea6da9625949ea95ecde5e4b6d15e1278
[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        container Address {
184                uses LispSimpleAddress;
185        }
186     }
187     grouping LcafTrafficEngineeringAddress {
188         reference http://tools.ietf.org/html/draft-ietf-lisp-lcaf-03#section-4.1;
189         uses LispLcafAddress{
190                 refine lcafType {
191                         default 10;
192         }
193     }
194        list Hops {
195                uses ReencapHop;
196        }
197     }
198     
199     grouping LcafListAddress {
200         reference http://tools.ietf.org/html/draft-ietf-lisp-lcaf-03#section-4.1;
201         uses LispLcafAddress{
202                 refine lcafType {
203                         default 1;
204         }
205     }
206        list Addresses {
207                uses LispSimpleAddress;
208        }
209     }
210     
211        grouping LcafSourceDestAddress {
212                 reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-03#section-4.11";
213                 uses LispLcafAddress{
214                         refine lcafType {
215                                 default 12;
216                         }
217                 }
218             container srcAddress {
219                 uses LispSimpleAddress;
220              }
221              container dstAddress {
222                 uses LispSimpleAddress;
223              }
224              leaf srcMaskLength {
225                 type uint8;
226              }
227              leaf dstMaskLength {
228                  type uint8;
229               }
230         }
231         
232         grouping LcafKeyValueAddress {
233                 reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-04#section-4.14";
234                 uses LispLcafAddress{
235                         refine lcafType {
236                                 default 15;
237                         }
238                 }
239             container key {
240                 uses LispSimpleAddress;
241              }
242              container value {
243                 uses LispSimpleAddress;
244              }
245         }
246         
247         grouping LcafApplicationDataAddress {
248                 reference "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-03#section-4.11";
249                 uses LispLcafAddress{
250                         refine lcafType {
251                                 default 4;
252                         }
253                 }
254             container Address {
255                 uses LispSimpleAddress;
256              }
257              leaf protocol {
258                 type uint8;
259              }
260              leaf ipTos {
261                  type int32;
262               }
263               leaf localPort {  
264                                 type inet:port-number;  
265                         }       
266                         leaf remotePort {       
267                                 type inet:port-number;  
268                         }       
269         }
270
271        
272        grouping LispAddress {
273        container LispAddressContainer{
274                choice Address {
275                                 case No {
276                                                 uses LispNoAddress;
277                                         }
278                        case Ipv4 {
279                                                 uses LispIpv4Address;
280                                         }
281                                         case Ipv6 {
282                                                 uses LispIpv6Address;
283                                         }
284                                         case Mac {
285                                                 uses LispMacAddress;
286                                         }
287                                         case DistinguishedName {
288                                                         uses LispDistinguishedNameAddress;
289                                         }
290                                         case AS {
291                                                         uses LispASAddress;
292                                         }
293                        case LcafSegment {
294                                uses LcafSegmentAddress;
295                        }
296                        case LcafSourceDest {
297                                uses LcafSourceDestAddress;
298                        }
299                        case LcafKeyValue {
300                                uses LcafKeyValueAddress;
301                        }
302                        case LcafList {
303                                uses LcafListAddress;
304                        }
305                        case LcafApplicationData {
306                                uses LcafApplicationDataAddress;
307                        }
308                        case LcafTrafficEngineering {
309                                uses LcafTrafficEngineeringAddress;
310                        }
311                } 
312        }
313        }
314     
315     
316     grouping EidRecords {
317     list EidRecord {
318         
319                 // EID
320                 uses LispAddress; 
321                 
322                 leaf mask {
323                         type uint8;
324                 }
325         }
326     }
327     
328     grouping LocatorRecords {
329     list LocatorRecord {
330         leaf priority {
331                 type uint8;
332         }
333         leaf weight {
334                 type uint8;
335         }
336         leaf multicastPriority {
337                 type uint8;
338         }
339         leaf multicastWeight {
340                 type uint8;
341         }
342         leaf localLocator {
343                 type boolean;
344         }
345         leaf rlocProbed {
346                 type boolean;
347         }
348         leaf routed {
349                 type boolean;
350         }
351         
352         //locator address
353         uses LispAddress; 
354     }   
355     }
356     
357     grouping EidToLocatorRecord {       
358         leaf recordTtl {
359                 type int32;
360         }
361         leaf maskLength {
362                 type uint8;
363         }
364         leaf mapVersion {
365                 type int16;
366         }
367         leaf action {
368                 type enumeration {
369                         enum NoAction;
370                         enum NativelyForward;
371                         enum SendMapRequest;
372                         enum Drop;
373                 }
374         }
375         leaf authoritative {
376                 type boolean;
377         }
378         // EID prefix
379         uses LispAddress; 
380         
381         // locator record list
382         uses LocatorRecords;
383     }
384     
385     grouping EidToLocatorRecords {
386         list eidToLocatorRecord {
387                 uses EidToLocatorRecord;
388         }
389     }
390     
391     grouping xtrSiteId {
392         leaf xtrId {
393             type binary;
394         }
395         leaf siteId {
396             type binary;
397         }
398     }
399
400     grouping MapRegister {
401         reference "http://tools.ietf.org/html/rfc6830#section-6.1.6";
402         reference "http://tools.ietf.org/html/draft-ermagan-lisp-nat-traversal-05#section-4.3";
403         leaf proxyMapReply {
404                 type boolean;
405         }
406         leaf xtrSiteIdPresent {
407             type boolean;
408         }
409         leaf wantMapNotify {
410                 type boolean;
411         }
412         leaf nonce {
413                 type int64;
414         }
415         leaf keyId {
416                 type int16;
417         }
418         leaf authenticationData {
419                 type binary;
420         }
421         uses EidToLocatorRecords;
422         uses xtrSiteId;
423     }
424     
425     grouping MapNotify {
426         reference "http://tools.ietf.org/html/rfc6830#section-6.1.7";
427         reference "http://tools.ietf.org/html/draft-ermagan-lisp-nat-traversal-05#section-4.3";
428         leaf xtrSiteIdPresent {
429             type boolean;
430         }
431         leaf nonce {
432                 type int64;
433         }
434         leaf keyId {
435                 type int16;
436         }
437         leaf authenticationData {
438                 type binary;
439         }
440         uses EidToLocatorRecords;
441         uses xtrSiteId;
442     }
443     
444     grouping MapRequest {
445         reference "http://tools.ietf.org/html/rfc6830#section-6.1.2";
446         leaf authoritative {
447                 type boolean;
448         }
449         leaf mapDataPresent {
450                 type boolean;
451         }
452         leaf probe {
453                 type boolean;
454         }
455         leaf smr {
456                 type boolean;
457         }
458         leaf pitr {
459                 type boolean;
460         }
461         leaf smrInvoked {
462                 type boolean;
463         }
464         leaf nonce {
465                 type int64;
466         }
467         container SourceEid {
468                 uses LispAddress; 
469         }
470         list itrRloc {
471                 uses LispAddress; 
472         }
473         uses EidRecords;
474         container MapReply{ 
475                 uses EidToLocatorRecord;
476         }
477     }
478     
479     grouping MapReply {
480         reference "http://tools.ietf.org/html/rfc6830#section-6.1.4";
481         leaf probe {
482                 type boolean;
483         }
484         leaf nonce {
485                 type int64;
486         }
487         leaf echoNonceEnabled {
488                 type boolean;
489         }
490         leaf securityEnabled {
491                 type boolean;
492         }
493         uses EidToLocatorRecords;
494     }
495     
496     grouping MapRegisterNotification {
497         container MapRegister {
498                 uses MapRegister;
499         }
500         uses TransportAddress;
501         
502     }
503     
504     grouping MapNotifyMessage {
505         container MapNotify {
506                 uses MapNotify;
507         }
508         uses TransportAddress;
509         
510     }
511     
512     grouping MapRequestMessage {
513         container MapRequest {
514                 uses MapRequest;
515         }
516         uses TransportAddress;
517         
518     }
519     
520     grouping MapRequestNotification {
521         container MapRequest {
522                 uses MapRequest;
523         }
524         uses TransportAddress;
525     
526     }
527     
528     
529     grouping MapReplyMessage {
530         container MapReply {
531                 uses MapReply;
532         }
533         uses TransportAddress;
534         
535     }
536     
537     rpc sendMapNotify {
538         input {
539                 uses MapNotifyMessage;
540         }
541     }
542     
543     rpc sendMapRequest {
544         input {
545                 uses MapRequestMessage;
546         }
547     }
548     
549     rpc sendMapReply {
550         input {
551                 uses MapReplyMessage;
552         }
553     }
554     
555     notification addMapping {
556         uses MapRegisterNotification;
557     }
558     
559     notification requestMapping {
560         uses MapRequestNotification;
561     }
562     
563     notification xtrRequestMapping {
564         uses MapRequestNotification;
565     }
566     
567 }
568          
569