summaryrefslogtreecommitdiffstats
path: root/vtysh/extract.pl
diff options
context:
space:
mode:
authorpaul <paul>2003-03-25 02:37:13 +0000
committerpaul <paul>2003-03-25 02:37:13 +0000
commitf7ccadc4a079d585770cb5fc6add832d4384facc (patch)
treec2c96f7405c46112eb3d8f6efcc693e040bc222b /vtysh/extract.pl
parent139c7c96b474a90aa3685b7efb8f23b550be1ff1 (diff)
downloadquagga-zebra.org.20030325.tar.bz2
quagga-zebra.org.20030325.tar.xz
Import of Zebra CVS 20030325-02:30zebra.org.20030325
Diffstat (limited to 'vtysh/extract.pl')
-rwxr-xr-xvtysh/extract.pl46
1 files changed, 27 insertions, 19 deletions
diff --git a/vtysh/extract.pl b/vtysh/extract.pl
index 4a459013..2f1c8200 100755
--- a/vtysh/extract.pl
+++ b/vtysh/extract.pl
@@ -61,25 +61,6 @@ foreach (@ARGV) {
@defun = ($line =~ /(?:DEFUN|ALIAS)\s*\((.+?)\);?\s?\s?\n/sg);
@install = ($line =~ /install_element \(\s*[0-9A-Z_]+,\s*&[^;]*;\s*\n/sg);
- # $protocol is VTYSH_PROTO format for redirection of user input
- if ($file =~ /lib/) {
- if ($file =~ /keychain.c/) {
- $protocol = "VTYSH_RIPD";
- }
- if ($file =~ /routemap.c/) {
- $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD";
- }
- if ($file =~ /filter.c/) {
- $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD";
- }
- if ($file =~ /plist.c/) {
- $protocol = "VTYSH_RIPD|VTYSH_BGPD";
- }
- } else {
- ($protocol) = ($file =~ /\/([a-z0-9]+)/);
- $protocol = "VTYSH_" . uc $protocol;
- }
-
# DEFUN process
foreach (@defun) {
my (@defun_array);
@@ -98,6 +79,33 @@ foreach (@ARGV) {
$cmd =~ s/^\s+//g;
$cmd =~ s/\s+$//g;
+ # $protocol is VTYSH_PROTO format for redirection of user input
+ if ($file =~ /lib/) {
+ if ($file =~ /keychain.c/) {
+ $protocol = "VTYSH_RIPD";
+ }
+ if ($file =~ /routemap.c/) {
+ $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD";
+ }
+ if ($file =~ /filter.c/) {
+ if ($defun_array[1] =~ m/ipv6/) {
+ $protocol = "VTYSH_RIPNGD|VTYSH_OSPF6D|VTYSH_BGPD";
+ } else {
+ $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD";
+ }
+ }
+ if ($file =~ /plist.c/) {
+ if ($defun_array[1] =~ m/ipv6/) {
+ $protocol = "VTYSH_RIPNGD|VTYSH_BGPD";
+ } else {
+ $protocol = "VTYSH_RIPD|VTYSH_BGPD";
+ }
+ }
+ } else {
+ ($protocol) = ($file =~ /\/([a-z0-9]+)/);
+ $protocol = "VTYSH_" . uc $protocol;
+ }
+
# Append _vtysh to structure then build DEFUN again
$defun_array[1] = $cmd . "_vtysh";
$defun_body = join (", ", @defun_array);