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