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

Inherits:
Resolv::DNS::Resource show all
Defined in:
lib/logmerge/resolv.rb

Constant Summary

Constants inherited from Resolv::DNS::Resource

ClassHash, ClassInsensitiveTypes, ClassValue

Instance Attribute Summary collapse

Attributes inherited from Resolv::DNS::Resource

#ttl

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resolv::DNS::Resource

#==, #eql?, get_class, #hash

Constructor Details

#initialize(address, protocol, bitmap) ⇒ WKS

Returns a new instance of WKS.



1623
1624
1625
1626
1627
# File 'lib/logmerge/resolv.rb', line 1623

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

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



1628
1629
1630
# File 'lib/logmerge/resolv.rb', line 1628

def address
  @address
end

#bitmapObject (readonly)

Returns the value of attribute bitmap.



1628
1629
1630
# File 'lib/logmerge/resolv.rb', line 1628

def bitmap
  @bitmap
end

#protocolObject (readonly)

Returns the value of attribute protocol.



1628
1629
1630
# File 'lib/logmerge/resolv.rb', line 1628

def protocol
  @protocol
end

Class Method Details

.decode_rdata(msg) ⇒ Object



1636
1637
1638
1639
1640
1641
# File 'lib/logmerge/resolv.rb', line 1636

def self.decode_rdata(msg)
  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



1630
1631
1632
1633
1634
# File 'lib/logmerge/resolv.rb', line 1630

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