Class: Dnsruby::RR::IN::WKS
- Inherits:
-
Dnsruby::RR
- Object
- Dnsruby::RR
- Dnsruby::RR::IN::WKS
- Defined in:
- lib/Dnsruby/resource/IN.rb
Overview
RFC 1035, Section 3.4.2 (deprecated)
Constant Summary
Constants inherited from Dnsruby::RR
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#bitmap ⇒ Object
readonly
Returns the value of attribute bitmap.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
Attributes inherited from Dnsruby::RR
#klass, #name, #rdata, #ttl, #type
Class Method Summary collapse
-
.decode_rdata(msg) ⇒ Object
:nodoc: all.
Instance Method Summary collapse
-
#encode_rdata(msg, canonical = false) ⇒ Object
:nodoc: all.
-
#initialize(address, protocol, bitmap) ⇒ WKS
constructor
A new instance of WKS.
Methods inherited from Dnsruby::RR
#==, create, #eql?, #from_data, #from_hash, #from_string, get_class, get_num, #hash, implemented_rrs, #init_defaults, new_from_data, new_from_hash, new_from_string, #rdata_to_string, #rdlength, #sameRRset, #to_s
Constructor Details
#initialize(address, protocol, bitmap) ⇒ WKS
Returns a new instance of WKS.
42 43 44 45 46 |
# File 'lib/Dnsruby/resource/IN.rb', line 42 def initialize(address, protocol, bitmap) @address = IPv4.create(address) @protocol = protocol @bitmap = bitmap end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
47 48 49 |
# File 'lib/Dnsruby/resource/IN.rb', line 47 def address @address end |
#bitmap ⇒ Object (readonly)
Returns the value of attribute bitmap.
47 48 49 |
# File 'lib/Dnsruby/resource/IN.rb', line 47 def bitmap @bitmap end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
47 48 49 |
# File 'lib/Dnsruby/resource/IN.rb', line 47 def protocol @protocol end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc: all
55 56 57 58 59 60 |
# File 'lib/Dnsruby/resource/IN.rb', line 55 def self.decode_rdata(msg) #:nodoc: all address = IPv4.new(msg.get_bytes(4)) protocol, = msg.get_unpack("n") bitmap = msg.get_bytes return self.new(address, protocol, bitmap) end |
Instance Method Details
#encode_rdata(msg, canonical = false) ⇒ Object
:nodoc: all
49 50 51 52 53 |
# File 'lib/Dnsruby/resource/IN.rb', line 49 def encode_rdata(msg, canonical=false) #:nodoc: all msg.put_bytes(@address.address) msg.put_pack("n", @protocol) msg.put_bytes(@bitmap) end |