From owner-freebsd-ports-bugs@FreeBSD.ORG Sat May 17 14:10:02 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 160871065674 for ; Sat, 17 May 2008 14:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E1C5D8FC15 for ; Sat, 17 May 2008 14:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4HEA1mM012648 for ; Sat, 17 May 2008 14:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4HEA150012647; Sat, 17 May 2008 14:10:01 GMT (envelope-from gnats) Resent-Date: Sat, 17 May 2008 14:10:01 GMT Resent-Message-Id: <200805171410.m4HEA150012647@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Janos Mohacsi Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2B3106567E for ; Sat, 17 May 2008 14:01:37 +0000 (UTC) (envelope-from mohacsi@csoki.ki.iif.hu) Received: from csoki.ki.iif.hu (csoki.ki.iif.hu [IPv6:2001:738:0:401::3]) by mx1.freebsd.org (Postfix) with ESMTP id E88BF8FC16 for ; Sat, 17 May 2008 14:01:35 +0000 (UTC) (envelope-from mohacsi@csoki.ki.iif.hu) Received: from csoki.ki.iif.hu (localhost [127.0.0.1]) by csoki.ki.iif.hu (8.14.2/8.14.2) with ESMTP id m4HE1XRQ085015 for ; Sat, 17 May 2008 16:01:33 +0200 (CEST) (envelope-from mohacsi@csoki.ki.iif.hu) Received: (from mohacsi@localhost) by csoki.ki.iif.hu (8.14.2/8.14.2/Submit) id m4HE1WoY085014; Sat, 17 May 2008 16:01:32 +0200 (CEST) (envelope-from mohacsi) Message-Id: <200805171401.m4HE1WoY085014@csoki.ki.iif.hu> Date: Sat, 17 May 2008 16:01:32 +0200 (CEST) From: Janos Mohacsi To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/123764: [MAINTAINER UPDATE] net-mgmt/aspathtree: [clean up] X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2008 14:10:02 -0000 >Number: 123764 >Category: ports >Synopsis: [MAINTAINER UPDATE] net-mgmt/aspathtree: [clean up] >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat May 17 14:10:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Janos Mohacsi >Release: FreeBSD 6.3-PRERELEASE i386 >Organization: NIIF/HUNGARNET >Environment: System: FreeBSD csoki.ki.iif.hu 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #4: Fri Jan 18 12:13:09 CET 2008 >Description: [DESCRIBE CHANGES] - clean up: remove old terminology and disable 6Bone specific code Added file(s): - files/patch-lib_ASmain.pl - files/patch-lib_bgp-tree.pl - files/patch-lib_create-homepage.pl - files/patch-lib_elaborate-aspaths.pl - files/patch-lib_ipv6prefix.pl - files/patch-lib_odd-routes.pl - files/patch-lib_route-stability.pl - files/patch-lib_utility.pl Generated with FreeBSD Port Tools 0.77 >How-To-Repeat: >Fix: --- aspathtree-4.2_3.patch begins here --- diff -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/Makefile /usr/ports/net-mgmt/aspathtree/Makefile --- /usr/ports/net-mgmt/aspathtree.orig/Makefile 2006-11-12 20:19:04.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/Makefile 2008-05-17 15:59:12.000000000 +0200 @@ -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 -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-etc::ASpath-tree.config /usr/ports/net-mgmt/aspathtree/files/patch-etc::ASpath-tree.config --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-etc::ASpath-tree.config 2005-04-24 15:34:46.000000000 +0200 +++ /usr/ports/net-mgmt/aspathtree/files/patch-etc::ASpath-tree.config 2008-05-07 21:28:01.000000000 +0200 @@ -1,5 +1,5 @@ -$FreeBSD: ports/net-mgmt/aspathtree/files/patch-etc::ASpath-tree.config,v 1.2 2005/04/24 13:34:46 pav Exp $ +$FreeBSD$ --- etc/ASpath-tree.config.orig +++ etc/ASpath-tree.config @@ -8,7 +8,7 @@ # 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 -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_ASmain.pl /usr/ports/net-mgmt/aspathtree/files/patch-lib_ASmain.pl --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_ASmain.pl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/files/patch-lib_ASmain.pl 2008-05-07 20:31:55.000000000 +0200 @@ -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 -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_bgp-tree.pl /usr/ports/net-mgmt/aspathtree/files/patch-lib_bgp-tree.pl --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_bgp-tree.pl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/files/patch-lib_bgp-tree.pl 2008-05-13 16:12:58.000000000 +0200 @@ -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: "2001" routes"; ++ $title = "IPv6 BGP table: the routes"; + } + + open(HTMLFILE,">".$output_file); +@@ -215,8 +215,8 @@ + print HTMLFILE " $lastchange on the tree detected on $printable_date

\n"; + } + print HTMLFILE " +- The IPv6 BGP routing tree for the "2001" 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 ++ 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.
+ A link to detailed routing information is available at the end of each branch + of the tree.
+@@ -268,7 +268,7 @@ + print HTMLDETAILS "\n"; + print HTMLDETAILS " Assigned to \n"; + print HTMLDETAILS "\n"; +- print HTMLDETAILS " xTLA owner \n"; ++ print HTMLDETAILS " IPv6 owner \n"; + print HTMLDETAILS "\n"; + print HTMLDETAILS "Time (updates)
 since last change \n"; + print HTMLDETAILS "\n"; diff -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_create-homepage.pl /usr/ports/net-mgmt/aspathtree/files/patch-lib_create-homepage.pl --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_create-homepage.pl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/files/patch-lib_create-homepage.pl 2008-05-13 16:00:35.000000000 +0200 @@ -0,0 +1,55 @@ + +$FreeBSD$ + +--- lib/create-homepage.pl.orig ++++ lib/create-homepage.pl +@@ -149,17 +149,16 @@ + Graphic display of: + \n"; + + if ($$inumelab{N_6to4}) {$sixto4link = "
  • the 6to4 prefix"} + + print OUT_FILE " Prefix analysis(*):
    +
      +-
    • $$inumelab{N_ptlas} 6Bone pTLAs +
    • $$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 @@ +
        +
      • $$inumelab{N_invalid} invalid prefixes (out of allocated public address space)
      • +
      • $$inumelab{N_unaggr} unaggregated prefixes, sorted by origin AS +- and by xTLA owner
      • \n"; ++ and by IPv6 allocation owner\n"; + if ($$inumelab{N_longer6to4}) { + print OUT_FILE "
      • $$inumelab{N_longer6to4} 6to4 longer prefixes
      • \n"; + } +@@ -182,8 +181,7 @@ + print OUT_FILE " Routing stability analysis + during the last 24 hours for:
        + + + +@@ -249,7 +247,7 @@ + sub footer { + my $footer = "This page has been produced using the + ASpath-tree tool ($VER), +- developed at Telecom Italia Lab (formerly CSELT).
        ++ developed at Telecom Italia Lab (formerly CSELT). and NIIF
        + Questions and comments to: $CONTACTNAME\n"; + return($footer); + } diff -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_elaborate-aspaths.pl /usr/ports/net-mgmt/aspathtree/files/patch-lib_elaborate-aspaths.pl --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_elaborate-aspaths.pl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/files/patch-lib_elaborate-aspaths.pl 2008-05-13 16:29:03.000000000 +0200 @@ -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 -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_ipv6prefix.pl /usr/ports/net-mgmt/aspathtree/files/patch-lib_ipv6prefix.pl --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_ipv6prefix.pl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/files/patch-lib_ipv6prefix.pl 2008-05-13 16:32:08.000000000 +0200 @@ -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 -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_odd-routes.pl /usr/ports/net-mgmt/aspathtree/files/patch-lib_odd-routes.pl --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_odd-routes.pl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/files/patch-lib_odd-routes.pl 2008-05-07 20:51:42.000000000 +0200 @@ -0,0 +1,24 @@ + +$FreeBSD$ + +--- lib/odd-routes.pl.orig ++++ lib/odd-routes.pl +@@ -308,14 +308,12 @@ + print HTMLFILE " +
        \n + This pages display all the anomalous IPv6 BGP prefixes (according to RFC2546 - "IPv6 routing Practice") +- 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: +
          \n +
        • Invalid prefixes: prefixes outside of the IANA assigned address spaces +- (e.g. the old RFC1897 test addresses)\n +-
        • Unaggregated prefixes: 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"s delegations but longer than assigned sTLAs.\n ++ (e.g. the old RFC1897 test addresses, 6Bone addresses)\n ++
        • Unaggregated prefixes: ++ prefixes belonging to the RIR"s delegations but longer than assigned allocation.\n +
        +
        \n".&footer." + \n\n\n"; diff -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_route-stability.pl /usr/ports/net-mgmt/aspathtree/files/patch-lib_route-stability.pl --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_route-stability.pl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/files/patch-lib_route-stability.pl 2008-05-13 16:01:53.000000000 +0200 @@ -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 @@ + \n +

        Back to routing information page

        \n +


        \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.
        + 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 +
      • Unavailability: the ratio between the number of times the route + was not present and the number of snapshots in the last 24 hours
      +- Clicking on \"view\" for each sTLA you can get more detailed information about routing stability ++ Clicking on \"view\" for each IPv6 prefix you can get more detailed information about routing stability + in the last 24 hours. + "; + } diff -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_utility.pl /usr/ports/net-mgmt/aspathtree/files/patch-lib_utility.pl --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-lib_utility.pl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/aspathtree/files/patch-lib_utility.pl 2008-05-07 21:23:34.000000000 +0200 @@ -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 () { ++ 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 () { ++ 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 () { ++ 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 -ruN --exclude=CVS /usr/ports/net-mgmt/aspathtree.orig/files/patch-update-rtree /usr/ports/net-mgmt/aspathtree/files/patch-update-rtree --- /usr/ports/net-mgmt/aspathtree.orig/files/patch-update-rtree 2003-04-27 03:34:15.000000000 +0200 +++ /usr/ports/net-mgmt/aspathtree/files/patch-update-rtree 2008-05-13 15:57:36.000000000 +0200 @@ -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"; + } --- aspathtree-4.2_3.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: