Parent

Methods

Class/Module Index [+]

Quicksearch

Rex::Socket::SwitchBoard::Route

This class represents a logical switch board route. TODO: Enable this to work with IPv6 addresses

Attributes

comm[RW]
netmask[RW]
netmask_nbo[RW]
subnet[RW]
subnet_nbo[RW]

Public Class Methods

new(subnet, netmask, comm) click to toggle source
# File lib/rex/socket/switch_board.rb, line 36
def initialize(subnet, netmask, comm)
        self.subnet      = subnet
        self.netmask     = netmask
        self.comm        = comm
        self.subnet_nbo  = Socket.resolv_nbo_i(subnet)
        self.netmask_nbo = Socket.resolv_nbo_i(netmask)
end

Public Instance Methods

<=>(other) click to toggle source

Sort according to bitmask

# File lib/rex/socket/switch_board.rb, line 47
def <=>(other)
        self.bitmask <=> other.bitmask
end
bitmask() click to toggle source

Convert the netmask to a bitmask and cache it.

# File lib/rex/socket/switch_board.rb, line 54
def bitmask
        @_bitmask = Socket.net2bitmask(self.netmask) if (@_bitmask == nil)
        @_bitmask
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.