Changeset 814 for trunk/bind-import


Ignore:
Timestamp:
11/25/20 10:49:10 (4 years ago)
Author:
Kris Deugau
Message:

/trunk

Seventh sampled iteration of bind-import

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bind-import

    r813 r814  
    108108  my ($name) = /^([\w\@_.-]+)\s/;
    109109
    110 print "$i ($_)\n\t$name";
    111110# foo IN A 1.2.3.4
    112111#   IN A 2.3.4.5
     
    115114# foo.zone. IN A 2.3.4.5
    116115
     116  # "empty" label records inherit the previous label
     117  # RRs start in the first column by definition, so leading whitespace indicates an inherited label
     118  if (/^\s+/) {
     119    # fatal error.  if there is no previous label, we can by definition not set
     120    # the current label based on it.  this can only happen on the very first
     121    # record, following records will *ALWAYS* have a previous label
     122    die "bad first record ($_):  no previous label\n" if !$prevlabel;
     123    $name = $prevlabel;
     124  }
     125
     126print "$i ($_)\n\t$name";
    117127
    118128  # magic name!
    119129  $name = $zname if $name eq '@';
     130
     131
    120132
    121133  # append zone name to record name if missing AND not dot-terminated;
     
    130142  }
    131143
    132   # fatal error.  if there is no previous label, we can by definition not set
    133   # the current label based on it.  this can only happen on the very first
    134   # record, following records will *ALWAYS* have a previous label
    135   if (/^\s+[A-Z]/) {
    136     die "bad first record ($_):  no previous label\n" if !$prevlabel;
    137     $name = $prevlabel;
    138   }
    139 
    140 last if $i > 2;
     144
     145last if $i > 5;
    141146
    142147  s/^([\w\@_.-]+)\s+//;
    143148
     149##fixme:  drop curlabel?  not sure it's needed
     150$curlabel = $name;
    144151$prevlabel = $curlabel;
     152##todo:  BIND conflates a repeated label with repeating the TTL too.  Matter of opinion whether that's really correct or not.
     153
     154
    145155# by convention the optional TTL leads the optional class, but they're apparently swappable.
    146156  my ($ttl) = /^(\d+)?\s/;
Note: See TracChangeset for help on using the changeset viewer.