summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@uffda.(none)>2007-11-05 17:30:38 -0800
committerStig Thormodsrud <stig@uffda.(none)>2007-11-05 17:30:38 -0800
commitd2de5c5263822a0c3bfa625f8d7cb3a2baa9377c (patch)
treebc9750a81c82cccce28ec7cbcf3473f2acbfa265 /scripts
parentf6d78b37ef2c22f273484ccf68aa50e00facf4bf (diff)
downloadvyatta-cfg-quagga-d2de5c5263822a0c3bfa625f8d7cb3a2baa9377c.tar.gz
vyatta-cfg-quagga-d2de5c5263822a0c3bfa625f8d7cb3a2baa9377c.zip
Add ospf area validation and fix tab completion for router-id.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta_quagga_utils.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/vyatta_quagga_utils.pl b/scripts/vyatta_quagga_utils.pl
index 2b5b05ac..d64be3a9 100644
--- a/scripts/vyatta_quagga_utils.pl
+++ b/scripts/vyatta_quagga_utils.pl
@@ -8,11 +8,13 @@ use Getopt::Long;
GetOptions("check-prefix-boundry=s" => \$prefix,
"not-exists=s" => \$notexists,
"exists=s" => \$exists,
+ "check-ospf-area=s" => \$area,
);
if (defined $prefix) { check_prefix_boundry($prefix); }
if (defined $notexists) { check_not_exists($notexists); }
if (defined $exists) { check_exists($exists); }
+if (defined $area) { check_ospf_area($area); }
exit 0;
@@ -52,3 +54,19 @@ sub check_not_exists() {
exit 1;
}
+sub check_ospf_area() {
+ my $area = shift;
+
+ if ($area =~ m/^\d+$/) {
+ if ($area >= 0 && $area <= 4294967295) {
+ return 0;
+ }
+ }
+
+ if (isIpAddress($area)) {
+ return 0;
+ }
+ print "invalid ospf area\n";
+ exit 1;
+}
+