Commit 29975877 authored by Vincent Autefage's avatar Vincent Autefage

Merge branch 'v0.7.0-fix-slirp'

parents 13a19e7f f006ff64
......@@ -217,22 +217,24 @@ class VNode:
restrict = "off"
if iface.restrict:
restrict = "on"
com = ",user"
com += "user"
if iface.net:
com += ",net=" + str(iface.net)
com += ",restrict=" + restrict
for fw in iface.forwards:
com += "\n" + "hostfwd_add " + " socket." + str(iface.id) + " " + str(fw.proto) + ":" + str(fw.haddr) + ":" + str(fw.hport) + "-" + str(fw.gaddr) + ":" + str(fw.gport)
elif iface.proto == 'vde':
com = "vde,sock=" + str(iface.addr)
elif iface.proto == 'tap':
com = "tap,ifname=" + str(iface.addr) + ",script=" + str(NemuVar.tapup) + ",downscript=" + str(NemuVar.tapdown)
else:
raise NemuError(str(iface.proto) + ' is not supported by VNode')
raise NemuError(str(iface.proto) + ' is not supported by VNode')
com += ",id=socket." + str(iface.id)
self.send(com)
com = "netdev_add hubport,id=endpoint." + str(iface.id) + ",netdev=socket." + str(iface.id) + ",hubid=" + str(iface.id)
self.send(com)
if iface.proto == 'slirp':
for fw in iface.forwards:
com = "hostfwd_add " + " socket." + str(iface.id) + " " + str(fw.proto) + ":" + str(fw.haddr) + ":" + str(fw.hport) + "-" + str(fw.gaddr) + ":" + str(fw.gport)
self.send(com)
def unsetiface(self, id):
'''Unsets connection information of <id>'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment