1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef QEMU_NET_QUEUE_H
25#define QEMU_NET_QUEUE_H
26
27#include "qemu-common.h"
28
29typedef struct NetPacket NetPacket;
30typedef struct NetQueue NetQueue;
31
32typedef void (NetPacketSent) (NetClientState *sender, ssize_t ret);
33
34#define QEMU_NET_PACKET_FLAG_NONE 0
35#define QEMU_NET_PACKET_FLAG_RAW (1<<0)
36
37
38
39
40
41
42typedef ssize_t (NetQueueDeliverFunc)(NetClientState *sender,
43 unsigned flags,
44 const struct iovec *iov,
45 int iovcnt,
46 void *opaque);
47
48NetQueue *qemu_new_net_queue(NetQueueDeliverFunc *deliver, void *opaque);
49
50void qemu_net_queue_append_iov(NetQueue *queue,
51 NetClientState *sender,
52 unsigned flags,
53 const struct iovec *iov,
54 int iovcnt,
55 NetPacketSent *sent_cb);
56
57void qemu_del_net_queue(NetQueue *queue);
58
59ssize_t qemu_net_queue_send(NetQueue *queue,
60 NetClientState *sender,
61 unsigned flags,
62 const uint8_t *data,
63 size_t size,
64 NetPacketSent *sent_cb);
65
66ssize_t qemu_net_queue_send_iov(NetQueue *queue,
67 NetClientState *sender,
68 unsigned flags,
69 const struct iovec *iov,
70 int iovcnt,
71 NetPacketSent *sent_cb);
72
73void qemu_net_queue_purge(NetQueue *queue, NetClientState *from);
74bool qemu_net_queue_flush(NetQueue *queue);
75
76#endif
77