Skip to content

Commit 3d7dac6

Browse files
committed
added extra logic to EMANE node to enable flow control in the virtual transport
if it is enabled in the MAC model (Boeing r1801)
1 parent 035351c commit 3d7dac6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

daemon/core/emane/nodes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,22 @@ def buildtransportxml(self, emane, type):
166166
trans.setAttribute("name", "%s Transport" % type.capitalize())
167167
trans.setAttribute("library", "trans%s" % type.lower())
168168
trans.appendChild(emane.xmlparam(transdoc, "bitrate", "0"))
169+
170+
flowcontrol = False
171+
names = self.model.getnames()
172+
values = emane.getconfig(self.objid, self.model._name,
173+
self.model.getdefaultvalues())[1]
174+
if "flowcontrolenable" in names and values:
175+
i = names.index("flowcontrolenable")
176+
if self.model.booltooffon(values[i]) == "on":
177+
flowcontrol = True
178+
169179
if "virtual" in type.lower():
170180
trans.appendChild(emane.xmlparam(transdoc, "devicepath",
171181
"/dev/net/tun"))
182+
if flowcontrol:
183+
trans.appendChild(emane.xmlparam(transdoc, "flowcontrolenable",
184+
"on"))
172185
emane.xmlwrite(transdoc, self.transportxmlname(type.lower()))
173186

174187
def transportxmlname(self, type):

0 commit comments

Comments
 (0)