Skip to content

Instantly share code, notes, and snippets.

@ivelin
Created June 19, 2019 17:49
Show Gist options
  • Save ivelin/25ec18b74e01e3683ce502c938863102 to your computer and use it in GitHub Desktop.
Save ivelin/25ec18b74e01e3683ce502c938863102 to your computer and use it in GitHub Desktop.
dataset = pcap_io.PcapDataset(url_filenames, batch=1)
packets_total = 0
for v in dataset:
(packet_timestamp, packet_data) = v
if packets_total == 0:
assert packet_timestamp.numpy()[0] == 1084443427.311224 # we know this is the correct value in the test pcap file
assert len(packet_data.numpy()[0]) == 62 # we know this is the correct packet data buffer length in the test pcap file
packets_total += 1
assert packets_total == 43 # we know this is the correct number of packets in the test pcap file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment