summaryrefslogtreecommitdiff
path: root/vtysh/extract.pl
diff options
context:
space:
mode:
authorpaul <paul>2003-03-25 05:07:42 +0000
committerpaul <paul>2003-03-25 05:07:42 +0000
commit6898008484a562ff5bae178a6fb0bd885fe8b1e5 (patch)
tree27797ca6532ca0ef85f538ac8f3070639e579229 /vtysh/extract.pl
parent1ef74ef70bdab672458c4d1e4cea24197066c0af (diff)
2003-03-25 Paul Jakma <paul@dishone.st>
* sync to latest zebra CVS * spec file: updated and added define for ospf-api/client NB: OSPF-API has been broken by the zebra.org changes, which has added struct ospf * as a new arg to many functions
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 4eb88fa6..5d29f8ab 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);