Diff for /embedaddon/quagga/vtysh/extract.pl between versions 1.1.1.3 and 1.1.1.4

version 1.1.1.3, 2013/07/21 23:54:40 version 1.1.1.4, 2016/11/02 10:09:10
Line 31  print <<EOF; Line 31  print <<EOF;
 EOF  EOF
   
 $ignore{'"interface IFNAME"'} = "ignore";  $ignore{'"interface IFNAME"'} = "ignore";
   $ignore{'"interface IFNAME " "vrf <0-65535>"'} = "ignore";
 $ignore{'"ip vrf NAME"'} = "ignore";  $ignore{'"ip vrf NAME"'} = "ignore";
 $ignore{'"router rip"'} = "ignore";  $ignore{'"router rip"'} = "ignore";
 $ignore{'"router ripng"'} = "ignore";  $ignore{'"router ripng"'} = "ignore";
 $ignore{'"router ospf"'} = "ignore";  $ignore{'"router ospf"'} = "ignore";
 $ignore{'"router ospf <0-65535>"'} = "ignore";  $ignore{'"router ospf <0-65535>"'} = "ignore";
 $ignore{'"router ospf6"'} = "ignore";  $ignore{'"router ospf6"'} = "ignore";
 $ignore{'"router babel"'} = "ignore";  
 $ignore{'"router bgp " "<1-4294967295>"'} = "ignore";  $ignore{'"router bgp " "<1-4294967295>"'} = "ignore";
 $ignore{'"router bgp " "<1-4294967295>" " view WORD"'} = "ignore";  $ignore{'"router bgp " "<1-4294967295>" " view WORD"'} = "ignore";
 $ignore{'"router isis WORD"'} = "ignore";  $ignore{'"router isis WORD"'} = "ignore";
Line 49  $ignore{'"address-family ipv6 unicast"'} = "ignore"; Line 49  $ignore{'"address-family ipv6 unicast"'} = "ignore";
 $ignore{'"address-family vpnv4"'} = "ignore";  $ignore{'"address-family vpnv4"'} = "ignore";
 $ignore{'"address-family vpnv4 unicast"'} = "ignore";  $ignore{'"address-family vpnv4 unicast"'} = "ignore";
 $ignore{'"address-family ipv4 vrf NAME"'} = "ignore";  $ignore{'"address-family ipv4 vrf NAME"'} = "ignore";
   $ignore{'"address-family encap"'} = "ignore";
   $ignore{'"address-family encapv4"'} = "ignore";
   $ignore{'"address-family encapv6"'} = "ignore";
 $ignore{'"exit-address-family"'} = "ignore";  $ignore{'"exit-address-family"'} = "ignore";
 $ignore{'"key chain WORD"'} = "ignore";  $ignore{'"key chain WORD"'} = "ignore";
 $ignore{'"key <0-2147483647>"'} = "ignore";  $ignore{'"key <0-2147483647>"'} = "ignore";
Line 60  $ignore{'"terminal monitor"'} = "ignore"; Line 63  $ignore{'"terminal monitor"'} = "ignore";
 $ignore{'"terminal no monitor"'} = "ignore";  $ignore{'"terminal no monitor"'} = "ignore";
 $ignore{'"show history"'} = "ignore";  $ignore{'"show history"'} = "ignore";
   
   my $cli_stomp = 0;
   
 foreach (@ARGV) {  foreach (@ARGV) {
     $file = $_;      $file = $_;
   
Line 90  foreach (@ARGV) { Line 95  foreach (@ARGV) {
         $cmd =~ s/\s+$//g;          $cmd =~ s/\s+$//g;
   
         # $protocol is VTYSH_PROTO format for redirection of user input          # $protocol is VTYSH_PROTO format for redirection of user input
        if ($file =~ /lib/) {        if ($file =~ /lib\/keychain\.c$/) {
           if ($file =~ /keychain.c/) {            $protocol = "VTYSH_RIPD";
              $protocol = "VTYSH_RIPD";        }
           }        elsif ($file =~ /lib\/routemap\.c$/) {
           if ($file =~ /routemap.c/) {            $protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";
              $protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";        }
           }        elsif ($file =~ /lib\/filter\.c$/) {
           if ($file =~ /filter.c/) {            $protocol = "VTYSH_ALL";
              $protocol = "VTYSH_ALL";        }
           }        elsif ($file =~ /lib\/vrf\.c$/) {
           if ($file =~ /plist.c/) {            $protocol = "VTYSH_ZEBRA";
              if ($defun_array[1] =~ m/ipv6/) {        }
                 $protocol = "VTYSH_RIPNGD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";        elsif ($file =~ /lib\/plist\.c$/) {
              } else {            if ($defun_array[1] =~ m/ipv6/) {
                 $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD|VTYSH_ZEBRA";                $protocol = "VTYSH_RIPNGD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";
              }            } else {
           }                $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD|VTYSH_ZEBRA";
           if ($file =~ /distribute.c/) {            }
              if ($defun_array[1] =~ m/ipv6/) {        }
                 $protocol = "VTYSH_RIPNGD";        elsif ($file =~ /lib\/distribute\.c$/) {
              } else {            if ($defun_array[1] =~ m/ipv6/) {
                 $protocol = "VTYSH_RIPD";                $protocol = "VTYSH_RIPNGD";
              }            } else {
           }                $protocol = "VTYSH_RIPD";
           if ($file =~ /if_rmap.c/) {            }
              if ($defun_array[1] =~ m/ipv6/) {        }
                 $protocol = "VTYSH_RIPNGD";        elsif ($file =~ /lib\/if_rmap\.c$/) {
              } else {            if ($defun_array[1] =~ m/ipv6/) {
                 $protocol = "VTYSH_RIPD";                $protocol = "VTYSH_RIPNGD";
              }            } else {
           }                $protocol = "VTYSH_RIPD";
           if ($file =~ /vty.c/) {            }
              $protocol = "VTYSH_ALL";        }
           }        elsif ($file =~ /lib\/vty\.c$/) {
        } else {           $protocol = "VTYSH_ALL";
         }
         else {
            ($protocol) = ($file =~ /^.*\/([a-z0-9]+)\/[a-zA-Z0-9_\-]+\.c$/);             ($protocol) = ($file =~ /^.*\/([a-z0-9]+)\/[a-zA-Z0-9_\-]+\.c$/);
            $protocol = "VTYSH_" . uc $protocol;             $protocol = "VTYSH_" . uc $protocol;
         }          }
Line 134  foreach (@ARGV) { Line 141  foreach (@ARGV) {
         $defun_body = join (", ", @defun_array);          $defun_body = join (", ", @defun_array);
   
         # $cmd -> $str hash for lookup          # $cmd -> $str hash for lookup
          if (exists($cmd2str{$cmd})) {
              warn "Duplicate CLI Function: $cmd\n";
              warn "\tFrom cli: $cmd2str{$cmd} to New cli: $str\n";
              warn "\tOriginal Protocol: $cmd2proto{$cmd} to New Protocol: $protocol\n";
              $cli_stomp++;
          }
         $cmd2str{$cmd} = $str;          $cmd2str{$cmd} = $str;
         $cmd2defun{$cmd} = $defun_body;          $cmd2defun{$cmd} = $defun_body;
         $cmd2proto{$cmd} = $protocol;          $cmd2proto{$cmd} = $protocol;
Line 165  foreach (@ARGV) { Line 178  foreach (@ARGV) {
             push (@{$oproto{$key}}, $cmd2proto{$ecmd});              push (@{$oproto{$key}}, $cmd2proto{$ecmd});
         }          }
     }      }
   }
   
   my $bad_cli_stomps = 89;
   # Currently we have $bad_cli_stomps.  This was determined by
   # running this script and counting up the collisions from what
   # was returned.
   #
   # When we have cli commands that map to the same function name, we
   # can introduce subtle bugs due to code not being called when
   # we think it is.
   #
   # If extract.pl fails with a error message and you've been
   # modifying the cli, then go back and fix your code to
   # not have cli command function collisions.
   #
   # If you've removed a cli overwrite, you can safely subtract
   # one from $bad_cli_stomps.  If you've added to the problem
   # please fix your code before submittal
   if ($cli_stomp != $bad_cli_stomps) {
       warn "Expected $bad_cli_stomps command line stomps, but got $cli_stomp instead\n";
       exit $cli_stomp;
 }  }
   
 # Check finaly alive $cmd;  # Check finaly alive $cmd;

Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>