diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-10-08 19:58:31 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-15 09:32:03 -0500 |
commit | f71058439974f6236ecc0a8eeb58ccc2e8fc87f9 (patch) | |
tree | dff36303bdf4f4c5f6bd4b69aceca2f81e0f939c /net.h | |
parent | 283c7c63f5c56c4d0340fb39093fb47e75cb122e (diff) | |
download | qemu-f71058439974f6236ecc0a8eeb58ccc2e8fc87f9.tar.gz qemu-f71058439974f6236ecc0a8eeb58ccc2e8fc87f9.tar.bz2 qemu-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.h | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -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); |