Changeset 355


Ignore:
Timestamp:
06/29/12 14:50:17 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Checkpoint filling in tiny-import.pl stubs; NS records complete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tiny-import.pl

    r354 r355  
    179179      $cnt{NS}++;
    180180
     181      my ($zone,$ip,$ns,$ttl,$stamp,$loc) = split /:/, $rec, 6;
     182      $zone =~ s/^\&//;
     183      $zone =~ s/\.$//;
     184      $ttl = 0 if !$ttl;
     185      $stamp = '' if !$stamp;
     186      $loc = '' if !$loc;
     187      $loc = '' if $loc =~ /^:+$/;
     188      if ($zone =~ /\.arpa$/) {
     189        ($code,$msg) = DNSDB::_zone2cidr($zone);
     190        print "revzone $msg from $zone\n";
     191        my ($rparent) = $dbh->selectrow_array("SELECT rdns_id FROM revzones WHERE revnet >>= ?", undef, ("$msg"));
     192##fixme, in concert with the CNAME check for same;  automagically
     193# create "delegate" record instead for subzone NSes:  convert above to use = instead of >>=
     194#  ($rparent) = $dbh->selectrow_array("SELECT rdns_id FROM revzones WHERE revnet >> ?", undef, ("$msg"))
     195#       if !$rparent;
     196        if ($rparent) {
     197          $recsth->execute(0, $rparent, $ns, 2, $msg, 0, 0, 0, $ttl);
     198        } else {
     199          push @deferred, $rec unless $nodefer;
     200        }
     201      } else {
     202        my $fparent = DNSDB::_hostparent($dbh, $zone);
     203        if ($fparent) {
     204          $recsth->execute($fparent, 0, $zone, 2, $ns, 0, 0, 0, $ttl);
     205        } else {
     206          push @deferred, $rec unless $nodefer;
     207        }
     208      }
     209
    181210    } elsif ($rec =~ /^\^/) {
    182211      $cnt{PTR}++;
Note: See TracChangeset for help on using the changeset viewer.