Lines Matching refs:sfd
487 int err, i, fd, udp, sfd[6] = {0xdeadbeef}; in test_sockmap() local
500 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap()
501 if (sfd[i] < 0) in test_sockmap()
503 err = setsockopt(sfd[i], SOL_SOCKET, SO_REUSEADDR, in test_sockmap()
509 err = ioctl(sfd[i], FIONBIO, (char *)&one); in test_sockmap()
518 err = bind(sfd[i], (struct sockaddr *)&addr, sizeof(addr)); in test_sockmap()
521 err, i, sfd[i]); in test_sockmap()
524 err = listen(sfd[i], 32); in test_sockmap()
532 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap()
533 if (sfd[i] < 0) in test_sockmap()
535 err = setsockopt(sfd[i], SOL_SOCKET, SO_REUSEADDR, in test_sockmap()
545 err = connect(sfd[i], (struct sockaddr *)&addr, sizeof(addr)); in test_sockmap()
554 sfd[i] = accept(sfd[i - 4], NULL, NULL); in test_sockmap()
555 if (sfd[i] < 0) { in test_sockmap()
582 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); in test_sockmap()
585 i, sfd[i]); in test_sockmap()
589 i, sfd[i]); in test_sockmap()
749 err = bpf_map_update_elem(map_fd_rx, &i, &sfd[i], BPF_ANY); in test_sockmap()
752 err, i, sfd[i]); in test_sockmap()
755 err = bpf_map_update_elem(map_fd_tx, &i, &sfd[i], BPF_ANY); in test_sockmap()
758 err, i, sfd[i]); in test_sockmap()
768 err, i, sfd[i]); in test_sockmap()
774 err, i, sfd[i]); in test_sockmap()
781 err = bpf_map_update_elem(map_fd_msg, &i, &sfd[2], BPF_ANY); in test_sockmap()
791 sc = send(sfd[2], buf, 20, 0); in test_sockmap()
798 FD_SET(sfd[3], &w); in test_sockmap()
801 s = select(sfd[3] + 1, &w, NULL, NULL, &to); in test_sockmap()
810 if (!FD_ISSET(sfd[3], &w)) { in test_sockmap()
815 rc = recv(sfd[3], buf, sizeof(buf), 0); in test_sockmap()
825 sc = send(sfd[2], buf, 20, 0); in test_sockmap()
833 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_NOEXIST); in test_sockmap()
839 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); in test_sockmap()
845 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_EXIST); in test_sockmap()
856 err, i, sfd[i]); in test_sockmap()
875 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); in test_sockmap()
878 err, i, sfd[i]); in test_sockmap()
881 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_NOEXIST); in test_sockmap()
884 err, i, sfd[i]); in test_sockmap()
887 err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_EXIST); in test_sockmap()
890 err, i, sfd[i]); in test_sockmap()
903 &sfd[i], BPF_ANY); in test_sockmap()
905 &sfd[i], BPF_ANY); in test_sockmap()
943 close(sfd[i]); in test_sockmap()
951 close(sfd[i]); in test_sockmap()
960 close(sfd[i]); in test_sockmap()