diff --git a/daemon/core/coreobj.py b/daemon/core/coreobj.py index 6b04be8a..2bedbfa8 100644 --- a/daemon/core/coreobj.py +++ b/daemon/core/coreobj.py @@ -232,6 +232,7 @@ class PyCoreNode(PyCoreObj): if ifindex in self._netif: raise ValueError, "ifindex %s already exists" % ifindex self._netif[ifindex] = netif + netif.netindex = ifindex def delnetif(self, ifindex): if ifindex not in self._netif: diff --git a/daemon/core/emane/emane.py b/daemon/core/emane/emane.py index 64cd828d..69ed3be1 100644 --- a/daemon/core/emane/emane.py +++ b/daemon/core/emane/emane.py @@ -235,7 +235,14 @@ class Emane(ConfigurableManager): # don't use default values when interface config is the same as net # note here that using ifc.node.objid as key allows for only one type # of each model per node; TODO: use both node and interface as key - values = self.getconfig(ifc.node.objid, conftype, None)[1] + + # Adamson change: first check for iface config keyed by "node:ifc.name" + # (so that nodes w/ multiple interfaces of same conftype can have + # different configs for each separate interface) + key = 1000*ifc.node.objid + ifc.netindex + values = self.getconfig(key, conftype, None)[1] + if not values: + values = self.getconfig(ifc.node.objid, conftype, None)[1] if not values and self.version > self.EMANE091: # with EMANE 0.9.2+, we need an extra NEM XML from # model.buildnemxmlfiles(), so defaults are returned here @@ -1279,7 +1286,9 @@ class EmaneModel(WirelessModel): name = "n%s" % self.objid if ifc is not None: nodenum = ifc.node.objid - if emane.getconfig(nodenum, self._name, None)[1] is not None: + # Adamson change - use getifcconfig() to get proper result + #if emane.getconfig(nodenum, self._name, None)[1] is not None: + if emane.getifcconfig(nodenum, self._name, None, ifc) is not None: name = ifc.localname.replace('.','_') return "%s%s" % (name, self._name) diff --git a/daemon/examples/netns/emane80211.py b/daemon/examples/netns/emane80211.py index 5a7fbcdc..6868d49c 100755 --- a/daemon/examples/netns/emane80211.py +++ b/daemon/examples/netns/emane80211.py @@ -62,11 +62,13 @@ def main(): names = EmaneIeee80211abgModel.getnames() values = list(EmaneIeee80211abgModel.getdefaultvalues()) # TODO: change any of the EMANE 802.11 parameter values here + for i in range(0, len(names)): + print "EMANE 80211 \"%s\" = \"%s\"" % (names[i], values[i]) try: values[ names.index('pathlossmode') ] = '2ray' except ValueError: values[ names.index('propagationmodel') ] = '2ray' - + session.emane.setconfig(wlan.objid, EmaneIeee80211abgModel._name, values) services_str = "zebra|OSPFv3MDR|vtysh|IPForward"