daemon/core/misc/xmlwriter1.py
def addInterfaces(self, devObj):
        ''' Add interfaces to a device element.
        '''
        idx=0
        for ifcObj in devObj.netifs(sort=True):
            if ifcObj.net and isinstance(ifcObj.net, nodes.CtrlNet):
                continue
            if isinstance(devObj, nodes.PyCoreNode):
                ifcEle = InterfaceElement(self.scenPlan, self, devObj, ifcObj)
            else: # isinstance(node, (nodes.HubNode nodes.SwitchNode)):
                ifcEle = InterfaceElement(self.scenPlan, self, devObj, ifcObj, idx)
            idx += 1

            netmodel = None
            if ifcObj.net:
                if hasattr(ifcObj.net, "model"):
                    netmodel = ifcObj.net.model
            if ifcObj.mtu and ifcObj.mtu != 1500:
                ifcEle.setAttribute("mtu", "%s" % ifcObj.mtu)

            # The interfaces returned for Switches and Hubs are the interfaces of the nodes connected to them.
            # The addresses are for those interfaces. Don't include them here.
            if isinstance(devObj, nodes.PyCoreNode):
                # could use ifcObj.params, transport_type
                ifcEle.addAddresses(ifcObj)
                # per-interface models
                # XXX Remove???
                if netmodel and netmodel._name[:6] == "emane_":
                    cfg = self.coreSession.emane.getifcconfig(devObj.objid, netmodel._name,
                                                              None, ifcObj)
                    if cfg:
                        ifcEle.addModels(((netmodel, cfg),) )

            self.interfaces.append(ifcEle)
 Add interfaces to a device element.
        
Add interfaces to a device element.
Add interfaces to a device element .
def addInterfaces(self, devObj):
        idx=0
        for ifcObj in devObj.netifs(sort=True):
            if ifcObj.net and isinstance(ifcObj.net, nodes.CtrlNet):
                continue
            if isinstance(devObj, nodes.PyCoreNode):
                ifcEle = InterfaceElement(self.scenPlan, self, devObj, ifcObj)
            else: 
                ifcEle = InterfaceElement(self.scenPlan, self, devObj, ifcObj, idx)
            idx += 1
            netmodel = None
            if ifcObj.net:
                if hasattr(ifcObj.net, "model"):
                    netmodel = ifcObj.net.model
            if ifcObj.mtu and ifcObj.mtu != 1500:
                ifcEle.setAttribute("mtu", "%s" % ifcObj.mtu)
            if isinstance(devObj, nodes.PyCoreNode):
                ifcEle.addAddresses(ifcObj)
                if netmodel and netmodel._name[:6] == "emane_":
                    cfg = self.coreSession.emane.getifcconfig(devObj.objid, netmodel._name,
                                                              None, ifcObj)
                    if cfg:
                        ifcEle.addModels(((netmodel, cfg),) )
            self.interfaces.append(ifcEle)
def addInterfaces ( self , devObj ) : idx = 0 for ifcObj in devObj . netifs ( sort = True ) : if ifcObj . net and isinstance ( ifcObj . net , nodes . CtrlNet ) : continue if isinstance ( devObj , nodes . PyCoreNode ) : ifcEle = InterfaceElement ( self . scenPlan , self , devObj , ifcObj ) else : ifcEle = InterfaceElement ( self . scenPlan , self , devObj , ifcObj , idx ) idx += 1 netmodel = None if ifcObj . net : if hasattr ( ifcObj . net , "model" ) : netmodel = ifcObj . net . model if ifcObj . mtu and ifcObj . mtu != 1500 : ifcEle . setAttribute ( "mtu" , "%s" % ifcObj . mtu ) if isinstance ( devObj , nodes . PyCoreNode ) : ifcEle . addAddresses ( ifcObj ) if netmodel and netmodel . _name [ : 6 ] == "emane_" : cfg = self . coreSession . emane . getifcconfig ( devObj . objid , netmodel . _name , None , ifcObj ) if cfg : ifcEle . addModels ( ( ( netmodel , cfg ) , ) ) self . interfaces . append ( ifcEle )
Add interfaces to a device element.
Add interfaces to a device element .
''' Add interfaces to a device element.
        ''' # isinstance(node, (nodes.HubNode nodes.SwitchNode)): # The interfaces returned for Switches and Hubs are the interfaces of the nodes connected to them. # The addresses are for those interfaces. Don't include them here. # could use ifcObj.params, transport_type # per-interface models # XXX Remove???
self
devObj