Lines Matching refs:bpf

753 int uml_vector_attach_bpf(int fd, void *bpf)  in uml_vector_attach_bpf()  argument
755 struct sock_fprog *prog = bpf; in uml_vector_attach_bpf()
757 int err = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, bpf, sizeof(struct sock_fprog)); in uml_vector_attach_bpf()
764 int uml_vector_detach_bpf(int fd, void *bpf) in uml_vector_detach_bpf() argument
766 struct sock_fprog *prog = bpf; in uml_vector_detach_bpf()
768 int err = setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, bpf, sizeof(struct sock_fprog)); in uml_vector_detach_bpf()
775 struct sock_filter *bpf; in uml_vector_default_bpf() local
787 bpf = uml_kmalloc( in uml_vector_default_bpf()
789 if (bpf) { in uml_vector_default_bpf()
790 bpf_prog->filter = bpf; in uml_vector_default_bpf()
792 bpf[0] = (struct sock_filter){ 0x20, 0, 0, 0x00000008 }; in uml_vector_default_bpf()
794 bpf[1] = (struct sock_filter){ 0x15, 0, 3, ntohl(*mac1)}; in uml_vector_default_bpf()
796 bpf[2] = (struct sock_filter){ 0x28, 0, 0, 0x00000006 }; in uml_vector_default_bpf()
798 bpf[3] = (struct sock_filter){ 0x15, 0, 1, ntohs(*mac2)}; in uml_vector_default_bpf()
800 bpf[4] = (struct sock_filter){ 0x6, 0, 0, 0x00000000 }; in uml_vector_default_bpf()
802 bpf[5] = (struct sock_filter){ 0x6, 0, 0, 0x00040000 }; in uml_vector_default_bpf()
814 struct sock_filter *bpf; in uml_vector_user_bpf() local
838 bpf = uml_kmalloc(statbuf.st_size, UM_GFP_KERNEL); in uml_vector_user_bpf()
839 if (bpf == NULL) { in uml_vector_user_bpf()
843 bpf_prog->filter = bpf; in uml_vector_user_bpf()
844 res = os_read_file(ffd, bpf, statbuf.st_size); in uml_vector_user_bpf()
847 kfree(bpf); in uml_vector_user_bpf()