Upgrade ietf-{inet,yang}-types to 2013-07-15
[vpnservice.git] / model-bgp / src / main / yang / bgp.yang
1 module bgp {
2   namespace "urn:cisco:params:xml:ns:yang:bgp";
3   // replace with IANA namespace when assigned
4   prefix bgp;
5
6   import ietf-inet-types {
7     prefix inet;
8     revision-date "2013-07-15";
9   }
10   import ietf-yang-types {
11     prefix yang;
12   }
13
14   organization
15     "Cisco Systems
16      170 West Tasman Drive
17      San Jose, CA 95134-1706
18      USA";
19   contact
20     "Aleksandr Zhdankin azhdanki@cisco.com
21      Keyur Patel keyupate@cisco.com
22      Alexander Clemm alex@cisco.com";
23   description
24     "This YANG module defines the generic configuration
25      data for BGP, which is common across all of the vendor
26      implementations of the protocol. It is intended that the module
27      will be extended by vendors to define vendor-specific
28      BGP configuration parameters and policies,
29      for example route maps or route policies.
30
31
32      Terms and Acronyms
33
34      BGP (bgp): Border Gateway Protocol
35
36      IP (ip): Internet Protocol
37
38      IPv4 (ipv4):Internet Protocol Version 4
39
40      IPv6 (ipv6): Internet Protocol Version 6
41
42      MED(med): Multi Exit Discriminator
43
44      IGP (igp): Interior Gateway Protocol
45
46      MTU (mtu) Maximum Transmission Unit
47     ";
48
49   revision 2013-07-15 {
50     description
51       "Initial revision.";
52   }
53
54   typedef prefix-list-ref {
55     description
56       "A reference to the prefix list which a bgp-neighbor can use.";
57     type leafref {
58       path "/prefix-lists/prefix-list/prefix-list-name";
59     }
60   }
61
62   typedef neigbour-ref {
63     description
64       "A reference to the bgp-neighbor.";
65     type leafref {
66       path "/bgp-neighbors/bgp-neighbor/as-number";
67     }
68   }
69
70   typedef bgp-peer-admin-status {
71     description
72       "Administartive status of a BGP peer.";
73     type enumeration {
74       enum "unknown";
75       enum "up";
76       enum "down";
77     }
78   }
79
80   typedef actions-enum {
81     description
82       "Permit/deny action.";
83     type enumeration {
84       enum "permit";
85       enum "deny";
86     }
87   }
88
89   grouping ACTIONS {
90     description
91       "Permit/deny action.";
92     leaf action {
93       type actions-enum;
94       mandatory true;
95     }
96   }
97
98   grouping slow-peer-config {
99     description
100       "Configure a slow-peer.";
101     container detection {
102       leaf enable {
103         type boolean;
104         default "true";
105       }
106       leaf threshold {
107         type uint16 {
108           range "120..3600";
109         }
110       }
111     }
112     leaf split-update-group {
113       type enumeration {
114         enum "dynamic";
115         enum "static";
116       }
117     }
118   }
119   grouping update-group-management {
120     description
121       "Manage peers in BGP update group.";
122     leaf split-as-override {
123       description
124         "Keeps peers with as-override in different update groups.";
125       type boolean;
126     }
127   }
128
129   grouping neighbour-base-af-config {
130     description
131       "A set of configuration parameters that is applicable to all neighbour address families.";
132     leaf active {
133       description
134         "Enable the address family for this neighbor.";
135       type boolean;
136       default "false";
137     }
138     leaf advertisement-interval {
139       description
140         "Minimum interval between sending BGP routing updates.";
141       type uint32;
142     }
143     leaf allowas-in {
144       description
145         "Accept as-path with my AS present in it.";
146       type boolean;
147       default "false";
148     }
149     leaf maximum-prefix {
150       description
151         "Maximum number of prefixes accepted from this peer.";
152       type uint32;
153     }
154     leaf next-hop-self {
155       description
156         "Enable the next hop calculation for this neighbor.";
157       type boolean;
158       default "true";
159     }
160     leaf next-hop-unchanged {
161       description
162         "Propagate next hop unchanged for iBGP paths to this neighbour.";
163       type boolean;
164       default "true";
165     }
166     container remove-private-as {
167       leaf remove-private-as-number {
168         description
169           "Remove private AS number from outbound updates.";
170         type boolean;
171       }
172       leaf replace-with-local-as {
173         description
174           "Replace private AS number with local AS.";
175         type boolean;
176       }
177     }
178     leaf route-reflector-client {
179       description
180         "Configure a neighbor as Route Reflector client.";
181       type boolean;
182       default "false";
183     }
184     leaf send-community {
185       description
186         "Send Community attribute to this neighbor.";
187       type enumeration {
188         enum "both";
189         enum "extended";
190         enum "standard";
191       }
192       default "standard";
193     }
194     uses slow-peer-config;
195     leaf soo {
196       description
197         "Site-of-Origin extended community. Format is ASN:nn or IP-address:nn";
198       type string;
199     }
200     leaf weight {
201       description
202         "Set default weight for routes from this neighbor.";
203       type uint16;
204     }
205   }
206
207   grouping neighbour-common-af-config {
208     description
209       "A set of configuration parameters that is applicable to all neighbour address families,
210        except of nsap and rtfilter.";
211     uses neighbour-base-af-config;
212     leaf prefix-list {
213       description
214         "Reference to the prefix list of this neighbour.";
215       type prefix-list-ref;
216     }
217     leaf soft-reconfiguration {
218       description
219         "Allow inbound soft reconfiguration.";
220       type boolean;
221     }
222   }
223
224   grouping neighbour-cast-af-config {
225     description
226       "A set of configuration parameters that is applicable to both unicast and multicast sub-address families.";
227     uses neighbour-common-af-config;
228     leaf propagate-dmzlink-bw {
229       description
230         "Propagate the DMZ link bandwidth.";
231       type boolean;
232     }
233     container default-originate {
234       description
235         "Originate default route to this neighbor.";
236       leaf enable {
237         type boolean;
238         default "false";
239       }
240     }
241   }
242
243   grouping neighbour-ip-multicast-af-config {
244     description
245       "A set of configuration parameters that is applicable to ip multicast.";
246     uses neighbour-cast-af-config;
247     leaf route-server-client-context {
248       description
249         "Specifies Route Server client context name.";
250       type string;
251     }
252   }
253
254   grouping neighbour-ip-unicast-af-config {
255     description
256       "A set of configuration parameters that is applicable to ip unicast.
257        This grouping is intended to be extended by vendors as necessary to describe the vendor-specific configuration parameters.";
258     uses neighbour-ip-multicast-af-config;
259   }
260
261   grouping bgp-af-config {
262     description
263       "A set of configuration parameters that is applicable to all address families of the BFP router.";
264     leaf additional-paths {
265       description
266         "Additional paths in the BGP table.";
267       type enumeration {
268         enum "all";
269         enum "best-n";
270         enum "group-best";
271       }
272     }
273     leaf advertise-best-external {
274       description
275         "Advertise best external path to internal peers.";
276       type boolean;
277     }
278     container aggregate-timer {
279       description
280         "Configure aggregation timer.";
281       leaf enable {
282         type boolean;
283         default "true";
284       }
285       leaf threshold {
286         type uint16 {
287           range "6..60";
288         }
289       }
290     }
291     container bestpath {
292       description
293         "Change the default bestpath selection.";
294       choice bestpath-selection {
295         case as-path {
296           description
297             "Configures a BGP routrer to not consider the autonomous system (AS) path during best path route selection.";
298           leaf ignore-as-path {
299             type boolean;
300             default "false";
301           }
302         }
303         case compare-routerid {
304           description
305             "Configures a BGP routrer to compare identical routes received from different external peers
306              during the best path selection process and to select the route with the lowest router ID as the best path.";
307           leaf ignore-routerid {
308             type boolean;
309             default "false";
310           }
311         }
312         case cost-community {
313           description
314             "Configures a BGP router to not evaluate the cost community attribute
315              during the best path selection process.";
316           leaf ignore-cost-community {
317             type boolean;
318             default "false";
319           }
320         }
321         case igp-metric {
322           description
323             "Configures the system to ignore the IGP metric during BGP best path selection.";
324           leaf ignore-igp-metric {
325             type boolean;
326             default "false";
327           }
328         }
329         case mad-confed {
330           description
331             "Configure a BGP routing process to compare the Multi Exit Discriminator (MED)
332              between paths learned from confederation peers.";
333           leaf enable {
334             type boolean;
335             default "false";
336           }
337           leaf missing-as-worst {
338             description
339               "Assigns a value of infinity to routes that are missing
340                the Multi Exit Discriminator (MED) attribute,
341                making the path without a MED value the least desirable path";
342             type boolean;
343             default "false";
344           }
345         }
346       }
347     }
348     leaf dampening {
349       description
350         "Enable route-flap dampening.";
351       type boolean;
352       default "false";
353     }
354     leaf propagate-dmzlink-bw {
355       description
356         "Use DMZ Link Bandwidth as weight for BGP multipaths.";
357       type boolean;
358     }
359     leaf redistribute-internal {
360       description
361         "Allow redistribution of iBGP into IGPs (dangerous)";
362       type boolean;
363     }
364     leaf scan-time {
365       description
366         "Configure background scanner interval in seconds.";
367       type uint8 {
368         range "5..60";
369       }
370     }
371     uses slow-peer-config;
372     leaf soft-reconfig-backup {
373       description
374         "Use soft-reconfiguration inbound only when route-refresh is not negotiated.";
375       type boolean;
376     }
377   }
378
379   grouping bgp-af-vpn-config {
380     description
381       "A set of configuration parameters that is applicable to vpn sub-address family on the BGP router.";
382     uses bgp-af-config;
383     uses update-group-management;
384   }
385
386   grouping bgp-af-mvpn-config {
387     description
388       "A set of configuration parameters that is applicable to mvpn sub-address family on the BGP router.";
389     leaf scan-time {
390       description
391         "Configure background scanner interval in seconds.";
392       type uint8 {
393         range "5..60";
394       }
395     }
396     uses slow-peer-config;
397     leaf soft-reconfig-backup {
398       description
399         "Use soft-reconfiguration inbound only when route-refresh is not negotiated.";
400       type boolean;
401     }
402     leaf propagate-dmzlink-bw {
403       description
404         "Use DMZ Link Bandwidth as weight for BGP multipaths.";
405       type boolean;
406     }
407     leaf rr-group {
408       description
409         "Extended community list name.";
410       type string;
411     }
412     uses update-group-management;
413   }
414
415   grouping redistribute {
416     description
417       "Redistribute information from another routing protocol.
418        This grouping is intended to be augmented by vendors to implement vendor-specific protocol redistribution configuration options.";
419     choice protocol {
420       case bgp {
421         leaf enable-bgp {
422           type boolean;
423         }
424       }
425       case ospf {
426         leaf enable-ospf {
427           type boolean;
428         }
429       }
430       case isis {
431         leaf enable-isis {
432           type boolean;
433         }
434       }
435       case connected {
436         leaf enable-connected {
437           type boolean;
438         }
439       }
440       case eigrp {
441         leaf enable-eigrp {
442           type boolean;
443         }
444       }
445       case mobile {
446         leaf enable-mobile {
447           type boolean;
448         }
449       }
450       case static {
451         leaf enable-static {
452           type boolean;
453         }
454       }
455       case rip {
456         leaf enable-rip {
457           type boolean;
458         }
459       }
460     }
461   }
462
463   grouping router-af-config {
464     description
465       "A set of configuration parameters that is applicable to all address families on the BGP router.";
466     leaf aggregate-address {
467       description
468         "Configure BGP aggregate address.";
469       type inet:ip-address;
470     }
471     leaf distance {
472       description
473         "Define an administrative distance.";
474       type uint8 {
475         range "1..255";
476       }
477     }
478     leaf network {
479       description
480         "Specify a network to announce via BGP.";
481       type inet:ip-address;
482     }
483     uses redistribute;
484   }
485
486   grouping maximum-paths {
487     description
488       "Configures packet forwarding over multiple paths.";
489     leaf number-of-path {
490       type uint8 {
491         range "1..32";
492       }
493     }
494     leaf ibgp-number-of-path {
495       type uint8 {
496         range "1..32";
497       }
498     }
499   }
500
501   container bgp-router {
502     description
503       "This is a top-level container for the BGP router.";
504     leaf local-as-number {
505       type uint32;
506     }
507     leaf local-as-identifier {
508       type inet:ip-address;
509     }
510     container rpki-config {
511       description
512         "RPKI configuration parameters.";
513       container cache-server-config {
514         description
515           "Configure the RPKI cache-server parameters in rpki-server configuration mode.";
516         choice server {
517           case ip-address {
518             leaf ip-address {
519               type inet:ip-address;
520               mandatory true;
521             }
522           }
523           case host-name {
524             leaf ip-host-address {
525               type inet:host;
526               mandatory true;
527             }
528           }
529         }
530         choice transport {
531           description
532             "Specifies a transport method for the RPKI cache.";
533           case tcp {
534             leaf tcp-port {
535               type uint32;
536             }
537           }
538           case ssh {
539             leaf ssh-port {
540               type uint32;
541             }
542           }
543         }
544         leaf user-name {
545           type string;
546         }
547         leaf password {
548           type string;
549         }
550         leaf preference-value {
551           description
552             "Specifies a preference value for the RPKI cache.
553              Setting a lower preference value is better.";
554           type uint8 {
555             range "1..10";
556           }
557         }
558         leaf purge-time {
559           description
560             "Configures the time BGP waits to keep routes from a cache after the cache session drops. Set purge time in seconds.";
561           type uint16 {
562             range "30..360";
563           }
564         }
565         choice refresh-time {
566           description
567             "Configures the time BGP waits in between sending periodic serial queries to the cache. Set refresh-time in seconds.";
568           case disable {
569             leaf refresh-time-disable {
570               type boolean;
571             }
572           }
573           case set-time {
574             leaf refresh-interval {
575               type uint16 {
576                 range "15..3600";
577               }
578             }
579           }
580         }
581         choice responce-time {
582           description
583             "Configures the time BGP waits for a response after sending a serial or reset query. Set response-time in seconds.";
584           case disable {
585             leaf responce-time-disable {
586               type boolean;
587             }
588           }
589           case set-time {
590             leaf responce-interval {
591               type uint16 {
592                 range "15..3600";
593               }
594             }
595           }
596         }
597       }
598       container validation-config {
599         description
600           "Controls the behavior of RPKI prefix validation processing.";
601         leaf enable {
602           description
603             "Enables RPKI origin-AS validation.";
604           type boolean;
605           default "true";
606         }
607         leaf enable-ibgp {
608           description
609             "Enables the iBGP signaling of validity state through an extended-community.";
610           type boolean;
611         }
612         choice validation-time {
613           description
614             "Sets prefix validation time (in seconds) or to set off the automatic prefix validation after an RPKI update.";
615           case validation-off {
616             leaf disable {
617               type boolean;
618             }
619           }
620           case set-time {
621             leaf prefix-validation-time {
622               description
623                 "Range in seconds.";
624               type uint16 {
625                 range "5..60";
626               }
627             }
628           }
629         }
630       }
631       container bestpath-computation {
632         description
633           "Configures RPKI bestpath computation options.";
634         leaf enable {
635           description
636             "Enables the validity states of BGP paths to affect the path's preference in the BGP bestpath process.";
637           type boolean;
638         }
639         leaf allow-invalid {
640           description
641             "Allows all 'invalid' paths to be considered for BGP bestpath computation.";
642           type boolean;
643         }
644       }
645     }
646     container af-configuration {
647       description
648         "Top level container for address families specific configuration of the BGP router.";
649       container ipv4 {
650         container mdt {
651           container bgp {
652             description
653               "BGP specific commands for ipv4-mdt address family/sub-addess family combination.";
654             leaf dampening {
655               description
656                 "Enable route-flap dampening.";
657               type boolean;
658               default "false";
659             }
660             leaf scan-time {
661               description
662                 "Configure background scanner interval in seconds.";
663               type uint8 {
664                 range "5..60";
665               }
666             }
667             uses slow-peer-config;
668             leaf soft-reconfig-backup {
669               description
670                 "Use soft-reconfiguration inbound only when route-refresh is not negotiated.";
671               type boolean;
672             }
673             leaf propagate-dmzlink-bw {
674               description
675                 "Use DMZ Link Bandwidth as weight for BGP multipaths.";
676               type boolean;
677             }
678           }
679         }
680         container multicast {
681           container bgp {
682             description
683               "BGP specific commands for ipv4-multicast address family/sub-addess family combination.";
684             uses bgp-af-config;
685           }
686           leaf auto-summary {
687             description
688               "Enable automatic network number summarization";
689             type boolean;
690           }
691           uses router-af-config;
692           leaf default-metric {
693             description
694               "Set metric of redistributed routes.";
695             type uint32;
696           }
697         }
698         container unicast {
699           container bgp {
700             description
701               "BGP specific commands for ipv4-unicast address family/sub-addess family combination.";
702             uses bgp-af-config;
703             leaf always-compare-med {
704               description
705                 "Allow comparing MED from different neighbors.";
706               type boolean;
707               default "false";
708             }
709             leaf enforce-first-as {
710               description
711                 "Enforce the first AS for EBGP routes(default).";
712               type boolean;
713               default "true";
714             }
715             leaf fast-external-fallover {
716               description
717                 "Immediately reset session if a link to a directly connected external peer goes down.";
718               type boolean;
719               default "true";
720             }
721             leaf suppress-inactive {
722               description
723                 "Suppress routes that are not in the routing table.";
724               type boolean;
725             }
726             leaf asnotation {
727               description
728                 "Sets the default asplain notation.";
729               type enumeration {
730                 enum "asplain";
731                 enum "dot";
732               }
733             }
734             leaf enable-client-to-client-reflection {
735               description
736                 "Manages client to client route reflection.";
737               type boolean;
738               default "true";
739             }
740             leaf cluster-id {
741               description
742                 "Configure Route-Reflector Cluster-id.";
743               type string;
744             }
745             container confederation {
746               description
747                 "AS confederation parameters.";
748               leaf identifier {
749                 description
750                   "Confederation identifier.";
751                 type string;
752               }
753               list peers {
754                 description
755                   "Confederation peers.";
756                 key "as-name";
757                 leaf as-name {
758                   type string;
759                 }
760               }
761             }
762             container consistency-checker {
763               description
764                 "Consistency-checker configuration.";
765               leaf enable {
766                 type boolean;
767               }
768               leaf interval {
769                 description
770                   "Check interval in minutes.";
771                 type uint16 {
772                   range "5..1440";
773                 }
774               }
775               choice inconsistency-action {
776                 case error-message {
777                   description
778                     "Specifies that when an inconsistency is found, the system will only generate a syslog message.";
779                   leaf generate-error-message-only {
780                     type boolean;
781                   }
782                 }
783                 case autorepair {
784                   description
785                     "Specifies that when an inconsistency is found,
786                      the system will generate a syslog message and take action
787                      based on the type of inconsistency found.";
788                   leaf perform-autorepair {
789                     type boolean;
790                   }
791                 }
792               }
793             }
794             leaf deterministic-med {
795               description
796                 "If enabled it enforce the deterministic comparison of the MED value between
797                  all paths received from within the same autonomous system.";
798               type boolean;
799             }
800             container graceful-restart {
801               description
802                 "Controls the BGP graceful restart capability.";
803               leaf enable {
804                 type boolean;
805               }
806               leaf restart-time {
807                 description
808                   "Sets the maximum time period (in seconds) that the local router will wait
809                    for a graceful-restart-capable neighbor to return to normal operation after a restart event occurs.";
810                 type uint16 {
811                   range "1..3600";
812                 }
813                 default "120";
814               }
815               leaf stalepath-time {
816                 description
817                   "Sets the maximum time period that the local router will hold stale paths for a restarting peer.";
818                 type uint16 {
819                   range "5..3600";
820                 }
821                 default "360";
822               }
823             }
824             container listener-congfig {
825               description
826                 "Associates a subnet range with a BGP peer group and activate the BGP dynamic neighbors feature.";
827               leaf enable {
828                 type boolean;
829               }
830               leaf limit {
831                 description
832                   "Sets a maximum limit number of BGP dynamic subnet range neighbors.";
833                 type uint16 {
834                   range "1..5000";
835                 }
836                 default "100";
837               }
838               leaf range {
839                 description
840                   "Specifies a subnet range that is to be associated with a specified peer group.";
841                 type uint16 {
842                   range "0..32";
843                 }
844               }
845               leaf peer-group {
846                 description
847                   "Specifies a BGP peer group that is to be associated with the specified subnet range.";
848                 type string;
849               }
850             }
851             leaf log-neighbor-changes {
852               description
853                 "Log neighbor up/down and reset reason.";
854               type boolean;
855             }
856             leaf max-as-limit {
857               description
858                 "Configures BGP to discard routes that have a number of autonomous system numbers in AS-path that exceed the specified value.";
859               type uint16 {
860                 range "1..254";
861               }
862             }
863             container router-id {
864               description
865                 "Configures a fixed router ID for the local BGP routing process.";
866               leaf enable {
867                 type boolean;
868               }
869               choice config-type {
870                 case static {
871                   leaf ip-address {
872                     type boolean;
873                   }
874                 }
875                 case auto-config {
876                   leaf enable-auto-config {
877                     type boolean;
878                   }
879                 }
880               }
881             }
882             container transport {
883               description
884                 "Manages transport session parameters.";
885               leaf enable-path-mtu-discovery {
886                 description
887                   "Enables transport path MTU discovery.";
888                 type boolean;
889                 default "true";
890               }
891             }
892           }
893           leaf auto-summary {
894             description
895               "Enable automatic network number summarization";
896             type boolean;
897           }
898           uses router-af-config;
899           uses maximum-paths;
900           leaf synchronization {
901             description
902               "Perform IGP synchronization.";
903             type boolean;
904           }
905         }
906         container mvpn {
907           container bgp {
908             description
909               "BGP specific commands for ipv4-mvpn address family/sub-addess family combination.";
910             uses bgp-af-mvpn-config;
911           }
912           leaf auto-summary {
913             description
914               "Enable automatic network number summarization.";
915             type boolean;
916           }
917         }
918       }
919       container ipv6 {
920         container multicast {
921           container bgp {
922             description
923               "BGP specific commands for ipv6-multicast address family/sub-addess family combination.";
924             uses bgp-af-config;
925           }
926           uses router-af-config;
927         }
928         container unicast {
929           container bgp {
930             description
931               "BGP specific commands for ipv6-unicast address family/sub-addess family combination.";
932             uses bgp-af-config;
933           }
934           uses router-af-config;
935           leaf default-metric {
936             description
937               "Set metric of redistributed routes.";
938             type uint32;
939           }
940           uses maximum-paths;
941           leaf synchronization {
942             description
943               "Perform IGP synchronization.";
944             type boolean;
945           }
946         }
947         container mvpn {
948           container bgp {
949             description
950               "BGP specific commands for ipv6-mvpn address family/sub-addess family combination.";
951             uses bgp-af-mvpn-config;
952           }
953         }
954       }
955       container l2vpn {
956         container vpls {
957           container bgp {
958             description
959               "BGP specific commands for l2vpn-vpls address family/sub-addess family combination.";
960             leaf scan-time {
961               description
962                 "Configure background scanner interval in seconds.";
963               type uint8 {
964                 range "5..60";
965               }
966             }
967             uses slow-peer-config;
968           }
969         }
970       }
971       container nsap {
972         container unicast {
973           container bgp {
974             description
975               "BGP specific commands for nsap-unicast address family/sub-addess family combination.";
976             container aggregate-timer {
977               description
978                 "Configure Aggregation Timer.";
979               leaf enable {
980                 type boolean;
981                 default "true";
982               }
983               leaf threshold {
984                 type uint16 {
985                   range "6..60";
986                 }
987               }
988             }
989             leaf dampening {
990               description
991                 "Enable route-flap dampening.";
992               type boolean;
993               default "false";
994             }
995             leaf propagate-dmzlink-bw {
996               description
997                 "Use DMZ Link Bandwidth as weight for BGP multipaths.";
998               type boolean;
999             }
1000             leaf redistribute-internal {
1001               description
1002                 "Allow redistribution of iBGP into IGPs (dangerous)";
1003               type boolean;
1004             }
1005             leaf scan-time {
1006               description
1007                 "Configure background scanner interval in seconds.";
1008               type uint8 {
1009                 range "5..60";
1010               }
1011             }
1012             uses slow-peer-config;
1013             leaf soft-reconfig-backup {
1014               description
1015                 "Use soft-reconfiguration inbound only when route-refresh is not negotiated.";
1016               type boolean;
1017             }
1018           }
1019           leaf default-metric {
1020             description
1021               "Set metric of redistributed routes.";
1022             type uint32;
1023           }
1024           uses maximum-paths;
1025           leaf network {
1026             description
1027               "Specify a network to announce via BGP.";
1028             type inet:ip-address;
1029           }
1030           uses redistribute;
1031           leaf synchronization {
1032             description
1033               "Perform IGP synchronization.";
1034             type boolean;
1035           }
1036         }
1037       }
1038     }
1039     container rtfilter {
1040       container unicast {
1041         container bgp {
1042           description
1043             "BGP specific commands for rtfilter-unicast address family/sub-addess family combination.";
1044           uses slow-peer-config;
1045         }
1046         uses maximum-paths;
1047       }
1048     }
1049     container vpnv4 {
1050       container unicast {
1051         container bgp {
1052           description
1053             "BGP specific commands for vpnv4-unicast address family/sub-addess family combination.";
1054           uses bgp-af-vpn-config;
1055         }
1056         uses maximum-paths;
1057       }
1058       container multicast {
1059         container bgp {
1060           description
1061             "BGP specific commands for vpnv4-multicast address family/sub-addess family combination.";
1062           uses bgp-af-vpn-config;
1063         }
1064         uses maximum-paths;
1065       }
1066     }
1067     container vpnv6 {
1068       container unicast {
1069         container bgp {
1070           description
1071             "BGP specific commands for vpnv6-unicast address family/sub-addess family combination.";
1072           uses bgp-af-vpn-config;
1073         }
1074       }
1075     }
1076   }
1077   container bgp-neighbors {
1078     description
1079       "The top level container for the list of neighbours of the BGP router.";
1080     list bgp-neighbor {
1081       key "as-number";
1082       leaf as-number {
1083         type uint32;
1084       }
1085       choice peer-address-type {
1086         case ip-address {
1087           leaf ip-address {
1088             type inet:ip-address;
1089             mandatory true;
1090           }
1091         }
1092         case prefix {
1093           leaf prefix {
1094             type inet:ip-prefix;
1095             mandatory true;
1096           }
1097         }
1098         case host {
1099           leaf ip-host-address {
1100             type inet:host;
1101             mandatory true;
1102           }
1103         }
1104       }
1105       leaf prefix-list {
1106         type prefix-list-ref;
1107       }
1108       leaf default-action {
1109         type actions-enum;
1110       }
1111       container af-specific-config {
1112         description
1113           "Address family specific configuration parameters for the neighbours.";
1114         container ipv4 {
1115           container mdt {
1116             uses neighbour-common-af-config;
1117           }
1118           container unicast {
1119             uses neighbour-ip-unicast-af-config;
1120           }
1121           container multicast {
1122             uses neighbour-ip-multicast-af-config;
1123           }
1124           container mvpn {
1125             uses neighbour-cast-af-config;
1126           }
1127         }
1128         container ipv6 {
1129           container unicast {
1130             uses neighbour-ip-unicast-af-config;
1131           }
1132           container multicast {
1133             uses neighbour-ip-multicast-af-config;
1134           }
1135           container mvpn {
1136             uses neighbour-common-af-config;
1137           }
1138         }
1139         container l2vpn {
1140           container evpn {
1141             uses neighbour-common-af-config;
1142           }
1143           container vpls {
1144             uses neighbour-common-af-config;
1145           }
1146         }
1147         container nsap {
1148           container unicast {
1149             uses neighbour-base-af-config;
1150             leaf prefix-list {
1151               type prefix-list-ref;
1152             }
1153           }
1154         }
1155         container rtfilter {
1156           container unicast {
1157             uses neighbour-base-af-config;
1158             leaf soft-reconfiguration {
1159               description
1160                 "Allow inbound soft reconfiguration.";
1161               type boolean;
1162             }
1163           }
1164         }
1165         container vpnv4 {
1166           container unicast {
1167             uses neighbour-cast-af-config;
1168           }
1169           container multicast {
1170             uses neighbour-cast-af-config;
1171           }
1172         }
1173         container vpnv6 {
1174           container unicast {
1175             uses neighbour-cast-af-config;
1176           }
1177           container multicast {
1178             uses neighbour-cast-af-config;
1179           }
1180         }
1181       }
1182       container bgp-neighbor-state {
1183         description
1184           "The operational parameters describing the neighbour state.
1185            It is intended that this container may be augmented by vendors to reflect the vendor-specific operational state parameters.";
1186         leaf adminStatus {
1187           type bgp-peer-admin-status;
1188         }
1189         leaf in-lastupdatetime {
1190           type yang:timestamp;
1191         }
1192       }
1193       container bgp-neighbor-statistics {
1194         description
1195           "The operational parameters describing the neighbour statistics.
1196            It is intended that this container may be augmented by vendors to reflect the vendor-specific staistical parameters.";
1197         leaf nr-in-updates {
1198           type uint32;
1199         }
1200         leaf nr-out-updates {
1201           type uint32;
1202         }
1203       }
1204     }
1205   }
1206   container prefix-lists {
1207     description
1208       "Contains all prefix lists defined
1209        on a router.";
1210     list prefix-list {
1211       key "prefix-list-name";
1212       description
1213         "A prefix list.";
1214       leaf prefix-list-name {
1215         type string;
1216       }
1217       container prefixes {
1218         list prefix {
1219           key "seq-nr";
1220           description
1221             "A prefix is a rule with a BGP filter.
1222              The left hand side of the rule is the prefix filter.
1223                          It specifies a set of IP addresses.
1224              If a BGP announcement contains an address that matches, the
1225              rule is applied.  The right hand side of the rule specifies
1226              the action that is to be applied.";
1227           leaf seq-nr {
1228             type uint16;
1229             description
1230               "Sequence number of the rule.
1231                The sequence number is included for compatibility purposes
1232                with CLI; from a machine-to-machine interface perspective,
1233                it would strictly speaking not be required as list elements
1234                can be arranged in a particular order.";
1235           }
1236           container prefix-filter {
1237             choice ip-address-group {
1238               case ip-address {
1239                 leaf ip-address {
1240                   type inet:ip-address;
1241                   mandatory true;
1242                 }
1243               }
1244               case prefix {
1245                 leaf prefix {
1246                   type inet:ip-prefix;
1247                   mandatory true;
1248                 }
1249               }
1250               case host {
1251                 leaf ip-host-address {
1252                   type inet:host;
1253                   mandatory true;
1254                 }
1255               }
1256               case ip-range {
1257                 leaf lower {
1258                   type inet:ip-address;
1259                 }
1260                 leaf upper {
1261                   type inet:ip-address;
1262                 }
1263               }
1264             }
1265             leaf action {
1266               type actions-enum;
1267               mandatory true;
1268               description
1269                 "permit/deny action";
1270             }
1271                         container statistics {
1272               leaf prefix-hit-count {
1273                 type uint32;
1274                 config false;
1275               }
1276             }
1277           }
1278         }
1279       }
1280     }
1281   }
1282 }