Lines Matching refs:opts
80 int inet_listen_opts(QemuOpts *opts, int port_offset)
92 const char* socket_fd = qemu_opt_get(opts, "socket");
98 if ((qemu_opt_get(opts, "host") == NULL) ||
99 (qemu_opt_get(opts, "port") == NULL)) {
103 pstrcpy(port, sizeof(port), qemu_opt_get(opts, "port"));
104 addr = qemu_opt_get(opts, "host");
106 to = qemu_opt_get_number(opts, "to", 0);
107 if (qemu_opt_get_bool(opts, "ipv4", 0))
109 if (qemu_opt_get_bool(opts, "ipv6", 0))
179 qemu_opt_set(opts, "host", uaddr);
180 qemu_opt_set(opts, "port", uport);
181 qemu_opt_set(opts, "ipv6", (e->family == SOCKET_IN6) ? "on" : "off");
182 qemu_opt_set(opts, "ipv4", (e->family != SOCKET_IN6) ? "on" : "off");
187 int inet_connect_opts(QemuOpts *opts)
197 const char* socket_fd = qemu_opt_get(opts, "socket");
203 addr = qemu_opt_get(opts, "host");
204 port = qemu_opt_get(opts, "port");
210 if (qemu_opt_get_bool(opts, "ipv4", 0)) {
214 if (qemu_opt_get_bool(opts, "ipv6", 0)) {
259 int inet_dgram_opts(QemuOpts *opts)
273 addr = qemu_opt_get(opts, "host");
274 port = qemu_opt_get(opts, "port");
284 if (qemu_opt_get_bool(opts, "ipv4", 0)) {
288 if (qemu_opt_get_bool(opts, "ipv6", 0)) {
301 addr = qemu_opt_get(opts, "localaddr");
302 port = qemu_opt_get(opts, "localport");
369 static int inet_parse(QemuOpts *opts, const char *str)
392 qemu_opt_set(opts, "ipv6", "on");
400 qemu_opt_set(opts, "ipv4", "on");
409 qemu_opt_set(opts, "host", addr);
410 qemu_opt_set(opts, "port", port);
416 qemu_opt_set(opts, "to", h+4);
418 qemu_opt_set(opts, "ipv4", "on");
420 qemu_opt_set(opts, "ipv6", "on");
437 qemu_opt_set(opts, "socket", str_fd);
446 QemuOpts *opts;
450 opts = qemu_opts_create(&dummy_opts, NULL, 0);
451 if (inet_parse(opts, str) == 0) {
452 sock = inet_listen_opts(opts, port_offset);
455 if (qemu_opt_get_bool(opts, "ipv6", 0)) {
457 qemu_opt_get(opts, "host"),
458 qemu_opt_get(opts, "port"),
462 qemu_opt_get(opts, "host"),
463 qemu_opt_get(opts, "port"),
468 qemu_opts_del(opts);
474 QemuOpts *opts;
477 opts = qemu_opts_create(&dummy_opts, NULL, 0);
478 if (inet_parse(opts, str) == 0)
479 sock = inet_connect_opts(opts);
480 qemu_opts_del(opts);
486 int unix_listen_opts(QemuOpts *opts)
488 const char *path = qemu_opt_get(opts, "path");
508 qemu_opt_set(opts, "path", unpath);
528 int unix_connect_opts(QemuOpts *opts)
531 const char *path = qemu_opt_get(opts, "path");
557 QemuOpts *opts;
561 opts = qemu_opts_create(&dummy_opts, NULL, 0);
569 qemu_opt_set(opts, "path", path);
573 qemu_opt_set(opts, "path", str);
576 sock = unix_listen_opts(opts);
579 snprintf(ostr, olen, "%s%s", qemu_opt_get(opts, "path"), optstr ? optstr : "");
580 qemu_opts_del(opts);
586 QemuOpts *opts;
589 opts = qemu_opts_create(&dummy_opts, NULL, 0);
590 qemu_opt_set(opts, "path", path);
591 sock = unix_connect_opts(opts);
592 qemu_opts_del(opts);
598 int unix_listen_opts(QemuOpts *opts)
604 int unix_connect_opts(QemuOpts *opts)