#include "qemu/osdep.h"
#include "qapi/error.h"
#include "tap_int.h"
-#include "qemu-common.h"
-#include "sysemu/sysemu.h"
+#include "qemu/cutils.h"
#include "qemu/error-report.h"
#if defined(__NetBSD__) || defined(__FreeBSD__)
if (*ifname) {
snprintf(dname, sizeof dname, "/dev/%s", ifname);
} else {
-#if defined(__OpenBSD__)
- snprintf(dname, sizeof dname, "/dev/tun%d", i);
-#else
snprintf(dname, sizeof dname, "/dev/tap%d", i);
-#endif
}
- TFR(fd = open(dname, O_RDWR));
+ fd = RETRY_ON_EINTR(open(dname, O_RDWR));
if (fd >= 0) {
break;
}
return -1;
}
}
- fcntl(fd, F_SETFL, O_NONBLOCK);
+ g_unix_set_fd_nonblocking(fd, true, NULL);
return fd;
}
int fd, s, ret;
struct ifreq ifr;
- TFR(fd = open(PATH_NET_TAP, O_RDWR));
+ fd = RETRY_ON_EINTR(open(PATH_NET_TAP, O_RDWR));
if (fd < 0) {
error_setg_errno(errp, errno, "could not open %s", PATH_NET_TAP);
return -1;
if (ifname[0] != '\0') {
char dname[100];
snprintf(dname, sizeof dname, "/dev/%s", ifname);
- TFR(fd = open(dname, O_RDWR));
+ fd = RETRY_ON_EINTR(open(dname, O_RDWR));
if (fd < 0 && errno != ENOENT) {
error_setg_errno(errp, errno, "could not open %s", dname);
return -1;
goto error;
}
- fcntl(fd, F_SETFL, O_NONBLOCK);
+ g_unix_set_fd_nonblocking(fd, true, NULL);
return fd;
error:
{
}
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
{
return 0;
}
return 0;
}
+int tap_probe_has_uso(int fd)
+{
+ return 0;
+}
+
int tap_probe_vnet_hdr_len(int fd, int len)
{
return 0;
}
void tap_fd_set_offload(int fd, int csum, int tso4,
- int tso6, int ecn, int ufo)
+ int tso6, int ecn, int ufo, int uso4, int uso6)
{
}
{
return -1;
}
+
+int tap_fd_set_steering_ebpf(int fd, int prog_fd)
+{
+ return -1;
+}