Sha256: 642cfd818da7b66a474d40a5de19f4f3e3013cf5f684746b23359d54a1ab4ef9
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
#!/usr/bin/env ruby # -*- 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
librex-0.0.68 | lib/rex/post/meterpreter/extensions/stdapi/net/route.rb |
librex-0.0.66 | lib/rex/post/meterpreter/extensions/stdapi/net/route.rb |