Lines Matching defs:vlan
315 VLANState *vlan;
319 for (vlan = first_vlan; vlan; vlan = vlan->next) {
322 for (vc = vlan->first_client; vc; vc = vc->next)
332 VLANClientState *qemu_new_vlan_client(VLANState *vlan,
353 vc->vlan = vlan;
356 pvc = &vlan->first_client;
365 VLANClientState **pvc = &vc->vlan->first_client;
381 VLANClientState *qemu_find_vlan_client(VLANState *vlan, void *opaque)
383 VLANClientState **pvc = &vlan->first_client;
396 VLANState *vlan = sender->vlan;
399 for (vc = vlan->first_client; vc != NULL; vc = vc->next) {
418 sender->vlan->delivering = 1;
420 for (vc = sender->vlan->first_client; vc != NULL; vc = vc->next) {
437 sender->vlan->delivering = 0;
446 while ((packet = vc->vlan->send_queue) != NULL) {
449 vc->vlan->send_queue = packet->next;
453 packet->next = vc->vlan->send_queue;
454 vc->vlan->send_queue = packet;
472 packet->next = sender->vlan->send_queue;
477 sender->vlan->send_queue = packet;
491 printf("vlan %d send:\n", sender->vlan->id);
495 if (sender->vlan->delivering) {
550 sender->vlan->delivering = 1;
552 for (vc = sender->vlan->first_client; vc != NULL; vc = vc->next) {
573 sender->vlan->delivering = 0;
589 packet->next = sender->vlan->send_queue;
601 sender->vlan->send_queue = packet;
616 if (sender->vlan->delivering) {
711 static int net_slirp_init(VLANState *vlan, const char *model, const char *name,
736 slirp_vc = qemu_new_vlan_client(vlan, model, name, NULL, slirp_receive,
1125 static TAPState *net_tap_fd_init(VLANState *vlan,
1134 s->vc = qemu_new_vlan_client(vlan, model, name, NULL, tap_receive,
1375 static int net_tap_init(VLANState *vlan, const char *model,
1397 s = net_tap_fd_init(vlan, model, name, fd);
1448 static int net_vde_init(VLANState *vlan, const char *model,
1468 s->vc = qemu_new_vlan_client(vlan, model, name, NULL, vde_receive,
1489 VLANState *vlan;
1663 static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan,
1707 s->vc = qemu_new_vlan_client(vlan, model, name, NULL, net_socket_receive_dgram,
1727 static NetSocketState *net_socket_fd_init_stream(VLANState *vlan,
1735 s->vc = qemu_new_vlan_client(vlan, model, name, NULL, net_socket_receive,
1747 static NetSocketState *net_socket_fd_init(VLANState *vlan,
1760 return net_socket_fd_init_dgram(vlan, model, name, fd, is_connected);
1762 return net_socket_fd_init_stream(vlan, model, name, fd, is_connected);
1766 return net_socket_fd_init_stream(vlan, model, name, fd, is_connected);
1788 s1 = net_socket_fd_init(s->vlan, s->model, s->name, fd, 1);
1798 static int net_socket_listen_init(VLANState *vlan,
1833 s->vlan = vlan;
1841 static int net_socket_connect_init(VLANState *vlan,
1882 s = net_socket_fd_init(vlan, model, name, fd, connected);
1891 static int net_socket_mcast_init(VLANState *vlan,
1908 s = net_socket_fd_init(vlan, model, name, fd, 0);
1985 static int net_dump_init(Monitor *mon, VLANState *vlan, const char *device,
2016 s->pcap_vc = qemu_new_vlan_client(vlan, device, name, NULL, dump_receive, NULL,
2023 /* find or alloc a new VLAN */
2026 VLANState **pvlan, *vlan;
2027 for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {
2028 if (vlan->id == id)
2029 return vlan;
2031 vlan = qemu_mallocz(sizeof(VLANState));
2032 vlan->id = id;
2033 vlan->next = NULL;
2037 *pvlan = vlan;
2038 return vlan;
2088 "vlan", "name", "fd", NULL
2092 VLANState *vlan;
2096 if (get_param_value(buf, sizeof(buf), "vlan", p)) {
2099 vlan = qemu_find_vlan(vlan_id);
2106 "vlan", "name", "macaddr", "model", NULL
2141 nd->vlan = vlan;
2146 vlan->nb_guest_devs++;
2162 "vlan", "name", "hostname", "restrict", "ip", NULL
2181 vlan->nb_host_devs++;
2182 ret = net_slirp_init(vlan, device, name, restricted, ip);
2215 "vlan", "name", "ifname", NULL
2229 vlan->nb_host_devs++;
2230 ret = tap_win32_init(vlan, device, name, ifname);
2238 vlan->nb_host_devs++;
2247 net_tap_fd_init(vlan, device, name, fd);
2251 "vlan", "name", "ifname", "script", "downscript", NULL
2267 ret = net_tap_init(vlan, device, name, ifname, setup_script, down_script);
2282 if (net_socket_fd_init(vlan, device, name, fd, 1))
2286 "vlan", "name", "listen", NULL
2293 ret = net_socket_listen_init(vlan, device, name, buf);
2296 "vlan", "name", "connect", NULL
2303 ret = net_socket_connect_init(vlan, device, name, buf);
2306 "vlan", "name", "mcast", NULL
2313 ret = net_socket_mcast_init(vlan, device, name, buf);
2319 vlan->nb_host_devs++;
2324 "vlan", "name", "sock", "port", "group", "mode", NULL
2334 vlan->nb_host_devs++;
2351 ret = net_vde_init(vlan, device, name, vde_sock, vde_port, vde_group, vde_mode);
2361 snprintf(buf, sizeof(buf), "qemu-vlan%d.pcap", vlan_id);
2363 ret = net_dump_init(mon, vlan, device, name, buf, len);
2379 nd->vlan->nb_guest_devs--;
2418 VLANState *vlan;
2421 vlan = qemu_find_vlan(vlan_id);
2423 for (vc = vlan->first_client; vc != NULL; vc = vc->next) {
2462 VLANState *vlan;
2465 for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {
2466 monitor_printf(mon, "VLAN %d devices:\n", vlan->id);
2467 for(vc = vlan->first_client; vc != NULL; vc = vc->next)
2474 VLANState *vlan;
2477 for (vlan = first_vlan; vlan != NULL; vlan = vlan->next)
2478 for (vc = vlan->first_client; vc != NULL; vc = vc->next)
2504 VLANState *vlan;
2507 for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {
2508 VLANClientState *vc = vlan->first_client;
2522 VLANState *vlan;
2524 for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {
2525 if (vlan->nb_guest_devs == 0 && vlan->nb_host_devs == 0)
2527 if (vlan->nb_guest_devs == 0)
2528 fprintf(stderr, "Warning: vlan %d with no nics\n", vlan->id);
2529 if (vlan->nb_host_devs == 0)
2531 "Warning: vlan %d is not connected to host network\n",
2532 vlan->id);