Changeset 856
- Timestamp:
- 04/14/16 18:14:45 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/extras/db2rwhois.pl
r680 r856 73 73 # Also remove the details of our "reserved CORE/WAN" blocks; they're not critical. 74 74 my $ssth = $dbh->prepare(q( 75 SELECT cidr, custid, type, city, description, createstamp, modifystamp, swip76 FROM allocations 75 SELECT a.cidr, a.custid, a.type, a.city, a.description, a.createstamp, a.modifystamp, a.swip, a.custid=t.def_custid AS isdef 76 FROM allocations a JOIN alloctypes t ON a.type=t.type 77 77 WHERE 78 NOT ( cidr <<= '192.168.0.0/16') AND79 NOT ( cidr <<= '172.16.0.0/12') AND80 NOT ( cidr <<= '10.0.0.0/8') AND81 NOT ( type = 'wr' ORtype = 'mm') AND82 ((masklen( cidr) <=30 AND family(cidr)=4) OR (masklen(cidr) <=64 AND family(cidr)=6)) AND83 master_id = ? AND84 cidr <<= ?78 NOT (a.cidr <<= '192.168.0.0/16') AND 79 NOT (a.cidr <<= '172.16.0.0/12') AND 80 NOT (a.cidr <<= '10.0.0.0/8') AND 81 NOT (a.type = 'wr' OR a.type = 'mm') AND 82 ((masklen(a.cidr) <=30 AND family(a.cidr)=4) OR (masklen(a.cidr) <=64 AND family(a.cidr)=6)) AND 83 a.master_id = ? AND 84 a.cidr <<= ? 85 85 ) ); 86 86 … … 217 217 # And now the subblocks 218 218 $ssth->execute($mid, $master) or die "nosubs: $!\n".$dbh->errstr."\n"; 219 while (my ($cidr, $custid, $type, $city, $desc, $ctime, $mtime, $swip ) = $ssth->fetchrow_array) {219 while (my ($cidr, $custid, $type, $city, $desc, $ctime, $mtime, $swip, $defcust) = $ssth->fetchrow_array) { 220 220 221 221 # We get master block info from @masterblocks. … … 266 266 my $netname = $netnameprefix{$type}; 267 267 268 if ($swip eq 'n' ) {268 if ($swip eq 'n' || $defcust) { 269 269 print MASTERFILE "---\nID: NETBLK-$netnameprefix{mm}.$masterblocks[$i]\n". 270 270 "Auth-Area: $masterblocks[$i]\n".
Note:
See TracChangeset
for help on using the changeset viewer.