Revision bb6e6364 net.c

b/net.c
325 325
                                       int iovcnt,
326 326
                                       void *opaque);
327 327

  
328
VLANClientState *qemu_new_vlan_client(VLANState *vlan,
328
VLANClientState *qemu_new_vlan_client(net_client_type type,
329
                                      VLANState *vlan,
329 330
                                      VLANClientState *peer,
330 331
                                      const char *model,
331 332
                                      const char *name,
......
339 340

  
340 341
    vc = qemu_mallocz(sizeof(VLANClientState));
341 342

  
343
    vc->type = type;
342 344
    vc->model = qemu_strdup(model);
343 345
    if (name)
344 346
        vc->name = qemu_strdup(name);
......
880 882
    }
881 883
#endif
882 884

  
883
    s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
885
    s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_SLIRP,
886
                                 vlan, NULL, model, name, NULL,
884 887
                                 slirp_receive, NULL,
885 888
                                 net_slirp_cleanup, s);
886 889
    snprintf(s->vc->info_str, sizeof(s->vc->info_str),
......
1486 1489
    s = qemu_mallocz(sizeof(TAPState));
1487 1490
    s->fd = fd;
1488 1491
    s->has_vnet_hdr = vnet_hdr != 0;
1489
    s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
1492
    s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_TAP,
1493
                                 vlan, NULL, model, name, NULL,
1490 1494
                                 tap_receive, tap_receive_iov,
1491 1495
                                 tap_cleanup, s);
1492 1496
    tap_read_poll(s, 1);
......
1845 1849
        free(s);
1846 1850
        return -1;
1847 1851
    }
1848
    s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
1852
    s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_VDE,
1853
                                 vlan, NULL, model, name, NULL,
1849 1854
                                 vde_receive, NULL,
1850 1855
                                 vde_cleanup, s);
1851 1856
    qemu_set_fd_handler(vde_datafd(s->vde), vde_to_qemu, NULL, s);
......
2085 2090
    s = qemu_mallocz(sizeof(NetSocketState));
2086 2091
    s->fd = fd;
2087 2092

  
2088
    s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
2093
    s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_SOCKET,
2094
                                 vlan, NULL, model, name, NULL,
2089 2095
                                 net_socket_receive_dgram, NULL,
2090 2096
                                 net_socket_cleanup, s);
2091 2097
    qemu_set_fd_handler(s->fd, net_socket_send_dgram, NULL, s);
......
2114 2120
    NetSocketState *s;
2115 2121
    s = qemu_mallocz(sizeof(NetSocketState));
2116 2122
    s->fd = fd;
2117
    s->vc = qemu_new_vlan_client(vlan, NULL, model, name, NULL,
2123
    s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_SOCKET,
2124
                                 vlan, NULL, model, name, NULL,
2118 2125
                                 net_socket_receive, NULL,
2119 2126
                                 net_socket_cleanup, s);
2120 2127
    snprintf(s->vc->info_str, sizeof(s->vc->info_str),
......
2396 2403
        return -1;
2397 2404
    }
2398 2405

  
2399
    s->pcap_vc = qemu_new_vlan_client(vlan, NULL, device, name, NULL,
2406
    s->pcap_vc = qemu_new_vlan_client(NET_CLIENT_TYPE_DUMP,
2407
                                      vlan, NULL, device, name, NULL,
2400 2408
                                      dump_receive, NULL,
2401 2409
                                      net_dump_cleanup, s);
2402 2410
    snprintf(s->pcap_vc->info_str, sizeof(s->pcap_vc->info_str),

Also available in: Unified diff