daemon/core/emane/nodes.py
def buildtransportxml(self, emane, type):
        ''' Write a transport XML file for the Virtual or Raw Transport.
        '''
        transdoc = emane.xmldoc("transport")
        trans = transdoc.getElementsByTagName("transport").pop()
        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():
            if os.path.exists("/dev/net/tun_flowctl"):
                trans.appendChild(emane.xmlparam(transdoc, "devicepath",
                                  "/dev/net/tun_flowctl"))
            else:
                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()))
 Write a transport XML file for the Virtual or Raw Transport.
        
Write a transport XML file for the Virtual or Raw Transport.
Write a transport XML file for the Virtual or Raw Transport .
def buildtransportxml(self, emane, type):
        transdoc = emane.xmldoc("transport")
        trans = transdoc.getElementsByTagName("transport").pop()
        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():
            if os.path.exists("/dev/net/tun_flowctl"):
                trans.appendChild(emane.xmlparam(transdoc, "devicepath",
                                  "/dev/net/tun_flowctl"))
            else:
                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 buildtransportxml ( self , emane , type ) : transdoc = emane . xmldoc ( "transport" ) trans = transdoc . getElementsByTagName ( "transport" ) . pop ( ) 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 ( ) : if os . path . exists ( "/dev/net/tun_flowctl" ) : trans . appendChild ( emane . xmlparam ( transdoc , "devicepath" , "/dev/net/tun_flowctl" ) ) else : 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 ( ) ) )
Write a transport XML file for the Virtual or Raw Transport.
Write a transport XML file for the Virtual or Raw Transport .
''' Write a transport XML file for the Virtual or Raw Transport.
        '''
self
emane
type