Class: Resolv::DNS::Resource::IN::WKS
- Inherits:
-
Resolv::DNS::Resource
- Object
- Query
- Resolv::DNS::Resource
- Resolv::DNS::Resource::IN::WKS
- Defined in:
- lib/resolv.rb
Overview
Well Known Service resource.
Constant Summary collapse
- TypeValue =
11- ClassValue =
IN::ClassValue
Constants inherited from Resolv::DNS::Resource
ClassHash, ClassInsensitiveTypes
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
The host these services run on.
-
#bitmap ⇒ Object
readonly
A bit map of enabled services on this host.
-
#protocol ⇒ Object
readonly
IP protocol number for these services.
Attributes inherited from Resolv::DNS::Resource
Class Method Summary collapse
-
.decode_rdata(msg) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#encode_rdata(msg) ⇒ Object
:nodoc:.
-
#initialize(address, protocol, bitmap) ⇒ WKS
constructor
A new instance of WKS.
Methods inherited from Resolv::DNS::Resource
Constructor Details
#initialize(address, protocol, bitmap) ⇒ WKS
Returns a new instance of WKS.
2136 2137 2138 2139 2140 |
# File 'lib/resolv.rb', line 2136 def initialize(address, protocol, bitmap) @address = IPv4.create(address) @protocol = protocol @bitmap = bitmap end |
Instance Attribute Details
#address ⇒ Object (readonly)
The host these services run on.
2145 2146 2147 |
# File 'lib/resolv.rb', line 2145 def address @address end |
#bitmap ⇒ Object (readonly)
A bit map of enabled services on this host.
If protocol is 6 (TCP) then the 26th bit corresponds to the SMTP service (port 25). If this bit is set, then an SMTP server should be listening on TCP port 25; if zero, SMTP service is not supported.
2160 2161 2162 |
# File 'lib/resolv.rb', line 2160 def bitmap @bitmap end |
#protocol ⇒ Object (readonly)
IP protocol number for these services.
2150 2151 2152 |
# File 'lib/resolv.rb', line 2150 def protocol @protocol end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc:
2168 2169 2170 2171 2172 2173 |
# File 'lib/resolv.rb', line 2168 def self.decode_rdata(msg) # :nodoc: 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) ⇒ Object
:nodoc:
2162 2163 2164 2165 2166 |
# File 'lib/resolv.rb', line 2162 def encode_rdata(msg) # :nodoc: msg.put_bytes(@address.address) msg.put_pack("n", @protocol) msg.put_bytes(@bitmap) end |