Module: Rex::Post::Channel::Container

Included in:
Msf::Sessions::SshCommandShellBind, Meterpreter::Client
Defined in:
lib/rex/post/channel/container.rb

Overview

This interface is meant to be included by things that are meant to contain zero or more channel instances in the form of a hash.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#channelsObject

The hash of channels.


44
45
46
# File 'lib/rex/post/channel/container.rb', line 44

def channels
  @channels
end

Instance Method Details

#add_channel(channel) ⇒ Object

Adds a channel to the container that is indexed by its channel identifier


23
24
25
# File 'lib/rex/post/channel/container.rb', line 23

def add_channel(channel)
  channels[channel.cid] = channel
end

#find_channel(cid) ⇒ Object

Looks up a channel instance based on its channel identifier


30
31
32
# File 'lib/rex/post/channel/container.rb', line 30

def find_channel(cid)
  return channels[cid]
end

#initialize_channelsObject

Initializes the channel association hash


16
17
18
# File 'lib/rex/post/channel/container.rb', line 16

def initialize_channels
  self.channels = {}
end

#remove_channel(cid) ⇒ Object

Removes a channel based on its channel identifier


37
38
39
# File 'lib/rex/post/channel/container.rb', line 37

def remove_channel(cid)
  return channels.delete(cid)
end