code: def get_dev_bpf():
      
  
      # Get the first available BPF handle
      for bpf in range(256):
          try:
              fd = os.open("/dev/bpf%i" % bpf, os.O_RDWR)
              return (fd, bpf)
          except OSError:
              continue
  
      raise Scapy_Exception("No /dev/bpf handle is available !")
docs: Returns an opened BPF file object