Sha256: 565cea0b6545d9740994877cb3e072aca85377defd32eebbd39b376a8cdc3fc6
Contents?: true
Size: 1.09 KB
Versions: 15
Compression:
Stored size: 1.09 KB
Contents
# -*- coding: binary -*- require 'ipaddr' module Rex module Post module Meterpreter module Extensions module Stdapi module Net ### # # Represents a logical network route. # ### class Route ## # # Constructor # ## # # Initializes a route instance. # 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 # # Provides a pretty version of the route. # def pretty return sprintf("%16s %16s %16s %d %16s", subnet, netmask, gateway, metric, interface) end # # The subnet mask associated with the route. # attr_accessor :subnet # # The netmask of the subnet route. # attr_accessor :netmask # # The gateway to take for the subnet route. # attr_accessor :gateway # # The interface to take for the subnet route. # attr_accessor :interface # # The metric of the route. # attr_accessor :metric end end; end; end; end; end; end
Version data entries
15 entries across 15 versions & 3 rubygems