Class: Rex::Socket::Host

Inherits:
Range
  • Object
show all
Defined in:
lib/rex/socket/range_walker.rb

Overview

A single host

Instance Attribute Summary collapse

Attributes inherited from Range

#options, #start, #stop

Instance Method Summary collapse

Methods inherited from Range

#==, #ipv6?, #length

Constructor Details

#initialize(address, hostname = nil, options = nil) ⇒ Host

Returns a new instance of Host.



543
544
545
546
547
548
# File 'lib/rex/socket/range_walker.rb', line 543

def initialize(address, hostname=nil, options=nil)
  address = Rex::Socket.addr_atoi(address) if address.is_a? String

  super(address, address, options)
  @hostname = hostname
end

Instance Attribute Details

#hostnameObject

Returns the value of attribute hostname.



541
542
543
# File 'lib/rex/socket/range_walker.rb', line 541

def hostname
  @hostname
end

Instance Method Details

#addressObject



550
551
552
# File 'lib/rex/socket/range_walker.rb', line 550

def address
  Rex::Socket.addr_itoa(@start)
end