Revision ceb69615
b/net.h | ||
---|---|---|
1 | 1 |
#ifndef QEMU_NET_H |
2 | 2 |
#define QEMU_NET_H |
3 | 3 |
|
4 |
#include <stdbool.h> |
|
4 | 5 |
#include "qemu-queue.h" |
5 | 6 |
#include "qemu-common.h" |
6 | 7 |
#include "qdict.h" |
... | ... | |
36 | 37 |
NET_CLIENT_TYPE_DUMP |
37 | 38 |
} net_client_type; |
38 | 39 |
|
40 |
typedef void (NetPoll)(VLANClientState *, bool enable); |
|
39 | 41 |
typedef int (NetCanReceive)(VLANClientState *); |
40 | 42 |
typedef ssize_t (NetReceive)(VLANClientState *, const uint8_t *, size_t); |
41 | 43 |
typedef ssize_t (NetReceiveIOV)(VLANClientState *, const struct iovec *, int); |
... | ... | |
51 | 53 |
NetCanReceive *can_receive; |
52 | 54 |
NetCleanup *cleanup; |
53 | 55 |
LinkStatusChanged *link_status_changed; |
56 |
NetPoll *poll; |
|
54 | 57 |
} NetClientInfo; |
55 | 58 |
|
56 | 59 |
struct VLANClientState { |
b/net/tap.c | ||
---|---|---|
262 | 262 |
close(s->fd); |
263 | 263 |
} |
264 | 264 |
|
265 |
static void tap_poll(VLANClientState *nc, bool enable) |
|
266 |
{ |
|
267 |
TAPState *s = DO_UPCAST(TAPState, nc, nc); |
|
268 |
tap_read_poll(s, enable); |
|
269 |
tap_write_poll(s, enable); |
|
270 |
} |
|
271 |
|
|
265 | 272 |
/* fd support */ |
266 | 273 |
|
267 | 274 |
static NetClientInfo net_tap_info = { |
... | ... | |
270 | 277 |
.receive = tap_receive, |
271 | 278 |
.receive_raw = tap_receive_raw, |
272 | 279 |
.receive_iov = tap_receive_iov, |
280 |
.poll = tap_poll, |
|
273 | 281 |
.cleanup = tap_cleanup, |
274 | 282 |
}; |
275 | 283 |
|
Also available in: Unified diff