Class: EventMachine::SFlow::RawPacketHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/em-sflow/packet/raw_packet_header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ RawPacketHeader

Returns a new instance of RawPacketHeader.



4
5
6
7
8
9
10
11
# File 'lib/em-sflow/packet/raw_packet_header.rb', line 4

def initialize data
  data.extend EventMachine::SFlow::BinaryString
  
  @protocol, @frame_length, @strip_count, length = data.unpack("NNNN")
  data.advance(16)
  
  @header = data
end

Instance Attribute Details

#frame_lengthObject

Returns the value of attribute frame_length.



2
3
4
# File 'lib/em-sflow/packet/raw_packet_header.rb', line 2

def frame_length
  @frame_length
end

#headerObject

Returns the value of attribute header.



2
3
4
# File 'lib/em-sflow/packet/raw_packet_header.rb', line 2

def header
  @header
end

#protocolObject

Returns the value of attribute protocol.



2
3
4
# File 'lib/em-sflow/packet/raw_packet_header.rb', line 2

def protocol
  @protocol
end

#strip_countObject

Returns the value of attribute strip_count.



2
3
4
# File 'lib/em-sflow/packet/raw_packet_header.rb', line 2

def strip_count
  @strip_count
end