Changeset 560
- Timestamp:
- 12/19/12 16:03:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r559 r560 341 341 342 342 foreach (@{$mlist}) { 343 my ($rcnt) = $dbh->selectrow_array("SELECT count(*) FROM routed WHERE cidr <<= ?", undef, ($$_{master})); 343 my ($rcnt) = $dbh->selectrow_array("SELECT count(*) FROM allocations WHERE cidr <<= ? AND type='rm'", 344 undef, ($$_{master})); 344 345 $$_{routed} = $rcnt; 345 my ($acnt) = $dbh->selectrow_array("SELECT count(*) FROM allocations WHERE cidr <<= ?", undef, ($$_{master})); 346 my ($acnt) = $dbh->selectrow_array("SELECT count(*) FROM allocations WHERE cidr <<= ? AND NOT type='rm'", 347 undef, ($$_{master})); 346 348 $$_{allocated} = $acnt; 347 my ($fcnt) = $dbh->selectrow_array("SELECT count(*) FROM freeblocks WHERE cidr <<= ?" .348 " AND (routed='y' OR routed='n')",undef, ($$_{master}));349 my ($fcnt) = $dbh->selectrow_array("SELECT count(*) FROM freeblocks WHERE cidr <<= ?", 350 undef, ($$_{master})); 349 351 $$_{free} = $fcnt; 350 my ($bigfree) = $dbh->selectrow_array("SELECT mask bits FROM freeblocks WHERE cidr <<= ?".351 " AND (routed='y' OR routed='n') ORDER BY maskbits LIMIT 1", undef, ($$_{master}));352 my ($bigfree) = $dbh->selectrow_array("SELECT masklen(cidr) AS maskbits FROM freeblocks WHERE cidr <<= ?". 353 " AND parent = ? ORDER BY masklen(cidr) LIMIT 1", undef, ($$_{master}, $$_{master})); 352 354 ##fixme: should find a way to do this without having to HTMLize the <> 353 355 $bigfree = "/$bigfree" if $bigfree;
Note:
See TracChangeset
for help on using the changeset viewer.