daemon: changes to support optional retainment of per-interface parameters for EMANE models when multiple EMANE models of the same type are used as interfaces for a node
This commit is contained in:
parent
c66914ec21
commit
b91b5125f2
3 changed files with 15 additions and 3 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue