docs: def analyse_pcap(infile, filename):
      """
      Run IDS across the supplied file.
  
      :param infile: File like object containing pcap data.
      :param filename: Filename of the submitted file.
      :returns: Dictionary of analysis results.
      """
      tmp = tempfile.NamedTemporaryFile(suffix=".pcap", delete=False)
      m = hashlib.md5()
      results = {'filename': filename,
                 'status': 'Failed',
                 'apiversion': __version__,
                 }
      try:
          size = 0
          while True:
              buf = infile.read(16384)
              if not buf: break
              tmp.write(buf)
              size += len(buf)
              m.update(buf)
          tmp.close()
          results['md5'] = m.hexdigest()
          results['filesize'] = size
          results.update(runner.run(tmp.name))
      except OSError as ex:
          results['stderr'] = str(ex)
      finally:
          os.remove(tmp.name)
      return results