aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2012-07-24 16:35:13 +0100
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2012-08-01 13:32:10 +0100
commit4e68f7a0819f179c2ff90a60611806c789911cc2 (patch)
treef276c08566561b0badcc95fe82047b3e018ffa5d /net
parent94878994dcd5d7c2d9c3fe689d6841f6e7ddc2c2 (diff)
net: Rename VLANClientState to NetClientState
The vlan feature is no longer part of net core. Rename VLANClientState to NetClientState because net clients are not explicitly associated with a vlan at all, instead they have a peer net client to which they are connected. This patch is a mechanical search-and-replace except for a few whitespace fixups where changing VLANClientState to NetClientState misaligned whitespace. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/dump.c12
-rw-r--r--net/dump.h2
-rw-r--r--net/hub.c26
-rw-r--r--net/hub.h10
-rw-r--r--net/queue.c16
-rw-r--r--net/queue.h12
-rw-r--r--net/slirp.c14
-rw-r--r--net/slirp.h2
-rw-r--r--net/socket.c30
-rw-r--r--net/socket.h2
-rw-r--r--net/tap-win32.c22
-rw-r--r--net/tap.c38
-rw-r--r--net/tap.h20
-rw-r--r--net/vde.c12
-rw-r--r--net/vde.h2
15 files changed, 110 insertions, 110 deletions
diff --git a/net/dump.c b/net/dump.c
index 69d5abe1e9..004231d481 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -30,7 +30,7 @@
#include "hub.h"
typedef struct DumpState {
- VLANClientState nc;
+ NetClientState nc;
int64_t start_ts;
int fd;
int pcap_caplen;
@@ -57,7 +57,7 @@ struct pcap_sf_pkthdr {
uint32_t len;
};
-static ssize_t dump_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t dump_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
DumpState *s = DO_UPCAST(DumpState, nc, nc);
struct pcap_sf_pkthdr hdr;
@@ -86,7 +86,7 @@ static ssize_t dump_receive(VLANClientState *nc, const uint8_t *buf, size_t size
return size;
}
-static void dump_cleanup(VLANClientState *nc)
+static void dump_cleanup(NetClientState *nc)
{
DumpState *s = DO_UPCAST(DumpState, nc, nc);
@@ -100,11 +100,11 @@ static NetClientInfo net_dump_info = {
.cleanup = dump_cleanup,
};
-static int net_dump_init(VLANClientState *peer, const char *device,
+static int net_dump_init(NetClientState *peer, const char *device,
const char *name, const char *filename, int len)
{
struct pcap_file_hdr hdr;
- VLANClientState *nc;
+ NetClientState *nc;
DumpState *s;
struct tm tm;
int fd;
@@ -146,7 +146,7 @@ static int net_dump_init(VLANClientState *peer, const char *device,
}
int net_init_dump(const NetClientOptions *opts, const char *name,
- VLANClientState *peer)
+ NetClientState *peer)
{
int len;
const char *file;
diff --git a/net/dump.h b/net/dump.h
index 9d70195a8b..33f152b460 100644
--- a/net/dump.h
+++ b/net/dump.h
@@ -28,6 +28,6 @@
#include "qapi-types.h"
int net_init_dump(const NetClientOptions *opts, const char *name,
- VLANClientState *peer);
+ NetClientState *peer);
#endif /* QEMU_NET_DUMP_H */
diff --git a/net/hub.c b/net/hub.c
index e80d1312d4..900fa4ebb9 100644
--- a/net/hub.c
+++ b/net/hub.c
@@ -25,7 +25,7 @@
typedef struct NetHub NetHub;
typedef struct NetHubPort {
- VLANClientState nc;
+ NetClientState nc;
QLIST_ENTRY(NetHubPort) next;
NetHub *hub;
int id;
@@ -85,7 +85,7 @@ static NetHub *net_hub_new(int id)
return hub;
}
-static ssize_t net_hub_port_receive(VLANClientState *nc,
+static ssize_t net_hub_port_receive(NetClientState *nc,
const uint8_t *buf, size_t len)
{
NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc);
@@ -93,7 +93,7 @@ static ssize_t net_hub_port_receive(VLANClientState *nc,
return net_hub_receive(port->hub, port, buf, len);
}
-static ssize_t net_hub_port_receive_iov(VLANClientState *nc,
+static ssize_t net_hub_port_receive_iov(NetClientState *nc,
const struct iovec *iov, int iovcnt)
{
NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc);
@@ -101,7 +101,7 @@ static ssize_t net_hub_port_receive_iov(VLANClientState *nc,
return net_hub_receive_iov(port->hub, port, iov, iovcnt);
}
-static void net_hub_port_cleanup(VLANClientState *nc)
+static void net_hub_port_cleanup(NetClientState *nc)
{
NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc);
@@ -118,7 +118,7 @@ static NetClientInfo net_hub_port_info = {
static NetHubPort *net_hub_port_new(NetHub *hub, const char *name)
{
- VLANClientState *nc;
+ NetClientState *nc;
NetHubPort *port;
int id = hub->num_ports++;
char default_name[128];
@@ -145,7 +145,7 @@ static NetHubPort *net_hub_port_new(NetHub *hub, const char *name)
*
* If there is no existing hub with the given id then a new hub is created.
*/
-VLANClientState *net_hub_add_port(int hub_id, const char *name)
+NetClientState *net_hub_add_port(int hub_id, const char *name)
{
NetHub *hub;
NetHubPort *port;
@@ -167,11 +167,11 @@ VLANClientState *net_hub_add_port(int hub_id, const char *name)
/**
* Find a specific client on a hub
*/
-VLANClientState *net_hub_find_client_by_name(int hub_id, const char *name)
+NetClientState *net_hub_find_client_by_name(int hub_id, const char *name)
{
NetHub *hub;
NetHubPort *port;
- VLANClientState *peer;
+ NetClientState *peer;
QLIST_FOREACH(hub, &hubs, next) {
if (hub->id == hub_id) {
@@ -190,11 +190,11 @@ VLANClientState *net_hub_find_client_by_name(int hub_id, const char *name)
/**
* Find a available port on a hub; otherwise create one new port
*/
-VLANClientState *net_hub_port_find(int hub_id)
+NetClientState *net_hub_port_find(int hub_id)
{
NetHub *hub;
NetHubPort *port;
- VLANClientState *nc;
+ NetClientState *nc;
QLIST_FOREACH(hub, &hubs, next) {
if (hub->id == hub_id) {
@@ -234,7 +234,7 @@ void net_hub_info(Monitor *mon)
*
* @id Pointer for hub id output, may be NULL
*/
-int net_hub_id_for_client(VLANClientState *nc, int *id)
+int net_hub_id_for_client(NetClientState *nc, int *id)
{
NetHubPort *port;
@@ -254,7 +254,7 @@ int net_hub_id_for_client(VLANClientState *nc, int *id)
}
int net_init_hubport(const NetClientOptions *opts, const char *name,
- VLANClientState *peer)
+ NetClientState *peer)
{
const NetdevHubPortOptions *hubport;
@@ -277,7 +277,7 @@ void net_hub_check_clients(void)
{
NetHub *hub;
NetHubPort *port;
- VLANClientState *peer;
+ NetClientState *peer;
QLIST_FOREACH(hub, &hubs, next) {
int has_nic = 0, has_host_dev = 0;
diff --git a/net/hub.h b/net/hub.h
index 3906df2fad..26a1ade1f9 100644
--- a/net/hub.h
+++ b/net/hub.h
@@ -18,12 +18,12 @@
#include "qemu-common.h"
int net_init_hubport(const NetClientOptions *opts, const char *name,
- VLANClientState *peer);
-VLANClientState *net_hub_add_port(int hub_id, const char *name);
-VLANClientState *net_hub_find_client_by_name(int hub_id, const char *name);
+ NetClientState *peer);
+NetClientState *net_hub_add_port(int hub_id, const char *name);
+NetClientState *net_hub_find_client_by_name(int hub_id, const char *name);
void net_hub_info(Monitor *mon);
-int net_hub_id_for_client(VLANClientState *nc, int *id);
+int net_hub_id_for_client(NetClientState *nc, int *id);
void net_hub_check_clients(void);
-VLANClientState *net_hub_port_find(int hub_id);
+NetClientState *net_hub_port_find(int hub_id);
#endif /* NET_HUB_H */
diff --git a/net/queue.c b/net/queue.c
index 1ab5247a32..35c3463f53 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -40,7 +40,7 @@
struct NetPacket {
QTAILQ_ENTRY(NetPacket) entry;
- VLANClientState *sender;
+ NetClientState *sender;
unsigned flags;
int size;
NetPacketSent *sent_cb;
@@ -89,7 +89,7 @@ void qemu_del_net_queue(NetQueue *queue)
}
static ssize_t qemu_net_queue_append(NetQueue *queue,
- VLANClientState *sender,
+ NetClientState *sender,
unsigned flags,
const uint8_t *buf,
size_t size,
@@ -110,7 +110,7 @@ static ssize_t qemu_net_queue_append(NetQueue *queue,
}
static ssize_t qemu_net_queue_append_iov(NetQueue *queue,
- VLANClientState *sender,
+ NetClientState *sender,
unsigned flags,
const struct iovec *iov,
int iovcnt,
@@ -143,7 +143,7 @@ static ssize_t qemu_net_queue_append_iov(NetQueue *queue,
}
static ssize_t qemu_net_queue_deliver(NetQueue *queue,
- VLANClientState *sender,
+ NetClientState *sender,
unsigned flags,
const uint8_t *data,
size_t size)
@@ -158,7 +158,7 @@ static ssize_t qemu_net_queue_deliver(NetQueue *queue,
}
static ssize_t qemu_net_queue_deliver_iov(NetQueue *queue,
- VLANClientState *sender,
+ NetClientState *sender,
unsigned flags,
const struct iovec *iov,
int iovcnt)
@@ -173,7 +173,7 @@ static ssize_t qemu_net_queue_deliver_iov(NetQueue *queue,
}
ssize_t qemu_net_queue_send(NetQueue *queue,
- VLANClientState *sender,
+ NetClientState *sender,
unsigned flags,
const uint8_t *data,
size_t size,
@@ -197,7 +197,7 @@ ssize_t qemu_net_queue_send(NetQueue *queue,
}
ssize_t qemu_net_queue_send_iov(NetQueue *queue,
- VLANClientState *sender,
+ NetClientState *sender,
unsigned flags,
const struct iovec *iov,
int iovcnt,
@@ -220,7 +220,7 @@ ssize_t qemu_net_queue_send_iov(NetQueue *queue,
return ret;
}
-void qemu_net_queue_purge(NetQueue *queue, VLANClientState *from)
+void qemu_net_queue_purge(NetQueue *queue, NetClientState *from)
{
NetPacket *packet, *next;
diff --git a/net/queue.h b/net/queue.h
index a31958e3c6..d8eac0b260 100644
--- a/net/queue.h
+++ b/net/queue.h
@@ -29,15 +29,15 @@
typedef struct NetPacket NetPacket;
typedef struct NetQueue NetQueue;
-typedef void (NetPacketSent) (VLANClientState *sender, ssize_t ret);
+typedef void (NetPacketSent) (NetClientState *sender, ssize_t ret);
-typedef ssize_t (NetPacketDeliver) (VLANClientState *sender,
+typedef ssize_t (NetPacketDeliver) (NetClientState *sender,
unsigned flags,
const uint8_t *buf,
size_t size,
void *opaque);
-typedef ssize_t (NetPacketDeliverIOV) (VLANClientState *sender,
+typedef ssize_t (NetPacketDeliverIOV) (NetClientState *sender,
unsigned flags,
const struct iovec *iov,
int iovcnt,
@@ -52,20 +52,20 @@ NetQueue *qemu_new_net_queue(NetPacketDeliver *deliver,
void qemu_del_net_queue(NetQueue *queue);
ssize_t qemu_net_queue_send(NetQueue *queue,
- VLANClientState *sender,
+ NetClientState *sender,
unsigned flags,
const uint8_t *data,
size_t size,
NetPacketSent *sent_cb);
ssize_t qemu_net_queue_send_iov(NetQueue *queue,
- VLANClientState *sender,
+ NetClientState *sender,
unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb);
-void qemu_net_queue_purge(NetQueue *queue, VLANClientState *from);
+void qemu_net_queue_purge(NetQueue *queue, NetClientState *from);
void qemu_net_queue_flush(NetQueue *queue);
#endif /* QEMU_NET_QUEUE_H */
diff --git a/net/slirp.c b/net/slirp.c
index 85d6fb4b34..1bdad37040 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -68,7 +68,7 @@ struct slirp_config_str {
};
typedef struct SlirpState {
- VLANClientState nc;
+ NetClientState nc;
QTAILQ_ENTRY(SlirpState) entry;
Slirp *slirp;
#ifndef _WIN32
@@ -111,7 +111,7 @@ void slirp_output(void *opaque, const uint8_t *pkt, int pkt_len)
qemu_send_packet(&s->nc, pkt, pkt_len);
}
-static ssize_t net_slirp_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t net_slirp_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
SlirpState *s = DO_UPCAST(SlirpState, nc, nc);
@@ -120,7 +120,7 @@ static ssize_t net_slirp_receive(VLANClientState *nc, const uint8_t *buf, size_t
return size;
}
-static void net_slirp_cleanup(VLANClientState *nc)
+static void net_slirp_cleanup(NetClientState *nc)
{
SlirpState *s = DO_UPCAST(SlirpState, nc, nc);
@@ -136,7 +136,7 @@ static NetClientInfo net_slirp_info = {
.cleanup = net_slirp_cleanup,
};
-static int net_slirp_init(VLANClientState *peer, const char *model,
+static int net_slirp_init(NetClientState *peer, const char *model,
const char *name, int restricted,
const char *vnetwork, const char *vhost,
const char *vhostname, const char *tftp_export,
@@ -153,7 +153,7 @@ static int net_slirp_init(VLANClientState *peer, const char *model,
#ifndef _WIN32
struct in_addr smbsrv = { .s_addr = 0 };
#endif
- VLANClientState *nc;
+ NetClientState *nc;
SlirpState *s;
char buf[20];
uint32_t addr;
@@ -284,7 +284,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *vlan,
{
if (vlan) {
- VLANClientState *nc;
+ NetClientState *nc;
nc = net_hub_find_client_by_name(strtol(vlan, NULL, 0), stack);
if (!nc) {
return NULL;
@@ -706,7 +706,7 @@ net_init_slirp_configs(const StringList *fwd, int flags)
}
int net_init_slirp(const NetClientOptions *opts, const char *name,
- VLANClientState *peer)
+ NetClientState *peer)
{
struct slirp_config_str *config;
char *vnet;
diff --git a/net/slirp.h b/net/slirp.h
index 1ff21b064a..5f685c4fb1 100644
--- a/net/slirp.h
+++ b/net/slirp.h
@@ -32,7 +32,7 @@
#ifdef CONFIG_SLIRP
int net_init_slirp(const NetClientOptions *opts, const char *name,
- VLANClientState *peer);
+ NetClientState *peer);
void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict);
void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict);
diff --git a/net/socket.c b/net/socket.c
index 31bbb30b97..65828cd3ba 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -34,7 +34,7 @@
#include "qemu_socket.h"
typedef struct NetSocketState {
- VLANClientState nc;
+ NetClientState nc;
int fd;
int state; /* 0 = getting length, 1 = getting data */
unsigned int index;
@@ -44,14 +44,14 @@ typedef struct NetSocketState {
} NetSocketState;
typedef struct NetSocketListenState {
- VLANClientState *peer;
+ NetClientState *peer;
char *model;
char *name;
int fd;
} NetSocketListenState;
/* XXX: we consider we can send the whole packet without blocking */
-static ssize_t net_socket_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t net_socket_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc);
uint32_t len;
@@ -61,7 +61,7 @@ static ssize_t net_socket_receive(VLANClientState *nc, const uint8_t *buf, size_
return send_all(s->fd, buf, size);
}
-static ssize_t net_socket_receive_dgram(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t net_socket_receive_dgram(NetClientState *nc, const uint8_t *buf, size_t size)
{
NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc);
@@ -231,7 +231,7 @@ fail:
return -1;
}
-static void net_socket_cleanup(VLANClientState *nc)
+static void net_socket_cleanup(NetClientState *nc)
{
NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc);
qemu_set_fd_handler(s->fd, NULL, NULL, NULL);
@@ -245,7 +245,7 @@ static NetClientInfo net_dgram_socket_info = {
.cleanup = net_socket_cleanup,
};
-static NetSocketState *net_socket_fd_init_dgram(VLANClientState *peer,
+static NetSocketState *net_socket_fd_init_dgram(NetClientState *peer,
const char *model,
const char *name,
int fd, int is_connected)
@@ -253,7 +253,7 @@ static NetSocketState *net_socket_fd_init_dgram(VLANClientState *peer,
struct sockaddr_in saddr;
int newfd;
socklen_t saddr_len;
- VLANClientState *nc;
+ NetClientState *nc;
NetSocketState *s;
/* fd passed: multicast: "learn" dgram_dst address from bound address and save it
@@ -323,12 +323,12 @@ static NetClientInfo net_socket_info = {
.cleanup = net_socket_cleanup,
};
-static NetSocketState *net_socket_fd_init_stream(VLANClientState *peer,
+static NetSocketState *net_socket_fd_init_stream(NetClientState *peer,
const char *model,
const char *name,
int fd, int is_connected)
{
- VLANClientState *nc;
+ NetClientState *nc;
NetSocketState *s;
nc = qemu_new_net_client(&net_socket_info, peer, model, name);
@@ -347,7 +347,7 @@ static NetSocketState *net_socket_fd_init_stream(VLANClientState *peer,
return s;
}
-static NetSocketState *net_socket_fd_init(VLANClientState *peer,
+static NetSocketState *net_socket_fd_init(NetClientState *peer,
const char *model, const char *name,
int fd, int is_connected)
{
@@ -398,7 +398,7 @@ static void net_socket_accept(void *opaque)
}
}
-static int net_socket_listen_init(VLANClientState *peer,
+static int net_socket_listen_init(NetClientState *peer,
const char *model,
const char *name,
const char *host_str)
@@ -446,7 +446,7 @@ static int net_socket_listen_init(VLANClientState *peer,
return 0;
}
-static int net_socket_connect_init(VLANClientState *peer,
+static int net_socket_connect_init(NetClientState *peer,
const char *model,
const char *name,
const char *host_str)
@@ -496,7 +496,7 @@ static int net_socket_connect_init(VLANClientState *peer,
return 0;
}
-static int net_socket_mcast_init(VLANClientState *peer,
+static int net_socket_mcast_init(NetClientState *peer,
const char *model,
const char *name,
const char *host_str,
@@ -535,7 +535,7 @@ static int net_socket_mcast_init(VLANClientState *peer,
}
-static int net_socket_udp_init(VLANClientState *peer,
+static int net_socket_udp_init(NetClientState *peer,
const char *model,
const char *name,
const char *rhost,
@@ -587,7 +587,7 @@ static int net_socket_udp_init(VLANClientState *peer,
}
int net_init_socket(const NetClientOptions *opts, const char *name,
- VLANClientState *peer)
+ NetClientState *peer)
{
const NetdevSocketOptions *sock;
diff --git a/net/socket.h b/net/socket.h
index 82b4d169d9..3f8a092459 100644
--- a/net/socket.h
+++ b/net/socket.h
@@ -28,6 +28,6 @@
#include "qapi-types.h"
int net_init_socket(const NetClientOptions *opts, const char *name,
- VLANClientState *peer);
+ NetClientState *peer);
#endif /* QEMU_NET_SOCKET_H */
diff --git a/net/tap-win32.c b/net/tap-win32.c
index c4c98aa256..dcc7a64ea8 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -630,11 +630,11 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle,
/********************************************/
typedef struct TAPState {
- VLANClientState nc;
+ NetClientState nc;
tap_win32_overlapped_t *handle;
} TAPState;
-static void tap_cleanup(VLANClientState *nc)
+static void tap_cleanup(NetClientState *nc)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -645,7 +645,7 @@ static void tap_cleanup(VLANClientState *nc)
*/
}
-static ssize_t tap_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t tap_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -673,10 +673,10 @@ static NetClientInfo net_tap_win32_info = {
.cleanup = tap_cleanup,
};
-static int tap_win32_init(VLANClientState *peer, const char *model,
+static int tap_win32_init(NetClientState *peer, const char *model,
const char *name, const char *ifname)
{
- VLANClientState *nc;
+ NetClientState *nc;
TAPState *s;
tap_win32_overlapped_t *handle;
@@ -700,7 +700,7 @@ static int tap_win32_init(VLANClientState *peer, const char *model,
}
int net_init_tap(const NetClientOptions *opts, const char *name,
- VLANClientState *peer)
+ NetClientState *peer)
{
const NetdevTapOptions *tap;
@@ -719,12 +719,12 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
return 0;
}
-int tap_has_ufo(VLANClientState *vc)
+int tap_has_ufo(NetClientState *vc)
{
return 0;
}
-int tap_has_vnet_hdr(VLANClientState *vc)
+int tap_has_vnet_hdr(NetClientState *vc)
{
return 0;
}
@@ -738,16 +738,16 @@ void tap_fd_set_vnet_hdr_len(int fd, int len)
{
}
-void tap_using_vnet_hdr(VLANClientState *vc, int using_vnet_hdr)
+void tap_using_vnet_hdr(NetClientState *vc, int using_vnet_hdr)
{
}
-void tap_set_offload(VLANClientState *vc, int csum, int tso4,
+void tap_set_offload(NetClientState *vc, int csum, int tso4,
int tso6, int ecn, int ufo)
{
}
-struct vhost_net *tap_get_vhost_net(VLANClientState *nc)
+struct vhost_net *tap_get_vhost_net(NetClientState *nc)
{
return NULL;
}
diff --git a/net/tap.c b/net/tap.c
index 10ae98d18b..1971525794 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -50,7 +50,7 @@
#define TAP_BUFSIZE (4096 + 65536)
typedef struct TAPState {
- VLANClientState nc;
+ NetClientState nc;
int fd;
char down_script[1024];
char down_script_arg[128];
@@ -115,7 +115,7 @@ static ssize_t tap_write_packet(TAPState *s, const struct iovec *iov, int iovcnt
return len;
}
-static ssize_t tap_receive_iov(VLANClientState *nc, const struct iovec *iov,
+static ssize_t tap_receive_iov(NetClientState *nc, const struct iovec *iov,
int iovcnt)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -134,7 +134,7 @@ static ssize_t tap_receive_iov(VLANClientState *nc, const struct iovec *iov,
return tap_write_packet(s, iovp, iovcnt);
}
-static ssize_t tap_receive_raw(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t tap_receive_raw(NetClientState *nc, const uint8_t *buf, size_t size)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
struct iovec iov[2];
@@ -154,7 +154,7 @@ static ssize_t tap_receive_raw(VLANClientState *nc, const uint8_t *buf, size_t s
return tap_write_packet(s, iov, iovcnt);
}
-static ssize_t tap_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t tap_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
struct iovec iov[1];
@@ -183,7 +183,7 @@ ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen)
}
#endif
-static void tap_send_completed(VLANClientState *nc, ssize_t len)
+static void tap_send_completed(NetClientState *nc, ssize_t len)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
tap_read_poll(s, 1);
@@ -214,7 +214,7 @@ static void tap_send(void *opaque)
} while (size > 0 && qemu_can_send_packet(&s->nc));
}
-int tap_has_ufo(VLANClientState *nc)
+int tap_has_ufo(NetClientState *nc)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -223,7 +223,7 @@ int tap_has_ufo(VLANClientState *nc)
return s->has_ufo;
}
-int tap_has_vnet_hdr(VLANClientState *nc)
+int tap_has_vnet_hdr(NetClientState *nc)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -232,7 +232,7 @@ int tap_has_vnet_hdr(VLANClientState *nc)
return !!s->host_vnet_hdr_len;
}
-int tap_has_vnet_hdr_len(VLANClientState *nc, int len)
+int tap_has_vnet_hdr_len(NetClientState *nc, int len)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -241,7 +241,7 @@ int tap_has_vnet_hdr_len(VLANClientState *nc, int len)
return tap_probe_vnet_hdr_len(s->fd, len);
}
-void tap_set_vnet_hdr_len(VLANClientState *nc, int len)
+void tap_set_vnet_hdr_len(NetClientState *nc, int len)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -253,7 +253,7 @@ void tap_set_vnet_hdr_len(VLANClientState *nc, int len)
s->host_vnet_hdr_len = len;
}
-void tap_using_vnet_hdr(VLANClientState *nc, int using_vnet_hdr)
+void tap_using_vnet_hdr(NetClientState *nc, int using_vnet_hdr)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -265,7 +265,7 @@ void tap_using_vnet_hdr(VLANClientState *nc, int using_vnet_hdr)
s->using_vnet_hdr = using_vnet_hdr;
}
-void tap_set_offload(VLANClientState *nc, int csum, int tso4,
+void tap_set_offload(NetClientState *nc, int csum, int tso4,
int tso6, int ecn, int ufo)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -276,7 +276,7 @@ void tap_set_offload(VLANClientState *nc, int csum, int tso4,
tap_fd_set_offload(s->fd, csum, tso4, tso6, ecn, ufo);
}
-static void tap_cleanup(VLANClientState *nc)
+static void tap_cleanup(NetClientState *nc)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -296,14 +296,14 @@ static void tap_cleanup(VLANClientState *nc)
s->fd = -1;
}
-static void tap_poll(VLANClientState *nc, bool enable)
+static void tap_poll(NetClientState *nc, bool enable)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
tap_read_poll(s, enable);
tap_write_poll(s, enable);
}
-int tap_get_fd(VLANClientState *nc)
+int tap_get_fd(NetClientState *nc)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
assert(nc->info->type == NET_CLIENT_OPTIONS_KIND_TAP);
@@ -322,13 +322,13 @@ static NetClientInfo net_tap_info = {
.cleanup = tap_cleanup,
};
-static TAPState *net_tap_fd_init(VLANClientState *peer,
+static TAPState *net_tap_fd_init(NetClientState *peer,
const char *model,
const char *name,
int fd,
int vnet_hdr)
{
- VLANClientState *nc;
+ NetClientState *nc;
TAPState *s;
nc = qemu_new_net_client(&net_tap_info, peer, model, name);
@@ -514,7 +514,7 @@ static int net_bridge_run_helper(const char *helper, const char *bridge)
}
int net_init_bridge(const NetClientOptions *opts, const char *name,
- VLANClientState *peer)
+ NetClientState *peer)
{
const NetdevBridgeOptions *bridge;
const char *helper, *br;
@@ -587,7 +587,7 @@ static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr,
}
int net_init_tap(const NetClientOptions *opts, const char *name,
- VLANClientState *peer)
+ NetClientState *peer)
{
const NetdevTapOptions *tap;
@@ -708,7 +708,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
return 0;
}
-VHostNetState *tap_get_vhost_net(VLANClientState *nc)
+VHostNetState *tap_get_vhost_net(NetClientState *nc)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
assert(nc->info->type == NET_CLIENT_OPTIONS_KIND_TAP);
diff --git a/net/tap.h b/net/tap.h
index 113906fc1b..1257404aee 100644
--- a/net/tap.h
+++ b/net/tap.h
@@ -33,18 +33,18 @@
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
int net_init_tap(const NetClientOptions *opts, const char *name,
- VLANClientState *peer);
+ NetClientState *peer);
int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required);
ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen);
-int tap_has_ufo(VLANClientState *vc);
-int tap_has_vnet_hdr(VLANClientState *vc);
-int tap_has_vnet_hdr_len(VLANClientState *vc, int len);
-void tap_using_vnet_hdr(VLANClientState *vc, int using_vnet_hdr);
-void tap_set_offload(VLANClientState *vc, int csum, int tso4, int tso6, int ecn, int ufo);
-void tap_set_vnet_hdr_len(VLANClientState *vc, int len);
+int tap_has_ufo(NetClientState *vc);
+int tap_has_vnet_hdr(NetClientState *vc);
+int tap_has_vnet_hdr_len(NetClientState *vc, int len);
+void tap_using_vnet_hdr(NetClientState *vc, int using_vnet_hdr);
+void tap_set_offload(NetClientState *vc, int csum, int tso4, int tso6, int ecn, int ufo);
+void tap_set_vnet_hdr_len(NetClientState *vc, int len);
int tap_set_sndbuf(int fd, const NetdevTapOptions *tap);
int tap_probe_vnet_hdr(int fd);
@@ -53,12 +53,12 @@ int tap_probe_has_ufo(int fd);
void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
void tap_fd_set_vnet_hdr_len(int fd, int len);
-int tap_get_fd(VLANClientState *vc);
+int tap_get_fd(NetClientState *vc);
struct vhost_net;
-struct vhost_net *tap_get_vhost_net(VLANClientState *vc);
+struct vhost_net *tap_get_vhost_net(NetClientState *vc);
int net_init_bridge(const NetClientOptions *opts, const char *name,
- VLANClientState *peer);
+ NetClientState *peer);
#endif /* QEMU_NET_TAP_H */
diff --git a/net/vde.c b/net/vde.c
index a1480d7016..b91a6c799b 100644
--- a/net/vde.c
+++ b/net/vde.c
@@ -33,7 +33,7 @@
#include "qemu-option.h"
typedef struct VDEState {
- VLANClientState nc;
+ NetClientState nc;
VDECONN *vde;
} VDEState;
@@ -49,7 +49,7 @@ static void vde_to_qemu(void *opaque)
}
}
-static ssize_t vde_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t vde_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
VDEState *s = DO_UPCAST(VDEState, nc, nc);
ssize_t ret;
@@ -61,7 +61,7 @@ static ssize_t vde_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
return ret;
}
-static void vde_cleanup(VLANClientState *nc)
+static void vde_cleanup(NetClientState *nc)
{
VDEState *s = DO_UPCAST(VDEState, nc, nc);
qemu_set_fd_handler(vde_datafd(s->vde), NULL, NULL, NULL);
@@ -75,11 +75,11 @@ static NetClientInfo net_vde_info = {
.cleanup = vde_cleanup,
};
-static int net_vde_init(VLANClientState *peer, const char *model,
+static int net_vde_init(NetClientState *peer, const char *model,
const char *name, const char *sock,
int port, const char *group, int mode)
{
- VLANClientState *nc;
+ NetClientState *nc;
VDEState *s;
VDECONN *vde;
char *init_group = (char *)group;
@@ -111,7 +111,7 @@ static int net_vde_init(VLANClientState *peer, const char *model,
}
int net_init_vde(const NetClientOptions *opts, const char *name,
- VLANClientState *peer)
+ NetClientState *peer)
{
const NetdevVdeOptions *vde;
diff --git a/net/vde.h b/net/vde.h
index d6f7af439d..6ce6698937 100644
--- a/net/vde.h
+++ b/net/vde.h
@@ -30,7 +30,7 @@
#ifdef CONFIG_VDE
int net_init_vde(const NetClientOptions *opts, const char *name,
- VLANClientState *peer);
+ NetClientState *peer);
#endif /* CONFIG_VDE */