Lines Matching full:sfd
664 int err, i, fd, udp, sfd[6] = {0xdeadbeef}; in test_sockmap() local
676 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap()
677 if (sfd[i] < 0) in test_sockmap()
679 err = setsockopt(sfd[i], SOL_SOCKET, SO_REUSEADDR, in test_sockmap()
685 err = ioctl(sfd[i], FIONBIO, (char *)&one); in test_sockmap()
694 err = bind(sfd[i], (struct sockaddr *)&addr, sizeof(addr)); in test_sockmap()
697 err, i, sfd[i]); in test_sockmap()
700 err = listen(sfd[i], 32); in test_sockmap()
708 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap()
709 if (sfd[i] < 0) in test_sockmap()
711 err = setsockopt(sfd[i], SOL_SOCKET, SO_REUSEADDR, in test_sockmap()
721 err = connect(sfd[i], (struct sockaddr *)&addr, sizeof(addr)); in test_sockmap()
730 sfd[i] = accept(sfd[i - 4], NULL, NULL); in test_sockmap()
731 if (sfd[i] < 0) { in test_sockmap()
747 close(sfd[i]); in test_sockmap()
768 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); in test_sockmap()
771 i, sfd[i]); in test_sockmap()
931 err = bpf_map_update_elem(map_fd_rx, &i, &sfd[i], BPF_ANY); in test_sockmap()
934 err, i, sfd[i]); in test_sockmap()
937 err = bpf_map_update_elem(map_fd_tx, &i, &sfd[i], BPF_ANY); in test_sockmap()
940 err, i, sfd[i]); in test_sockmap()
950 err, i, sfd[i]); in test_sockmap()
956 err, i, sfd[i]); in test_sockmap()
961 /* Put sfd[2] (sending fd below) into msg map to test sendmsg bpf */ in test_sockmap()
963 err = bpf_map_update_elem(map_fd_msg, &i, &sfd[2], BPF_ANY); in test_sockmap()
973 sc = send(sfd[2], buf, 20, 0); in test_sockmap()
980 FD_SET(sfd[3], &w); in test_sockmap()
983 s = select(sfd[3] + 1, &w, NULL, NULL, &to); in test_sockmap()
992 if (!FD_ISSET(sfd[3], &w)) { in test_sockmap()
997 rc = recv(sfd[3], buf, sizeof(buf), 0); in test_sockmap()
1007 sc = send(sfd[2], buf, 20, 0); in test_sockmap()
1015 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_NOEXIST); in test_sockmap()
1021 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); in test_sockmap()
1027 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_EXIST); in test_sockmap()
1038 err, i, sfd[i]); in test_sockmap()
1057 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); in test_sockmap()
1060 err, i, sfd[i]); in test_sockmap()
1063 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_NOEXIST); in test_sockmap()
1066 err, i, sfd[i]); in test_sockmap()
1069 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_EXIST); in test_sockmap()
1072 err, i, sfd[i]); in test_sockmap()
1085 &sfd[i], BPF_ANY); in test_sockmap()
1087 &sfd[i], BPF_ANY); in test_sockmap()
1125 close(sfd[i]); in test_sockmap()
1135 close(sfd[i]); in test_sockmap()
1144 close(sfd[i]); in test_sockmap()