Sha256: 565cea0b6545d9740994877cb3e072aca85377defd32eebbd39b376a8cdc3fc6

Contents?: true

Size: 1.09 KB

Versions: 15

Compression:

Stored size: 1.09 KB

Contents

# -*- coding: binary -*-

require 'ipaddr'

module Rex
module Post
module Meterpreter
module Extensions
module Stdapi
module Net

###
#
# Represents a logical network route.
#
###
class Route

  ##
  #
  # Constructor
  #
  ##

  #
  # Initializes a route instance.
  #
  def initialize(subnet, netmask, gateway, interface='', metric=0)
    self.subnet  = IPAddr.new_ntoh(subnet).to_s
    self.netmask = IPAddr.new_ntoh(netmask).to_s
    self.gateway = IPAddr.new_ntoh(gateway).to_s
    self.interface = interface
    self.metric = metric
  end

  #
  # Provides a pretty version of the route.
  #
  def pretty
    return sprintf("%16s %16s %16s %d %16s", subnet, netmask, gateway, metric, interface)
  end

  #
  # The subnet mask associated with the route.
  #
  attr_accessor :subnet
  #
  # The netmask of the subnet route.
  #
  attr_accessor :netmask
  #
  # The gateway to take for the subnet route.
  #
  attr_accessor :gateway
  #
  # The interface to take for the subnet route.
  #
  attr_accessor :interface
  #
  # The metric of the route.
  #
  attr_accessor :metric


end

end; end; end; end; end; end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
rex-2.0.13 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.12 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.11 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.10 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.9 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.8 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.7 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.5 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.4 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
dstruct-0.0.1 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.3 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
librex-0.0.999 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
rex-2.0.2 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
librex-0.0.71 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
librex-0.0.70 lib/rex/post/meterpreter/extensions/stdapi/net/route.rb