Class Rex::Socket::SwitchBoard
In: lib/rex/socket/switch_board.rb
Parent: Object

This class provides a global routing table that associates subnets with Comm classes. Comm classes are used to instantiate objects that are tied to remote network entities. For example, the Local Comm class is used to building network connections directly from the local machine whereas, for instance, a Meterpreter Comm would build a local socket pair that is associated with a connection established by a remote entity. This can be seen as a uniform way of communicating with hosts through arbitrary channels.

Methods

Included Modules

Singleton Enumerable

Classes and Modules

Class Rex::Socket::SwitchBoard::Route

Attributes

mutex  [R]  The mutex protecting the routes array.
routes  [R]  The routes array.

Public Class methods

Adds a route to the switch board routing table using the supplied Comm instance.

Returns the Comm instance that should be used for the supplied address. If no comm can be found, the default Local Comm is returned.

Enumerate each route in the routing table.

Flush all the routes from the switch board routing table.

Removes all routes that go through the supplied Comm.

Removes a route from the switch board routing table for the supplied subnet routing through the supplied Comm instance.

Returns the array of routes.

Public Instance methods

Adds a route for a given subnet and netmask destined through a given comm instance.

Finds the best possible comm for the supplied target address.

Enumerates each entry in the routing table.

Flushes all established routes.

Remove all routes that go through the supplied comm.

Removes a route for a given subnet and netmask destined through a given comm instance.

Checks to see if a route already exists for the supplied subnet and netmask.

Protected Instance methods

Initializes the underlying stuff.

[Validate]