def _handle_packet(self, packet):
        try:
            ip_p = get_ip_packet(packet.load, 0, self._port)
        except __HOLE__:
            return

        ip_data = getattr(ip_p, 'data', None)
        if ip_data is None:
            return

        if ip_data.sport != self._port and ip_data.dport != self._port:
            return

        if self._ip:
            src_ip = get_ip(ip_p, ip_p.src)
            dst_ip = get_ip(ip_p, ip_p.dst)

            if src_ip not in self._ip and dst_ip not in self._ip:
                return

        self._queue.append((packet.time, ip_p))
dataset/ETHPy150Open pinterest/thrift-tools/thrift_tools/sniffer.py/Sniffer._handle_packet