Revision 463af534 net.c
b/net.c | ||
---|---|---|
332 | 332 |
VLANClientState *qemu_new_vlan_client(VLANState *vlan, |
333 | 333 |
const char *model, |
334 | 334 |
const char *name, |
335 |
IOReadHandler *fd_read, |
|
336 | 335 |
IOCanRWHandler *fd_can_read, |
336 |
IOReadHandler *fd_read, |
|
337 |
IOReadvHandler *fd_readv, |
|
337 | 338 |
NetCleanup *cleanup, |
338 | 339 |
void *opaque) |
339 | 340 |
{ |
... | ... | |
344 | 345 |
vc->name = strdup(name); |
345 | 346 |
else |
346 | 347 |
vc->name = assign_name(vc, model); |
347 |
vc->fd_read = fd_read; |
|
348 | 348 |
vc->fd_can_read = fd_can_read; |
349 |
vc->fd_read = fd_read; |
|
350 |
vc->fd_readv = fd_readv; |
|
349 | 351 |
vc->cleanup = cleanup; |
350 | 352 |
vc->opaque = opaque; |
351 | 353 |
vc->vlan = vlan; |
... | ... | |
632 | 634 |
#endif |
633 | 635 |
} |
634 | 636 |
|
635 |
slirp_vc = qemu_new_vlan_client(vlan, model, name, slirp_receive, |
|
637 |
slirp_vc = qemu_new_vlan_client(vlan, model, name, NULL, slirp_receive,
|
|
636 | 638 |
NULL, net_slirp_cleanup, NULL); |
637 | 639 |
slirp_vc->info_str[0] = '\0'; |
638 | 640 |
slirp_in_use = 1; |
... | ... | |
1015 | 1017 |
|
1016 | 1018 |
s = qemu_mallocz(sizeof(TAPState)); |
1017 | 1019 |
s->fd = fd; |
1018 |
s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive, |
|
1019 |
NULL, tap_cleanup, s); |
|
1020 |
s->vc->fd_readv = tap_receive_iov; |
|
1020 |
s->vc = qemu_new_vlan_client(vlan, model, name, NULL, tap_receive, |
|
1021 |
tap_receive_iov, tap_cleanup, s); |
|
1021 | 1022 |
qemu_set_fd_handler2(s->fd, tap_can_send, tap_send, NULL, s); |
1022 | 1023 |
snprintf(s->vc->info_str, sizeof(s->vc->info_str), "fd=%d", fd); |
1023 | 1024 |
return s; |
... | ... | |
1351 | 1352 |
free(s); |
1352 | 1353 |
return -1; |
1353 | 1354 |
} |
1354 |
s->vc = qemu_new_vlan_client(vlan, model, name, vde_from_qemu, |
|
1355 |
s->vc = qemu_new_vlan_client(vlan, model, name, NULL, vde_from_qemu,
|
|
1355 | 1356 |
NULL, vde_cleanup, s); |
1356 | 1357 |
qemu_set_fd_handler(vde_datafd(s->vde), vde_to_qemu, NULL, s); |
1357 | 1358 |
snprintf(s->vc->info_str, sizeof(s->vc->info_str), "sock=%s,fd=%d", |
... | ... | |
1589 | 1590 |
s = qemu_mallocz(sizeof(NetSocketState)); |
1590 | 1591 |
s->fd = fd; |
1591 | 1592 |
|
1592 |
s->vc = qemu_new_vlan_client(vlan, model, name, net_socket_receive_dgram, |
|
1593 |
s->vc = qemu_new_vlan_client(vlan, model, name, NULL, net_socket_receive_dgram,
|
|
1593 | 1594 |
NULL, net_socket_cleanup, s); |
1594 | 1595 |
qemu_set_fd_handler(s->fd, net_socket_send_dgram, NULL, s); |
1595 | 1596 |
|
... | ... | |
1617 | 1618 |
NetSocketState *s; |
1618 | 1619 |
s = qemu_mallocz(sizeof(NetSocketState)); |
1619 | 1620 |
s->fd = fd; |
1620 |
s->vc = qemu_new_vlan_client(vlan, model, name, net_socket_receive, |
|
1621 |
s->vc = qemu_new_vlan_client(vlan, model, name, NULL, net_socket_receive,
|
|
1621 | 1622 |
NULL, net_socket_cleanup, s); |
1622 | 1623 |
snprintf(s->vc->info_str, sizeof(s->vc->info_str), |
1623 | 1624 |
"socket: fd=%d", fd); |
... | ... | |
1896 | 1897 |
return -1; |
1897 | 1898 |
} |
1898 | 1899 |
|
1899 |
s->pcap_vc = qemu_new_vlan_client(vlan, device, name, dump_receive, NULL, |
|
1900 |
s->pcap_vc = qemu_new_vlan_client(vlan, device, name, NULL, dump_receive, NULL,
|
|
1900 | 1901 |
net_dump_cleanup, s); |
1901 | 1902 |
snprintf(s->pcap_vc->info_str, sizeof(s->pcap_vc->info_str), |
1902 | 1903 |
"dump to %s (len=%d)", filename, len); |
Also available in: Unified diff