Lines Matching refs:fd
54 int fd = -1; in open_socket() local
64 fd = open(_PATH_BPF, O_RDWR | O_NONBLOCK); in open_socket()
72 fd = open(device, O_RDWR | O_NONBLOCK); in open_socket()
73 } while (fd == -1 && errno == EBUSY); in open_socket()
77 if (fd == -1) in open_socket()
80 if (ioctl(fd, BIOCVERSION, &pv) == -1) in open_socket()
90 if (ioctl(fd, BIOCSETIF, &ifr) == -1) in open_socket()
94 if (ioctl(fd, BIOCGBLEN, &buf_len) == -1) in open_socket()
105 if (ioctl(fd, BIOCIMMEDIATE, &flags) == -1) in open_socket()
119 if (ioctl(fd, BIOCSETF, &pf) == -1) in open_socket()
121 if (set_cloexec(fd) == -1) in open_socket()
126 *fdp = fd; in open_socket()
128 return fd; in open_socket()
133 close(fd); in open_socket()
143 int fd; in send_raw_packet() local
153 fd = iface->arp_fd; in send_raw_packet()
155 fd = iface->raw_fd; in send_raw_packet()
156 return writev(fd, iov, 2); in send_raw_packet()
165 int fd = -1; in get_raw_packet() local
171 fd = iface->arp_fd; in get_raw_packet()
173 fd = iface->raw_fd; in get_raw_packet()
177 bytes = read(fd, iface->buffer, iface->buffer_size); in get_raw_packet()