Changeset 308
- Timestamp:
- 02/28/06 17:45:43 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/extras/db2rwhois.pl
r253 r308 22 22 my $rwhoisDataPath = "/etc/rwhoisd"; 23 23 24 # We'll pull this out of the database instead. Just make sure our25 # master blocks are actually listed.... <g>26 #@masterblocks = (27 # (new NetAddr::IP "209.91.128.0/18"),28 # (new NetAddr::IP "66.186.64.0/19"),29 # (new NetAddr::IP "192.168.99.0/24")30 # );31 32 24 my ($dbh,$msg) = connectDB_My; 33 25 … … 47 39 48 40 # Techically, we only need to exclude 204.138.172.0/24, as we "own" all of the other blocks. 41 # However, 205.207.184.0/23 and 206.130.64.0/24 are, um, awkward. 49 42 if ($data[0] =~ /^(192.168.0.0|172.16.0.0|10.0.0.0|20[456])/) { 50 43 next GETMASTERS; … … 89 82 # Make sure to remove the private netblocks from this. 90 83 # No use or point in broadcasting our use of them. 84 # Also remove the details of our "reserved CORE/WAN" blocks; they're not critical. 91 85 $sth = $dbh->prepare("select cidr,custid,type,city,description,createstamp,modifystamp ". 92 86 "from allocations where ". … … 94 88 "not (cidr <<= '172.16.0.0/12') and ". 95 89 "not (cidr <<= '10.0.0.0/8') and ". 90 "not (type = 'wr') and ". 96 91 "masklen(cidr) <=30"); 97 92 #" and (custid='6750400' or custid like '%-RES' or custid like '%-BUS')"); … … 132 127 # cidr custid type city description notes maskbits 133 128 134 # Creation date in record to eventually be "correct"; near-term will 135 # be master's creation date; immediate is today's date. 136 my $date; 137 chomp ($date = `/bin/date +"%Y%m%d"`); 129 # Fill in a generic entry for nameless allocations 138 130 if ($desc =~ /^\s*$/) { $desc = 'Friendly ISP'; } 139 #print "$i:\t$net in $master\n"; 131 132 # Fix up datestamps. We don't *really* need sub-microsecond resolution on our exports... 133 ($ctime) = ($ctime =~ /^(\d+-\d+-\d+)\s+/); 134 ($mtime) = ($mtime =~ /^(\d+-\d+-\d+)\s+/); 140 135 141 136 print MASTERFILE "---\nID: NETBLK-ISP.$master\n".
Note:
See TracChangeset
for help on using the changeset viewer.