summaryrefslogtreecommitdiff
path: root/net.h
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-10-08 19:58:31 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-15 09:32:03 -0500
commitf71058439974f6236ecc0a8eeb58ccc2e8fc87f9 (patch)
treedff36303bdf4f4c5f6bd4b69aceca2f81e0f939c /net.h
parentnet: allow NICs to be connected to netdevs (diff)
downloadqemu-kvm-f71058439974f6236ecc0a8eeb58ccc2e8fc87f9.tar.gz
qemu-kvm-f71058439974f6236ecc0a8eeb58ccc2e8fc87f9.tar.bz2
qemu-kvm-f71058439974f6236ecc0a8eeb58ccc2e8fc87f9.zip
net: refactor packet queueing code
The packet queue code is fairly standalone, has some complex details and easily reusable. It makes sense to split it out on its own. This patch doesn't contain any functional changes. Patchworks-ID: 35511 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.h')
-rw-r--r--net.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/net.h b/net.h
index fa59c3d22..e79f524d5 100644
--- a/net.h
+++ b/net.h
@@ -5,11 +5,10 @@
#include "qemu-common.h"
#include "qdict.h"
#include "qemu-option.h"
+#include "net-queue.h"
/* VLANs support */
-typedef struct VLANClientState VLANClientState;
-
typedef int (NetCanReceive)(VLANClientState *);
typedef ssize_t (NetReceive)(VLANClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(VLANClientState *, const struct iovec *, int);
@@ -34,25 +33,12 @@ struct VLANClientState {
char info_str[256];
};
-typedef struct VLANPacket VLANPacket;
-
-typedef void (NetPacketSent) (VLANClientState *, ssize_t);
-
-struct VLANPacket {
- QTAILQ_ENTRY(VLANPacket) entry;
- VLANClientState *sender;
- int size;
- NetPacketSent *sent_cb;
- uint8_t data[0];
-};
-
struct VLANState {
int id;
QTAILQ_HEAD(, VLANClientState) clients;
QTAILQ_ENTRY(VLANState) next;
unsigned int nb_guest_devs, nb_host_devs;
- QTAILQ_HEAD(send_queue, VLANPacket) send_queue;
- int delivering;
+ NetQueue *send_queue;
};
VLANState *qemu_find_vlan(int id, int allocate);