Lines Matching refs:fd
76 int fd, val; in sock_fanout_open() local
78 fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); in sock_fanout_open()
79 if (fd < 0) { in sock_fanout_open()
86 if (setsockopt(fd, SOL_PACKET, PACKET_FANOUT, &val, sizeof(val))) { in sock_fanout_open()
87 if (close(fd)) { in sock_fanout_open()
94 pair_udp_setfilter(fd); in sock_fanout_open()
95 return fd; in sock_fanout_open()
98 static void sock_fanout_set_ebpf(int fd) in sock_fanout_set_ebpf() argument
132 if (setsockopt(fd, SOL_PACKET, PACKET_FANOUT_DATA, &pfd, sizeof(pfd))) { in sock_fanout_set_ebpf()
143 static char *sock_fanout_open_ring(int fd) in sock_fanout_open_ring() argument
154 if (setsockopt(fd, SOL_PACKET, PACKET_VERSION, (void *) &val, in sock_fanout_open_ring()
159 if (setsockopt(fd, SOL_PACKET, PACKET_RX_RING, (void *) &req, in sock_fanout_open_ring()
166 PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in sock_fanout_open_ring()
175 static int sock_fanout_read_ring(int fd, void *ring) in sock_fanout_read_ring() argument