Update Robert's coordinates
[honeycomb.git] / v3po / api / src / main / yang / ietf-ip.yang
1 module ietf-ip {
2
3   yang-version 1;
4
5   namespace
6     "urn:ietf:params:xml:ns:yang:ietf-ip";
7
8   prefix ip;
9
10   import ietf-interfaces {
11     prefix if;
12   }
13   import ietf-inet-types {
14     prefix inet;
15   }
16   import ietf-yang-types {
17     prefix yang;
18   }
19
20   organization
21     "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
22
23   contact
24     "WG Web:   <http://tools.ietf.org/wg/netmod/>
25   WG List:  <mailto:netmod@ietf.org>
26
27   WG Chair: Thomas Nadeau
28             <mailto:tnadeau@lucidvision.com>
29
30   WG Chair: Juergen Schoenwaelder
31             <mailto:j.schoenwaelder@jacobs-university.de>
32
33   Editor:   Martin Bjorklund
34             <mailto:mbj@tail-f.com>";
35
36   description
37     "This module contains a collection of YANG definitions for
38   configuring IP implementations.
39
40   Copyright (c) 2014 IETF Trust and the persons identified as
41   authors of the code.  All rights reserved.
42
43   Redistribution and use in source and binary forms, with or
44   without modification, is permitted pursuant to, and subject
45   to the license terms contained in, the Simplified BSD License
46   set forth in Section 4.c of the IETF Trust's Legal Provisions
47   Relating to IETF Documents
48   (http://trustee.ietf.org/license-info).
49
50   This version of this YANG module is part of RFC 7277; see
51   the RFC itself for full legal notices.";
52
53   revision "2014-06-16" {
54     description "Initial revision.";
55     reference
56       "RFC 7277: A YANG Data Model for IP Management";
57
58   }
59
60
61   feature ipv4-non-contiguous-netmasks {
62     description
63       "Indicates support for configuring non-contiguous
64     subnet masks.";
65   }
66
67   feature ipv6-privacy-autoconf {
68     description
69       "Indicates support for Privacy Extensions for Stateless Address
70     Autoconfiguration in IPv6.";
71     reference
72       "RFC 4941: Privacy Extensions for Stateless Address
73           Autoconfiguration in IPv6";
74
75   }
76
77   typedef ip-address-origin {
78     type enumeration {
79       enum "other" {
80         value 0;
81         description
82           "None of the following.";
83       }
84       enum "static" {
85         value 1;
86         description
87           "Indicates that the address has been statically
88         configured - for example, using NETCONF or a Command Line
89         Interface.";
90       }
91       enum "dhcp" {
92         value 2;
93         description
94           "Indicates an address that has been assigned to this
95         system by a DHCP server.";
96       }
97       enum "link-layer" {
98         value 3;
99         description
100           "Indicates an address created by IPv6 stateless
101         autoconfiguration that embeds a link-layer address in its
102         interface identifier.";
103       }
104       enum "random" {
105         value 4;
106         description
107           "Indicates an address chosen by the system at
108
109         random, e.g., an IPv4 address within 169.254/16, an
110         RFC 4941 temporary address, or an RFC 7217 semantically
111         opaque address.";
112         reference
113           "RFC 4941: Privacy Extensions for Stateless Address
114                   Autoconfiguration in IPv6
115            RFC 7217: A Method for Generating Semantically Opaque
116                   Interface Identifiers with IPv6 Stateless
117                   Address Autoconfiguration (SLAAC)";
118
119       }
120     }
121     description
122       "The origin of an address.";
123   }
124
125   typedef neighbor-origin {
126     type enumeration {
127       enum "other" {
128         value 0;
129         description
130           "None of the following.";
131       }
132       enum "static" {
133         value 1;
134         description
135           "Indicates that the mapping has been statically
136         configured - for example, using NETCONF or a Command Line
137         Interface.";
138       }
139       enum "dynamic" {
140         value 2;
141         description
142           "Indicates that the mapping has been dynamically resolved
143         using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
144         protocol.";
145       }
146     }
147     description
148       "The origin of a neighbor entry.";
149   }
150
151   augment /if:interfaces/if:interface {
152     description
153       "Parameters for configuring IP on interfaces.
154
155     If an interface is not capable of running IP, the server
156     must not allow the client to configure these parameters.";
157     container ipv4 {
158       presence
159         "Enables IPv4 unless the 'enabled' leaf
160       (which defaults to 'true') is set to 'false'";
161       description
162         "Parameters for the IPv4 address family.";
163       leaf enabled {
164         type boolean;
165         default 'true';
166         description
167           "Controls whether IPv4 is enabled or disabled on this
168         interface.  When IPv4 is enabled, this interface is
169         connected to an IPv4 stack, and the interface can send
170         and receive IPv4 packets.";
171       }
172
173       leaf forwarding {
174         type boolean;
175         default 'false';
176         description
177           "Controls IPv4 packet forwarding of datagrams received by,
178         but not addressed to, this interface.  IPv4 routers
179         forward datagrams.  IPv4 hosts do not (except those
180         source-routed via the host).";
181       }
182
183       leaf mtu {
184         type uint16 {
185           range "68..max";
186         }
187         units "octets";
188         description
189           "The size, in octets, of the largest IPv4 packet that the
190         interface will send and receive.
191
192         The server may restrict the allowed values for this leaf,
193         depending on the interface's type.
194
195         If this leaf is not configured, the operationally used MTU
196         depends on the interface's type.";
197         reference
198           "RFC 791: Internet Protocol";
199
200       }
201
202       list address {
203         key "ip";
204         description
205           "The list of configured IPv4 addresses on the interface.";
206         leaf ip {
207           type inet:ipv4-address-no-zone;
208           description
209             "The IPv4 address on the interface.";
210         }
211
212         choice subnet {
213           mandatory true;
214           description
215             "The subnet can be specified as a prefix-length, or,
216           if the server supports non-contiguous netmasks, as
217           a netmask.";
218           leaf prefix-length {
219             type uint8 {
220               range "0..32";
221             }
222             description
223               "The length of the subnet prefix.";
224           }
225           leaf netmask {
226             if-feature ipv4-non-contiguous-netmasks;
227             type yang:dotted-quad;
228             description
229               "The subnet specified as a netmask.";
230           }
231         }  // choice subnet
232       }  // list address
233
234       list neighbor {
235         key "ip";
236         description
237           "A list of mappings from IPv4 addresses to
238         link-layer addresses.
239
240         Entries in this list are used as static entries in the
241         ARP Cache.";
242         reference
243           "RFC 826: An Ethernet Address Resolution Protocol";
244
245         leaf ip {
246           type inet:ipv4-address-no-zone;
247           description
248             "The IPv4 address of the neighbor node.";
249         }
250
251         leaf link-layer-address {
252           type yang:phys-address;
253           mandatory true;
254           description
255             "The link-layer address of the neighbor node.";
256         }
257       }  // list neighbor
258     }  // container ipv4
259
260     container ipv6 {
261       presence
262         "Enables IPv6 unless the 'enabled' leaf
263       (which defaults to 'true') is set to 'false'";
264       description
265         "Parameters for the IPv6 address family.";
266       leaf enabled {
267         type boolean;
268         default 'true';
269         description
270           "Controls whether IPv6 is enabled or disabled on this
271         interface.  When IPv6 is enabled, this interface is
272         connected to an IPv6 stack, and the interface can send
273         and receive IPv6 packets.";
274       }
275
276       leaf forwarding {
277         type boolean;
278         default 'false';
279         description
280           "Controls IPv6 packet forwarding of datagrams received by,
281         but not addressed to, this interface.  IPv6 routers
282         forward datagrams.  IPv6 hosts do not (except those
283         source-routed via the host).";
284         reference
285           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
286                   Section 6.2.1, IsRouter";
287
288       }
289
290       leaf mtu {
291         type uint32 {
292           range "1280..max";
293         }
294         units "octets";
295         description
296           "The size, in octets, of the largest IPv6 packet that the
297         interface will send and receive.
298
299         The server may restrict the allowed values for this leaf,
300         depending on the interface's type.
301
302         If this leaf is not configured, the operationally used MTU
303         depends on the interface's type.";
304         reference
305           "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
306                   Section 5";
307
308       }
309
310       list address {
311         key "ip";
312         description
313           "The list of configured IPv6 addresses on the interface.";
314         leaf ip {
315           type inet:ipv6-address-no-zone;
316           description
317             "The IPv6 address on the interface.";
318         }
319
320         leaf prefix-length {
321           type uint8 {
322             range "0..128";
323           }
324           mandatory true;
325           description
326             "The length of the subnet prefix.";
327         }
328       }  // list address
329
330       list neighbor {
331         key "ip";
332         description
333           "A list of mappings from IPv6 addresses to
334         link-layer addresses.
335
336         Entries in this list are used as static entries in the
337         Neighbor Cache.";
338         reference
339           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
340
341         leaf ip {
342           type inet:ipv6-address-no-zone;
343           description
344             "The IPv6 address of the neighbor node.";
345         }
346
347         leaf link-layer-address {
348           type yang:phys-address;
349           mandatory true;
350           description
351             "The link-layer address of the neighbor node.";
352         }
353       }  // list neighbor
354
355       leaf dup-addr-detect-transmits {
356         type uint32;
357         default '1';
358         description
359           "The number of consecutive Neighbor Solicitation messages
360         sent while performing Duplicate Address Detection on a
361         tentative address.  A value of zero indicates that
362         Duplicate Address Detection is not performed on
363         tentative addresses.  A value of one indicates a single
364         transmission with no follow-up retransmissions.";
365         reference
366           "RFC 4862: IPv6 Stateless Address Autoconfiguration";
367
368       }
369
370       container autoconf {
371         description
372           "Parameters to control the autoconfiguration of IPv6
373         addresses, as described in RFC 4862.";
374         reference
375           "RFC 4862: IPv6 Stateless Address Autoconfiguration";
376
377         leaf create-global-addresses {
378           type boolean;
379           default 'true';
380           description
381             "If enabled, the host creates global addresses as
382           described in RFC 4862.";
383           reference
384             "RFC 4862: IPv6 Stateless Address Autoconfiguration
385                   Section 5.5";
386
387         }
388
389         leaf create-temporary-addresses {
390           if-feature ipv6-privacy-autoconf;
391           type boolean;
392           default 'false';
393           description
394             "If enabled, the host creates temporary addresses as
395           described in RFC 4941.";
396           reference
397             "RFC 4941: Privacy Extensions for Stateless Address
398                   Autoconfiguration in IPv6";
399
400         }
401
402         leaf temporary-valid-lifetime {
403           if-feature ipv6-privacy-autoconf;
404           type uint32;
405           units "seconds";
406           default '604800';
407           description
408             "The time period during which the temporary address
409           is valid.";
410           reference
411             "RFC 4941: Privacy Extensions for Stateless Address
412                   Autoconfiguration in IPv6
413                   - TEMP_VALID_LIFETIME";
414
415         }
416
417         leaf temporary-preferred-lifetime {
418           if-feature ipv6-privacy-autoconf;
419           type uint32;
420           units "seconds";
421           default '86400';
422           description
423             "The time period during which the temporary address is
424           preferred.";
425           reference
426             "RFC 4941: Privacy Extensions for Stateless Address
427                   Autoconfiguration in IPv6
428                   - TEMP_PREFERRED_LIFETIME";
429
430         }
431       }  // container autoconf
432     }  // container ipv6
433   }
434
435   augment /if:interfaces-state/if:interface {
436     description
437       "Data nodes for the operational state of IP on interfaces.";
438     container ipv4 {
439       presence
440         "Present if IPv4 is enabled on this interface";
441       config false;
442       description
443         "Interface-specific parameters for the IPv4 address family.";
444       leaf forwarding {
445         type boolean;
446         description
447           "Indicates whether IPv4 packet forwarding is enabled or
448         disabled on this interface.";
449       }
450
451       leaf mtu {
452         type uint16 {
453           range "68..max";
454         }
455         units "octets";
456         description
457           "The size, in octets, of the largest IPv4 packet that the
458         interface will send and receive.";
459         reference
460           "RFC 791: Internet Protocol";
461
462       }
463
464       list address {
465         key "ip";
466         description
467           "The list of IPv4 addresses on the interface.";
468         leaf ip {
469           type inet:ipv4-address-no-zone;
470           description
471             "The IPv4 address on the interface.";
472         }
473
474         choice subnet {
475           description
476             "The subnet can be specified as a prefix-length, or,
477           if the server supports non-contiguous netmasks, as
478           a netmask.";
479           leaf prefix-length {
480             type uint8 {
481               range "0..32";
482             }
483             description
484               "The length of the subnet prefix.";
485           }
486           leaf netmask {
487             if-feature ipv4-non-contiguous-netmasks;
488             type yang:dotted-quad;
489             description
490               "The subnet specified as a netmask.";
491           }
492         }  // choice subnet
493
494         leaf origin {
495           type ip-address-origin;
496           description
497             "The origin of this address.";
498         }
499       }  // list address
500
501       list neighbor {
502         key "ip";
503         description
504           "A list of mappings from IPv4 addresses to
505         link-layer addresses.
506
507         This list represents the ARP Cache.";
508         reference
509           "RFC 826: An Ethernet Address Resolution Protocol";
510
511         leaf ip {
512           type inet:ipv4-address-no-zone;
513           description
514             "The IPv4 address of the neighbor node.";
515         }
516
517         leaf link-layer-address {
518           type yang:phys-address;
519           description
520             "The link-layer address of the neighbor node.";
521         }
522
523         leaf origin {
524           type neighbor-origin;
525           description
526             "The origin of this neighbor entry.";
527         }
528       }  // list neighbor
529     }  // container ipv4
530
531     container ipv6 {
532       presence
533         "Present if IPv6 is enabled on this interface";
534       config false;
535       description
536         "Parameters for the IPv6 address family.";
537       leaf forwarding {
538         type boolean;
539         default 'false';
540         description
541           "Indicates whether IPv6 packet forwarding is enabled or
542         disabled on this interface.";
543         reference
544           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
545                   Section 6.2.1, IsRouter";
546
547       }
548
549       leaf mtu {
550         type uint32 {
551           range "1280..max";
552         }
553         units "octets";
554         description
555           "The size, in octets, of the largest IPv6 packet that the
556         interface will send and receive.";
557         reference
558           "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
559                   Section 5";
560
561       }
562
563       list address {
564         key "ip";
565         description
566           "The list of IPv6 addresses on the interface.";
567         leaf ip {
568           type inet:ipv6-address-no-zone;
569           description
570             "The IPv6 address on the interface.";
571         }
572
573         leaf prefix-length {
574           type uint8 {
575             range "0..128";
576           }
577           mandatory true;
578           description
579             "The length of the subnet prefix.";
580         }
581
582         leaf origin {
583           type ip-address-origin;
584           description
585             "The origin of this address.";
586         }
587
588         leaf status {
589           type enumeration {
590             enum "preferred" {
591               value 0;
592               description
593                 "This is a valid address that can appear as the
594               destination or source address of a packet.";
595             }
596             enum "deprecated" {
597               value 1;
598               description
599                 "This is a valid but deprecated address that should
600               no longer be used as a source address in new
601               communications, but packets addressed to such an
602               address are processed as expected.";
603             }
604             enum "invalid" {
605               value 2;
606               description
607                 "This isn't a valid address, and it shouldn't appear
608               as the destination or source address of a packet.";
609             }
610             enum "inaccessible" {
611               value 3;
612               description
613                 "The address is not accessible because the interface
614               to which this address is assigned is not
615               operational.";
616             }
617             enum "unknown" {
618               value 4;
619               description
620                 "The status cannot be determined for some reason.";
621             }
622             enum "tentative" {
623               value 5;
624               description
625                 "The uniqueness of the address on the link is being
626               verified.  Addresses in this state should not be
627               used for general communication and should only be
628               used to determine the uniqueness of the address.";
629             }
630             enum "duplicate" {
631               value 6;
632               description
633                 "The address has been determined to be non-unique on
634               the link and so must not be used.";
635             }
636             enum "optimistic" {
637               value 7;
638               description
639                 "The address is available for use, subject to
640               restrictions, while its uniqueness on a link is
641               being verified.";
642             }
643           }
644           description
645             "The status of an address.  Most of the states correspond
646           to states from the IPv6 Stateless Address
647           Autoconfiguration protocol.";
648           reference
649             "RFC 4293: Management Information Base for the
650                   Internet Protocol (IP)
651                   - IpAddressStatusTC
652              RFC 4862: IPv6 Stateless Address Autoconfiguration";
653
654         }
655       }  // list address
656
657       list neighbor {
658         key "ip";
659         description
660           "A list of mappings from IPv6 addresses to
661         link-layer addresses.
662
663         This list represents the Neighbor Cache.";
664         reference
665           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
666
667         leaf ip {
668           type inet:ipv6-address-no-zone;
669           description
670             "The IPv6 address of the neighbor node.";
671         }
672
673         leaf link-layer-address {
674           type yang:phys-address;
675           description
676             "The link-layer address of the neighbor node.";
677         }
678
679         leaf origin {
680           type neighbor-origin;
681           description
682             "The origin of this neighbor entry.";
683         }
684
685         leaf is-router {
686           type empty;
687           description
688             "Indicates that the neighbor node acts as a router.";
689         }
690
691         leaf state {
692           type enumeration {
693             enum "incomplete" {
694               value 0;
695               description
696                 "Address resolution is in progress, and the link-layer
697               address of the neighbor has not yet been
698               determined.";
699             }
700             enum "reachable" {
701               value 1;
702               description
703                 "Roughly speaking, the neighbor is known to have been
704               reachable recently (within tens of seconds ago).";
705             }
706             enum "stale" {
707               value 2;
708               description
709                 "The neighbor is no longer known to be reachable, but
710               until traffic is sent to the neighbor no attempt
711               should be made to verify its reachability.";
712             }
713             enum "delay" {
714               value 3;
715               description
716                 "The neighbor is no longer known to be reachable, and
717               traffic has recently been sent to the neighbor.
718               Rather than probe the neighbor immediately, however,
719               delay sending probes for a short while in order to
720               give upper-layer protocols a chance to provide
721               reachability confirmation.";
722             }
723             enum "probe" {
724               value 4;
725               description
726                 "The neighbor is no longer known to be reachable, and
727               unicast Neighbor Solicitation probes are being sent
728               to verify reachability.";
729             }
730           }
731           description
732             "The Neighbor Unreachability Detection state of this
733           entry.";
734           reference
735             "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
736                   Section 7.3.2";
737
738         }
739       }  // list neighbor
740     }  // container ipv6
741   }
742 }  // module ietf-ip