class Rex::Post::Meterpreter::Extensions::Stdapi::Net::Route

Represents a logical network route.

Attributes

gateway[RW]

The gateway to take for the subnet route.

interface[RW]

The interface to take for the subnet route.

metric[RW]

The metric of the route.

netmask[RW]

The netmask of the subnet route.

subnet[RW]

The subnet mask associated with the route.

Public Class Methods

new(subnet, netmask, gateway, interface='', metric=0) click to toggle source

Initializes a route instance.

# File lib/rex/post/meterpreter/extensions/stdapi/net/route.rb, line 27
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

Public Instance Methods

pretty() click to toggle source

Provides a pretty version of the route.

# File lib/rex/post/meterpreter/extensions/stdapi/net/route.rb, line 38
def pretty
  return sprintf("%16s %16s %16s %d %16s", subnet, netmask, gateway, metric, interface)
end