summaryrefslogtreecommitdiffstats
path: root/lisp/api/src/main/yang/ietf-lisp-address-types.yang
blob: 2a3a1d31dc45163f857cdf04aecd8cfc6069e63b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
module ietf-lisp-address-types {
  namespace "urn:ietf:params:xml:ns:yang:ietf-lisp-address-types";
  prefix laddr;
  import ietf-inet-types {
    prefix inet;
    revision-date 2013-07-15;
  }
  import ietf-yang-types {
    prefix yang;
    revision-date 2013-07-15;
  }
  organization
    "IETF LISP (Locator/ID Separation Protocol) Working Group";
  contact
    "lisp@ietf.org";
  description
    "This YANG module defines the LISP Canonical Address Formats
     (LCAF) for LISP. The module can be extended by vendors to
     define vendor-specific parameters.

     Copyright (c) 2014 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC 6338; see
     the RFC itself for full legal notices.

    ";
  revision 2015-11-05 {
    description
      "Initial revision.";
    reference
      "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10";
  }
  identity lisp-address-family {
    description
      "Base identity from which identities describing LISP address
       families are derived.";
  }
  identity no-address-afi {
    base lisp-address-family;
    description
      "IANA Reserved.";
    }
  identity ipv4-afi {
    base lisp-address-family;
    description
      "IANA IPv4 address family.";
  }
  identity ipv4-prefix-afi {
    base lisp-address-family;
    description
      "IANA IPv4 address family prefix.";
  }
  identity ipv6-afi {
    base lisp-address-family;
    description
      "IANA IPv6 address family.";
  }
  identity ipv6-prefix-afi {
    base lisp-address-family;
    description
      "IANA IPv6 address family prefix.";
  }
  identity mac-afi {
    base lisp-address-family;
    description
      "IANA MAC address family.";
  }
  identity distinguished-name-afi {
    base lisp-address-family;
    description
      "IANA Distinguished Name address family.";
  }
  identity as-number-afi {
      base lisp-address-family;
      description
        "IANA AS Number address family.";
  }
  identity lcaf {
    base lisp-address-family;
    description
      "IANA LISP Canonical Address Format address family.";
  }
  identity null-address-lcaf {
    base lcaf;
    description
      "Null body LCAF type.";
  }
  identity afi-list-lcaf {
    base lcaf;
    description
      "AFI-List LCAF type.";
  }
  identity instance-id-lcaf {
    base lcaf;
    description
      "Instance-ID LCAF type.";
  }
  identity as-number-lcaf {
    base lcaf;
    description
      "AS Number LCAF type.";
  }
  identity application-data-lcaf {
    base lcaf;
    description
      "Application Data LCAF type.";
  }
  identity geo-coordinates-lcaf {
    base lcaf;
    description
      "Geo-coordinates LCAF type.";
  }
  identity opaque-key-lcaf {
    base lcaf;
    description
      "Opaque Key LCAF type.";
  }
  identity nat-traversal-lcaf {
    base lcaf;
    description
      "NAT-Traversal LCAF type.";
  }
  identity nonce-locator-lcaf {
    base lcaf;
    description
      "Nonce-Locator LCAF type.";
  }
  identity multicast-info-lcaf {
    base lcaf;
    description
      "Multicast Info LCAF type.";
  }
  identity explicit-locator-path-lcaf {
    base lcaf;
    description
      "Explicit Locator Path LCAF type.";
  }
  identity security-key-lcaf {
    base lcaf;
    description
      "Security Key LCAF type.";
  }
  identity source-dest-key-lcaf {
    base lcaf;
    description
      "Source/Dest LCAF type.";
  }
  identity replication-list-lcaf {
    base lcaf;
    description
      "Replication-List LCAF type.";
  }
  identity json-data-model-lcaf {
    base lcaf;
    description
      "JSON Data Model LCAF type.";
  }
  identity key-value-address-lcaf {
    base lcaf;
    description
      "Key/Value Address LCAF type.";
  }
  identity encapsulation-format-lcaf {
    base lcaf;
    description
      "Encapsulation Format LCAF type.";
  }
  identity service-path-lcaf {
    base lcaf;
    description
      "Service Path LCAF type.";
  }
  typedef instance-id-type {
    type uint32 {
      range "0..16777215";
    }
    description
      "Defines the range of values for an Instance ID.";
  }
  typedef service-path-id-type {
    type uint32 {
      range "0..16777215";
    }
    description
      "Defines the range of values for a Service Path ID.";
  }
   typedef distinguished-name-type {
    type string;
    description
      "Distinguished Name address.";
    reference
      "http://www.iana.org/assignments/address-family-numbers/
       address-family-numbers.xhtml";
  }
  typedef simple-address {
    type union {
      type inet:ip-address;
      type inet:ip-prefix;
      type yang:mac-address;
      type distinguished-name-type;
      type inet:as-number;
    }
    description
      "Union of address types that can be part of LCAFs.";
  }

  typedef lisp-address-family-ref {
    type identityref {
      base lisp-address-family;
    }
    description
      "LISP address family reference.";
  }
  typedef lcaf-ref {
    type identityref {
      base lcaf;
    }
    description
      "LCAF types reference.";
  }

  grouping lisp-address {
    description
      "Generic LISP address.";
    leaf address-type {
      type lisp-address-family-ref;
      mandatory true;
      description
        "Type of the LISP address.";
    }
    leaf virtual-network-id {
      type instance-id-type;
      description
        "Virtual Network Identifier (instance-id) of the address.";
    }
    choice address {
      description
        "Various LISP address types, including IP, MAC, and LCAF.";
  
      leaf no-address {
        when "../address-type = 'laddr:no-addr-afi'" {
          description
            "When AFI is 0.";
        }
        type empty;
        description
          "No address.";
      }
      leaf ipv4 {
        when "../address-type = 'laddr:ipv4-afi'" {
          description
            "When AFI is IPv4.";
        }
        type inet:ipv4-address;
        description
          "IPv4 address.";
      }
      leaf ipv4-prefix {
        when "../address-type = 'laddr:ipv4-prefix-afi'" {
          description
            "When AFI is IPv4.";
        }
        type inet:ipv4-prefix;
        description
          "IPv4 prefix.";
      }
      leaf ipv6 {
        when "../address-type = 'laddr:ipv6-afi'" {
          description
            "When AFI is IPv6.";
        }
        type inet:ipv6-address;
        description
          "IPv6 address.";
      }
      leaf ipv6-prefix {
        when "../address-type = 'laddr:ipv6-prefix-afi'" {
          description
            "When AFI is IPv6.";
        }
        type inet:ipv6-prefix;
        description
          "IPv6 address.";
      }
      leaf mac {
        when "../address-type = 'laddr:mac-afi'" {
          description
            "When AFI is MAC.";
        }
        type yang:mac-address;
        description
          "MAC address.";
      }
      leaf distinguished-name {
        when "../address-type = 'laddr:distinguished-name-afi'" {
          description
            "When AFI is distinguished-name.";
        }
        type distinguished-name-type;
        description
          "Distinguished Name address.";
      }
      leaf as-number {
        when "../address-type = 'laddr:as-number-afi'" {
          description
            "When AFI is as-number.";
        }
        type inet:as-number;
        description
          "AS Number.";
      }
      container null-address {
        when "../address-type = 'laddr:null-address-lcaf'" {
          description
            "When LCAF type is null.";
        }
        description
          "Null body LCAF type";
        leaf address {
          type empty;
          description
            "AFI address.";
        }
      }
      container afi-list {
        when "../address-type = 'laddr:afi-list-lcaf'" {
          description
            "When LCAF type is AFI-List.";
        }
        description
          "AFI-List LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
           #section-4.16.1";
        leaf-list address-list {
          type simple-address;
          description
            "List of AFI addresses.";
        }
      }
      container instance-id {
        when "../address-type = 'laddr:instance-id-lcaf'" {
          description
            "When LCAF type is Instance-ID";
        }
        description
          "Instance ID LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
           #section-4.2";
        leaf iid {
          type instance-id-type;
          description
            "Instance ID value.";
        }
        leaf mask-length {
            type uint8;
            description
              "Mask length.";
        }
        leaf address {
          type simple-address;
          description
            "AFI address.";
        }
      }
      container as-number-lcaf {
        when "../address-type = 'laddr:as-number-lcaf'" {
          description
            "When LCAF type is AS-Number.";
        }
        description
          "AS Number LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
           #section-4.3";
        leaf as {
          type inet:as-number;
          description
            "AS number.";
        }
        leaf address {
          type simple-address;
          description
            "AFI address.";
        }
      }
      container application-data {
        when "../address-type = 'laddr:application-data-lcaf'" {
          description
            "When LCAF type is Application Data.";
        }
        description
          "Application Data LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
           #section-4.4";
        leaf address {
            type simple-address;
            description
              "AFI address.";
        }
        leaf protocol {
            type uint8;
            description
              "Protocol number.";
        }
        leaf ip-tos {
            type int32;
            description
              "Type of service field.";
        }
        leaf local-port-low {
            type inet:port-number;
            description
              "Low end of local port range.";
        }
        leaf local-port-high {
            type inet:port-number;
            description
              "High end of local port range.";
        }
        leaf remote-port-low {
            type inet:port-number;
            description
              "Low end of remote port range.";
        }
        leaf remote-port-high {
            type inet:port-number;
            description
              "High end of remote port range.";
        }
      }
      container geo-coordinates {
        when "../address-type = 'laddr:geo-coordinates-lcaf'" {
          description
            "When LCAF type is Geo-coordinates.";
        }
        description
          "Geo-coordinates LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
           #section-4.5";
        leaf latitude {
          type bits {
            bit N {
              description
                "Latitude bit.";
            }
          }
          description
            "Bit that selects between North and South latitude.";
        }
        leaf latitude-degrees {
          type uint8 {
            range "0 .. 90";
          }
          description
            "Degrees of latitude.";
        }
        leaf latitude-minutes {
          type uint8 {
            range "0..59";
          }
          description
            "Minutes of latitude.";
        }
        leaf latitude-seconds {
          type uint8 {
            range "0..59";
          }
          description
            "Seconds of latitude.";
        }
        leaf longitude {
          type bits {
            bit E {
              description
                "Longitude bit.";
            }
          }
          description
            "Bit that selects between East and West longitude.";
        }
        leaf longitude-degrees {
          type uint16 {
            range "0 .. 180";
          }
          description
            "Degrees of longitude.";
        }
        leaf longitude-minutes {
          type uint8 {
            range "0..59";
          }
          description
            "Minutes of longitude.";
        }
        leaf longitude-seconds {
          type uint8 {
            range "0..59";
          }
          description
            "Seconds of longitude.";
        }
        leaf altitude {
          type int32;
          description
            "Height relative to sea level in meters.";
        }
        leaf address {
          type simple-address;
          description
            "AFI address.";
        }
      }
      container nat-traversal {
        when "../address-type = 'laddr:nat-traversal-lcaf'" {
          description
            "When LCAF type is NAT-Traversal.";
        }
        description
          "NAT-Traversal LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
           #section-4.6";
        leaf ms-udp-port {
          type uint16;
          description
            "Map-Server UDP port (set to 4342).";
        }
        leaf etr-udp-port {
          type uint16;
          description
            "ETR UDP port.";
        }
        leaf global-etr-rloc {
          type simple-address;
          description
            "Global ETR RLOC address.";
        }
        leaf ms-rloc {
          type simple-address;
          description
            "Map-Server RLOC address.";
        }
        leaf private-etr-rloc {
          type simple-address;
          description
            "Private ETR RLOC address.";
        }
        leaf-list rtr-rlocs {
          type simple-address;
          description
            "List of RTR RLOC addresses.";
        }
      }
      container explicit-locator-path {
        when "../address-type = 'laddr:explicit-locator-path-lcaf'" {
          description
            "When LCAF type type is Explicit Locator Path.";
        }
        description
          "Explicit Locator Path LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
           #section-4.9";
        list hop {
          key "hop-id";
          ordered-by user;
          description
            "List of locator hops forming the explicit path.";
          leaf hop-id {
            type string {
              length "1..64";
            }
            description
              "Unique identifier for the hop.";
          }
          leaf address {
            type simple-address;
            description
              "AFI address.";
          }
          leaf lrs-bits {
            type bits{
              bit lookup {
                description
                  "Lookup bit.";
              }
              bit rloc-probe {
                description
                  "RLOC-probe bit.";
              }
              bit strict {
                description
                  "Strict bit.";
              }
            }
            description
              "Flag bits per hop.";
          }
        }
      }
      container source-dest-key {
        when "../address-type = 'laddr:source-dest-key-lcaf'" {
          description
            "When LCAF type type is Source/Dest.";
        }
        description
          "Source/Dest LCAF type.";
        reference
            "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
            #section-4.11";
        leaf source {
          type simple-address;
          description
            "Source address.";
        }
        leaf dest {
          type simple-address;
          description
            "Destination address.";
        }
      }
      container key-value-address {
        when "../address-type = 'laddr:key-value-address-lcaf'" {
          description
            "When LCAF type type is Key/Value Address.";
        }
        description
          "Key/Value Address LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
           #section-4.11";
        leaf key {
          type simple-address;
          description
            "Address as Key.";
        }
        leaf value {
          type simple-address;
          description
            "Address as Value.";
        }
      }
      container service-path {
        when "../address-type = 'laddr:service-path-lcaf'" {
        description
          "When LCAF type service path identifier.";
            }
        description
          "Service Path LCAF type.";
        reference
          "http://tools.ietf.org/html/draft-ermagan-lisp-nsh-00";
        leaf service-path-id {
          type service-path-id-type;
          description
            "Service path identifier for the path for NSH header";
        }
        leaf service-index {
          type uint8;
          description
            "Service path index for NSH header";
        }
      }
    }
  }
}