Lines Matching refs:bpf

754 int uml_vector_attach_bpf(int fd, void *bpf)  in uml_vector_attach_bpf()  argument
756 struct sock_fprog *prog = bpf; in uml_vector_attach_bpf()
758 int err = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, bpf, sizeof(struct sock_fprog)); in uml_vector_attach_bpf()
765 int uml_vector_detach_bpf(int fd, void *bpf) in uml_vector_detach_bpf() argument
767 struct sock_fprog *prog = bpf; in uml_vector_detach_bpf()
769 int err = setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, bpf, sizeof(struct sock_fprog)); in uml_vector_detach_bpf()
776 struct sock_filter *bpf; in uml_vector_default_bpf() local
788 bpf = uml_kmalloc( in uml_vector_default_bpf()
790 if (bpf) { in uml_vector_default_bpf()
791 bpf_prog->filter = bpf; in uml_vector_default_bpf()
793 bpf[0] = (struct sock_filter){ 0x20, 0, 0, 0x00000008 }; in uml_vector_default_bpf()
795 bpf[1] = (struct sock_filter){ 0x15, 0, 3, ntohl(*mac1)}; in uml_vector_default_bpf()
797 bpf[2] = (struct sock_filter){ 0x28, 0, 0, 0x00000006 }; in uml_vector_default_bpf()
799 bpf[3] = (struct sock_filter){ 0x15, 0, 1, ntohs(*mac2)}; in uml_vector_default_bpf()
801 bpf[4] = (struct sock_filter){ 0x6, 0, 0, 0x00000000 }; in uml_vector_default_bpf()
803 bpf[5] = (struct sock_filter){ 0x6, 0, 0, 0x00040000 }; in uml_vector_default_bpf()
815 struct sock_filter *bpf; in uml_vector_user_bpf() local
839 bpf = uml_kmalloc(statbuf.st_size, UM_GFP_KERNEL); in uml_vector_user_bpf()
840 if (bpf == NULL) { in uml_vector_user_bpf()
844 bpf_prog->filter = bpf; in uml_vector_user_bpf()
845 res = os_read_file(ffd, bpf, statbuf.st_size); in uml_vector_user_bpf()
848 kfree(bpf); in uml_vector_user_bpf()