Class: Mu::Xtractr::Stream::Message
- Inherits:
-
Object
- Object
- Mu::Xtractr::Stream::Message
- Defined in:
- lib/mu/xtractr/stream.rb
Overview
Message
Represents a single logical TCP message that has been potentially reassembled from across multiple packets spanning multiple pcaps. Each message contains the stream to which it belongs in addition to whether this message was sent from the client or the server.
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
Returns the actual bytes of the message.
-
#dir ⇒ Object
readonly
Returns the direction of the message (request/response).
-
#index ⇒ Object
readonly
Returns the index within the stream.
-
#stream ⇒ Object
readonly
Returns the stream to which this message belongs to.
Instance Method Summary collapse
-
#initialize(stream, index, dir, bytes) ⇒ Message
constructor
:nodoc:.
-
#inspect ⇒ Object
:nodoc:.
Constructor Details
#initialize(stream, index, dir, bytes) ⇒ Message
:nodoc:
79 80 81 82 83 84 |
# File 'lib/mu/xtractr/stream.rb', line 79 def initialize stream, index, dir, bytes # :nodoc: @stream = stream @index = index @dir = dir @bytes = bytes end |
Instance Attribute Details
#bytes ⇒ Object (readonly)
Returns the actual bytes of the message.
77 78 79 |
# File 'lib/mu/xtractr/stream.rb', line 77 def bytes @bytes end |
#dir ⇒ Object (readonly)
Returns the direction of the message (request/response).
74 75 76 |
# File 'lib/mu/xtractr/stream.rb', line 74 def dir @dir end |
#index ⇒ Object (readonly)
Returns the index within the stream
71 72 73 |
# File 'lib/mu/xtractr/stream.rb', line 71 def index @index end |
#stream ⇒ Object (readonly)
Returns the stream to which this message belongs to.
68 69 70 |
# File 'lib/mu/xtractr/stream.rb', line 68 def stream @stream end |
Instance Method Details
#inspect ⇒ Object
:nodoc:
86 87 88 89 90 |
# File 'lib/mu/xtractr/stream.rb', line 86 def inspect # :nodoc: preview = bytes[0..32] preview << "..." if bytes.size > 32 return "#<message:#{index} flow-#{stream.flow.id} #{preview.inspect}>" end |