Lines Matching refs:fd
72 int fd, val; in sock_fanout_open() local
74 fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); in sock_fanout_open()
75 if (fd < 0) { in sock_fanout_open()
82 if (setsockopt(fd, SOL_PACKET, PACKET_FANOUT, &val, sizeof(val))) { in sock_fanout_open()
83 if (close(fd)) { in sock_fanout_open()
90 pair_udp_setfilter(fd); in sock_fanout_open()
91 return fd; in sock_fanout_open()
94 static char *sock_fanout_open_ring(int fd) in sock_fanout_open_ring() argument
105 if (setsockopt(fd, SOL_PACKET, PACKET_VERSION, (void *) &val, in sock_fanout_open_ring()
110 if (setsockopt(fd, SOL_PACKET, PACKET_RX_RING, (void *) &req, in sock_fanout_open_ring()
117 PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in sock_fanout_open_ring()
126 static int sock_fanout_read_ring(int fd, void *ring) in sock_fanout_read_ring() argument