aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/aspathtree
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2008-05-18 14:00:51 +0000
committerMartin Wilke <miwi@FreeBSD.org>2008-05-18 14:00:51 +0000
commite1840655aaa0311605e47109d6f019140c63d699 (patch)
tree62f117d81bc66c789ad7eac02d117b050c64fa9d /net-mgmt/aspathtree
parentc5d67c45c5caff8b7defad1f20ee02c53397156b (diff)
downloadports-e1840655aaa0311605e47109d6f019140c63d699.tar.gz
ports-e1840655aaa0311605e47109d6f019140c63d699.zip
Notes
Diffstat (limited to 'net-mgmt/aspathtree')
-rw-r--r--net-mgmt/aspathtree/Makefile4
-rw-r--r--net-mgmt/aspathtree/files/patch-etc::ASpath-tree.config2
-rw-r--r--net-mgmt/aspathtree/files/patch-lib_ASmain.pl43
-rw-r--r--net-mgmt/aspathtree/files/patch-lib_bgp-tree.pl34
-rw-r--r--net-mgmt/aspathtree/files/patch-lib_create-homepage.pl55
-rw-r--r--net-mgmt/aspathtree/files/patch-lib_elaborate-aspaths.pl23
-rw-r--r--net-mgmt/aspathtree/files/patch-lib_ipv6prefix.pl107
-rw-r--r--net-mgmt/aspathtree/files/patch-lib_odd-routes.pl24
-rw-r--r--net-mgmt/aspathtree/files/patch-lib_route-stability.pl32
-rw-r--r--net-mgmt/aspathtree/files/patch-lib_utility.pl114
-rw-r--r--net-mgmt/aspathtree/files/patch-update-rtree61
11 files changed, 485 insertions, 14 deletions
diff --git a/net-mgmt/aspathtree/Makefile b/net-mgmt/aspathtree/Makefile
index c13b819aabaf..9bc7d694997e 100644
--- a/net-mgmt/aspathtree/Makefile
+++ b/net-mgmt/aspathtree/Makefile
@@ -6,12 +6,12 @@
PORTNAME= aspathtree
PORTVERSION= 4.2
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net-mgmt ipv6
MASTER_SITES= http://ipv6.niif.hu/~mohacsi/downloads/
DISTNAME= ASpath-tree-v${PORTVERSION}
-MAINTAINER= Janos.Mohacsi@bsd.hu
+MAINTAINER= janos.mohacsi@bsd.hu
COMMENT= Checks IPv6 routes' stability and correctness on IPv6 internet
RUN_DEPENDS= ${SITE_PERL}/Net/Telnet.pm:${PORTSDIR}/net/p5-Net-Telnet \
diff --git a/net-mgmt/aspathtree/files/patch-etc::ASpath-tree.config b/net-mgmt/aspathtree/files/patch-etc::ASpath-tree.config
index e3ec5ce9f82f..bbaa80f191ab 100644
--- a/net-mgmt/aspathtree/files/patch-etc::ASpath-tree.config
+++ b/net-mgmt/aspathtree/files/patch-etc::ASpath-tree.config
@@ -8,7 +8,7 @@ $FreeBSD$
# scripts. It is the directory where the script create-bgp-pages is
# located
-HOMEDIR = /usr/local/ASpath-tree-v4.2
-+HOMEDIR = %%PREFIX%%/var/aspathree/
++HOMEDIR = %%PREFIX%%/var/aspathtree/
# Router you are using. Currently supported platforms include Cisco, Juniper
# and Zebra routers. Allowed values are "CISCO", "JUNIPER" , "ZEBRA" and
diff --git a/net-mgmt/aspathtree/files/patch-lib_ASmain.pl b/net-mgmt/aspathtree/files/patch-lib_ASmain.pl
new file mode 100644
index 000000000000..cf1f665503c4
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib_ASmain.pl
@@ -0,0 +1,43 @@
+
+$FreeBSD$
+
+--- lib/ASmain.pl.orig
++++ lib/ASmain.pl
+@@ -41,20 +41,20 @@
+ # Create the whole IPv6 BGP ASpath tree
+ my $lastchange_time = &check_update_changes(0);
+ &create_html_tree(0, $lastchange_time);
+- if ($MORETREES) {
++# if ($MORETREES) {
+ # Create the IPv6 BGP ASpath tree for the 6Bone backbone
+- $lastchange_time = &check_update_changes(1);
+- &create_html_tree(1, $lastchange_time);
++# $lastchange_time = &check_update_changes(1);
++# &create_html_tree(1, $lastchange_time);
+
+ # Create the IPv6 BGP ASpath tree for the other IANA assigned prefixes
+- $lastchange_time = &check_update_changes(3);
+- &create_html_tree(3, $lastchange_time);
+- }
++# $lastchange_time = &check_update_changes(3);
++# &create_html_tree(3, $lastchange_time);
++# }
+ &log_it(" Tree page(s): done",1);
+ # Create routes stability pages
+ # for the 6bone backbone
+- &create_stability_page("$HTMLDIR_LOCAL/ptla-stability.html", "ptla");
+- &log_it(" bb stability page: done",1);
++# &create_stability_page("$HTMLDIR_LOCAL/ptla-stability.html", "ptla");
++# &log_it(" bb stability page: done",1);
+ # for the other IANA assigned prefixes
+ &create_stability_page("$HTMLDIR_LOCAL/200x-stability.html", "stla");
+ &log_it(" IANA stability page: done",1);
+@@ -113,7 +113,7 @@
+ system "cp $HTMLDIR_LOCAL/odd-routes*.html $HTMLDIR/";
+ system "cp $HTMLDIR_LOCAL/odd-asnumbers*.html $HTMLDIR/";
+ system "cp $HTMLDIR_LOCAL/200x-stability.html $HTMLDIR";
+- system "cp $HTMLDIR_LOCAL/ptla-stability.html $HTMLDIR";
++# system "cp $HTMLDIR_LOCAL/ptla-stability.html $HTMLDIR";
+
+ system "cp $HTMLDIR_LOCAL/$INDEXPAGE $HTMLDIR/$INDEXPAGE";
+ &log_it(" Done!",1);
diff --git a/net-mgmt/aspathtree/files/patch-lib_bgp-tree.pl b/net-mgmt/aspathtree/files/patch-lib_bgp-tree.pl
new file mode 100644
index 000000000000..62b2ac03fa72
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib_bgp-tree.pl
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- lib/bgp-tree.pl.orig
++++ lib/bgp-tree.pl
+@@ -131,7 +131,7 @@
+ }
+ elsif ($tree_type == 3) { # otherIANA
+ $output_file = $OUTPUTIANA;
+- $title = "IPv6 BGP table: &quot;2001&quot; routes";
++ $title = "IPv6 BGP table: the routes";
+ }
+
+ open(HTMLFILE,">".$output_file);
+@@ -215,8 +215,8 @@
+ print HTMLFILE " <SPAN CLASS=n12>$lastchange on the tree detected on $printable_date</SPAN><BR><HR>\n";
+ }
+ print HTMLFILE "
+- <SPAN CLASS=n10>The IPv6 BGP routing tree for the &quot;2001&quot; routes (route entries containing prefixes assigned by the RIRs
+- within the 2001::/16 address space and prefix length in range [29,35]) is obtained elaborating the AS path
++ <SPAN CLASS=n10>The IPv6 BGP routing tree for route entries containing prefixes assigned by the RIRs
++ and prefix length in range [19,32]) is obtained elaborating the AS path
+ information of the IPv6 BGP routing table.<BR>
+ A link to detailed routing information is available at the end of each branch
+ of the tree.<BR>
+@@ -268,7 +268,7 @@
+ print HTMLDETAILS "<TD BGCOLOR=\"$LINESDETTABLECOLOR\"><IMG SRC=\"../../$ICONS/p.gif\"></TD>\n";
+ print HTMLDETAILS "<TD ALIGN=center CLASS=n10b>&nbsp;Assigned to&nbsp;</TD>\n";
+ print HTMLDETAILS "<TD BGCOLOR=\"$LINESDETTABLECOLOR\"><IMG SRC=\"../../$ICONS/p.gif\"></TD>\n";
+- print HTMLDETAILS "<TD ALIGN=center CLASS=n10b>&nbsp;xTLA owner&nbsp;</TD>\n";
++ print HTMLDETAILS "<TD ALIGN=center CLASS=n10b>&nbsp;IPv6 owner&nbsp;</TD>\n";
+ print HTMLDETAILS "<TD BGCOLOR=\"$LINESDETTABLECOLOR\"><IMG SRC=\"../../$ICONS/p.gif\"></TD>\n";
+ print HTMLDETAILS "<TD ALIGN=center CLASS=n10b>Time&nbsp;(updates)<BR>&nbsp;since last change&nbsp;</TD>\n";
+ print HTMLDETAILS "<TD BGCOLOR=\"$LINESDETTABLECOLOR\"><IMG SRC=\"../../$ICONS/p.gif\"></TD>\n";
diff --git a/net-mgmt/aspathtree/files/patch-lib_create-homepage.pl b/net-mgmt/aspathtree/files/patch-lib_create-homepage.pl
new file mode 100644
index 000000000000..83258faf5da5
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib_create-homepage.pl
@@ -0,0 +1,55 @@
+
+$FreeBSD$
+
+--- lib/create-homepage.pl.orig
++++ lib/create-homepage.pl
+@@ -149,17 +149,16 @@
+ <SPAN CLASS=a18b>Graphic display</SPAN> of:
+ <UL>
+ <LI><A HREF=\"bgp-page-complete.html\" CLASS=l12b>all route entries within the IPv6 BGP cloud</A><BR>\n";
+- if ($MORETREES) {
+- print OUT_FILE " <LI><A HREF=\"bgp-page-backbone.html\" CLASS=l12b>the 6Bone backbone BGP tree</A><BR>
+- <LI><A HREF=\"bgp-page-otherIANA.html\" CLASS=l12b>the BGP tree for prefixes assigned by the RIRs</A>\n";
+- }
++# if ($MORETREES) {
++# print OUT_FILE " <LI><A HREF=\"bgp-page-backbone.html\" CLASS=l12b>the 6Bone backbone BGP tree</A><BR>
++# <LI><A HREF=\"bgp-page-otherIANA.html\" CLASS=l12b>the BGP tree for prefixes assigned by the RIRs</A>\n";
++# }
+ print OUT_FILE " </UL>\n";
+
+ if ($$inumelab{N_6to4}) {$sixto4link = "<LI>the 6to4 prefix"}
+
+ print OUT_FILE " <SPAN CLASS=a18b>Prefix analysis</SPAN>(*):<BR>
+ <UL>
+- <LI>$$inumelab{N_ptlas} 6Bone pTLAs
+ <LI>$$inumelab{N_otherIANA} prefixes assigned by RIRs (prefix length in range [29,35])
+ $sixto4link\n";
+ if ($$inumelab{N_invalid} || $$inumelab{N_unaggr} || $$inumelab{N_longer6to4}) {
+@@ -167,7 +166,7 @@
+ <UL>
+ <LI TYPE=square>$$inumelab{N_invalid} invalid prefixes (out of allocated public address space)</LI>
+ <LI TYPE=square>$$inumelab{N_unaggr} unaggregated prefixes, sorted <A HREF=\"odd-routes1.html\" CLASS=l12b> by origin AS</A>
+- and <A HREF=\"odd-routes2.html\" CLASS=l12b>by xTLA owner</A></LI>\n";
++ and <A HREF=\"odd-routes2.html\" CLASS=l12b>by IPv6 allocation owner</A></LI>\n";
+ if ($$inumelab{N_longer6to4}) {
+ print OUT_FILE " <LI TYPE=square>$$inumelab{N_longer6to4} <A HREF=\"odd-routes3.html\" CLASS=l12b>6to4 longer prefixes</A></LI>\n";
+ }
+@@ -182,8 +181,7 @@
+ print OUT_FILE " <SPAN CLASS=a18b>Routing stability analysis</SPAN>
+ during the last 24 hours for:<BR>
+ <UL>
+- <LI><A HREF=\"ptla-stability.html\" CLASS=l12b>all the 6Bone pTLAs</A><BR>
+- <LI><A HREF=\"200x-stability.html\" CLASS=l12b>the sTLAs assigned by the RIRs</A>
++ <LI><A HREF=\"200x-stability.html\" CLASS=l12b>the IPv6 adresses assigned by the RIRs</A>
+ </UL>
+ </TD></TR>
+ </TABLE>
+@@ -249,7 +247,7 @@
+ sub footer {
+ my $footer = "This page has been produced using the
+ <A HREF=\"http://carmen.ipv6.tilab.com/ipv6/tools/ASpath-tree/index.html\">ASpath-tree</A> tool ($VER),
+- developed at <A HREF=\"http://www.telecomitalialab.com\">Telecom Italia Lab</A> (formerly CSELT).<BR>
++ developed at <A HREF=\"http://www.telecomitalialab.com\">Telecom Italia Lab</A> (formerly CSELT). and NIIF<BR>
+ Questions and comments to: <A HREF=\"mailto:$CONTACTMAIL\">$CONTACTNAME</A>\n";
+ return($footer);
+ }
diff --git a/net-mgmt/aspathtree/files/patch-lib_elaborate-aspaths.pl b/net-mgmt/aspathtree/files/patch-lib_elaborate-aspaths.pl
new file mode 100644
index 000000000000..3c65ec5834e3
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib_elaborate-aspaths.pl
@@ -0,0 +1,23 @@
+
+$FreeBSD$
+
+--- lib/elaborate-aspaths.pl.orig
++++ lib/elaborate-aspaths.pl
+@@ -364,7 +364,7 @@
+ if ($value1 > 64511 && $value1 < 65535) {
+ push (@asspriv,$value1);
+ push (@{$paths_withasspriv{$value1}}, $key);
+- } elsif ($value1 == 65535 || ($value1 > 32767 && $value1 < 64512)) {
++ } elsif ($value1 == 65535 ) {
+ push (@assreserved,$value1);
+ push (@{$paths_withassreserved{$value1}}, $key);
+ }
+@@ -386,7 +386,7 @@
+ if ($value > 64511 && $value < 65535) {
+ push (@asspriv,$value);
+ push (@{$paths_withasspriv{$value}}, $key);
+- } elsif ($value == 65535 || ($value > 32767 && $value < 64512)) {
++ } elsif ($value == 65535 ) {
+ push (@assreserved,$value);
+ push (@{$paths_withassreserved{$value}}, $key);
+ }
diff --git a/net-mgmt/aspathtree/files/patch-lib_ipv6prefix.pl b/net-mgmt/aspathtree/files/patch-lib_ipv6prefix.pl
new file mode 100644
index 000000000000..cb8c8cfa44d5
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib_ipv6prefix.pl
@@ -0,0 +1,107 @@
+
+$FreeBSD$
+
+--- lib/ipv6prefix.pl.orig
++++ lib/ipv6prefix.pl
+@@ -12,8 +12,101 @@
+ # output = 4 stands for the 6to4 prefix
+ # output = 5 stands for 6to4 prefixes longer than /16
+ #
++
++use strict;
++
++# Order matters! Less specific prefixes first.
++my @prefix_list = (
++# prefix => min_lenght, max_len, valid_code, unaggr_code
++ [ '3FFE::/16' => 24, 32, 0, 0 ],
++ [ '2001::/3' => 19, 32, 3, 2 ],
++ [ '2001:0478::/32' => 40, 48, 3, 2 ], # ep.net IX assignments
++ [ '2001:0500::/30' => 48, 48, 3, 2 ], # ARIN microallocations
++ [ '2001:07F8::/32' => 48, 48, 3, 2 ], # RIPE IX assignments
++ [ '2001:0678::/29' => 48, 48, 3, 2 ],
++ [ '2001:0c00::/23' => 48, 48, 3, 2 ],
++ [ '2001:13c7:6000::/36' => 36, 48, 3, 2 ],
++ [ '2001:13c7:7000::/36' => 36, 48, 3, 2 ],
++ [ '2001:43f8::/29' => 40, 48, 3, 2 ],
++ [ '2002::/16' => 16, 16, 4, 5 ],
++);
++
+ sub check_prefix {
+ my ($prefix) = @_;
++
++ my ($net, $len) = split(m#/#, $prefix);
++ my $return = 0;
++ foreach my $pref (@prefix_list) {
++ next unless $len >= $pref->[1];
++ next unless includedprefix($prefix, $pref->[0]);
++ if ($len > $pref->[2]) {
++ $return = $pref->[4];
++ } else {
++ $return = $pref->[3];
++ }
++ }
++
++ return $return;
++}
++
++# Tell whether first arg is contained in second.
++sub includedprefix {
++ use integer;
++
++ my ($a1, $l1) = split(m#/#, $_[0]);
++ my ($a2, $l2) = split(m#/#, $_[1]);
++
++ return 0 if $l1 < $l2;
++
++ my @a1 = expand($a1);
++ my @a2 = expand($a2);
++
++ # Check parts which have to be identical
++ my $end = $l2 / 16;
++ my $i;
++ for ($i = 0; $i < $end; ++$i) {
++ return 0 if hex($a1[$i]) != hex($a2[$i]);
++ }
++
++ # Check last part
++ my $nbits = 16 - $l2 % 16;
++ return 0 if (hex($a1[$i]) >> $nbits) != (hex($a2[$i]) >> $nbits);
++
++ return 1;
++}
++
++# Expand :: and split the different 16-bit address parts
++sub expand {
++ my ($ip) = @_;
++
++ return split(/:/, $ip) if not $ip =~ /::/;
++
++ $ip =~ s/^::/0::/;
++ $ip =~ s/::$/::0/;
++ my ($l, $r) = split(/::/, $ip);
++ my @l = split(/:/, $l);
++ my @r = split(/:/, $r);
++ my @m;
++ for (my $i = 0; $i < 8 - length (@l) - length (@r); ++$i) {
++ push(@m, 0);
++ }
++ return (@l, @m, @r);
++}
++
++sub normal {
++ my ($ip, $len) = split(m#/#, $_[0]);
++
++ my $n = join(':', map { ('0' x (4 - length $_)) . $_ } expand($ip));
++ $n =~ s/(:0000)+/::/;
++ $n =~ s/^0000:::/::/;
++ return "$n/$len";
++}
++
++1;
++
++__END__
++sub OLD_check_prefix {
++ my ($prefix) = @_;
+ my ($normprefix, $addr, $lprefix, $conflprefix, $output, $hexprefix);
+ $normprefix = &normal($prefix);
+ ($addr,$lprefix) = split(/\//,$normprefix);
diff --git a/net-mgmt/aspathtree/files/patch-lib_odd-routes.pl b/net-mgmt/aspathtree/files/patch-lib_odd-routes.pl
new file mode 100644
index 000000000000..d256d15c1804
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib_odd-routes.pl
@@ -0,0 +1,24 @@
+
+$FreeBSD$
+
+--- lib/odd-routes.pl.orig
++++ lib/odd-routes.pl
+@@ -308,14 +308,12 @@
+ print HTMLFILE "
+ <HR>\n
+ This pages display all the anomalous IPv6 BGP prefixes (according to RFC2546 - &quot;IPv6 routing Practice&quot;)
+- currently advertised inside the 6Bone backbone. In particular two kinds of anomalous prefixes are displayed:
++ currently advertised inside the IPv6 backbone. In particular two kinds of anomalous prefixes are displayed:
+ <UL>\n
+ <LI><SPAN CLASS=r10>Invalid prefixes</SPAN>: prefixes outside of the IANA assigned address spaces
+- (e.g. the old RFC1897 test addresses)\n
+- <LI><SPAN CLASS=r10>Unaggregated prefixes</SPAN>: prefixes belonging to the 6Bone range
+- but longer than a given pTLA delegation (according to RFC2546 these
+- prefixes MUST NOT be advertised unless special peering agreements are implemented); prefixes
+- belonging to the RIR&quot;s delegations but longer than assigned sTLAs.\n
++ (e.g. the old RFC1897 test addresses, 6Bone addresses)\n
++ <LI><SPAN CLASS=r10>Unaggregated prefixes</SPAN>:
++ prefixes belonging to the RIR&quot;s delegations but longer than assigned allocation.\n
+ </UL>
+ <HR>\n".&footer."
+ </SPAN>\n</BODY>\n</HTML>\n";
diff --git a/net-mgmt/aspathtree/files/patch-lib_route-stability.pl b/net-mgmt/aspathtree/files/patch-lib_route-stability.pl
new file mode 100644
index 000000000000..4ad22c032785
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib_route-stability.pl
@@ -0,0 +1,32 @@
+
+$FreeBSD$
+
+--- lib/route-stability.pl.orig
++++ lib/route-stability.pl
+@@ -10,7 +10,7 @@
+ my ($ptlaprefix, $viewlink, $unstab, $unav, $key, $name, $title, $history_reldir);
+
+ if ($type eq "ptla") {$title = "6bone pTLAs: BGP route stability"}
+- elsif ($type eq "stla") {$title = "sTLAs: BGP route stability"}
++ elsif ($type eq "stla") {$title = "IPv6: BGP route stability"}
+ else {return(1)}
+
+ $history_reldir = substr($HISTORYHTMLDIR, length($HTMLDIR_LOCAL) + 1, length($HISTORYHTMLDIR) - length($HTMLDIR_LOCAL));
+@@ -120,7 +120,7 @@
+ </TABLE></CENTER>\n
+ <P><SPAN CLASS=n10><A HREF=\"./$INDEXPAGE\">Back to routing information page</A><P>\n
+ <HR>\n
+- This page displays all the locally known sTLAs that are advertised inside the 6Bone backbone.
++ This page displays all the locally known allocations that are advertised inside the IPv6 backbone.
+ For each IPv6 BGP route entry, figures representing instability and unavailability of are provided.
+ Ruote entries are sorted starting from the most unstable route entry.<BR>
+ These figures are calculated based on periodical snapshots of the IPv6 BGP routing table as follows:
+@@ -128,7 +128,7 @@
+ was a detection of AS Path changes for the specific route and the number of snapshots in the last 24 hours
+ <LI><SPAN CLASS=r10>Unavailability</SPAN>: the ratio between the number of times the route
+ was not present and the number of snapshots in the last 24 hours</UL>
+- Clicking on \&quot;view\&quot; for each sTLA you can get more detailed information about routing stability
++ Clicking on \&quot;view\&quot; for each IPv6 prefix you can get more detailed information about routing stability
+ in the last 24 hours.
+ ";
+ }
diff --git a/net-mgmt/aspathtree/files/patch-lib_utility.pl b/net-mgmt/aspathtree/files/patch-lib_utility.pl
new file mode 100644
index 000000000000..84c6641b487b
--- /dev/null
+++ b/net-mgmt/aspathtree/files/patch-lib_utility.pl
@@ -0,0 +1,114 @@
+
+$FreeBSD$
+
+--- lib/utility.pl.orig
++++ lib/utility.pl
+@@ -139,10 +139,35 @@
+ return($text);
+ }
+
++my $IPv6PrefixTable;
++
++sub read_prefixtable {
++ my ($file) = @_;
++
++ open(FILE, $file) or die "Cannot open $file: $!";
++ while (<FILE>) {
++ my ($site, @prefixes) = split;
++ foreach my $prefix (@prefixes) {
++ $IPv6PrefixTable->{$prefix} = $site;
++ }
++ }
++ close FILE;
++
++ return $IPv6PrefixTable;
++}
++
+ # Routine to find the owner site name of a prefix
+ sub extract_name_from_prefix {
+ my ($prefix) = @_;
+
++ $IPv6PrefixTable ||= read_prefixtable($IPV6PREFIXTABLE);
++ return $IPv6PrefixTable->{$prefix} || '?';
++}
++
++# Routine to find the owner site name of a prefix
++sub OLD_extract_name_from_prefix {
++ my ($prefix) = @_;
++
+ my ($line, $sitename) = ('', '');
+
+ open(FILE,"<".$IPV6PREFIXTABLE);
+@@ -377,7 +402,7 @@
+ my @outwhois = ();
+ my @coomands = ();
+
+- my $command = "-h whois.ripe.net -s ARIN,RIPE,APNIC -r -T inet6num -M 2001::/16";
++ my $command = "-h whois.ripe.net -s ARIN,RIPE,APNIC -r -T inet6num -M 2001::/3";
+ push (@commands, $command);
+
+ open(WHOISRES,"$RIPEWHOISCLIENT $command |");
+@@ -547,8 +572,63 @@
+ return($ias);
+ }
+
++my ($ASLines, $BBSites);
++
++sub read_astable {
++ my ($file) = @_;
++
++ open(FILE, $file) or die "Cannot open $file: $!";
++ while (<FILE>) {
++ my ($asn, $sites) = split(/\s+/, $_, 2);
++ $asn =~ s/^AS//;
++ $ASLines->{$asn} = $sites;
++ }
++ close FILE;
++
++ return $ASLines;
++}
++
++sub read_ptlafile {
++ my ($file) = @_;
++
++ open(FILE, $file) or die "Cannot open $file: $!";
++ while (<FILE>) {
++ my ($site, $prefix) = split;
++ $BBSites->{$site} = $prefix;
++ }
++ close FILE;
++
++ return $BBSites;
++}
++
+ # Routine to associate the name of the owner organisation to an AS number
+ sub asntosite {
++ my ($asn, $astable, $ptlastable) = @_;
++
++ $ASLines ||= read_astable($astable);
++ $BBSites ||= read_ptlafile($ptlastable);
++
++ my $sites = $ASLines->{$asn};
++ return (-1, ()) if not $sites;
++
++ my @tmp = split(/\s+/, $sites);
++ my @output;
++ my $nbb = 0;
++
++ foreach my $name (@tmp) {
++ if (exists $BBSites->{$name}) {
++ $nbb++;
++ unshift(@output, $name);
++ } else {
++ push(@output, $name);
++ }
++ }
++
++ return ($nbb, @output);
++}
++
++# Routine to associate the name of the owner organisation to an AS number
++sub OLD_asntosite {
+ my ($ASN, $astable, $ptlastable) = @_;
+ my (@aslines, @bb_sites, @output, @tmp);
+ my ($key, $line, $name, $nbb);
diff --git a/net-mgmt/aspathtree/files/patch-update-rtree b/net-mgmt/aspathtree/files/patch-update-rtree
index c0e9fe0c32bb..24b92f854785 100644
--- a/net-mgmt/aspathtree/files/patch-update-rtree
+++ b/net-mgmt/aspathtree/files/patch-update-rtree
@@ -1,5 +1,8 @@
---- update-rtree.orig Thu Apr 17 15:58:12 2003
-+++ update-rtree Sun Apr 27 02:01:49 2003
+
+$FreeBSD$
+
+--- update-rtree.orig
++++ update-rtree
@@ -1,13 +1,13 @@
-#!/usr/local/bin/perl
+#!%%PATHPERLBIN%%
@@ -37,7 +40,7 @@
if ($DEBUG) {open(LOGFILE, "> $LOGDIR/runlog.txt"); close(LOGFILE)}
&log_it_and_die("ERROR in configuration file: parameter SITENAME not set!") unless ($SITENAME);
&log_it_and_die("ERROR in configuration file: parameter ROUTER = \"$ROUTER\" not acceptable!") if ($ROUTER && !grep(/^$ROUTER$/, ("CISCO", "JUNIPER" , "ZEBRA", "ZEBRA93")));
-@@ -134,7 +135,7 @@
+@@ -134,13 +135,13 @@
}
unless ($WHOISLINK) {$WHOISLINK = "http://whois.6bone.net/cgi-bin/whois"}
unless ($DATADIR) {$DATADIR = "$HOMEDIR/data"}
@@ -46,7 +49,14 @@
unless ($FILTEROUT) {$FILTEROUT = 0}
$ICONS = "./icons";
$WARNINGTIME = 5;
-@@ -199,13 +200,13 @@
+ $HISTORYPERIOD = 24;
+ $RIPEWHOISLINK = "http://www.ripe.net/perl/whois?form_type=simple&full_query_string=&searchtext=-s+ARIN%2CAPNIC%2CRIPE";
+- $VER = "v.4.2";
++ $VER = "v.4.2 modif 6NET";
+ $logtext .= " Configuration file: $file.\n";
+ $logtext .= " HOMEDIR = $HOMEDIR\n";
+ $logtext .= " Parser = ";
+@@ -199,28 +200,28 @@
$logtext .= " LASTRUNFILE = \"$LASTRUNFILE\"\n";
$logtext .= " PTLASHISTORYDIR = \"$PTLASHISTORYDIR\" ";
if (-e "$PTLASHISTORYDIR") {$logtext .= "(ok)\n"}
@@ -62,8 +72,11 @@
+ else {mkdir("$HOMEDIR/history/completetree", 0775); $logtext .= "(created)\n"}
$logtext .= " OLDASPATHSFILE = \"$OLDASPATHSFILE\"\n";
$logtext .= " OLDDATEFILE = \"$OLDDATEFILE\"\n";
- if ($MORETREES) {
-@@ -215,12 +216,12 @@
+- if ($MORETREES) {
++ if ($NOMORETREES) {
+ $OLDOTHASPATHSFILE = "$HOMEDIR/history/othertree/aspaths.txt";
+ $OLDOTHDATEFILE = "$HOMEDIR/history/othertree/lastchangedate.txt";
+ $OLDBBASPATHSFILE = "$HOMEDIR/history/bbtree/bbaspaths.txt";
$OLDBBDATEFILE = "$HOMEDIR/history/bbtree/lastchangedate.txt";
$logtext .= " BB tree dir = \"$HOMEDIR/history/bbtree\" ";
if (-e "$HOMEDIR/history/bbtree") {$logtext .= "(ok)\n"}
@@ -78,7 +91,16 @@
$logtext .= " OLDOTHASPATHSFILE = \"$OLDOTHASPATHSFILE\"\n";
$logtext .= " OLDOTHDATEFILE = \"$OLDOTHDATEFILE\"\n";
} else {
-@@ -246,7 +247,7 @@
+@@ -236,7 +237,7 @@
+ $logtext .= " OUTPUTCOMPLETE = \"$OUTPUTCOMPLETE\"\n";
+ $OUTPUTBB = "$HTMLDIR_LOCAL/bgp-page-backbone.html";
+ $OUTPUTIANA = "$HTMLDIR_LOCAL/bgp-page-otherIANA.html";
+- if ($MORETREES) {
++ if ($NOMORETREES) {
+ $logtext .= " OUTPUTBB = \"$OUTPUTBB\"\n";
+ $logtext .= " OUTPUTIANA = \"$OUTPUTIANA\"\n";
+ }
+@@ -246,12 +247,12 @@
$CHANGESDIR = "$HTMLDIR_LOCAL/changes";
$logtext .= " CHANGESDIR = \"$CHANGESDIR\" ";
if (-e "$CHANGESDIR") {$logtext .= "(ok)\n"}
@@ -87,6 +109,12 @@
$OUTPUTCOMPLETECHANGES = "$CHANGESDIR/bgp-page-complete-changes.html";
$logtext .= " OUTPUTCOMPLETECHANGES = \"$OUTPUTCOMPLETECHANGES\"\n";
$OUTPUTBBCHANGES = "$CHANGESDIR/bgp-page-backbone-changes.html";
+ $OUTPUTIANACHANGES = "$CHANGESDIR/bgp-page-otherIANAchanges.html";
+- if ($MORETREES) {
++ if ($NOMORETREES) {
+ $logtext .= " OUTPUTBBCHANGES = \"$OUTPUTBBCHANGES\"\n";
+ $logtext .= " OUTPUTIANACHANGES = \"$OUTPUTIANACHANGES\"\n";
+ }
@@ -260,19 +261,19 @@
$DETAILDIRCO = "$DETAILDIR/complete";
$logtext .= " DETAILDIR = \"$DETAILDIR\" ";
@@ -96,8 +124,9 @@
$logtext .= " DETAILDIRCO = \"$DETAILDIRCO\" ";
if (-e "$DETAILDIRCO") {$logtext .= "(ok)\n"}
- else {mkdir("$DETAILDIRCO", 0777); $logtext .= "(created)\n"}
+- if ($MORETREES) {
+ else {mkdir("$DETAILDIRCO", 0775); $logtext .= "(created)\n"}
- if ($MORETREES) {
++ if ($NOMORETREES) {
$DETAILDIRBB = "$DETAILDIR/backbone";
$DETAILDIRIANA = "$DETAILDIR/otherIANA";
$logtext .= " DETAILDIRBB = \"$DETAILDIRBB\" ";
@@ -128,11 +157,12 @@
if (-d $HTMLDIR) {
- unless (-e "$HTMLDIR/details") {mkdir("$HTMLDIR/details", 0777); $logtext .= " $HTMLDIR/details created.\n"}
- unless (-e "$HTMLDIR/details/complete") {mkdir("$HTMLDIR/details/complete", 0777); $logtext .= " $HTMLDIR/details/complete created.\n"}
-+ unless (-e "$HTMLDIR/details") {mkdir("$HTMLDIR/details", 0775); $logtext .= " $HTMLDIR/details created.\n"}
-+ unless (-e "$HTMLDIR/details/complete") {mkdir("$HTMLDIR/details/complete", 0775); $logtext .= " $HTMLDIR/details/complete created.\n"}
- if ($MORETREES) {
+- if ($MORETREES) {
- unless (-e "$HTMLDIR/details/backbone") {mkdir("$HTMLDIR/details/backbone", 0777); $logtext .= " $HTMLDIR/details/backbone created.\n"}
- unless (-e "$HTMLDIR/details/otherIANA") {mkdir("$HTMLDIR/details/otherIANA", 0777); $logtext .= " $HTMLDIR/details/otherIANA created.\n"}
++ unless (-e "$HTMLDIR/details") {mkdir("$HTMLDIR/details", 0775); $logtext .= " $HTMLDIR/details created.\n"}
++ unless (-e "$HTMLDIR/details/complete") {mkdir("$HTMLDIR/details/complete", 0775); $logtext .= " $HTMLDIR/details/complete created.\n"}
++ if ($NOMORETREES) {
+ unless (-e "$HTMLDIR/details/backbone") {mkdir("$HTMLDIR/details/backbone", 0775); $logtext .= " $HTMLDIR/details/backbone created.\n"}
+ unless (-e "$HTMLDIR/details/otherIANA") {mkdir("$HTMLDIR/details/otherIANA", 0775); $logtext .= " $HTMLDIR/details/otherIANA created.\n"}
} else {
@@ -151,3 +181,12 @@
system("cp $ICONSDIR/* $HTMLDIR/icons");
$logtext .= " $HTMLDIR/icons created and template icons copied.\n";
}
+@@ -312,7 +313,7 @@
+
+ $INDEXPAGE = "bgp.html";
+ $LINKDIR = "details/complete";
+- if ($MORETREES) {
++ if ($NOMORETREES) {
+ $LINKDIRBB = "details/backbone";
+ $LINKDIRIANA = "details/otherIANA";
+ }