aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-if-ip@2018-01-05.yang
blob: a20e21c77593f55e10b3d7fbe94efba52111a2e5 (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
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
module openconfig-if-ip {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/interfaces/ip";

  prefix "oc-ip";

  // import some basic types
  import openconfig-inet-types { prefix oc-inet; }
  import openconfig-interfaces { prefix oc-if; }
  import openconfig-vlan { prefix oc-vlan; }
  import openconfig-yang-types { prefix oc-yang; }
  import openconfig-extensions { prefix oc-ext; }

  // meta
  organization "OpenConfig working group";

  contact
    "OpenConfig working group
    netopenconfig@googlegroups.com";

  description
    "This model defines data for managing configuration and
    operational state on IP (IPv4 and IPv6) interfaces.

    This model reuses data items defined in the IETF YANG model for
    interfaces described by RFC 7277 with an alternate structure
    (particularly for operational state data) and with
    additional configuration items.

    Portions of this code were derived from IETF RFC 7277.
    Please reproduce this note if possible.

    IETF code is subject to the following copyright and license:
    Copyright (c) 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).";

  oc-ext:openconfig-version "2.3.0";

  revision "2018-01-05" {
    description
      "Add logical loopback to interface.";
    reference "2.3.0";
  }

  revision "2017-12-21" {
    description
      "Added IPv6 router advertisement configuration.";
    reference "2.1.0";
  }

  revision "2017-07-14" {
    description
      "Added Ethernet/IP state data; Add dhcp-client;
      migrate to OpenConfig types modules; Removed or
      renamed opstate values";
    reference "2.0.0";
  }

  revision "2017-04-03"{
    description
      "Update copyright notice.";
    reference "1.1.1";
  }

  revision "2016-12-22" {
    description
      "Fixes to Ethernet interfaces model";
    reference "1.1.0";
  }


  // typedef statements

  typedef ip-address-origin {
    type enumeration {
      enum OTHER {
        description
          "None of the following.";
        }
      enum STATIC {
        description
          "Indicates that the address has been statically
          configured - for example, using NETCONF or a Command Line
          Interface.";
      }
      enum DHCP {
        description
          "Indicates an address that has been assigned to this
          system by a DHCP server.";
      }
      enum LINK_LAYER {
        description
          "Indicates an address created by IPv6 stateless
          autoconfiguration that embeds a link-layer address in its
          interface identifier.";
      }
      enum RANDOM {
        description
          "Indicates an address chosen by the system at
          random, e.g., an IPv4 address within 169.254/16, an
          RFC 4941 temporary address, or an RFC 7217 semantically
          opaque address.";
        reference
          "RFC 4941: Privacy Extensions for Stateless Address
                    Autoconfiguration in IPv6
          RFC 7217: A Method for Generating Semantically Opaque
                    Interface Identifiers with IPv6 Stateless
                    Address Autoconfiguration (SLAAC)";
      }
    }
    description
     "The origin of an address.";
  }

  typedef neighbor-origin {
    type enumeration {
      enum OTHER {
       description
         "None of the following.";
      }
      enum STATIC {
       description
         "Indicates that the mapping has been statically
          configured - for example, using NETCONF or a Command Line
          Interface.";
      }
      enum DYNAMIC {
       description
        "Indicates that the mapping has been dynamically resolved
        using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
        protocol.";
      }
    }
    description
      "The origin of a neighbor entry.";
  }

  // grouping statements

  grouping ip-common-global-config {
    description
      "Shared configuration data for IPv4 or IPv6 assigned
      globally on an interface.";

    leaf dhcp-client {
      type boolean;
      default false;
      description
        "Enables a DHCP client on the interface in order to request
        an address";
    }
  }

  grouping ip-common-counters-state {
    description
      "Operational state for IP traffic statistics for IPv4 and
      IPv6";

    container counters {
      description
        "Packet and byte counters for IP transmission and
        reception for the address family.";


      leaf in-pkts {
        type oc-yang:counter64;
        description
          "The total number of IP packets received for the specified
          address family, including those received in error";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf in-octets {
        type oc-yang:counter64;
        description
          "The total number of octets received in input IP packets
          for the specified address family, including those received
          in error.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf in-error-pkts {
        // TODO: this counter combines several error conditions --
        // could consider breaking them out to separate leaf nodes
        type oc-yang:counter64;
        description
          "Number of IP packets discarded due to errors for the
          specified address family, including errors in the IP
          header, no route found to the IP destination, invalid
          address, unknown protocol, etc.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf in-forwarded-pkts {
        type oc-yang:counter64;
        description
          "The number of input packets for which the device was not
          their final IP destination and for which the device
          attempted to find a route to forward them to that final
          destination.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf in-forwarded-octets {
        type oc-yang:counter64;
        description
          "The number of octets received in input IP packets
          for the specified address family for which the device was
          not their final IP destination and for which the
          device attempted to find a route to forward them to that
          final destination.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf in-discarded-pkts {
        type oc-yang:counter64;
        description
          "The number of input IP packets for the
          specified address family, for which no problems were
          encountered to prevent their continued processing, but
          were discarded (e.g., for lack of buffer space).";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf out-pkts {
        type oc-yang:counter64;
        description
          "The total number of IP packets for the
          specified address family that the device supplied
          to the lower layers for transmission.  This includes
          packets generated locally and those forwarded by the
          device.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf out-octets {
        type oc-yang:counter64;
        description
          "The total number of octets in IP packets for the
          specified address family that the device
          supplied to the lower layers for transmission.  This
          includes packets generated locally and those forwarded by
          the device.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf out-error-pkts {
        // TODO: this counter combines several error conditions --
        // could consider breaking them out to separate leaf nodes
        type oc-yang:counter64;
        description
          "Number of IP packets for the specified address family
          locally generated and discarded due to errors, including
          no route found to the IP destination.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf out-forwarded-pkts {
        type oc-yang:counter64;
        description
          "The number of packets for which this entity was not their
          final IP destination and for which it was successful in
          finding a path to their final destination.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf out-forwarded-octets {
        type oc-yang:counter64;
        description
          "The number of octets in packets for which this entity was
          not their final IP destination and for which it was
          successful in finding a path to their final destination.";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }

      leaf out-discarded-pkts {
        type oc-yang:counter64;
        description
          "The number of output IP packets for the
          specified address family for which no problem was
          encountered to prevent their transmission to their
          destination, but were discarded (e.g., for lack of
          buffer space).";
        reference
          "RFC 4293 - Management Information Base for the
          Internet Protocol (IP)";
      }
    }

  }



  grouping ipv4-global-config {
    description
      "Configuration data for IPv4 interfaces across
      all addresses assigned to the interface";

    leaf enabled {
     type boolean;
     default true;
     description
       "Controls whether IPv4 is enabled or disabled on this
        interface.  When IPv4 is enabled, this interface is
        connected to an IPv4 stack, and the interface can send
        and receive IPv4 packets.";
    }

    leaf mtu {
     type uint16 {
       range "68..max";
     }
     units octets;
     description
       "The size, in octets, of the largest IPv4 packet that the
        interface will send and receive.

        The server may restrict the allowed values for this leaf,
        depending on the interface's type.

        If this leaf is not configured, the operationally used MTU
        depends on the interface's type.";
     reference
       "RFC 791: Internet Protocol";
    }

    uses ip-common-global-config;


  }

  grouping ipv4-address-config {

    description
      "Per IPv4 adresss configuration data for the
      interface.";

    leaf ip {
       type oc-inet:ipv4-address;
       description
        "The IPv4 address on the interface.";
    }

    leaf prefix-length {
      type uint8 {
       range "0..32";
      }
      description
       "The length of the subnet prefix.";
    }
  }

  grouping ipv4-neighbor-config {
    description
      "Per IPv4 neighbor configuration data. Neighbor
      entries are analagous to static ARP entries, i.e., they
      create a correspondence between IP and link-layer addresses";

    leaf ip {
     type oc-inet:ipv4-address;
     description
       "The IPv4 address of the neighbor node.";
    }
    leaf link-layer-address {
     type oc-yang:phys-address;
     mandatory true;
     description
       "The link-layer address of the neighbor node.";
    }
  }

  grouping ipv4-address-state {
    description
      "State variables for IPv4 addresses on the interface";

    leaf origin {
      type ip-address-origin;
      description
       "The origin of this address, e.g., statically configured,
       assigned by DHCP, etc..";
    }
  }

  grouping ipv4-neighbor-state {
    description
      "State variables for IPv4 neighbor entries on the interface.";

    leaf origin {
      type neighbor-origin;
      description
        "The origin of this neighbor entry, static or dynamic.";
    }
  }

  grouping ipv6-global-config {
    description
      "Configuration data at the global level for each
      IPv6 interface";

    leaf enabled {
      type boolean;
      default true;
      description
        "Controls whether IPv6 is enabled or disabled on this
        interface.  When IPv6 is enabled, this interface is
        connected to an IPv6 stack, and the interface can send
        and receive IPv6 packets.";
    }

    leaf mtu {
      type uint32 {
       range "1280..max";
      }
      units octets;
      description
        "The size, in octets, of the largest IPv6 packet that the
        interface will send and receive.

        The server may restrict the allowed values for this leaf,
        depending on the interface's type.

        If this leaf is not configured, the operationally used MTU
        depends on the interface's type.";
      reference
        "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
                  Section 5";
    }

    leaf dup-addr-detect-transmits {
      type uint32;
      default 1;
      description
        "The number of consecutive Neighbor Solicitation messages
        sent while performing Duplicate Address Detection on a
        tentative address.  A value of zero indicates that
        Duplicate Address Detection is not performed on
        tentative addresses.  A value of one indicates a single
        transmission with no follow-up retransmissions.";
      reference
        "RFC 4862: IPv6 Stateless Address Autoconfiguration";
    }

    uses ip-common-global-config;
  }

  grouping ipv6-address-config {
    description "Per-address configuration data for IPv6 interfaces";

    leaf ip {
      type oc-inet:ipv6-address;
      description
        "The IPv6 address on the interface.";
    }

    leaf prefix-length {
      type uint8 {
        range "0..128";
      }
      mandatory true;
      description
        "The length of the subnet prefix.";
    }
  }

  grouping ipv6-address-state {
    description
      "Per-address operational state data for IPv6 interfaces";

    leaf origin {
      type ip-address-origin;
      description
        "The origin of this address, e.g., static, dhcp, etc.";
    }

    leaf status {
      type enumeration {
        enum PREFERRED {
          description
            "This is a valid address that can appear as the
            destination or source address of a packet.";
        }
        enum DEPRECATED {
          description
            "This is a valid but deprecated address that should
            no longer be used as a source address in new
            communications, but packets addressed to such an
            address are processed as expected.";
        }
        enum INVALID {
          description
            "This isn't a valid address, and it shouldn't appear
            as the destination or source address of a packet.";
        }
        enum INACCESSIBLE {
          description
            "The address is not accessible because the interface
            to which this address is assigned is not
            operational.";
        }
        enum UNKNOWN {
          description
            "The status cannot be determined for some reason.";
        }
        enum TENTATIVE {
          description
            "The uniqueness of the address on the link is being
            verified.  Addresses in this state should not be
            used for general communication and should only be
            used to determine the uniqueness of the address.";
        }
        enum DUPLICATE {
          description
           "The address has been determined to be non-unique on
            the link and so must not be used.";
        }
        enum OPTIMISTIC {
          description
            "The address is available for use, subject to
            restrictions, while its uniqueness on a link is
            being verified.";
        }
      }
      description
        "The status of an address.  Most of the states correspond
        to states from the IPv6 Stateless Address
        Autoconfiguration protocol.";
      reference
          "RFC 4293: Management Information Base for the
                      Internet Protocol (IP)
                      - IpAddressStatusTC
            RFC 4862: IPv6 Stateless Address Autoconfiguration";
    }
  }

  grouping ipv6-neighbor-config {
    description
      "Per-neighbor configuration data for IPv6 interfaces";

    leaf ip {
      type oc-inet:ipv6-address;
      description
        "The IPv6 address of the neighbor node.";
    }

    leaf link-layer-address {
      type oc-yang:phys-address;
      mandatory true;
      description
        "The link-layer address of the neighbor node.";
    }
  }

  grouping ipv6-neighbor-state {
    description "Per-neighbor state variables for IPv6 interfaces";

    leaf origin {
      type neighbor-origin;
      description
        "The origin of this neighbor entry.";
    }
    leaf is-router {
      type empty;
      description
        "Indicates that the neighbor node acts as a router.";
    }
    leaf neighbor-state {
      type enumeration {
        enum INCOMPLETE {
          description
          "Address resolution is in progress, and the link-layer
                address of the neighbor has not yet been
                determined.";
        }
        enum REACHABLE {
          description
          "Roughly speaking, the neighbor is known to have been
                reachable recently (within tens of seconds ago).";
        }
        enum STALE {
          description
          "The neighbor is no longer known to be reachable, but
                until traffic is sent to the neighbor no attempt
                should be made to verify its reachability.";
        }
        enum DELAY {
          description
          "The neighbor is no longer known to be reachable, and
                traffic has recently been sent to the neighbor.
                Rather than probe the neighbor immediately, however,
                delay sending probes for a short while in order to
                give upper-layer protocols a chance to provide
                reachability confirmation.";
        }
        enum PROBE {
          description
          "The neighbor is no longer known to be reachable, and
                unicast Neighbor Solicitation probes are being sent
                to verify reachability.";
        }
      }
      description
        "The Neighbor Unreachability Detection state of this
        entry.";
      reference
        "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
             Section 7.3.2";
    }
  }

  grouping ip-vrrp-ipv6-config {
    description
      "IPv6-specific configuration data for VRRP on IPv6
      interfaces";

      leaf virtual-link-local {
        type oc-inet:ip-address;
        description
          "For VRRP on IPv6 interfaces, sets the virtual link local
          address";
      }
  }

  grouping ip-vrrp-ipv6-state {
    description
      "IPv6-specific operational state for VRRP on IPv6 interfaces";

    uses ip-vrrp-ipv6-config;
  }

  grouping ip-vrrp-tracking-config {
    description
      "Configuration data for tracking interfaces
      in a VRRP group";

    leaf-list track-interface {
      type leafref {
        path "/oc-if:interfaces/oc-if:interface/oc-if:name";
      }
      // TODO: we may need to add some restriction to ethernet
      // or IP interfaces.
      description
        "Sets a list of one or more interfaces that should
        be tracked for up/down events to dynamically change the
        priority state of the VRRP group, and potentially
        change the mastership if the tracked interface going
        down lowers the priority sufficiently.  Any of the tracked
        interfaces going down will cause the priority to be lowered.
        Some implementations may only support a single
        tracked interface.";
    }

    leaf priority-decrement {
      type uint8 {
        range 0..254;
      }
      default 0;
      description "Set the value to subtract from priority when
      the tracked interface goes down";
    }
  }

  grouping ip-vrrp-tracking-state {
    description
      "Operational state data for tracking interfaces in a VRRP
      group";
  }

  grouping ip-vrrp-tracking-top {
    description
      "Top-level grouping for VRRP interface tracking";

    container interface-tracking {
      description
        "Top-level container for VRRP interface tracking";

      container config {
        description
          "Configuration data for VRRP interface tracking";

        uses ip-vrrp-tracking-config;
      }

      container state {

        config false;

        description
          "Operational state data for VRRP interface tracking";

        uses ip-vrrp-tracking-config;
        uses ip-vrrp-tracking-state;
      }
    }
  }

  grouping ip-vrrp-config {
    description
      "Configuration data for VRRP on IP interfaces";

    leaf virtual-router-id {
      type uint8 {
        range 1..255;
      }
      description
        "Set the virtual router id for use by the VRRP group.  This
        usually also determines the virtual MAC address that is
        generated for the VRRP group";
    }

    leaf-list virtual-address {
      type oc-inet:ip-address;
      description
        "Configure one or more virtual addresses for the
        VRRP group";
    }

    leaf priority {
      type uint8 {
        range 1..254;
      }
      default 100;
      description
        "Specifies the sending VRRP interface's priority
        for the virtual router.  Higher values equal higher
        priority";
    }

    leaf preempt {
      type boolean;
      default true;
      description
        "When set to true, enables preemption by a higher
        priority backup router of a lower priority master router";
    }

    leaf preempt-delay {
      type uint16 {
        range 0..3600;
      }
      default 0;
      description
        "Set the delay the higher priority router waits
        before preempting";
    }

    leaf accept-mode {
      type boolean;
      // TODO: should we adopt the RFC default given the common
      // operational practice of setting to true?
      default false;
      description
        "Configure whether packets destined for
        virtual addresses are accepted even when the virtual
        address is not owned by the router interface";
    }

    leaf advertisement-interval {
      type uint16 {
        range 1..4095;
      }
      // TODO this range is theoretical -- needs to be validated
      // against major implementations.
      units "centiseconds";
      default 100;
      description
        "Sets the interval between successive VRRP
        advertisements -- RFC 5798 defines this as a 12-bit
        value expressed as 0.1 seconds, with default 100, i.e.,
        1 second.  Several implementation express this in units of
        seconds";
    }
  }

  grouping ip-vrrp-state {
    description
      "Operational state data for VRRP on IP interfaces";

    leaf current-priority {
      type uint8;
      description "Operational value of the priority for the
      interface in the VRRP group";
    }
  }

  grouping ip-vrrp-top {
    description
      "Top-level grouping for Virtual Router Redundancy Protocol";

    container vrrp {
      description
        "Enclosing container for VRRP groups handled by this
        IP interface";

      reference "RFC 5798 - Virtual Router Redundancy Protocol
        (VRRP) Version 3 for IPv4 and IPv6";

      list vrrp-group {
        key "virtual-router-id";
        description
          "List of VRRP groups, keyed by virtual router id";

        leaf virtual-router-id {
          type leafref {
            path "../config/virtual-router-id";
          }
          description
            "References the configured virtual router id for this
            VRRP group";
        }

        container config {
          description
            "Configuration data for the VRRP group";

          uses ip-vrrp-config;
        }

        container state {

          config false;

          description
            "Operational state data for the VRRP group";

          uses ip-vrrp-config;
          uses ip-vrrp-state;
        }

        uses ip-vrrp-tracking-top;
      }
    }
  }

  grouping ipv6-ra-config {
    description
      "Configuration parameters for IPv6 router advertisements.";

    leaf interval {
      type uint32;
      units seconds;
      description
        "The interval between periodic router advertisement neighbor
        discovery messages sent on this interface expressed in
        seconds.";
    }

    leaf lifetime {
      type uint32;
      units seconds;
      description
        "The lifetime advertised in the router advertisement neighbor
        discovery message on this interface.";
    }

    leaf suppress {
      type boolean;
      default false;
      description
        "When set to true, router advertisement neighbor discovery
        messages are not transmitted on this interface.";
    }
  }

  grouping ipv4-proxy-arp-config {
    description
      "Configuration parameters for IPv4 proxy ARP";

    leaf mode {
      type enumeration {
        enum DISABLE {
          description
            "The system should not respond to ARP requests that
            do not specify an IP address configured on the local
            subinterface as the target address.";
        }
        enum REMOTE_ONLY {
          description
            "The system responds to ARP requests only when the
            sender and target IP addresses are in different
            subnets.";
        }
        enum ALL {
          description
            "The system responds to ARP requests where the sender
            and target IP addresses are in different subnets, as well
            as those where they are in the same subnet.";
        }
      }
      default "DISABLE";
      description
        "When set to a value other than DISABLE, the local system should
        respond to ARP requests that are for target addresses other than
        those that are configured on the local subinterface using its own
        MAC address as the target hardware address. If the REMOTE_ONLY
        value is specified, replies are only sent when the target address
        falls outside the locally configured subnets on the interface,
        whereas with the ALL value, all requests, regardless of their
        target address are replied to.";
      reference "RFC1027: Using ARP to Implement Transparent Subnet Gateways";
    }
  }

  grouping ipv4-top {
    description "Top-level configuration and state for IPv4
    interfaces";

    container ipv4 {
      description
        "Parameters for the IPv4 address family.";

      container addresses {
        description
          "Enclosing container for address list";

        list address {
          key "ip";
          description
           "The list of configured IPv4 addresses on the interface.";

          leaf ip {
            type leafref {
              path "../config/ip";
            }
            description "References the configured IP address";
          }

          container config {
            description "Configuration data for each configured IPv4
            address on the interface";

            uses ipv4-address-config;

          }

          container state {

            config false;
            description "Operational state data for each IPv4 address
            configured on the interface";

            uses ipv4-address-config;
            uses ipv4-address-state;
          }

        }
      }

      container proxy-arp {
        description
          "Configuration and operational state parameters
          relating to proxy ARP. This functionality allows a
          system to respond to ARP requests that are not
          explicitly destined to the local system.";

        container config {
          description
            "Configuration parameters for proxy ARP";
          uses ipv4-proxy-arp-config;
        }

        container state {
          config false;
          description
            "Operational state parameters for proxy ARP";
          uses ipv4-proxy-arp-config;
        }
      }

      container neighbors {
        description
          "Enclosing container for neighbor list";

        list neighbor {
          key "ip";
          description
           "A list of mappings from IPv4 addresses to
            link-layer addresses.

            Entries in this list are used as static entries in the
            ARP Cache.";
          reference
           "RFC 826: An Ethernet Address Resolution Protocol";

          leaf ip {
            type leafref  {
              path "../config/ip";
            }
            description "References the configured IP address";
          }

          container config {
            description "Configuration data for each configured IPv4
            address on the interface";

            uses ipv4-neighbor-config;

          }

          container state {

            config false;
            description "Operational state data for each IPv4 address
            configured on the interface";

            uses ipv4-neighbor-config;
            uses ipv4-neighbor-state;
          }
        }
      }

      uses oc-if:sub-unnumbered-top;

      container config {
        description
          "Top-level IPv4 configuration data for the interface";

        uses ipv4-global-config;
      }

      container state {

        config false;
        description
          "Top level IPv4 operational state data";

        uses ipv4-global-config;
        uses ip-common-counters-state;
      }
    }
  }

  grouping ipv6-top {
    description
      "Top-level configuration and state for IPv6 interfaces";

    container ipv6 {
      description
       "Parameters for the IPv6 address family.";

      container addresses {
        description
          "Enclosing container for address list";

        list address {
          key "ip";
          description
           "The list of configured IPv6 addresses on the interface.";

          leaf ip {
            type leafref {
              path "../config/ip";
            }
            description "References the configured IP address";
          }

          container config {
            description
              "Configuration data for each IPv6 address on
              the interface";

            uses ipv6-address-config;

          }

          container state {

            config false;
            description
              "State data for each IPv6 address on the
              interface";

            uses ipv6-address-config;
            uses ipv6-address-state;
          }
        }
      }

      container router-advertisement {
        description
          "Configuration and operational state parameters relating to
          router advertisements.";

        container config {
          description
            "Configuration parameters relating to router advertisements
            for IPv6.";
          uses ipv6-ra-config;
        }

        container state {
          config false;
          description
            "Operational state parameters relating to router
             advertisements for IPv6.";
          uses ipv6-ra-config;
        }
      }

      container neighbors {
        description
          "Enclosing container for list of IPv6 neighbors";

        list neighbor {
          key "ip";
          description
            "List of IPv6 neighbors";

          leaf ip {
            type leafref {
              path "../config/ip";
            }
            description
              "References the configured IP neighbor address";
          }

          container config {
            description "Configuration data for each IPv6 address on
            the interface";

            uses ipv6-neighbor-config;

          }

          container state {

            config false;
            description "State data for each IPv6 address on the
            interface";

            uses ipv6-neighbor-config;
            uses ipv6-neighbor-state;
          }
        }
      }
      uses oc-if:sub-unnumbered-top;

      container config {
        description "Top-level config data for the IPv6 interface";

        uses ipv6-global-config;
      }

      container state {
        config false;
        description
          "Top-level operational state data for the IPv6 interface";

        uses ipv6-global-config;
        uses ip-common-counters-state;

      }
    }
  }

  // augment statements

  augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
    "oc-if:subinterface" {
    description
      "IPv4 address family configuration for
      interfaces";

    uses ipv4-top;

  }

  augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
    "oc-if:subinterface" {
    description
      "IPv6 address family configuration for
      interfaces";

    uses ipv6-top;

  }

  // VRRP for IPv4 interfaces

  augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
    "oc-if:subinterface/oc-ip:ipv4/oc-ip:addresses/oc-ip:address" {

    description
      "Additional IP addr family configuration for
      interfaces";

    uses ip-vrrp-top;

  }

  // VRRP for IPv6 interfaces

  augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
    "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address" {
    description
      "Additional IP addr family configuration for
      interfaces";

    uses ip-vrrp-top;

  }

  augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
    "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address/" +
    "vrrp/vrrp-group/config" {
    description
      "Additional VRRP data for IPv6 interfaces";

    uses ip-vrrp-ipv6-config;
  }

  augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
  "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/" +
    "vrrp-group/state" {
    description
      "Additional VRRP data for IPv6 interfaces";

    uses ip-vrrp-ipv6-state;
  }

  // Augments for for routed VLANs

  augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan" {
    description
      "IPv4 address family configuration for
      interfaces";

    uses ipv4-top;
  }

  augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan" {
    description
      "IPv6 address family configuration for
      interfaces";

    uses ipv6-top;
  }

  // VRRP for routed VLAN interfaces

  augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" +
    "oc-ip:ipv4/oc-ip:addresses/oc-ip:address" {
    description
      "Additional IP addr family configuration for
      interfaces";

    uses ip-vrrp-top;

  }

  augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" +
    "oc-ip:ipv6/oc-ip:addresses/oc-ip:address" {
    description
      "Additional IP addr family configuration for
      interfaces";

    uses ip-vrrp-top;

  }

  augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" +
    "oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/vrrp-group/config" {
    description
      "Additional VRRP data for IPv6 interfaces";

    uses ip-vrrp-ipv6-config;
  }


  augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" +
    "oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/vrrp-group/state" {
    description
      "Additional VRRP data for IPv6 interfaces";

    uses ip-vrrp-ipv6-state;
  }

  // rpc statements

  // notification statements
}