Can't get pcap file scanner to terminate normally

Earl Eiland eee at nmt.edu
Wed Feb 9 16:41:58 EST 2005


I'm using pcapy to scan a packet capture file.  I've tried a variety of
tests to end the loop at EOF, but can't seem to avoid the program
terminating with a pcapy.PcapError.  I've tested for empty lists (while
Raw == [] or Passed == []:) and strings (while Raw ==""] or Passed ==
"":) as well as the test in the sample below.

while Raw and Passed :
	if Raw_IP != Passed_IP:
		Dropped.dump(Raw_hdr, Raw_data)
	else:
		Passed_hdr, Passed_data = Passed.next()
	Raw_hdr, Raw_data = Raw.next()





More information about the Python-list mailing list