Class: Jruby::Pcap::Packet
- Inherits:
-
Object
- Object
- Jruby::Pcap::Packet
- Defined in:
- lib/jruby-pcap/packet.rb
Instance Method Summary collapse
-
#initialize(packet, handle) ⇒ Packet
constructor
A new instance of Packet.
- #ipv4 ⇒ Object
- #timestamp ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(packet, handle) ⇒ Packet
Returns a new instance of Packet.
6 7 8 9 |
# File 'lib/jruby-pcap/packet.rb', line 6 def initialize(packet, handle) @packet = packet @handle = handle end |
Instance Method Details
#ipv4 ⇒ Object
15 16 17 |
# File 'lib/jruby-pcap/packet.rb', line 15 def ipv4 Frame.new(@handle, @packet.get(IpV4Packet)) end |
#timestamp ⇒ Object
11 12 13 |
# File 'lib/jruby-pcap/packet.rb', line 11 def @handle. * 1000 end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/jruby-pcap/packet.rb', line 19 def to_s @packet.to_s end |