Ignore:
Timestamp:
04/04/06 18:25:28 (18 years ago)
Author:
Kris Deugau
Message:

/trunk

Merge all bugfixes, hacks, tweaks, and miscellaneous updates from
/branches/stable necessary to bring code into line. Aside from
CustID verification and notification bits, /trunk and
/branches/stable should now be identical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/freespace.pl

    r146 r320  
    88# Last update by $Author$
    99###
    10 # Copyright (C) 2004,2005 - Kris Deugau
     10# Copyright (C) 2004-2006 - Kris Deugau
    1111
    1212use DBI;
     
    2020$tnumfree = $bigrfree = $bigufree = 0;
    2121
     22$sql = 'select * from freeblocks where ';
    2223# General counts first
    2324if ($ARGV[0]) {
    24   $sth = $dbh->prepare("select * from freeblocks where maskbits >= $ARGV[0] order by maskbits desc");
    25 } else {
    26   $sth = $dbh->prepare("select * from freeblocks order by maskbits desc");
     25  $sql .= 'maskbits >= $ARGV[0] and ';
    2726}
     27$sql .= "not (cidr <<= '192.168.0.0/16') ".
     28                "and not (cidr <<= '172.16.0.0/12') ".
     29                "and not (cidr <<= '10.0.0.0/8') ";
     30$sql .= "order by maskbits desc";
     31
     32$sth = $dbh->prepare($sql);
    2833$sth->execute;
    2934while (@data = $sth->fetchrow_array) {
     
    3338}
    3439
     40print "Free block counts:\n";
    3541foreach $size (sort {$a cmp $b} keys %numfree) {
    3642  print "/$size: $numfree{$size}\n";
     
    4450}
    4551
     52print "Aggregate free space:\n";
    4653foreach $size (sort {$a cmp $b} keys %numfree) {
    4754  print "/$size: $numfree{$size}\n";
Note: See TracChangeset for help on using the changeset viewer.