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

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/post/meterpreter/extensions/stdapi/net/route.rb

Overview

Represents a logical network route.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subnet, netmask, gateway, interface = '', metric = 0) ⇒ Route

Initializes a route instance.



29
30
31
32
33
34
35
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 29

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

Instance Attribute Details

#gatewayObject

The gateway to take for the subnet route.



55
56
57
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 55

def gateway
  @gateway
end

#interfaceObject

The interface to take for the subnet route.



59
60
61
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 59

def interface
  @interface
end

#metricObject

The metric of the route.



63
64
65
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 63

def metric
  @metric
end

#netmaskObject

The netmask of the subnet route.



51
52
53
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 51

def netmask
  @netmask
end

#subnetObject

The subnet mask associated with the route.



47
48
49
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 47

def subnet
  @subnet
end

Instance Method Details

#prettyObject

Provides a pretty version of the route.



40
41
42
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 40

def pretty
	return sprintf("%16s %16s %16s %d %16s", subnet, netmask, gateway, metric, interface)
end