Use range-based for loops to iterate over all packets.