Lines Matching defs:rcv_fd
30 static void build_rcv_group(int *rcv_fd, size_t len, int family, int proto)
56 rcv_fd[i] = socket(family, proto, 0);
57 if (rcv_fd[i] < 0)
61 if (setsockopt(rcv_fd[i], SOL_SOCKET, SO_REUSEPORT, &opt,
65 if (bind(rcv_fd[i], (struct sockaddr *)&addr, sizeof(addr)))
68 if (proto == SOCK_STREAM && listen(rcv_fd[i], len * 10))
161 void receive_on_node(int *rcv_fd, int len, int epfd, int node_id, int proto)
185 if (ev.data.fd == rcv_fd[i])
194 static void test(int *rcv_fd, int len, int family, int proto)
199 build_rcv_group(rcv_fd, len, family, proto);
200 attach_bpf(rcv_fd[0]);
207 ev.data.fd = rcv_fd[node];
208 if (epoll_ctl(epfd, EPOLL_CTL_ADD, rcv_fd[node], &ev))
217 receive_on_node(rcv_fd, len, epfd, node, proto);
225 receive_on_node(rcv_fd, len, epfd, node, proto);
230 close(rcv_fd[node]);
235 int *rcv_fd, nodes;
242 rcv_fd = calloc(nodes, sizeof(int));
243 if (!rcv_fd)
247 test(rcv_fd, nodes, AF_INET, SOCK_DGRAM);
250 test(rcv_fd, nodes, AF_INET6, SOCK_DGRAM);
253 test(rcv_fd, nodes, AF_INET, SOCK_STREAM);
256 test(rcv_fd, nodes, AF_INET6, SOCK_STREAM);
258 free(rcv_fd);