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) ⇒ Route

Initializes a route instance.



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

def initialize(subnet, netmask, gateway)
	self.subnet  = IPAddr.ntop(subnet)
	self.netmask = IPAddr.ntop(netmask)
	self.gateway = IPAddr.ntop(gateway)
end

Instance Attribute Details

#gatewayObject

The gateway to take for the subnet route.



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

def gateway
  @gateway
end

#netmaskObject

The netmask of the subnet route.



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

def netmask
  @netmask
end

#subnetObject

The subnet mask associated with the route.



44
45
46
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 44

def subnet
  @subnet
end

Instance Method Details

#prettyObject

Provides a pretty version of the route.



37
38
39
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 37

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