blob: ef7dd83f556e479da41e25e755c492dcc9db692c [file] [log] [blame]
Sui Chenb65280f2020-06-30 18:14:03 -07001# This script is used for printing out the number of packets in a pcap file
2
3from scapy.all import rdpcap
4import sys
5
6file_name = sys.argv[1]
7try:
8 stream = rdpcap(file_name)
9 n = 0
10 for packet in stream:
11 n += 1
12 print(n)
13except Exception as e:
14 pass