def __init__(self, listen=False):

        # Setup directories
        self.orig_dir = os.getcwd()
        self.temp_dir = None

        # This command will create two files workbench.pcap[0-1]
        if (listen):
            self.tcpdump_cmd = 'tcpdump -I -P -i en0 -C 1 -s 0 -k NP -W 2 -w workbench.pcap'
        else:
            self.tcpdump_cmd = 'tcpdump -i en0 -C 1 -s 0 -k NP -W 2 -w workbench.pcap'
        self.tcpdump_process = None
        self.pcap_index = 0

        # The logic here is a bit odd, we have an 'on-deck' pcap file
        # and when a new pcap file is created the on-deck one is considered
        # finished, sent to workbench and then deleted
        self.on_deck = None

        # Report the tcpdump command being used
        print 'Capturing with: %s' % self.tcpdump_cmd
Initialization
dataset/ETHPy150Open SuperCowPowers/workbench/workbench/utils/pcap_streamer.py/TCPDumpToWorkbench.__init__