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.
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
#gateway ⇒ Object
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 |
#interface ⇒ Object
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 |
#metric ⇒ Object
The metric of the route.
63 64 65 |
# File 'lib/rex/post/meterpreter/extensions/stdapi/net/route.rb', line 63 def metric @metric end |
#netmask ⇒ Object
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 |
#subnet ⇒ Object
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
#pretty ⇒ Object
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 |