Module: PacketGen::Pcap Private
- Defined in:
- lib/packetgen/pcap.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Module to read PCAP files
Class Method Summary collapse
-
.read(filename) ⇒ Array<Packet>
private
Read a PCAP file.
Class Method Details
.read(filename) ⇒ Array<Packet>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Read a PCAP file
20 21 22 23 24 25 26 27 28 |
# File 'lib/packetgen/pcap.rb', line 20 def self.read(filename) packets = [] PCAPRUBWrapper.read_pcap(filename: filename) do |packet| next unless (packet = PacketGen.parse(packet.to_s)) packets << packet end packets end |