code: def attach_filter(fd, bpf_filter, iface):
      
      bp = compile_filter(bpf_filter, iface)
      # Assign the BPF program to the interface
      ret = LIBC.ioctl(c_int(fd), BIOCSETF, cast(pointer(bp), c_char_p))
      if ret < 0:
          raise Scapy_Exception("Can't attach the BPF filter !")
docs: Attach a BPF filter to the BPF file descriptor