def test():
    """Open up a test pcap file and stream the packets"""

    data_path = file_utils.relative_dir(__file__, '../../data/http.pcap')
    streamer = PacketStreamer(iface_name=data_path, max_packets=50)
    for packet in streamer.output_stream:
        print(packet)

    # Test BPF Filter
    data_path = file_utils.relative_dir(__file__, '../../data/dns.pcap')
    streamer = PacketStreamer(iface_name=data_path, bpf='udp and dst port 53', max_packets=50)
    for packet in streamer.output_stream:
        print(packet)
def test ( ) : data_path = file_utils . relative_dir ( __file__ , '../../data/http.pcap' ) streamer = PacketStreamer ( iface_name = data_path , max_packets = 50 ) for packet in streamer . output_stream : print ( packet ) data_path = file_utils . relative_dir ( __file__ , '../../data/dns.pcap' ) streamer = PacketStreamer ( iface_name = data_path , bpf = 'udp and dst port 53' , max_packets = 50 ) for packet in streamer . output_stream : print ( packet )
Open up a test pcap file and stream the packets