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.
-
#interface ⇒ Object
The interface to take for the subnet route.
-
#metric ⇒ Object
The metric of the 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, interface = '', metric = 0) ⇒ Route
constructor
Initializes a route instance.
-
#pretty ⇒ Object
Provides a pretty version of the route.
Constructor Details
#initialize(subnet, netmask, gateway, interface = '', metric = 0) ⇒ Route
Initializes a route instance.
28 29 30 31 32 33 34 |
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 28 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
#gateway ⇒ Object
The gateway to take for the subnet route.
54 55 56 |
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 54 def gateway @gateway end |
#interface ⇒ Object
The interface to take for the subnet route.
58 59 60 |
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 58 def interface @interface end |
#metric ⇒ Object
The metric of the route.
62 63 64 |
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 62 def metric @metric end |
#netmask ⇒ Object
The netmask of the subnet route.
50 51 52 |
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 50 def netmask @netmask end |
#subnet ⇒ Object
The subnet mask associated with the route.
46 47 48 |
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 46 def subnet @subnet end |
Instance Method Details
#pretty ⇒ Object
Provides a pretty version of the route.
39 40 41 |
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 39 def pretty return sprintf("%16s %16s %16s %d %16s", subnet, netmask, gateway, metric, interface) end |