123456789_123456789_123456789_123456789_123456789_

Class: Resolv::DNS::Resource::IN::WKS

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Resolv::DNS::Resource
Defined in: lib/resolv.rb

Overview

Well Known Service resource.

Constant Summary

::Resolv::DNS::Resource - Inherited

ClassHash, ClassInsensitiveTypes, ClassValue

Class Method Summary

Instance Attribute Summary

  • #address readonly

    The host these services run on.

  • #bitmap readonly

    A bit map of enabled services on this host.

  • #protocol readonly

    IP protocol number for these services.

::Resolv::DNS::Resource - Inherited

#ttl

Remaining Time To Live for this ::Resolv::DNS::Resource.

Instance Method Summary

Constructor Details

.new(address, protocol, bitmap) ⇒ WKS

[ GitHub ]

  
# File 'lib/resolv.rb', line 2658

def initialize(address, protocol, bitmap)
  @address = IPv4.create(address)
  @protocol = protocol
  @bitmap = bitmap
end

Class Method Details

.decode_rdata(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 2690

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 Attribute Details

#address (readonly)

The host these services run on.

[ GitHub ]

  
# File 'lib/resolv.rb', line 2667

attr_reader :address

#bitmap (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.

[ GitHub ]

  
# File 'lib/resolv.rb', line 2682

attr_reader :bitmap

#protocol (readonly)

IP protocol number for these services.

[ GitHub ]

  
# File 'lib/resolv.rb', line 2672

attr_reader :protocol

Instance Method Details

#encode_rdata(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 2684

def encode_rdata(msg) # :nodoc:
  msg.put_bytes(@address.address)
  msg.put_pack("n", @protocol)
  msg.put_bytes(@bitmap)
end