/* slirp network adapter */
static int slirp_inited;
+static int slirp_restrict;
+static char *slirp_ip;
static VLANClientState *slirp_vc;
int slirp_can_output(void)
{
if (!slirp_inited) {
slirp_inited = 1;
- slirp_init(0, NULL);
+ slirp_init(slirp_restrict, slirp_ip);
}
slirp_vc = qemu_new_vlan_client(vlan, model, name,
slirp_receive, NULL, NULL);
if (!slirp_inited) {
slirp_inited = 1;
- slirp_init(0, NULL);
+ slirp_init(slirp_restrict, slirp_ip);
}
p = redir_str;
if (!slirp_inited) {
slirp_inited = 1;
- slirp_init(0, NULL);
+ slirp_init(slirp_restrict, slirp_ip);
}
/* XXX: better tmp dir construction */
if (get_param_value(buf, sizeof(buf), "hostname", p)) {
pstrcpy(slirp_hostname, sizeof(slirp_hostname), buf);
}
+ if (get_param_value(buf, sizeof(buf), "restrict", p)) {
+ slirp_restrict = (buf[0] == 'y') ? 1 : 0;
+ }
+ if (get_param_value(buf, sizeof(buf), "ip", p)) {
+ slirp_ip = strdup(buf);
+ }
vlan->nb_host_devs++;
ret = net_slirp_init(vlan, device, name);
} else