diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-01 12:03:56 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-01 12:03:56 -0700 |
commit | 11e3c9aa29c64e6f66239f6c3fdf414004f71ea7 (patch) | |
tree | 9637ce1430a164ad636eac7e587c3294ab3bf7a2 /scripts/policy | |
parent | d1627b367e30988d26b7e393600149750534aaf6 (diff) | |
parent | ed9ffaed671f21e9e6e32e49d3fb0a491cf46804 (diff) | |
download | vyatta-cfg-quagga-11e3c9aa29c64e6f66239f6c3fdf414004f71ea7.tar.gz vyatta-cfg-quagga-11e3c9aa29c64e6f66239f6c3fdf414004f71ea7.zip |
Merge branch 'larkspur' of suva.vyatta.com:/git/vyatta-cfg-quagga into larkspur
Diffstat (limited to 'scripts/policy')
-rwxr-xr-x | scripts/policy/vyatta-policy.pl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/policy/vyatta-policy.pl b/scripts/policy/vyatta-policy.pl index 08dc3b93..b4439bec 100755 --- a/scripts/policy/vyatta-policy.pl +++ b/scripts/policy/vyatta-policy.pl @@ -8,7 +8,7 @@ use Getopt::Long; my $VTYSH = '/usr/bin/vtysh'; my ( $accesslist, $accesslist6, $aspathlist, $communitylist, $peer ); -my ( $routemap, $deleteroutemap ); +my ( $routemap, $deleteroutemap, $listpolicy ); GetOptions( "update-access-list=s" => \$accesslist, @@ -18,6 +18,7 @@ GetOptions( "check-peer-syntax=s" => \$peer, "check-routemap-action=s" => \$routemap, "check-delete-routemap-action=s" => \$deleteroutemap, + "list-policy=s" => \$listpolicy, ) or exit 1; update_access_list($accesslist) if ($accesslist); @@ -27,6 +28,7 @@ update_community_list($communitylist) if ($communitylist); check_peer_syntax($peer) if ($peer); check_routemap_action($routemap) if ($routemap); check_delete_routemap_action($deleteroutemap) if ($deleteroutemap); +list_policy($listpolicy) if ($listpolicy); exit 0; @@ -309,3 +311,14 @@ sub check_delete_routemap_action { exit(@nodes) ? 1 : 0; } + +## list available policies +sub list_policy { + my $policy = shift; + my $config = new Vyatta::Config; + + $config->setLevel("policy $policy"); + my @nodes = $config->listNodes(); + foreach my $node (@nodes) { print "$node "; } + return; +} |