int iovcnt,
void *opaque);
-VLANClientState *qemu_new_vlan_client(VLANState *vlan,
+VLANClientState *qemu_new_vlan_client(net_client_type type,
+ VLANState *vlan,
VLANClientState *peer,
const char *model,
const char *name,
vc = qemu_mallocz(sizeof(VLANClientState));
+ vc->type = type;
vc->model = qemu_strdup(model);
if (name)
vc->name = qemu_strdup(name);
}
#endif
- s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
+ s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_SLIRP,
+ vlan, NULL, model, name, NULL,
slirp_receive, NULL,
net_slirp_cleanup, s);
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
s = qemu_mallocz(sizeof(TAPState));
s->fd = fd;
s->has_vnet_hdr = vnet_hdr != 0;
- s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
+ s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_TAP,
+ vlan, NULL, model, name, NULL,
tap_receive, tap_receive_iov,
tap_cleanup, s);
tap_read_poll(s, 1);
free(s);
return -1;
}
- s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
+ s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_VDE,
+ vlan, NULL, model, name, NULL,
vde_receive, NULL,
vde_cleanup, s);
qemu_set_fd_handler(vde_datafd(s->vde), vde_to_qemu, NULL, s);
s = qemu_mallocz(sizeof(NetSocketState));
s->fd = fd;
- s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
+ s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_SOCKET,
+ vlan, NULL, model, name, NULL,
net_socket_receive_dgram, NULL,
net_socket_cleanup, s);
qemu_set_fd_handler(s->fd, net_socket_send_dgram, NULL, s);
NetSocketState *s;
s = qemu_mallocz(sizeof(NetSocketState));
s->fd = fd;
- s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
+ s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_SOCKET,
+ vlan, NULL, model, name, NULL,
net_socket_receive, NULL,
net_socket_cleanup, s);
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
return -1;
}
- s->pcap_vc = qemu_new_vlan_client(vlan, NULL, device, name, NULL,
+ s->pcap_vc = qemu_new_vlan_client(NET_CLIENT_TYPE_DUMP,
+ vlan, NULL, device, name, NULL,
dump_receive, NULL,
net_dump_cleanup, s);
snprintf(s->pcap_vc->info_str, sizeof(s->pcap_vc->info_str),