Class: ResolvFiber::DNS::Resource::IN::WKS
- Inherits:
-
ResolvFiber::DNS::Resource
- Object
- Query
- ResolvFiber::DNS::Resource
- ResolvFiber::DNS::Resource::IN::WKS
- Defined in:
- lib/resolv_fiber.rb
Overview
Well Known Service resource.
Constant Summary collapse
- TypeValue =
11- ClassValue =
IN::ClassValue
Constants inherited from ResolvFiber::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 ResolvFiber::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 ResolvFiber::DNS::Resource
Constructor Details
#initialize(address, protocol, bitmap) ⇒ WKS
Returns a new instance of WKS.
2221 2222 2223 2224 2225 |
# File 'lib/resolv_fiber.rb', line 2221 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.
2230 2231 2232 |
# File 'lib/resolv_fiber.rb', line 2230 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.
2245 2246 2247 |
# File 'lib/resolv_fiber.rb', line 2245 def bitmap @bitmap end |
#protocol ⇒ Object (readonly)
IP protocol number for these services.
2235 2236 2237 |
# File 'lib/resolv_fiber.rb', line 2235 def protocol @protocol end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc:
2253 2254 2255 2256 2257 2258 |
# File 'lib/resolv_fiber.rb', line 2253 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:
2247 2248 2249 2250 2251 |
# File 'lib/resolv_fiber.rb', line 2247 def encode_rdata(msg) # :nodoc: msg.put_bytes(@address.address) msg.put_pack("n", @protocol) msg.put_bytes(@bitmap) end |