Browse Source

tools: Remove historic scripts

Paul Jakma 6 years ago
parent
commit
5931124b6c
4 changed files with 0 additions and 370 deletions
  1. 0 1
      Makefile.am
  2. 0 135
      tools/rrcheck.pl
  3. 0 123
      tools/rrlookup.pl
  4. 0 111
      tools/zc.pl

+ 0 - 1
Makefile.am

@@ -11,7 +11,6 @@ DIST_SUBDIRS = lib qpb fpm zebra bgpd ripd ripngd ospfd ospf6d nhrpd \
 EXTRA_DIST = aclocal.m4 SERVICES TODO REPORTING-BUGS INSTALL.quagga.txt \
 	update-autotools \
 	vtysh/Makefile.in vtysh/Makefile.am \
-	tools/rrcheck.pl tools/rrlookup.pl tools/zc.pl \
 	tools/zebra.el tools/multiple-bgpd.sh
 
 if HAVE_LATEX

+ 0 - 135
tools/rrcheck.pl

@@ -1,135 +0,0 @@
-#!/usr/bin/env perl
-##
-## Read BGPd logfile and lookup RR's whois database.
-##
-##   Copyright (c) 1997 Kunihiro Ishiguro
-##
-use Socket;
-
-## Configuration variables
-$whois_host = "whois.jpix.ad.jp";
-
-#$logfile = "/usr/local/sbin/logfile"
-$logfile = shift || die "Please specify filename";
-
-## mail routine
-{
-    local ($prefix, $origin);
-
-    open (LOG, $logfile) || die "can't open $logfile";
-    
-    $index = '';
-    while ($index) {
-	$index = <LOG>;
-	if ($index =~ /[bgpd]/) {
-	    break;
-	}
-    }
-
-    while (<LOG>) {
-	if (/([\d\.\/]+)\s+([\d\.]+)\s+(\d+)\s+(\d+)\s+([\d ]+)\s+[ie\?]/) {
-	    $prefix = $1;
-	    $nexthop = $2;
-	    $med = $3;
-	    $dummy = $4;
-	    $aspath = $5;
-	    ($origin) = ($aspath =~ /([\d]+)$/);
-
-	    print "$nexthop [$origin] $prefix $aspath ";
-
-	    $ret = &whois_check ($prefix, $origin);
-	    if ($ret == 0) {
-		print "Check OK\n";
-	    } elsif ($ret == 1){
-		print "AS orgin mismatch\n";
-	    } else {
-		print "prefix doesn't exist \n";
-	    }
-	}
-    }
-}
-
-sub whois_check
-{
-    local ($prefix, $origin) = @_;
-    local ($rr_prefix, $rr_origin) = ();
-    local (@result);
-
-    $origin = "AS" . $origin;
-
-    @result = &whois ($prefix);
-
-    $prefix_match = 0;
-    foreach (@result) {
-        if (/^route:.*\s([\d\.\/]+)$/) {
-            $rr_prefix = $1;
-        }
-        if (/^origin:.*\s(AS[\d]+)$/) {
-            $rr_origin = $1;
-
-            if ($prefix eq $rr_prefix and $origin eq $rr_origin) {
-                return 0;
-            } elsif ($prefix eq $rr_prefix) {
-		$prefix_match = 1;
-	    }
-        }
-    }
-#    alarm_mail ($prefix, $origin, @result);
-    if ($prefix_match) {
-	return 1;
-    } else {
-	return 2;
-    }
-}
-
-## get port of whois
-sub get_whois_port 
-{
-    local ($name, $aliases, $port, $proto) = getservbyname ("whois", "tcp");
-    return ($port, $proto);
-}
-
-## whois lookup
-sub whois 
-{
-    local ($query) = @_;
-    local ($port, $proto) = &get_whois_port;
-    local (@result);
-
-    if ($whois_host=~ /^\s*\d+\.\d+\.\d+\.\d+\s*$/) {
-       $address = pack ("C4",split(/\./,$host));
-    } else {
-       $address = (gethostbyname ($whois_host))[4];
-    }
-
-    socket (SOCKET, PF_INET, SOCK_STREAM, $proto);
-
-    if (connect (SOCKET, sockaddr_in ($port, $address))) {
-        local ($oldhandle) = select (SOCKET);
-        $| = 1;
-        select($oldhandle);
-
-        print SOCKET "$query\r\n";
-
-        @result = <SOCKET>;
-        return @result;
-    }
-}
-
-##
-sub alarm_mail 
-{
-    local ($prefix, $origin, @result) = @_;
-
-    open (MAIL, "|$mailer -t $mail_address") || die "can't open $mailer";
-    
-    print MAIL "From: root\@rr1.jpix.ad.jp\n";
-    print MAIL "Subject: RR $origin $prefix\n";
-    print MAIL "MIME-Version: 1.0\n";
-    print MAIL "Content-Type: text/plain; charset=us-ascii \n\n";
-    print MAIL "RR Lookup Error Report\n";
-    print MAIL "======================\n";
-    print MAIL "Announced route : $prefix from $origin\n\n";
-    print MAIL "@result";
-    close MAIL;
-}

+ 0 - 123
tools/rrlookup.pl

@@ -1,123 +0,0 @@
-#!/usr/bin/env perl
-##
-## Read BGPd logfile and lookup RR's whois database.
-##
-##   Copyright (c) 1997 Kunihiro Ishiguro
-##
-use Socket;
-
-## Configuration variables
-$whois_host = "whois.jpix.ad.jp";
-
-#$mail_address = "toshio\@iri.co.jp";
-$mail_address = "kunihiro\@zebra.org";
-$mailer = "/usr/sbin/sendmail -oi";
-
-#$logfile = "/usr/local/sbin/logfile"
-$logfile = "logfile";
-$lookuplog = "lookuplog";
-
-## mail routine
-{
-    local ($prefix, $origin);
-
-    open (LOG, $logfile) || die "can't open $logfile";
-    open (LOOKUP, ">$lookuplog") || die "can't open $lookuplog";
-    
-    for (;;) {
-    while (<LOG>) {
-        if (/Update\S+ ([\d\.\/]+) .* (\d+) [ie\?]/) {
-            $prefix = $1;
-            $origin = $2;
-            $ret = &whois_check ($prefix, $origin);
-            if ($ret) {
-                print LOOKUP "$prefix AS$origin : Check OK\n";
-            } else {
-                print LOOKUP "$prefix AS$origin : Error\n";
-            }
-#        fflush (LOOKUP);
-        }
-    }
-    sleep (3);
-    }
-}
-
-sub whois_check
-{
-    local ($prefix, $origin) = @_;
-    local ($rr_prefix, $rr_origin) = ();
-    local (@result);
-
-    $origin = "AS" . $origin;
-
-#    print "$prefix $origin\n";
-
-    @result = &whois ($prefix);
-
-    foreach (@result) {
-        if (/^route:.*\s([\d\.\/]+)$/) {
-            $rr_prefix = $1;
-        }
-        if (/^origin:.*\s(AS[\d]+)$/) {
-            $rr_origin = $1;
-
-            if ($prefix eq $rr_prefix and $origin eq $rr_origin) {
-                return 1;
-            }
-        }
-    }
-    alarm_mail ($prefix, $origin, @result);
-    return 0;
-}
-
-## get port of whois
-sub get_whois_port 
-{
-    local ($name, $aliases, $port, $proto) = getservbyname ("whois", "tcp");
-    return ($port, $proto);
-}
-
-## whois lookup
-sub whois 
-{
-    local ($query) = @_;
-    local ($port, $proto) = &get_whois_port;
-    local (@result);
-
-    if ($whois_host=~ /^\s*\d+\.\d+\.\d+\.\d+\s*$/) {
-       $address = pack ("C4",split(/\./,$host));
-    } else {
-       $address = (gethostbyname ($whois_host))[4];
-    }
-
-    socket (SOCKET, PF_INET, SOCK_STREAM, $proto);
-
-    if (connect (SOCKET, sockaddr_in ($port, $address))) {
-        local ($oldhandle) = select (SOCKET);
-        $| = 1;
-        select($oldhandle);
-
-        print SOCKET "$query\r\n";
-
-        @result = <SOCKET>;
-        return @result;
-    }
-}
-
-##
-sub alarm_mail 
-{
-    local ($prefix, $origin, @result) = @_;
-
-    open (MAIL, "|$mailer -t $mail_address") || die "can't open $mailer";
-    
-    print MAIL "From: root\@rr1.jpix.ad.jp\n";
-    print MAIL "Subject: RR $origin $prefix\n";
-    print MAIL "MIME-Version: 1.0\n";
-    print MAIL "Content-Type: text/plain; charset=us-ascii \n\n";
-    print MAIL "RR Lookup Error Report\n";
-    print MAIL "======================\n";
-    print MAIL "Announced route : $prefix from $origin\n\n";
-    print MAIL "@result";
-    close MAIL;
-}

+ 0 - 111
tools/zc.pl

@@ -1,111 +0,0 @@
-#!/usr/bin/env perl
-##
-## Zebra interactive console
-## Copyright (C) 2000 Vladimir B. Grebenschikov <vova@express.ru>
-##
-## This file is part of GNU Zebra.
-##
-## GNU Zebra is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by the
-## Free Software Foundation; either version 2, or (at your option) any
-## later version.
-##
-## GNU Zebra is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with GNU Zebra; see the file COPYING.  If not, write to the
-## Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-## Boston, MA 02111-1307, USA.
-
-use Net::Telnet ();
-use Getopt::Std;
-
-#use strict;
-
-my $host = `hostname -s`; $host =~ s/\s//g;
-my $port = 'zebra';
-my $server = 'localhost';
-
-# Check arguments
-&getopts ('l:e:czborh');
-
-&usage () if $opt_h;
-
-# main 
-{
-  my $login_pass = $opt_l || $ENV{ZEBRA_PASSWORD} || 'zebra';
-  my $enable_pass = $opt_e || $ENV{ZEBRA_ENABLE} || '';
-
-  my $port = ($opt_z ? 'zebra' : 0) ||
-	     ($opt_b ? 'bgpd' : 0) ||
-             ($opt_o ? 'ospfd' : 0) ||
-	     ($opt_r ? 'ripd' : 0) || 'zebra';
-
-  my $cmd = join (' ', @ARGV);
-
-  my $t = new Net::Telnet (Timeout => 10,
-			   Prompt  => '/[\>\#] $/',
-			   Port    => $port);
-
-  $t->open ($server);
-
-  $t->cmd ($login_pass);
-  if ($enable_pass) {
-      $t->cmd (String => 'en',
-	       Prompt => '/Password: /');
-      $t->cmd ($enable_pass);
-  }
-  $t->cmd ('conf t') if "$opt_c";
-
-  if ($cmd)
-    {
-      docmd ($t, $cmd);
-      exit (0); 
-    }
-
-  my $prompt = sprintf ("%s%s# ", $host,
-			($port eq 'zebra') ? '' : "/$port");
-
-  print "\nZEBRA interactive console ($port)\n\n" if -t STDIN;
-
-  while (1)
-    {
-      $| = 1;
-      print $prompt if -t STDIN;
-      chomp ($cmd = <>);
-      if (!defined ($cmd))
-        {
-	  print "\n" if -t STDIN;
-	  exit(0);
-        }
-      exit (0) if ($cmd eq 'q' || $cmd eq 'quit');
- 
-      docmd ($t, $cmd) if $cmd !~ /^\s*$/;
-    }
-
-  exit(0);
-}
-
-sub docmd
-{
-  my ($t, $cmd) = @_;
-  my @lines = $t->cmd ($cmd);
-  print join ('', grep (!/[\>\#] $/, @lines)), "\n";
-}
-
-sub usage
-{
-  print "USAGE: $0 [-l LOGIN_PASSWORD] [-e ENABLE_PASSWORD] [-z|-b|-o|-r|-h] [<cmd>]\n",
-        "\t-l - specify login password\n",
-        "\t-e - specify enable password\n",
-        "\t-c - execute command in configure mode\n",
-        "\t-z - connect to zebra daemon\n",
-        "\t-b - connect to bgpd  daemon\n",
-        "\t-o - connect to ospfd daemon\n",
-        "\t-r - connect to ripd  daemon\n",
-        "\t-h - help\n";
-  exit (1);
-}