mirror of
https://github.com/JoelBender/bacpypes
synced 2025-10-05 22:18:16 +08:00
sync the py34 changes with py27 #173
This commit is contained in:
parent
48f55e0b73
commit
2fb24ae22e
|
@ -355,16 +355,17 @@ def decode_file(fname):
|
|||
if not pcap:
|
||||
raise RuntimeError("failed to import pcap")
|
||||
|
||||
# create a pcap object
|
||||
# create a pcap object, reading from the file
|
||||
p = pcap.pcap(fname)
|
||||
|
||||
for timestamp, data in p:
|
||||
# loop through the packets
|
||||
for i, (timestamp, data) in enumerate(p):
|
||||
pkt = decode_packet(data)
|
||||
if not pkt:
|
||||
continue
|
||||
|
||||
# save the index and timestamp in the packet
|
||||
# pkt._index = i
|
||||
# save the packet number (as viewed in Wireshark) and timestamp
|
||||
pkt._number = i + 1
|
||||
pkt._timestamp = timestamp
|
||||
|
||||
yield pkt
|
||||
|
|
|
@ -355,9 +355,10 @@ def decode_file(fname):
|
|||
if not pcap:
|
||||
raise RuntimeError("failed to import pcap")
|
||||
|
||||
# create a pcap object
|
||||
# create a pcap object, reading from the file
|
||||
p = pcap.pcap(fname)
|
||||
|
||||
# loop through the packets
|
||||
for i, (timestamp, data) in enumerate(p):
|
||||
pkt = decode_packet(data)
|
||||
if not pkt:
|
||||
|
|
Loading…
Reference in New Issue
Block a user