Class: Rex::Post::Meterpreter::Extensions::Stdapi::Net::Route
- Inherits:
-
Object
- Object
- Rex::Post::Meterpreter::Extensions::Stdapi::Net::Route
- Defined in:
- lib/rex/post/meterpreter/extensions/stdapi/net/route.rb
Overview
Represents a logical network route.
Instance Attribute Summary collapse
-
#gateway ⇒ Object
The gateway to take for the subnet route.
-
#netmask ⇒ Object
The netmask of the subnet route.
-
#subnet ⇒ Object
The subnet mask associated with the route.
Instance Method Summary collapse
-
#initialize(subnet, netmask, gateway) ⇒ Route
constructor
Initializes a route instance.
-
#pretty ⇒ Object
Provides a pretty version of the route.
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
#gateway ⇒ Object
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 |
#netmask ⇒ Object
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 |
#subnet ⇒ Object
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
#pretty ⇒ Object
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 |