Lines Matching refs:bpf
837 int uml_vector_attach_bpf(int fd, void *bpf) in uml_vector_attach_bpf() argument
839 struct sock_fprog *prog = bpf; in uml_vector_attach_bpf()
841 int err = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, bpf, sizeof(struct sock_fprog)); in uml_vector_attach_bpf()
848 int uml_vector_detach_bpf(int fd, void *bpf) in uml_vector_detach_bpf() argument
850 struct sock_fprog *prog = bpf; in uml_vector_detach_bpf()
852 int err = setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, bpf, sizeof(struct sock_fprog)); in uml_vector_detach_bpf()
859 struct sock_filter *bpf; in uml_vector_default_bpf() local
871 bpf = uml_kmalloc( in uml_vector_default_bpf()
873 if (bpf) { in uml_vector_default_bpf()
874 bpf_prog->filter = bpf; in uml_vector_default_bpf()
876 bpf[0] = (struct sock_filter){ 0x20, 0, 0, 0x00000008 }; in uml_vector_default_bpf()
878 bpf[1] = (struct sock_filter){ 0x15, 0, 3, ntohl(*mac1)}; in uml_vector_default_bpf()
880 bpf[2] = (struct sock_filter){ 0x28, 0, 0, 0x00000006 }; in uml_vector_default_bpf()
882 bpf[3] = (struct sock_filter){ 0x15, 0, 1, ntohs(*mac2)}; in uml_vector_default_bpf()
884 bpf[4] = (struct sock_filter){ 0x6, 0, 0, 0x00000000 }; in uml_vector_default_bpf()
886 bpf[5] = (struct sock_filter){ 0x6, 0, 0, 0x00040000 }; in uml_vector_default_bpf()
898 struct sock_filter *bpf; in uml_vector_user_bpf() local
922 bpf = uml_kmalloc(statbuf.st_size, UM_GFP_KERNEL); in uml_vector_user_bpf()
923 if (bpf == NULL) { in uml_vector_user_bpf()
927 bpf_prog->filter = bpf; in uml_vector_user_bpf()
928 res = os_read_file(ffd, bpf, statbuf.st_size); in uml_vector_user_bpf()
931 kfree(bpf); in uml_vector_user_bpf()