diff options
author | Justin Fletcher <jfletcher@phuket.vyatta.com> | 2007-11-05 17:35:29 -0800 |
---|---|---|
committer | Justin Fletcher <jfletcher@phuket.vyatta.com> | 2007-11-05 17:35:29 -0800 |
commit | 42dfee070aaa757ff9b8230fa2879b89883ab205 (patch) | |
tree | 12fe7dd1a1b9dc6ba98a2f0192b1399c27d7a9a9 | |
parent | 56c73bf4dee6082a5a6277b237038b0a68131c8c (diff) | |
parent | d2de5c5263822a0c3bfa625f8d7cb3a2baa9377c (diff) | |
download | vyatta-cfg-quagga-42dfee070aaa757ff9b8230fa2879b89883ab205.tar.gz vyatta-cfg-quagga-42dfee070aaa757ff9b8230fa2879b89883ab205.zip |
Merge branch 'master' of /usr/local/git/vyatta-cfg-quagga
-rw-r--r-- | scripts/vyatta_quagga_utils.pl | 18 | ||||
-rw-r--r-- | templates/protocols/ospf/area/node.def | 1 | ||||
-rw-r--r-- | templates/protocols/ospf/router-id/node.def | 2 |
3 files changed, 20 insertions, 1 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; +} + diff --git a/templates/protocols/ospf/area/node.def b/templates/protocols/ospf/area/node.def index d06ef605..22cb1ca0 100644 --- a/templates/protocols/ospf/area/node.def +++ b/templates/protocols/ospf/area/node.def @@ -1,4 +1,5 @@ tag: type: txt +syntax: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-ospf-area $(@)" help: "Area" diff --git a/templates/protocols/ospf/router-id/node.def b/templates/protocols/ospf/router-id/node.def index b5072ccd..e37ba0ee 100644 --- a/templates/protocols/ospf/router-id/node.def +++ b/templates/protocols/ospf/router-id/node.def @@ -1,4 +1,4 @@ -type: ipv4; "router-id must be a IPv4 address" +type: ipv4 help: "Override the default router identifier" update: "/usr/bin/vtysh -c \"configure terminal\" -c \"router ospf\" \ -c \"ospf router-id $(@)\" " |