summaryrefslogtreecommitdiff
path: root/scripts/bgp
diff options
context:
space:
mode:
authorRobert Bays <robert@vyatta.com>2011-09-29 12:00:10 -0700
committerRobert Bays <robert@vyatta.com>2011-09-29 12:00:10 -0700
commitff703eb15618b2ebcc1ed85563a73de944d59664 (patch)
treeb82291e56d92cd826bfb094fa2a74d221808a9f0 /scripts/bgp
parent33d8cca996a4f8dd1a5d918c57cc4c82696694bb (diff)
downloadvyatta-cfg-quagga-ff703eb15618b2ebcc1ed85563a73de944d59664.tar.gz
vyatta-cfg-quagga-ff703eb15618b2ebcc1ed85563a73de944d59664.zip
bgp: Bug 6033 - There is no auto completion for "bgp <> neighbor <> peer-group"
Diffstat (limited to 'scripts/bgp')
-rwxr-xr-xscripts/bgp/vyatta-bgp.pl15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl
index 4f4ac40e..d10a37af 100755
--- a/scripts/bgp/vyatta-bgp.pl
+++ b/scripts/bgp/vyatta-bgp.pl
@@ -1072,7 +1072,7 @@ my %qcom = (
my $qconfig = new Vyatta::Quagga::Config('protocols', \%qcom);
my ( $pg, $as, $neighbor );
-my ( $main, $peername, $isneighbor, $checkpeergroups, $checksource, $isiBGPpeer, $wasiBGPpeer, $confedibgpasn);
+my ( $main, $peername, $isneighbor, $checkpeergroups, $checksource, $isiBGPpeer, $wasiBGPpeer, $confedibgpasn, $listpeergroups);
GetOptions(
"peergroup=s" => \$pg,
@@ -1085,6 +1085,7 @@ GetOptions(
"is-iBGP" => \$isiBGPpeer,
"was-iBGP" => \$wasiBGPpeer,
"confed-iBGP-ASN-check=s" => \$confedibgpasn,
+ "list-peer-groups" => \$listpeergroups,
"main" => \$main,
);
@@ -1096,10 +1097,20 @@ check_source($checksource) if ($checksource);
confed_iBGP_ASN($as, $confedibgpasn) if ($confedibgpasn);
is_iBGP_peer($neighbor, $as) if ($isiBGPpeer);
was_iBGP_peer($neighbor, $as) if ($wasiBGPpeer);
-
+list_peer_groups($as) if ($listpeergroups);
exit 0;
+sub list_peer_groups {
+ my $as = shift;
+ my $config = new Vyatta::Config;
+
+ $config->setLevel("protocols bgp $as peer-group");
+ my @nodes = $config->listNodes();
+ foreach my $node (@nodes) { print "$node "; }
+ return;
+}
+
# Make sure the peer IP isn't a local system IP
sub check_neighbor_ip {
my $neighbor = shift;