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
-
#channels ⇒ Object
readonly
The hash of channels.
Instance Method Summary collapse
-
#add_channel(channel) ⇒ Object
Adds a channel to the container that is indexed by its channel identifier.
-
#find_channel(cid) ⇒ Object
Looks up a channel instance based on its channel identifier.
-
#initialize_channels ⇒ Object
Initializes the channel association hash.
-
#remove_channel(cid) ⇒ Object
Removes a channel based on its channel identifier.
Instance Attribute Details
#channels ⇒ Object
The hash of channels.
46 47 48 |
# File 'lib/rex/post/meterpreter/channel_container.rb', line 46 def channels @channels end |
Instance Method Details
#add_channel(channel) ⇒ Object
Adds a channel to the container that is indexed by its channel identifier
25 26 27 |
# File 'lib/rex/post/meterpreter/channel_container.rb', line 25 def add_channel(channel) self.channels[channel.cid] = channel end |
#find_channel(cid) ⇒ Object
Looks up a channel instance based on its channel identifier
32 33 34 |
# File 'lib/rex/post/meterpreter/channel_container.rb', line 32 def find_channel(cid) return self.channels[cid] end |
#initialize_channels ⇒ Object
Initializes the channel association hash
18 19 20 |
# File 'lib/rex/post/meterpreter/channel_container.rb', line 18 def initialize_channels self.channels = {} end |
#remove_channel(cid) ⇒ Object
Removes a channel based on its channel identifier
39 40 41 |
# File 'lib/rex/post/meterpreter/channel_container.rb', line 39 def remove_channel(cid) return self.channels.delete(cid) end |