Module: Rex::Post::Meterpreter::ChannelContainer

Included in:
Client
Defined in:
lib/rex/post/meterpreter/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.



47
48
49
# File 'lib/rex/post/meterpreter/channel_container.rb', line 47

def channels
  @channels
end

Instance Method Details

#add_channel(channel) ⇒ Object

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



26
27
28
# File 'lib/rex/post/meterpreter/channel_container.rb', line 26

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

#find_channel(cid) ⇒ Object

Looks up a channel instance based on its channel identifier



33
34
35
# File 'lib/rex/post/meterpreter/channel_container.rb', line 33

def find_channel(cid)
	return self.channels[cid]
end

#initialize_channelsObject

Initializes the channel association hash



19
20
21
# File 'lib/rex/post/meterpreter/channel_container.rb', line 19

def initialize_channels
	self.channels = {}
end

#remove_channel(cid) ⇒ Object

Removes a channel based on its channel identifier



40
41
42
# File 'lib/rex/post/meterpreter/channel_container.rb', line 40

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