Esempio n. 1
0
    def start(self):
        if self.pc is not None:
            raise Exception('Already listening.')

        self.pc = PcapWrapper(self.interface, filters='tcp')

        try:
            self.pc.loop(self._on_packet)
        except KeyboardInterrupt:
            pass

        if self.pc.human_stats is not None:
            logging.info(self.pc.human_stats)