summaryrefslogtreecommitdiff
path: root/net-mgmt/aspathtree/files/patch-lib__getbgptable.pl
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/aspathtree/files/patch-lib__getbgptable.pl')
-rw-r--r--net-mgmt/aspathtree/files/patch-lib__getbgptable.pl66
1 files changed, 66 insertions, 0 deletions
diff --git a/net-mgmt/aspathtree/files/patch-lib__getbgptable.pl b/net-mgmt/aspathtree/files/patch-lib__getbgptable.pl
new file mode 100644
index 000000000000..d428d27200d6
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib__getbgptable.pl
@@ -0,0 +1,66 @@
+--- lib/getbgptable.pl.orig Thu Feb 6 11:25:26 2003
++++ lib/getbgptable.pl Thu Feb 6 11:43:58 2003
+@@ -24,10 +24,55 @@
+ # ASs (all the ASs in the router BGP table)
+ # Finally this routine produces a text file containing the raw version of the router table
+ # and if required log files of both the raw router table and the normalized table.
++
++
+ sub get_bgp_table {
+ my ($parser, $command, $line) = ('', '', '');
+ my (@lines) = ();
+
++ use Socket;
++ use Net::Telnet;
++
++ if (defined($ROUTERUSERPASS)) {
++
++# TELNET module to get BGP4+ AS Path table
++
++ if ($ROUTER =~ /^JUNIPER$/i) {
++ $parser = "juniper";
++ $STATUSCODES = "*> active";
++ my $telnet_session = new Net::Telnet(
++ prompt => '/[\w().-]*[\$#]\s*$/'
++ );
++
++ $telnet_session->open($ROUTERADDR);
++ $telnet_session->login($ROUTERUSER, $ROUTERUSERPASS);
++ $telnet_session->cmd(String => "set cli screen-length 0", Timeout => 1800);
++
++ @lines = $telnet_session->cmd(String => "show route table inet6.0 all terse",
++ Timeout => 1800);
++ $telnet_session->close;
++ } else {
++ $ROUTER = "CISCO";
++ $parser = "cisco";
++ $STATUSCODES = "s suppressed, d damped, h history, * valid, > best, r RIB-failure";
++ my $telnet_session = new Net::Telnet(
++ prompt => '/[\w().-]*[\$#]\s*$/'
++ );
++
++ $telnet_session->open($ROUTERADDR);
++ $telnet_session->login($ROUTERUSER, $ROUTERUSERPASS);
++ $telnet_session->cmd(String => "terminal length 0", Timeout => 1800);
++
++ @lines = $telnet_session->cmd(String => "show bgp ipv6",
++ Timeout => 1800);
++ $telnet_session->close;
++ }
++# end TELNET module
++
++ } else {
++
++# RSH module to get BGP4+ AS Path table
++
+ if ($ROUTER =~ /^JUNIPER$/i) {
+ $parser = "juniper";
+ $STATUSCODES = "*> active";
+@@ -58,6 +103,7 @@
+ push(@lines, $_);
+ }
+ close(OUTPUT);
++ }
+ chomp(@lines);
+ # Write log and for web files (raw table)
+ open(TXTFILE,"> $BGPTABLEFILE");