Lines Matching refs:fd

44     int fd, ret;  in tap_open()  local
48 fd = RETRY_ON_EINTR(open(PATH_NET_TUN, O_RDWR)); in tap_open()
49 if (fd < 0) { in tap_open()
56 if (ioctl(fd, TUNGETFEATURES, &features) == -1) { in tap_open()
76 close(fd); in tap_open()
85 ioctl(fd, TUNSETVNETHDRSZ, &len); in tap_open()
92 close(fd); in tap_open()
103 ret = ioctl(fd, TUNSETIFF, (void *) &ifr); in tap_open()
112 close(fd); in tap_open()
116 g_unix_set_fd_nonblocking(fd, true, NULL); in tap_open()
117 return fd; in tap_open()
132 void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp) in tap_set_sndbuf() argument
144 if (ioctl(fd, TUNSETSNDBUF, &sndbuf) == -1 && tap->has_sndbuf) { in tap_set_sndbuf()
149 int tap_probe_vnet_hdr(int fd, Error **errp) in tap_probe_vnet_hdr() argument
154 if (ioctl(fd, TUNGETIFF, &ifr) != 0) { in tap_probe_vnet_hdr()
157 "Unable to query TUNGETIFF on FD %d", fd); in tap_probe_vnet_hdr()
164 int tap_probe_has_ufo(int fd) in tap_probe_has_ufo() argument
170 if (ioctl(fd, TUNSETOFFLOAD, offload) < 0) in tap_probe_has_ufo()
176 int tap_probe_has_uso(int fd) in tap_probe_has_uso() argument
182 if (ioctl(fd, TUNSETOFFLOAD, offload) < 0) { in tap_probe_has_uso()
188 void tap_fd_set_vnet_hdr_len(int fd, int len) in tap_fd_set_vnet_hdr_len() argument
190 if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) { in tap_fd_set_vnet_hdr_len()
197 int tap_fd_set_vnet_le(int fd, int is_le) in tap_fd_set_vnet_le() argument
201 if (!ioctl(fd, TUNSETVNETLE, &arg)) { in tap_fd_set_vnet_le()
214 int tap_fd_set_vnet_be(int fd, int is_be) in tap_fd_set_vnet_be() argument
218 if (!ioctl(fd, TUNSETVNETBE, &arg)) { in tap_fd_set_vnet_be()
231 void tap_fd_set_offload(int fd, int csum, int tso4, in tap_fd_set_offload() argument
237 if (ioctl(fd, TUNSETOFFLOAD, 0) != 0 && errno == EINVAL) { in tap_fd_set_offload()
259 if (ioctl(fd, TUNSETOFFLOAD, offload) != 0) { in tap_fd_set_offload()
261 if (ioctl(fd, TUNSETOFFLOAD, offload) != 0) { in tap_fd_set_offload()
263 if (ioctl(fd, TUNSETOFFLOAD, offload) != 0) { in tap_fd_set_offload()
272 int tap_fd_enable(int fd) in tap_fd_enable() argument
280 ret = ioctl(fd, TUNSETQUEUE, (void *) &ifr); in tap_fd_enable()
290 int tap_fd_disable(int fd) in tap_fd_disable() argument
298 ret = ioctl(fd, TUNSETQUEUE, (void *) &ifr); in tap_fd_disable()
307 int tap_fd_get_ifname(int fd, char *ifname) in tap_fd_get_ifname() argument
311 if (ioctl(fd, TUNGETIFF, &ifr) != 0) { in tap_fd_get_ifname()
321 int tap_fd_set_steering_ebpf(int fd, int prog_fd) in tap_fd_set_steering_ebpf() argument
323 if (ioctl(fd, TUNSETSTEERINGEBPF, (void *) &prog_fd) != 0) { in tap_fd_set_steering_ebpf()
326 strerror(errno), fd, prog_fd); in tap_fd_set_steering_ebpf()