Class: Net::DNS::RR::UNKNOWN

Inherits:
Net::DNS::RR show all
Defined in:
lib/Net/DNS/RR/UNKNOWN.rb

Overview

NAME

Net::DNS::RR::Unknown - Unknown RR record

DESCRIPTION

Class for dealing with unknown RR types (RFC3597)

COPYRIGHT

Copyright © 1997-2002 Michael Fuhr.

Portions Copyright © 2002-2004 Chris Reinhardt.

Portions Copyright © 2003 Olaf M. Kolkman, RIPE NCC.

All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Net::DNS, Net::DNS::RR, RFC 3597

Constant Summary

Constants inherited from Net::DNS::RR

RRS

Instance Attribute Summary

Attributes inherited from Net::DNS::RR

#name, #rdata, #rdlength, #rrclass, #ttl, #type

Instance Method Summary collapse

Methods inherited from Net::DNS::RR

#_canonicalRdata, #_canonicaldata, _get_subclass, _name2wire, #_name2wire, build_regex, create, #create_rrsort_func, #data, #get_rrsort_func, #init, #init_rrsort_func, #inspect, new_from_data, new_from_hash, new_from_string, #rr_rdata, #set_rrsort_func

Constructor Details

#initialize(*args) ⇒ UNKNOWN

Returns a new instance of UNKNOWN.



42
43
44
# File 'lib/Net/DNS/RR/UNKNOWN.rb', line 42

def initialize(*args)
  @rdatastr=""
end

Instance Method Details

#new_from_data(data, offset) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/Net/DNS/RR/UNKNOWN.rb', line 45

def new_from_data(data, offset)
  if (@rdlength!=nil && @rdlength > 0)
    #          @rData    = substr($$data, $offset,$length);
    @rData = data.slice(offset, @rdlength)
    @rdatastr = "\\# #{@rdlength} " + @rData.unpack('H*')[0];
  end
end

#rdatastrObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/Net/DNS/RR/UNKNOWN.rb', line 54

def rdatastr
  
  if (@rDatastr!=nil)
    return @rDatastr;
  else
    if (@rData!=nil)
      #              return  "\\# " +  @rData.length.to_s +  "  " + @rData.unpack('H*')[0];
      return  "\\# " +  @rData.length.to_s +  " " + @rData.unpack('H*')[0];
    end
  end
  ret = @rdlength!=nil ? "; rdlength = #{@rdlength}" : '';
  
  return ret         
  #          return "#NO DATA";
end