diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-03-04 09:44:42 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-03-04 09:44:42 -0800 |
commit | b59815d0df23a26a92dab4183b554cffbad426c2 (patch) | |
tree | 7fbee50be9fd0f0c837fcf3c9456332501af3b9e /scripts/vyatta_quagga_utils.pl | |
parent | d912bede4d9708e0d26c09d3fa8e0acfa95c6bff (diff) | |
parent | 8daaf563f262f65fd2eca1cd37956e3d75ef0db0 (diff) | |
download | vyatta-cfg-quagga-b59815d0df23a26a92dab4183b554cffbad426c2.tar.gz vyatta-cfg-quagga-b59815d0df23a26a92dab4183b554cffbad426c2.zip |
Merge branch 'kenwood' of vm:vyatta/kenwood/vyatta-cfg-quagga into kenwood
Diffstat (limited to 'scripts/vyatta_quagga_utils.pl')
-rwxr-xr-x | scripts/vyatta_quagga_utils.pl | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/scripts/vyatta_quagga_utils.pl b/scripts/vyatta_quagga_utils.pl index 1d85b431..0b9fb2ae 100755 --- a/scripts/vyatta_quagga_utils.pl +++ b/scripts/vyatta_quagga_utils.pl @@ -6,15 +6,27 @@ use Vyatta::Misc; use NetAddr::IP; use Getopt::Long; -my ( $prefix, $exists, $not_exists, $area ); +my ( $prefix, $exists, $not_exists, $area, $community ); + +# Allowed well-know community values (see set commuinity) +my %communities = ( + 'additive' => 1, + 'internet' => 1, + 'local-AS' => 1, + 'no-advertise' => 1, + 'no-export' => 1, + 'none' => 1, +); GetOptions( "check-prefix-boundry=s" => \$prefix, "not-exists=s" => \$not_exists, "exists=s" => \$exists, "check-ospf-area=s" => \$area, + "check-community" => \$community, ); +check_community(@ARGV) if ($community); check_prefix_boundry($prefix) if ($prefix); check_not_exists($not_exists) if ($not_exists); check_exists($exists) if ($exists); @@ -74,3 +86,11 @@ sub check_ospf_area { die "Invalid OSPF area: $area\n"; } +sub check_community { + foreach my $arg (@_) { + next if ($arg =~ /\d+:\d+/); + next if $communities{$arg}; + + die "$arg unknown community value\n" + } +} |