diff options
author | Robert Bays <robert@vyatta.com> | 2011-09-29 12:00:10 -0700 |
---|---|---|
committer | Robert Bays <robert@vyatta.com> | 2011-09-29 12:00:10 -0700 |
commit | ff703eb15618b2ebcc1ed85563a73de944d59664 (patch) | |
tree | b82291e56d92cd826bfb094fa2a74d221808a9f0 /scripts/bgp/vyatta-bgp.pl | |
parent | 33d8cca996a4f8dd1a5d918c57cc4c82696694bb (diff) | |
download | vyatta-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/vyatta-bgp.pl')
-rwxr-xr-x | scripts/bgp/vyatta-bgp.pl | 15 |
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; |