added extra logic to EMANE node to enable flow control in the virtual transport

if it is enabled in the MAC model
(Boeing r1801)
This commit is contained in:
ahrenholz 2013-12-03 23:10:21 +00:00
parent 6babc9895e
commit 3e99c9d12f

View file

@ -166,9 +166,22 @@ class EmaneNode(EmaneNet):
trans.setAttribute("name", "%s Transport" % type.capitalize())
trans.setAttribute("library", "trans%s" % type.lower())
trans.appendChild(emane.xmlparam(transdoc, "bitrate", "0"))
flowcontrol = False
names = self.model.getnames()
values = emane.getconfig(self.objid, self.model._name,
self.model.getdefaultvalues())[1]
if "flowcontrolenable" in names and values:
i = names.index("flowcontrolenable")
if self.model.booltooffon(values[i]) == "on":
flowcontrol = True
if "virtual" in type.lower():
trans.appendChild(emane.xmlparam(transdoc, "devicepath",
"/dev/net/tun"))
if flowcontrol:
trans.appendChild(emane.xmlparam(transdoc, "flowcontrolenable",
"on"))
emane.xmlwrite(transdoc, self.transportxmlname(type.lower()))
def transportxmlname(self, type):