summaryrefslogtreecommitdiffstats
path: root/net.h
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-05-18 13:13:16 +0100
committerMark McLoughlin <markmc@redhat.com>2009-06-09 11:38:49 +0100
commitcda9046ba7dbba45f3016e5d60caffa2d72960fa (patch)
treeda29fa06d782170b8214be44382549735eafa3b3 /net.h
parent463af5349a787160642f023dad10eaf0cb419fb7 (diff)
downloadhqemu-cda9046ba7dbba45f3016e5d60caffa2d72960fa.zip
hqemu-cda9046ba7dbba45f3016e5d60caffa2d72960fa.tar.gz
net: re-name vc->fd_read() to vc->receive()
VLANClientState's fd_read() handler doesn't read from file descriptors, it adds a buffer to the client's receive queue. Re-name the handlers to make things a little less confusing. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Diffstat (limited to 'net.h')
-rw-r--r--net.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/net.h b/net.h
index ab445aa..4d204e0 100644
--- a/net.h
+++ b/net.h
@@ -5,19 +5,20 @@
/* VLANs support */
-typedef ssize_t (IOReadvHandler)(void *, const struct iovec *, int);
-
typedef struct VLANClientState VLANClientState;
+typedef int (NetCanReceive)(void *);
+typedef void (NetReceive)(void *, const uint8_t *, size_t);
+typedef ssize_t (NetReceiveIOV)(void *, const struct iovec *, int);
typedef void (NetCleanup) (VLANClientState *);
typedef void (LinkStatusChanged)(VLANClientState *);
struct VLANClientState {
- IOReadHandler *fd_read;
- IOReadvHandler *fd_readv;
+ NetReceive *receive;
+ NetReceiveIOV *receive_iov;
/* Packets may still be sent if this returns zero. It's used to
rate-limit the slirp code. */
- IOCanRWHandler *fd_can_read;
+ NetCanReceive *can_receive;
NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
int link_down;
@@ -51,9 +52,9 @@ VLANState *qemu_find_vlan(int id);
VLANClientState *qemu_new_vlan_client(VLANState *vlan,
const char *model,
const char *name,
- IOCanRWHandler *fd_can_read,
- IOReadHandler *fd_read,
- IOReadvHandler *fd_readv,
+ NetCanReceive *can_receive,
+ NetReceive *receive,
+ NetReceiveIOV *receive_iov,
NetCleanup *cleanup,
void *opaque);
void qemu_del_vlan_client(VLANClientState *vc);
@@ -130,9 +131,9 @@ void net_host_device_remove(Monitor *mon, int vlan_id, const char *device);
void qdev_get_macaddr(DeviceState *dev, uint8_t *macaddr);
VLANClientState *qdev_get_vlan_client(DeviceState *dev,
- IOCanRWHandler *fd_can_read,
- IOReadHandler *fd_read,
- IOReadvHandler *fd_readv,
+ NetCanReceive *can_receive,
+ NetReceive *receive,
+ NetReceiveIOV *receive_iov,
NetCleanup *cleanup,
void *opaque);
OpenPOWER on IntegriCloud