Class: EventMachine::SFlow::IPv6Data
- Inherits:
-
Object
- Object
- EventMachine::SFlow::IPv6Data
- Defined in:
- lib/em-sflow/packet/ipv6_data.rb
Instance Attribute Summary collapse
-
#dst_ip ⇒ Object
Returns the value of attribute dst_ip.
-
#dst_port ⇒ Object
Returns the value of attribute dst_port.
-
#length ⇒ Object
Returns the value of attribute length.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#src_ip ⇒ Object
Returns the value of attribute src_ip.
-
#src_port ⇒ Object
Returns the value of attribute src_port.
-
#tcp_flags ⇒ Object
Returns the value of attribute tcp_flags.
Instance Method Summary collapse
-
#initialize(data) ⇒ IPv6Data
constructor
A new instance of IPv6Data.
Constructor Details
#initialize(data) ⇒ IPv6Data
Returns a new instance of IPv6Data.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 4 def initialize data data.extend EventMachine::SFlow::BinaryString @length, @protocol = data.unpack("NN") data.advance(8) src = data.unpack("NNNN") @src_ip = IPAddr.new((src[0] << 96) + (src[1] << 64) + (src[2] << 32) + src[3], Socket::AF_INET6) data.advance(16) dst = data.unpack("NNNN") @dst_ip = IPAddr.new((dst[0] << 96) + (dst[1] << 64) + (dst[2] << 32) + dst[3], Socket::AF_INET6) data.advance(16) @src_port, @dst_port, @tcp_flags, @priority = data.unpack("NNNN") data.advance(16) end |
Instance Attribute Details
#dst_ip ⇒ Object
Returns the value of attribute dst_ip.
2 3 4 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 2 def dst_ip @dst_ip end |
#dst_port ⇒ Object
Returns the value of attribute dst_port.
2 3 4 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 2 def dst_port @dst_port end |
#length ⇒ Object
Returns the value of attribute length.
2 3 4 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 2 def length @length end |
#priority ⇒ Object
Returns the value of attribute priority.
2 3 4 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 2 def priority @priority end |
#protocol ⇒ Object
Returns the value of attribute protocol.
2 3 4 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 2 def protocol @protocol end |
#src_ip ⇒ Object
Returns the value of attribute src_ip.
2 3 4 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 2 def src_ip @src_ip end |
#src_port ⇒ Object
Returns the value of attribute src_port.
2 3 4 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 2 def src_port @src_port end |
#tcp_flags ⇒ Object
Returns the value of attribute tcp_flags.
2 3 4 |
# File 'lib/em-sflow/packet/ipv6_data.rb', line 2 def tcp_flags @tcp_flags end |