Changeset 811 for trunk/bind-import


Ignore:
Timestamp:
11/24/20 17:18:34 (4 years ago)
Author:
Kris Deugau
Message:

/trunk

Fourth sampled iteration of bind-import

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bind-import

    r810 r811  
    3636my %amap;
    3737my %namemap;
     38my %cmap;
    3839
    3940if ($zname =~ /\.arpa\.?$/ || $zname =~ m,^[\d./]+$,) {
     
    100101  $name .= ".$zname" if $name !~ /$zname$/ && $zname !~ /\.$/;
    101102$name = $zname if /^\s*IN/;
    102   s/([\w_.-]+)\s+//;
     103$name = $zname if /^\@/;
     104  s/([\w\@_.-]+)\s+//;
    103105  my ($class) = /(IN|CS|CH|HS)\s/;
    104106  if ($class) {
     
    121123  my ($type) = /([A-Z-]+)\s/;
    122124  if (!$reverse_typemap{$type}) {
    123     print "Unknown type $type, skipping\n";
     125    print "Unknown type $type, skipping\n  ($_)\n";
    124126    next;
    125127  }
     
    135137  }
    136138
     139# temp hack for hosts file
    137140if ($type eq 'A') {
    138141#  if ($amap{$name}) {
     
    142145#  }
    143146  push @{$namemap{$rdata}}, $name;
     147}
     148if ($type eq 'CNAME') {
     149  push @{$cmap{$rdata}}, $name;
    144150}
    145151
     
    162168
    163169#print Dumper \%amap;
     170#print Dumper \%namemap;
     171#print Dumper \%cmap;
     172
    164173foreach my $n (keys %amap) {
    165174  foreach my $ip (@{$amap{$n}}) {
     
    169178}
    170179
    171 #print Dumper \%namemap;
    172 foreach my $ip (sort keys %namemap) {
    173   print "$ip    ".join(' ', @{$namemap{$ip}})."\n";
     180foreach my $c (keys %cmap) {
     181  if ($amap{$c}) {
     182    print Dumper(\@{$amap{$c}});
     183  }
     184#  print $amap{$c};
    174185}
     186
     187# cname targ -> IP
     188
     189#foreach my $ip (sort keys %namemap) {
     190#  print "$ip   ".join(' ', @{$namemap{$ip}})."\n";
     191#}
     192
Note: See TracChangeset for help on using the changeset viewer.