print('Total number of packets in the pcap file: ', counter)
print('Total number of ip packets: ', ipcounter)
print('Total number of tcp packets: ', tcpcounter)
print('Total number of udp packets: ', udpcounter)
Parsing a pcap file in python