aboutsummaryrefslogtreecommitdiff
path: root/net.h
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-10-22 17:43:38 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:29:00 -0500
commitbb6e636443d49f7444f49ab64dc7ec6aae1493a7 (patch)
tree67f2e6436aec330d4ebbd3430e3c0dd9ad84f0f8 /net.h
parentbaf74c95802347e218721dbaa331997e11fbf903 (diff)
net: add a client type code
This is so as to allow APIs which operate on specific client types without having to add a function table entry which is only implemented by a single client type. 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.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/net.h b/net.h
index c96f29142d..f592ffb290 100644
--- a/net.h
+++ b/net.h
@@ -26,6 +26,16 @@ typedef struct NICConf {
/* VLANs support */
+typedef enum {
+ NET_CLIENT_TYPE_NONE,
+ NET_CLIENT_TYPE_NIC,
+ NET_CLIENT_TYPE_SLIRP,
+ NET_CLIENT_TYPE_TAP,
+ NET_CLIENT_TYPE_SOCKET,
+ NET_CLIENT_TYPE_VDE,
+ NET_CLIENT_TYPE_DUMP
+} net_client_type;
+
typedef int (NetCanReceive)(VLANClientState *);
typedef ssize_t (NetReceive)(VLANClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(VLANClientState *, const struct iovec *, int);
@@ -33,6 +43,7 @@ typedef void (NetCleanup) (VLANClientState *);
typedef void (LinkStatusChanged)(VLANClientState *);
struct VLANClientState {
+ net_client_type type;
NetReceive *receive;
NetReceiveIOV *receive_iov;
/* Packets may still be sent if this returns zero. It's used to