summaryrefslogtreecommitdiff
path: root/tap-linux.h
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-10-22 17:43:35 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:29:00 -0500
commit8e0f8e5bf8fd483dd28329055336cf895b74c89f (patch)
treeffe6c1da95d86b0a9c1cedbb0c29dd5f39c3500b /tap-linux.h
parent38c75be3139a117b02350dbda9d48d47aa57fa3d (diff)
downloadqemu-8e0f8e5bf8fd483dd28329055336cf895b74c89f.tar.gz
net: enable IFF_VNET_HDR on tap fds if available
For now, we just add an empty header before writing and strip the header after reading. We really only want IFF_VNET_HDR when virtio_net is using it, but it would significantly complicate matters to try and do that. There should be little or no performance impact with always adding headers. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'tap-linux.h')
-rw-r--r--tap-linux.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tap-linux.h b/tap-linux.h
index cd07ea8efb..8e7534829e 100644
--- a/tap-linux.h
+++ b/tap-linux.h
@@ -16,14 +16,28 @@
#ifndef QEMU_TAP_H
#define QEMU_TAP_H
+#include <stdint.h>
#include <linux/ioctl.h>
/* Ioctl defines */
#define TUNSETIFF _IOW('T', 202, int)
+#define TUNGETFEATURES _IOR('T', 207, unsigned int)
+#define TUNGETIFF _IOR('T', 210, unsigned int)
#define TUNSETSNDBUF _IOW('T', 212, int)
/* TUNSETIFF ifr flags */
#define IFF_TAP 0x0002
#define IFF_NO_PI 0x1000
+#define IFF_VNET_HDR 0x4000
+
+struct virtio_net_hdr
+{
+ uint8_t flags;
+ uint8_t gso_type;
+ uint16_t hdr_len;
+ uint16_t gso_size;
+ uint16_t csum_start;
+ uint16_t csum_offset;
+};
#endif /* QEMU_TAP_H */