vendor/bundle/ruby/2.7.0/gems/dnsruby-1.61.5/lib/dnsruby/zone_transfer.rb
#  The nameserver to use for the zone transfer - defaults to system config
The nameserver to use for the zone transfer - defaults to system config
The nameserver to use for the zone transfer - defaults to system config
def parseRR(rec) 
      name = rec.name
      type = rec.type
      delta = Delta.new
      case @state
      when :InitialSoa
        if (type != Types.SOA)
          raise ResolvError.new("missing initial SOA")
        end
        @initialsoa = rec
        @end_serial = rec.serial
        if ((@transfer_type == Types.IXFR) && (compare_serial(@end_serial, @serial) >= 0))
          Dnsruby.log.debug("zone up to date")
          raise ZoneSerialError.new("IXFR up to date: expected serial " +
              @serial.to_s + " , got " + rec.serial.to_s);
          @state = :End
        else
          @state = :FirstData
        end
      when :FirstData
        if (@transfer_type == Types.IXFR && type == Types.SOA &&
              rec.serial == @serial)
          Dnsruby.log.debug("IXFR response - using IXFR")
          @rtype = Types.IXFR
          @ixfr = []
          @state = :Ixfr_DelSoa
        else
          Dnsruby.log.debug("AXFR response - using AXFR")
          @rtype = Types.AXFR
          @transfer_type = Types.AXFR
          @axfr = []
          @axfr << @initialsoa
          @state = :Axfr
        end
        parseRR(rec) 
        return
      when :Ixfr_DelSoa
        delta = Delta.new
        @ixfr.push(delta)
        delta.start = rec.serial
        delta.deletes << rec
        @state = :Ixfr_Del
      when :Ixfr_Del
        if (type == Types.SOA)
          @current_serial = rec.serial
          @state = :Ixfr_AddSoa
          parseRR(rec); 
          return;
        end
        delta = @ixfr[@ixfr.length - 1]
        delta.deletes << rec
      when :Ixfr_AddSoa
        delta = @ixfr[@ixfr.length - 1]
        delta.end = rec.serial
        delta.adds << rec
        @state = :Ixfr_Add
      when :Ixfr_Add
        if (type == Types.SOA)
          soa_serial = rec.serial
          if (soa_serial == @end_serial)
            @state = :End
            return
          elsif (soa_serial != @current_serial)
            raise ZoneSerialError.new("IXFR out of sync: expected serial " +
                @current_serial.to_s + " , got " + soa_serial.to_s);
          else
            @state = :Ixfr_DelSoa
            parseRR(rec); 
            return;
          end
        end
        delta = @ixfr[@ixfr.length - 1]
        delta.adds << rec
      when :Axfr
        if (type == Types.A && rec.klass() != @klass)
        else
          if (type == Types.SOA)
            @state = :End
          else
            @axfr << rec
          end
        end
      when :End
        raise ResolvError.new("extra data in zone transfer")
      else
        raise ResolvError.new("invalid state for zone transfer")
      end
    end
def parseRR ( rec ) name = rec . name type = rec . type delta = Delta . new case @state when :InitialSoa if ( type != Types . SOA ) raise ResolvError . new ( "missing initial SOA" ) end @initialsoa = rec @end_serial = rec . serial if ( ( @transfer_type == Types . IXFR ) && ( compare_serial ( @end_serial , @serial ) >= 0 ) ) Dnsruby . log . debug ( "zone up to date" ) raise ZoneSerialError . new ( "IXFR up to date: expected serial " + @serial . to_s + " , got " + rec . serial . to_s ) ; @state = :End else @state = :FirstData end when :FirstData if ( @transfer_type == Types . IXFR && type == Types . SOA && rec . serial == @serial ) Dnsruby . log . debug ( "IXFR response - using IXFR" ) @rtype = Types . IXFR @ixfr = [ ] @state = :Ixfr_DelSoa else Dnsruby . log . debug ( "AXFR response - using AXFR" ) @rtype = Types . AXFR @transfer_type = Types . AXFR @axfr = [ ] @axfr << @initialsoa @state = :Axfr end parseRR ( rec ) return when :Ixfr_DelSoa delta = Delta . new @ixfr . push ( delta ) delta . start = rec . serial delta . deletes << rec @state = :Ixfr_Del when :Ixfr_Del if ( type == Types . SOA ) @current_serial = rec . serial @state = :Ixfr_AddSoa parseRR ( rec ) ; return ; end delta = @ixfr [ @ixfr . length - 1 ] delta . deletes << rec when :Ixfr_AddSoa delta = @ixfr [ @ixfr . length - 1 ] delta . end = rec . serial delta . adds << rec @state = :Ixfr_Add when :Ixfr_Add if ( type == Types . SOA ) soa_serial = rec . serial if ( soa_serial == @end_serial ) @state = :End return elsif ( soa_serial != @current_serial ) raise ZoneSerialError . new ( "IXFR out of sync: expected serial " + @current_serial . to_s + " , got " + soa_serial . to_s ) ; else @state = :Ixfr_DelSoa parseRR ( rec ) ; return ; end end delta = @ixfr [ @ixfr . length - 1 ] delta . adds << rec when :Axfr if ( type == Types . A && rec . klass ( ) != @klass ) else if ( type == Types . SOA ) @state = :End else @axfr << rec end end when :End raise ResolvError . new ( "extra data in zone transfer" ) else raise ResolvError . new ( "invalid state for zone transfer" ) end end
The nameserver to use for the zone transfer - defaults to system config
The nameserver to use for the zone transfer - defaults to system config
#:nodoc: all #  Remember the serial number in the initial SOA; we need it #  to recognize the end of an IXFR. #         if ((@transfer_type == Types.IXFR) && (@end_serial <= @serial)) #  If the transfer begins with 1 SOA, it's an AXFR. #  If it begins with 2 SOAs, it's an IXFR. # Restart... # Restart... # Restart... #  Old BINDs sent cross class A records for non IN classes.
rec
<not_specific>