making usage of double quotes standard for emane files

This commit is contained in:
Blake J. Harnden 2017-08-04 14:34:44 -07:00
parent 850cc599c8
commit 2281051edf
8 changed files with 278 additions and 277 deletions

View file

@ -12,8 +12,8 @@ class EmaneBypassModel(EmaneModel):
name = "emane_bypass" name = "emane_bypass"
config_matrix = [ config_matrix = [
("none", ConfigDataTypes.BOOL.value, '0', ("none", ConfigDataTypes.BOOL.value, "0",
'True,False', 'There are no parameters for the bypass model.'), "True,False", "There are no parameters for the bypass model."),
] ]
# value groupings # value groupings

View file

@ -24,24 +24,24 @@ class EmaneCommEffectModel(EmaneModel):
name = "emane_commeffect" name = "emane_commeffect"
# CommEffect parameters # CommEffect parameters
_confmatrix_shim_base = [ _confmatrix_shim_base = [
("filterfile", ConfigDataTypes.STRING.value, '', ("filterfile", ConfigDataTypes.STRING.value, "",
'', 'filter file'), "", "filter file"),
("groupid", ConfigDataTypes.UINT32.value, '0', ("groupid", ConfigDataTypes.UINT32.value, "0",
'', 'NEM Group ID'), "", "NEM Group ID"),
("enablepromiscuousmode", ConfigDataTypes.BOOL.value, '0', ("enablepromiscuousmode", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable promiscuous mode'), "On,Off", "enable promiscuous mode"),
("receivebufferperiod", ConfigDataTypes.FLOAT.value, '1.0', ("receivebufferperiod", ConfigDataTypes.FLOAT.value, "1.0",
'', 'receivebufferperiod'), "", "receivebufferperiod"),
] ]
_confmatrix_shim_081 = [ _confmatrix_shim_081 = [
("defaultconnectivity", ConfigDataTypes.BOOL.value, '0', ("defaultconnectivity", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'defaultconnectivity'), "On,Off", "defaultconnectivity"),
("enabletighttimingmode", ConfigDataTypes.BOOL.value, '0', ("enabletighttimingmode", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable tight timing mode'), "On,Off", "enable tight timing mode"),
] ]
_confmatrix_shim_091 = [ _confmatrix_shim_091 = [
("defaultconnectivitymode", ConfigDataTypes.BOOL.value, '0', ("defaultconnectivitymode", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'defaultconnectivity'), "On,Off", "defaultconnectivity"),
] ]
if emane.VERSION >= emane.EMANE091: if emane.VERSION >= emane.EMANE091:
_confmatrix_shim = _confmatrix_shim_base + _confmatrix_shim_091 _confmatrix_shim = _confmatrix_shim_base + _confmatrix_shim_091
@ -75,7 +75,7 @@ class EmaneCommEffectModel(EmaneModel):
map(lambda n: shim.appendChild(e.xmlparam(shimdoc, n, self.valueof(n, values))), shimnames) map(lambda n: shim.appendChild(e.xmlparam(shimdoc, n, self.valueof(n, values))), shimnames)
# empty filterfile is not allowed # empty filterfile is not allowed
ff = self.valueof("filterfile", values) ff = self.valueof("filterfile", values)
if ff.strip() != '': if ff.strip() != "":
shim.appendChild(e.xmlparam(shimdoc, "filterfile", ff)) shim.appendChild(e.xmlparam(shimdoc, "filterfile", ff))
e.xmlwrite(shimdoc, self.shimxmlname(ifc)) e.xmlwrite(shimdoc, self.shimxmlname(ifc))

View file

@ -64,7 +64,7 @@ class EmaneManager(ConfigurableManager):
config_type = RegisterTlvs.EMULATION_SERVER.value config_type = RegisterTlvs.EMULATION_SERVER.value
_hwaddr_prefix = "02:02" _hwaddr_prefix = "02:02"
(SUCCESS, NOT_NEEDED, NOT_READY) = (0, 1, 2) (SUCCESS, NOT_NEEDED, NOT_READY) = (0, 1, 2)
EVENTCFGVAR = 'LIBEMANEEVENTSERVICECONFIG' EVENTCFGVAR = "LIBEMANEEVENTSERVICECONFIG"
DEFAULT_LOG_LEVEL = 3 DEFAULT_LOG_LEVEL = 3
def __init__(self, session): def __init__(self, session):
@ -81,8 +81,8 @@ class EmaneManager(ConfigurableManager):
self._ifccounts = {} self._ifccounts = {}
self._ifccountslock = threading.Lock() self._ifccountslock = threading.Lock()
# Port numbers are allocated from these counters # Port numbers are allocated from these counters
self.platformport = self.session.get_config_item_int('emane_platform_port', 8100) self.platformport = self.session.get_config_item_int("emane_platform_port", 8100)
self.transformport = self.session.get_config_item_int('emane_transform_port', 8200) self.transformport = self.session.get_config_item_int("emane_transform_port", 8200)
self.doeventloop = False self.doeventloop = False
self.eventmonthread = None self.eventmonthread = None
self.logversion() self.logversion()
@ -102,7 +102,7 @@ class EmaneManager(ConfigurableManager):
logger.info("using EMANE version: %s", emane.VERSIONSTR) logger.info("using EMANE version: %s", emane.VERSIONSTR)
def deleteeventservice(self): def deleteeventservice(self):
if hasattr(self, 'service'): if hasattr(self, "service"):
if self.service: if self.service:
for fd in self.service._readFd, self.service._writeFd: for fd in self.service._readFd, self.service._writeFd:
if fd >= 0: if fd >= 0:
@ -132,8 +132,8 @@ class EmaneManager(ConfigurableManager):
return return
# Get the control network to be used for events # Get the control network to be used for events
values = self.getconfig(None, "emane", self.emane_config.getdefaultvalues())[1] values = self.getconfig(None, "emane", self.emane_config.getdefaultvalues())[1]
group, port = self.emane_config.valueof('eventservicegroup', values).split(':') group, port = self.emane_config.valueof("eventservicegroup", values).split(":")
eventdev = self.emane_config.valueof('eventservicedevice', values) eventdev = self.emane_config.valueof("eventservicedevice", values)
eventnetidx = self.session.get_control_net_index(eventdev) eventnetidx = self.session.get_control_net_index(eventdev)
if emane.VERSION > emane.EMANE091: if emane.VERSION > emane.EMANE091:
if eventnetidx < 0: if eventnetidx < 0:
@ -240,14 +240,14 @@ class EmaneManager(ConfigurableManager):
if ifc is None: if ifc is None:
return self.getconfig(nodenum, conftype, defaultvalues)[1] return self.getconfig(nodenum, conftype, defaultvalues)[1]
else: else:
# don't use default values when interface config is the same as net # 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 # 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 # of each model per node; TODO: use both node and interface as key
# Adamson change: first check for iface config keyed by "node:ifc.name" # Adamson change: first check for iface config keyed by "node:ifc.name"
# (so that nodes w/ multiple interfaces of same conftype can have # (so that nodes w/ multiple interfaces of same conftype can have
# different configs for each separate interface) # different configs for each separate interface)
key = 1000*ifc.node.objid key = 1000 * ifc.node.objid
if ifc.netindex is not None: if ifc.netindex is not None:
key += ifc.netindex key += ifc.netindex
values = self.getconfig(key, conftype, None)[1] values = self.getconfig(key, conftype, None)[1]
@ -274,14 +274,14 @@ class EmaneManager(ConfigurableManager):
if len(self._objs) == 0: if len(self._objs) == 0:
return EmaneManager.NOT_NEEDED return EmaneManager.NOT_NEEDED
if emane.VERSION == emane.EMANEUNK: if emane.VERSION == emane.EMANEUNK:
raise ValueError, 'EMANE version not properly detected' raise ValueError, "EMANE version not properly detected"
# control network bridge required for EMANE 0.9.2 # control network bridge required for EMANE 0.9.2
# - needs to be configured before checkdistributed() for distributed # - needs to be configured before checkdistributed() for distributed
# - needs to exist when eventservice binds to it (initeventservice) # - needs to exist when eventservice binds to it (initeventservice)
if emane.VERSION > emane.EMANE091 and self.session.master: if emane.VERSION > emane.EMANE091 and self.session.master:
values = self.getconfig(None, "emane", values = self.getconfig(None, "emane",
self.emane_config.getdefaultvalues())[1] self.emane_config.getdefaultvalues())[1]
otadev = self.emane_config.valueof('otamanagerdevice', values) otadev = self.emane_config.valueof("otamanagerdevice", values)
netidx = self.session.get_control_net_index(otadev) netidx = self.session.get_control_net_index(otadev)
if netidx < 0: if netidx < 0:
msg = "EMANE cannot be started. " \ msg = "EMANE cannot be started. " \
@ -291,7 +291,7 @@ class EmaneManager(ConfigurableManager):
ctrlnet = self.session.add_remove_control_net(net_index=netidx, remove=False, conf_required=False) ctrlnet = self.session.add_remove_control_net(net_index=netidx, remove=False, conf_required=False)
self.distributedctrlnet(ctrlnet) self.distributedctrlnet(ctrlnet)
eventdev = self.emane_config.valueof('eventservicedevice', values) eventdev = self.emane_config.valueof("eventservicedevice", values)
if eventdev != otadev: if eventdev != otadev:
netidx = self.session.get_control_net_index(eventdev) netidx = self.session.get_control_net_index(eventdev)
if netidx < 0: if netidx < 0:
@ -304,10 +304,10 @@ class EmaneManager(ConfigurableManager):
self.distributedctrlnet(ctrlnet) self.distributedctrlnet(ctrlnet)
if self.checkdistributed(): if self.checkdistributed():
# we are slave, but haven't received a platformid yet # we are slave, but haven"t received a platformid yet
cfgval = self.getconfig(None, self.emane_config.name, cfgval = self.getconfig(None, self.emane_config.name,
self.emane_config.getdefaultvalues())[1] self.emane_config.getdefaultvalues())[1]
i = self.emane_config.getnames().index('platform_id_start') i = self.emane_config.getnames().index("platform_id_start")
if cfgval[i] == self.emane_config.getdefaultvalues()[i]: if cfgval[i] == self.emane_config.getdefaultvalues()[i]:
return EmaneManager.NOT_READY return EmaneManager.NOT_READY
self.setnodemodels() self.setnodemodels()
@ -348,13 +348,13 @@ class EmaneManager(ConfigurableManager):
e.getnemid(netif))) e.getnemid(netif)))
if nems: if nems:
emane_nems_filename = os.path.join(self.session.session_dir, emane_nems_filename = os.path.join(self.session.session_dir,
'emane_nems') "emane_nems")
try: try:
with open(emane_nems_filename, 'w') as f: with open(emane_nems_filename, "w") as f:
for nodename, ifname, nemid in nems: for nodename, ifname, nemid in nems:
f.write('%s %s %s\n' % (nodename, ifname, nemid)) f.write("%s %s %s\n" % (nodename, ifname, nemid))
except IOError: except IOError:
logger.exception('Error writing EMANE NEMs file: %s') logger.exception("Error writing EMANE NEMs file: %s")
return EmaneManager.SUCCESS return EmaneManager.SUCCESS
@ -378,9 +378,9 @@ class EmaneManager(ConfigurableManager):
""" """
with self._objslock: with self._objslock:
self._objs.clear() self._objs.clear()
# don't clear self._ifccounts here; NEM counts are needed for buildxml # don"t clear self._ifccounts here; NEM counts are needed for buildxml
self.platformport = self.session.get_config_item_int('emane_platform_port', 8100) self.platformport = self.session.get_config_item_int("emane_platform_port", 8100)
self.transformport = self.session.get_config_item_int('emane_transform_port', 8200) self.transformport = self.session.get_config_item_int("emane_transform_port", 8200)
def shutdown(self): def shutdown(self):
""" """
@ -522,8 +522,8 @@ class EmaneManager(ConfigurableManager):
# not distributed # not distributed
if len(servers) < 2: if len(servers) < 2:
return return
prefix = session.config.get('controlnet') prefix = session.config.get("controlnet")
prefix = getattr(session.options, 'controlnet', prefix) prefix = getattr(session.options, "controlnet", prefix)
prefixes = prefix.split() prefixes = prefix.split()
# normal Config messaging will distribute controlnets # normal Config messaging will distribute controlnets
if len(prefixes) >= len(servers): if len(prefixes) >= len(servers):
@ -531,7 +531,7 @@ class EmaneManager(ConfigurableManager):
# this generates a config message having controlnet prefix assignments # this generates a config message having controlnet prefix assignments
logger.info("Setting up default controlnet prefixes for distributed (%d configured)" % len(prefixes)) logger.info("Setting up default controlnet prefixes for distributed (%d configured)" % len(prefixes))
prefixes = ctrlnet.DEFAULT_PREFIX_LIST[0] prefixes = ctrlnet.DEFAULT_PREFIX_LIST[0]
vals = "controlnet='%s'" % prefixes vals = 'controlnet="%s"' % prefixes
tlvdata = "" tlvdata = ""
tlvdata += coreapi.CoreConfigTlv.pack(ConfigTlvs.OBJECT.value, "session") tlvdata += coreapi.CoreConfigTlv.pack(ConfigTlvs.OBJECT.value, "session")
tlvdata += coreapi.CoreConfigTlv.pack(ConfigTlvs.TYPE.value, 0) tlvdata += coreapi.CoreConfigTlv.pack(ConfigTlvs.TYPE.value, 0)
@ -647,7 +647,7 @@ class EmaneManager(ConfigurableManager):
names = list(self.emane_config.getnames()) names = list(self.emane_config.getnames())
platform_names = names[:len(self.emane_config._confmatrix_platform)] platform_names = names[:len(self.emane_config._confmatrix_platform)]
platform_names.remove('platform_id_start') platform_names.remove("platform_id_start")
# append all platform options (except starting id) to doc # append all platform options (except starting id) to doc
map(lambda n: plat.appendChild(self.xmlparam(doc, n, self.emane_config.valueof(n, values))), platform_names) map(lambda n: plat.appendChild(self.xmlparam(doc, n, self.emane_config.valueof(n, values))), platform_names)
@ -697,13 +697,13 @@ class EmaneManager(ConfigurableManager):
plat = doc.getElementsByTagName("platform").pop() plat = doc.getElementsByTagName("platform").pop()
names = list(self.emane_config.getnames()) names = list(self.emane_config.getnames())
platform_names = names[:len(self.emane_config._confmatrix_platform)] platform_names = names[:len(self.emane_config._confmatrix_platform)]
platform_names.remove('platform_id_start') platform_names.remove("platform_id_start")
platform_values = list(values) platform_values = list(values)
if otadev: if otadev:
i = platform_names.index('otamanagerdevice') i = platform_names.index("otamanagerdevice")
platform_values[i] = otadev platform_values[i] = otadev
if eventdev: if eventdev:
i = platform_names.index('eventservicedevice') i = platform_names.index("eventservicedevice")
platform_values[i] = eventdev platform_values[i] = eventdev
# append all platform options (except starting id) to doc # append all platform options (except starting id) to doc
map(lambda n: plat.appendChild(self.xmlparam(doc, n, self.emane_config.valueof(n, platform_values))), map(lambda n: plat.appendChild(self.xmlparam(doc, n, self.emane_config.valueof(n, platform_values))),
@ -727,7 +727,7 @@ class EmaneManager(ConfigurableManager):
nementry.setAttribute("id", "%d" % nemid) nementry.setAttribute("id", "%d" % nemid)
k = netif.node.objid k = netif.node.objid
if netif.transport_type == "raw": if netif.transport_type == "raw":
k = 'host' k = "host"
otadev = ctrlnet.brname otadev = ctrlnet.brname
eventdev = ctrlnet.brname eventdev = ctrlnet.brname
else: else:
@ -745,8 +745,8 @@ class EmaneManager(ConfigurableManager):
netif.sethwaddr(MacAddress.from_string(macstr)) netif.sethwaddr(MacAddress.from_string(macstr))
nemid += 1 nemid += 1
for k in sorted(platformxmls.keys()): for k in sorted(platformxmls.keys()):
if k == 'host': if k == "host":
self.xmlwrite(platformxmls['host'], "platform.xml") self.xmlwrite(platformxmls["host"], "platform.xml")
continue continue
self.xmlwrite(platformxmls[k], "platform%d.xml" % k) self.xmlwrite(platformxmls[k], "platform%d.xml" % k)
@ -763,7 +763,7 @@ class EmaneManager(ConfigurableManager):
""" """
Given a nem XML node and EMANE WLAN node number, append Given a nem XML node and EMANE WLAN node number, append
a <transport/> tag to the NEM definition, required for using a <transport/> tag to the NEM definition, required for using
EMANE's internal transport. EMANE"s internal transport.
""" """
if emane.VERSION < emane.EMANE092: if emane.VERSION < emane.EMANE092:
return return
@ -793,7 +793,7 @@ class EmaneManager(ConfigurableManager):
defaults = self.emane_config.getdefaultvalues() defaults = self.emane_config.getdefaultvalues()
values = self.getconfig(None, "emane", self.emane_config.getdefaultvalues())[1] values = self.getconfig(None, "emane", self.emane_config.getdefaultvalues())[1]
need_xml = False need_xml = False
keys = ('eventservicegroup', 'eventservicedevice') keys = ("eventservicegroup", "eventservicedevice")
for k in keys: for k in keys:
a = self.emane_config.valueof(k, defaults) a = self.emane_config.valueof(k, defaults)
b = self.emane_config.valueof(k, values) b = self.emane_config.valueof(k, values)
@ -806,17 +806,17 @@ class EmaneManager(ConfigurableManager):
return return
try: try:
group, port = self.emane_config.valueof('eventservicegroup', values).split(':') group, port = self.emane_config.valueof("eventservicegroup", values).split(":")
except ValueError: except ValueError:
logger.exception("invalid eventservicegroup in EMANE config") logger.exception("invalid eventservicegroup in EMANE config")
return return
dev = self.emane_config.valueof('eventservicedevice', values) dev = self.emane_config.valueof("eventservicedevice", values)
doc = self.xmldoc("emaneeventmsgsvc") doc = self.xmldoc("emaneeventmsgsvc")
es = doc.getElementsByTagName("emaneeventmsgsvc").pop() es = doc.getElementsByTagName("emaneeventmsgsvc").pop()
kvs = (('group', group), ('port', port), ('device', dev), ('mcloop', '1'), ('ttl', '32')) kvs = (("group", group), ("port", port), ("device", dev), ("mcloop", "1"), ("ttl", "32"))
xmlutils.add_text_elements_from_tuples(doc, es, kvs) xmlutils.add_text_elements_from_tuples(doc, es, kvs)
filename = 'libemaneeventservice.xml' filename = "libemaneeventservice.xml"
self.xmlwrite(doc, filename) self.xmlwrite(doc, filename)
pathname = os.path.join(self.session.session_dir, filename) pathname = os.path.join(self.session.session_dir, filename)
self.initeventservice(filename=pathname) self.initeventservice(filename=pathname)
@ -875,17 +875,17 @@ class EmaneManager(ConfigurableManager):
emanecmd += "-r", emanecmd += "-r",
values = self.getconfig(None, "emane", self.emane_config.getdefaultvalues())[1] values = self.getconfig(None, "emane", self.emane_config.getdefaultvalues())[1]
otagroup, otaport = self.emane_config.valueof('otamanagergroup', values).split(':') otagroup, otaport = self.emane_config.valueof("otamanagergroup", values).split(":")
otadev = self.emane_config.valueof('otamanagerdevice', values) otadev = self.emane_config.valueof("otamanagerdevice", values)
otanetidx = self.session.get_control_net_index(otadev) otanetidx = self.session.get_control_net_index(otadev)
eventgroup, eventport = self.emane_config.valueof('eventservicegroup', values).split(':') eventgroup, eventport = self.emane_config.valueof("eventservicegroup", values).split(":")
eventdev = self.emane_config.valueof('eventservicedevice', values) eventdev = self.emane_config.valueof("eventservicedevice", values)
eventservicenetidx = self.session.get_control_net_index(eventdev) eventservicenetidx = self.session.get_control_net_index(eventdev)
run_emane_on_host = False run_emane_on_host = False
for node in self.getnodes(): for node in self.getnodes():
if hasattr(node, 'transport_type') and node.transport_type == "raw": if hasattr(node, "transport_type") and node.transport_type == "raw":
run_emane_on_host = True run_emane_on_host = True
continue continue
path = self.session.session_dir path = self.session.session_dir
@ -937,12 +937,12 @@ class EmaneManager(ConfigurableManager):
Kill the appropriate EMANE daemons. Kill the appropriate EMANE daemons.
""" """
# TODO: we may want to improve this if we had the PIDs from the # TODO: we may want to improve this if we had the PIDs from the
# specific EMANE daemons that we've started # specific EMANE daemons that we"ve started
cmd = ["killall", "-q", "emane"] cmd = ["killall", "-q", "emane"]
stop_emane_on_host = False stop_emane_on_host = False
if emane.VERSION > emane.EMANE091: if emane.VERSION > emane.EMANE091:
for node in self.getnodes(): for node in self.getnodes():
if hasattr(node, 'transport_type') and \ if hasattr(node, "transport_type") and \
node.transport_type == "raw": node.transport_type == "raw":
stop_emane_on_host = True stop_emane_on_host = True
continue continue
@ -997,7 +997,7 @@ class EmaneManager(ConfigurableManager):
""" """
# this support must be explicitly turned on; by default, CORE will # this support must be explicitly turned on; by default, CORE will
# generate the EMANE events when nodes are moved # generate the EMANE events when nodes are moved
return self.session.get_config_item_bool('emane_event_monitor', False) return self.session.get_config_item_bool("emane_event_monitor", False)
def genlocationevents(self): def genlocationevents(self):
""" """
@ -1005,7 +1005,7 @@ class EmaneManager(ConfigurableManager):
""" """
# By default, CORE generates EMANE location events when nodes # By default, CORE generates EMANE location events when nodes
# are moved; this can be explicitly disabled in core.conf # are moved; this can be explicitly disabled in core.conf
tmp = self.session.get_config_item_bool('emane_event_generate') tmp = self.session.get_config_item_bool("emane_event_generate")
if tmp is None: if tmp is None:
tmp = not self.doeventmonitor() tmp = not self.doeventmonitor()
return tmp return tmp
@ -1036,7 +1036,7 @@ class EmaneManager(ConfigurableManager):
self.doeventloop = False self.doeventloop = False
if self.service is not None: if self.service is not None:
self.service.breakloop() self.service.breakloop()
# reset the service, otherwise nextEvent won't work # reset the service, otherwise nextEvent won"t work
self.initeventservice(shutdown=True) self.initeventservice(shutdown=True)
if self.eventmonthread is not None: if self.eventmonthread is not None:
if emane.VERSION >= emane.EMANE091: if emane.VERSION >= emane.EMANE091:
@ -1086,14 +1086,14 @@ class EmaneManager(ConfigurableManager):
events.restore(data) events.restore(data)
for event in events: for event in events:
(txnemid, attrs) = event (txnemid, attrs) = event
if 'latitude' not in attrs or 'longitude' not in attrs or \ if "latitude" not in attrs or "longitude" not in attrs or \
'altitude' not in attrs: "altitude" not in attrs:
logger.warn("dropped invalid location event") logger.warn("dropped invalid location event")
continue continue
# yaw,pitch,roll,azimuth,elevation,velocity are unhandled # yaw,pitch,roll,azimuth,elevation,velocity are unhandled
lat = attrs['latitude'] lat = attrs["latitude"]
long = attrs['longitude'] long = attrs["longitude"]
alt = attrs['altitude'] alt = attrs["altitude"]
self.handlelocationeventtoxyz(txnemid, lat, long, alt) self.handlelocationeventtoxyz(txnemid, lat, long, alt)
def handlelocationeventtoxyz(self, nemid, lat, long, alt): def handlelocationeventtoxyz(self, nemid, lat, long, alt):
@ -1133,7 +1133,7 @@ class EmaneManager(ConfigurableManager):
except KeyError: except KeyError:
logger.exception("location event NEM %s has no corresponding node %s" % (nemid, n)) logger.exception("location event NEM %s has no corresponding node %s" % (nemid, n))
return False return False
# don't use node.setposition(x,y,z) which generates an event # don"t use node.setposition(x,y,z) which generates an event
node.position.set(x, y, z) node.position.set(x, y, z)
node_data = node.data(message_type=0) node_data = node.data(message_type=0)
@ -1150,7 +1150,7 @@ class EmaneManager(ConfigurableManager):
is running, False otherwise. is running, False otherwise.
""" """
status = -1 status = -1
cmd = ['pkill', '-0', '-x', 'emane'] cmd = ["pkill", "-0", "-x", "emane"]
try: try:
if emane.VERSION < emane.EMANE092: if emane.VERSION < emane.EMANE092:
@ -1172,50 +1172,50 @@ class EmaneGlobalModel(EmaneModel):
EmaneModel.__init__(self, session, object_id) EmaneModel.__init__(self, session, object_id)
# Over-The-Air channel required for EMANE 0.9.2 # Over-The-Air channel required for EMANE 0.9.2
_DEFAULT_OTA = '0' _DEFAULT_OTA = "0"
_DEFAULT_DEV = 'lo' _DEFAULT_DEV = "lo"
if emane.VERSION >= emane.EMANE092: if emane.VERSION >= emane.EMANE092:
_DEFAULT_OTA = '1' _DEFAULT_OTA = "1"
_DEFAULT_DEV = 'ctrl0' _DEFAULT_DEV = "ctrl0"
name = "emane" name = "emane"
_confmatrix_platform_base = [ _confmatrix_platform_base = [
("otamanagerchannelenable", ConfigDataTypes.BOOL.value, _DEFAULT_OTA, ("otamanagerchannelenable", ConfigDataTypes.BOOL.value, _DEFAULT_OTA,
'on,off', 'enable OTA Manager channel'), "on,off", "enable OTA Manager channel"),
("otamanagergroup", ConfigDataTypes.STRING.value, '224.1.2.8:45702', ("otamanagergroup", ConfigDataTypes.STRING.value, "224.1.2.8:45702",
'', 'OTA Manager group'), "", "OTA Manager group"),
("otamanagerdevice", ConfigDataTypes.STRING.value, _DEFAULT_DEV, ("otamanagerdevice", ConfigDataTypes.STRING.value, _DEFAULT_DEV,
'', 'OTA Manager device'), "", "OTA Manager device"),
("eventservicegroup", ConfigDataTypes.STRING.value, '224.1.2.8:45703', ("eventservicegroup", ConfigDataTypes.STRING.value, "224.1.2.8:45703",
'', 'Event Service group'), "", "Event Service group"),
("eventservicedevice", ConfigDataTypes.STRING.value, _DEFAULT_DEV, ("eventservicedevice", ConfigDataTypes.STRING.value, _DEFAULT_DEV,
'', 'Event Service device'), "", "Event Service device"),
("platform_id_start", ConfigDataTypes.INT32.value, '1', ("platform_id_start", ConfigDataTypes.INT32.value, "1",
'', 'starting Platform ID'), "", "starting Platform ID"),
] ]
_confmatrix_platform_081 = [ _confmatrix_platform_081 = [
("debugportenable", ConfigDataTypes.BOOL.value, '0', ("debugportenable", ConfigDataTypes.BOOL.value, "0",
'on,off', 'enable debug port'), "on,off", "enable debug port"),
("debugport", ConfigDataTypes.UINT16.value, '47000', ("debugport", ConfigDataTypes.UINT16.value, "47000",
'', 'debug port number'), "", "debug port number"),
] ]
_confmatrix_platform_091 = [ _confmatrix_platform_091 = [
("controlportendpoint", ConfigDataTypes.STRING.value, '0.0.0.0:47000', ("controlportendpoint", ConfigDataTypes.STRING.value, "0.0.0.0:47000",
'', 'Control port address'), "", "Control port address"),
("antennaprofilemanifesturi", ConfigDataTypes.STRING.value, '', ("antennaprofilemanifesturi", ConfigDataTypes.STRING.value, "",
'', 'antenna profile manifest URI'), "", "antenna profile manifest URI"),
] ]
_confmatrix_nem = [ _confmatrix_nem = [
("transportendpoint", ConfigDataTypes.STRING.value, 'localhost', ("transportendpoint", ConfigDataTypes.STRING.value, "localhost",
'', 'Transport endpoint address (port is automatic)'), "", "Transport endpoint address (port is automatic)"),
("platformendpoint", ConfigDataTypes.STRING.value, 'localhost', ("platformendpoint", ConfigDataTypes.STRING.value, "localhost",
'', 'Platform endpoint address (port is automatic)'), "", "Platform endpoint address (port is automatic)"),
("nem_id_start", ConfigDataTypes.INT32.value, '1', ("nem_id_start", ConfigDataTypes.INT32.value, "1",
'', 'starting NEM ID'), "", "starting NEM ID"),
] ]
_confmatrix_nem_092 = [ _confmatrix_nem_092 = [
("nem_id_start", ConfigDataTypes.INT32.value, '1', ("nem_id_start", ConfigDataTypes.INT32.value, "1",
'', 'starting NEM ID'), "", "starting NEM ID"),
] ]
if emane.VERSION >= emane.EMANE091: if emane.VERSION >= emane.EMANE091:

View file

@ -17,24 +17,25 @@ class EmaneModel(WirelessModel):
handling configuration messages based on the _confmatrix list of handling configuration messages based on the _confmatrix list of
configurable parameters. Helper functions also live here. configurable parameters. Helper functions also live here.
""" """
_prefix = {'y': 1e-24, # yocto _prefix = {
'z': 1e-21, # zepto "y": 1e-24, # yocto
'a': 1e-18, # atto "z": 1e-21, # zepto
'f': 1e-15, # femto "a": 1e-18, # atto
'p': 1e-12, # pico "f": 1e-15, # femto
'n': 1e-9, # nano "p": 1e-12, # pico
'u': 1e-6, # micro "n": 1e-9, # nano
'm': 1e-3, # mili "u": 1e-6, # micro
'c': 1e-2, # centi "m": 1e-3, # mili
'd': 1e-1, # deci "c": 1e-2, # centi
'k': 1e3, # kilo "d": 1e-1, # deci
'M': 1e6, # mega "k": 1e3, # kilo
'G': 1e9, # giga "M": 1e6, # mega
'T': 1e12, # tera "G": 1e9, # giga
'P': 1e15, # peta "T": 1e12, # tera
'E': 1e18, # exa "P": 1e15, # peta
'Z': 1e21, # zetta "E": 1e18, # exa
'Y': 1e24, # yotta "Z": 1e21, # zetta
"Y": 1e24, # yotta
} }
@classmethod @classmethod
@ -106,10 +107,10 @@ class EmaneModel(WirelessModel):
param = doc.createElement("param") param = doc.createElement("param")
param.setAttribute("name", "device") param.setAttribute("name", "device")
if ttype == "raw": if ttype == "raw":
# raw RJ45 name e.g. 'eth0' # raw RJ45 name e.g. "eth0"
param.setAttribute("value", ifc.name) param.setAttribute("value", ifc.name)
else: else:
# virtual TAP name e.g. 'n3.0.17' # virtual TAP name e.g. "n3.0.17"
param.setAttribute("value", ifc.localname) param.setAttribute("value", ifc.localname)
if emane.VERSION > emane.EMANE091: if emane.VERSION > emane.EMANE091:
param.setAttribute("value", ifc.name) param.setAttribute("value", ifc.name)
@ -120,7 +121,7 @@ class EmaneModel(WirelessModel):
def basename(self, interface=None): def basename(self, interface=None):
""" """
Return the string that other names are based on. Return the string that other names are based on.
If a specific config is stored for a node's interface, a unique If a specific config is stored for a node"s interface, a unique
filename is needed; otherwise the name of the EmaneNode is used. filename is needed; otherwise the name of the EmaneNode is used.
""" """
emane = self.session.emane emane = self.session.emane
@ -130,12 +131,12 @@ class EmaneModel(WirelessModel):
# Adamson change - use getifcconfig() to get proper result # Adamson change - use getifcconfig() to get proper result
# if emane.getconfig(nodenum, self._name, None)[1] is not None: # if emane.getconfig(nodenum, self._name, None)[1] is not None:
if emane.getifcconfig(nodenum, self.name, None, interface) is not None: if emane.getifcconfig(nodenum, self.name, None, interface) is not None:
name = interface.localname.replace('.', '_') name = interface.localname.replace(".", "_")
return "%s%s" % (name, self.name) return "%s%s" % (name, self.name)
def nemxmlname(self, interface=None): def nemxmlname(self, interface=None):
""" """
Return the string name for the NEM XML file, e.g. 'n3rfpipenem.xml' Return the string name for the NEM XML file, e.g. "n3rfpipenem.xml"
""" """
append = "" append = ""
if emane.VERSION > emane.EMANE091: if emane.VERSION > emane.EMANE091:
@ -145,19 +146,19 @@ class EmaneModel(WirelessModel):
def shimxmlname(self, ifc=None): def shimxmlname(self, ifc=None):
""" """
Return the string name for the SHIM XML file, e.g. 'commeffectshim.xml' Return the string name for the SHIM XML file, e.g. "commeffectshim.xml"
""" """
return "%sshim.xml" % self.basename(ifc) return "%sshim.xml" % self.basename(ifc)
def macxmlname(self, ifc=None): def macxmlname(self, ifc=None):
""" """
Return the string name for the MAC XML file, e.g. 'n3rfpipemac.xml' Return the string name for the MAC XML file, e.g. "n3rfpipemac.xml"
""" """
return "%smac.xml" % self.basename(ifc) return "%smac.xml" % self.basename(ifc)
def phyxmlname(self, ifc=None): def phyxmlname(self, ifc=None):
""" """
Return the string name for the PHY XML file, e.g. 'n3rfpipephy.xml' Return the string name for the PHY XML file, e.g. "n3rfpipephy.xml"
""" """
return "%sphy.xml" % self.basename(ifc) return "%sphy.xml" % self.basename(ifc)
@ -194,7 +195,7 @@ class EmaneModel(WirelessModel):
logger.exception("error in value string to param list") logger.exception("error in value string to param list")
return None return None
if not hasattr(values, '__iter__'): if not hasattr(values, "__iter__"):
return None return None
if len(values) < 2: if len(values) < 2:

View file

@ -17,64 +17,64 @@ class EmaneIeee80211abgModel(EmaneModel):
# model name # model name
name = "emane_ieee80211abg" name = "emane_ieee80211abg"
_80211rates = '1 1 Mbps,2 2 Mbps,3 5.5 Mbps,4 11 Mbps,5 6 Mbps,' + \ _80211rates = "1 1 Mbps,2 2 Mbps,3 5.5 Mbps,4 11 Mbps,5 6 Mbps," + \
'6 9 Mbps,7 12 Mbps,8 18 Mbps,9 24 Mbps,10 36 Mbps,11 48 Mbps,' + \ "6 9 Mbps,7 12 Mbps,8 18 Mbps,9 24 Mbps,10 36 Mbps,11 48 Mbps," + \
'12 54 Mbps' "12 54 Mbps"
if emane.VERSION >= emane.EMANE091: if emane.VERSION >= emane.EMANE091:
xml_path = '/usr/share/emane/xml/models/mac/ieee80211abg' xml_path = "/usr/share/emane/xml/models/mac/ieee80211abg"
else: else:
xml_path = "/usr/share/emane/models/ieee80211abg/xml" xml_path = "/usr/share/emane/models/ieee80211abg/xml"
# MAC parameters # MAC parameters
_confmatrix_mac_base = [ _confmatrix_mac_base = [
("mode", ConfigDataTypes.UINT8.value, '0', ("mode", ConfigDataTypes.UINT8.value, "0",
'0 802.11b (DSSS only),1 802.11b (DSSS only),' + "0 802.11b (DSSS only),1 802.11b (DSSS only)," +
'2 802.11a or g (OFDM),3 802.11b/g (DSSS and OFDM)', 'mode'), "2 802.11a or g (OFDM),3 802.11b/g (DSSS and OFDM)", "mode"),
("enablepromiscuousmode", ConfigDataTypes.BOOL.value, '0', ("enablepromiscuousmode", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable promiscuous mode'), "On,Off", "enable promiscuous mode"),
("distance", ConfigDataTypes.UINT32.value, '1000', ("distance", ConfigDataTypes.UINT32.value, "1000",
'', 'max distance (m)'), "", "max distance (m)"),
("unicastrate", ConfigDataTypes.UINT8.value, '4', _80211rates, ("unicastrate", ConfigDataTypes.UINT8.value, "4", _80211rates,
'unicast rate (Mbps)'), "unicast rate (Mbps)"),
("multicastrate", ConfigDataTypes.UINT8.value, '1', _80211rates, ("multicastrate", ConfigDataTypes.UINT8.value, "1", _80211rates,
'multicast rate (Mbps)'), "multicast rate (Mbps)"),
("rtsthreshold", ConfigDataTypes.UINT16.value, '0', ("rtsthreshold", ConfigDataTypes.UINT16.value, "0",
'', 'RTS threshold (bytes)'), "", "RTS threshold (bytes)"),
("pcrcurveuri", ConfigDataTypes.STRING.value, ("pcrcurveuri", ConfigDataTypes.STRING.value,
'%s/ieee80211pcr.xml' % xml_path, "%s/ieee80211pcr.xml" % xml_path,
'', 'SINR/PCR curve file'), "", "SINR/PCR curve file"),
("flowcontrolenable", ConfigDataTypes.BOOL.value, '0', ("flowcontrolenable", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable traffic flow control'), "On,Off", "enable traffic flow control"),
("flowcontroltokens", ConfigDataTypes.UINT16.value, '10', ("flowcontroltokens", ConfigDataTypes.UINT16.value, "10",
'', 'number of flow control tokens'), "", "number of flow control tokens"),
] ]
# mac parameters introduced in EMANE 0.8.1 # mac parameters introduced in EMANE 0.8.1
# Note: The entry format for category queue parameters (queuesize, aifs, etc) were changed in # Note: The entry format for category queue parameters (queuesize, aifs, etc) were changed in
# EMANE 9.x, but are being preserved for the time being due to space constraints in the # EMANE 9.x, but are being preserved for the time being due to space constraints in the
# CORE GUI. A conversion function (get9xmacparamequivalent) has been defined to support this. # CORE GUI. A conversion function (get9xmacparamequivalent) has been defined to support this.
_confmatrix_mac_extended = [ _confmatrix_mac_extended = [
("wmmenable", ConfigDataTypes.BOOL.value, '0', ("wmmenable", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'WiFi Multimedia (WMM)'), "On,Off", "WiFi Multimedia (WMM)"),
("queuesize", ConfigDataTypes.STRING.value, '0:255 1:255 2:255 3:255', ("queuesize", ConfigDataTypes.STRING.value, "0:255 1:255 2:255 3:255",
'', 'queue size (0-4:size)'), "", "queue size (0-4:size)"),
("cwmin", ConfigDataTypes.STRING.value, '0:32 1:32 2:16 3:8', ("cwmin", ConfigDataTypes.STRING.value, "0:32 1:32 2:16 3:8",
'', 'min contention window (0-4:minw)'), "", "min contention window (0-4:minw)"),
("cwmax", ConfigDataTypes.STRING.value, '0:1024 1:1024 2:64 3:16', ("cwmax", ConfigDataTypes.STRING.value, "0:1024 1:1024 2:64 3:16",
'', 'max contention window (0-4:maxw)'), "", "max contention window (0-4:maxw)"),
("aifs", ConfigDataTypes.STRING.value, '0:2 1:2 2:2 3:1', ("aifs", ConfigDataTypes.STRING.value, "0:2 1:2 2:2 3:1",
'', 'arbitration inter frame space (0-4:aifs)'), "", "arbitration inter frame space (0-4:aifs)"),
("txop", ConfigDataTypes.STRING.value, '0:0 1:0 2:0 3:0', ("txop", ConfigDataTypes.STRING.value, "0:0 1:0 2:0 3:0",
'', 'txop (0-4:usec)'), "", "txop (0-4:usec)"),
("retrylimit", ConfigDataTypes.STRING.value, '0:3 1:3 2:3 3:3', ("retrylimit", ConfigDataTypes.STRING.value, "0:3 1:3 2:3 3:3",
'', 'retry limit (0-4:numretries)'), "", "retry limit (0-4:numretries)"),
] ]
_confmatrix_mac_091 = [ _confmatrix_mac_091 = [
('radiometricenable', ConfigDataTypes.BOOL.value, '0', ("radiometricenable", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'report radio metrics via R2RI'), "On,Off", "report radio metrics via R2RI"),
('radiometricreportinterval', ConfigDataTypes.FLOAT.value, '1.0', ("radiometricreportinterval", ConfigDataTypes.FLOAT.value, "1.0",
'', 'R2RI radio metric report interval (sec)'), "", "R2RI radio metric report interval (sec)"),
('neighbormetricdeletetime', ConfigDataTypes.FLOAT.value, '60.0', ("neighbormetricdeletetime", ConfigDataTypes.FLOAT.value, "60.0",
'', 'R2RI neighbor table inactivity time (sec)'), "", "R2RI neighbor table inactivity time (sec)"),
] ]
_confmatrix_mac = _confmatrix_mac_base + _confmatrix_mac_extended _confmatrix_mac = _confmatrix_mac_base + _confmatrix_mac_extended
if emane.VERSION >= emane.EMANE091: if emane.VERSION >= emane.EMANE091:
@ -136,7 +136,7 @@ class EmaneIeee80211abgModel(EmaneModel):
# #
# TEMP HACK: Account for parameter convention change in EMANE 9.x # TEMP HACK: Account for parameter convention change in EMANE 9.x
# This allows CORE to preserve the entry layout for the mac 'category' parameters # This allows CORE to preserve the entry layout for the mac "category" parameters
# and work with EMANE 9.x onwards. # and work with EMANE 9.x onwards.
# #
def get9xmacparamequivalent(self, macname, values): def get9xmacparamequivalent(self, macname, values):

View file

@ -18,47 +18,47 @@ class EmaneRfPipeModel(EmaneModel):
# model name # model name
name = "emane_rfpipe" name = "emane_rfpipe"
if emane.VERSION >= emane.EMANE091: if emane.VERSION >= emane.EMANE091:
xml_path = '/usr/share/emane/xml/models/mac/rfpipe' xml_path = "/usr/share/emane/xml/models/mac/rfpipe"
else: else:
xml_path = "/usr/share/emane/models/rfpipe/xml" xml_path = "/usr/share/emane/models/rfpipe/xml"
# configuration parameters are # configuration parameters are
# ( 'name', 'type', 'default', 'possible-value-list', 'caption') # ( "name", "type", "default", "possible-value-list", "caption")
# MAC parameters # MAC parameters
_confmatrix_mac_base = [ _confmatrix_mac_base = [
("enablepromiscuousmode", ConfigDataTypes.BOOL.value, '0', ("enablepromiscuousmode", ConfigDataTypes.BOOL.value, "0",
'True,False', 'enable promiscuous mode'), "True,False", "enable promiscuous mode"),
("datarate", ConfigDataTypes.UINT32.value, '1M', ("datarate", ConfigDataTypes.UINT32.value, "1M",
'', 'data rate (bps)'), "", "data rate (bps)"),
("flowcontrolenable", ConfigDataTypes.BOOL.value, '0', ("flowcontrolenable", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable traffic flow control'), "On,Off", "enable traffic flow control"),
("flowcontroltokens", ConfigDataTypes.UINT16.value, '10', ("flowcontroltokens", ConfigDataTypes.UINT16.value, "10",
'', 'number of flow control tokens'), "", "number of flow control tokens"),
("pcrcurveuri", ConfigDataTypes.STRING.value, ("pcrcurveuri", ConfigDataTypes.STRING.value,
'%s/rfpipepcr.xml' % xml_path, "%s/rfpipepcr.xml" % xml_path,
'', 'SINR/PCR curve file'), "", "SINR/PCR curve file"),
] ]
_confmatrix_mac_081 = [ _confmatrix_mac_081 = [
("jitter", ConfigDataTypes.FLOAT.value, '0.0', ("jitter", ConfigDataTypes.FLOAT.value, "0.0",
'', 'transmission jitter (usec)'), "", "transmission jitter (usec)"),
("delay", ConfigDataTypes.FLOAT.value, '0.0', ("delay", ConfigDataTypes.FLOAT.value, "0.0",
'', 'transmission delay (usec)'), "", "transmission delay (usec)"),
("transmissioncontrolmap", ConfigDataTypes.STRING.value, '', ("transmissioncontrolmap", ConfigDataTypes.STRING.value, "",
'', 'tx control map (nem:rate:freq:tx_dBm)'), "", "tx control map (nem:rate:freq:tx_dBm)"),
("enabletighttiming", ConfigDataTypes.BOOL.value, '0', ("enabletighttiming", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable tight timing for pkt delay'), "On,Off", "enable tight timing for pkt delay"),
] ]
_confmatrix_mac_091 = [ _confmatrix_mac_091 = [
("jitter", ConfigDataTypes.FLOAT.value, '0.0', ("jitter", ConfigDataTypes.FLOAT.value, "0.0",
'', 'transmission jitter (sec)'), "", "transmission jitter (sec)"),
("delay", ConfigDataTypes.FLOAT.value, '0.0', ("delay", ConfigDataTypes.FLOAT.value, "0.0",
'', 'transmission delay (sec)'), "", "transmission delay (sec)"),
('radiometricenable', ConfigDataTypes.BOOL.value, '0', ("radiometricenable", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'report radio metrics via R2RI'), "On,Off", "report radio metrics via R2RI"),
('radiometricreportinterval', ConfigDataTypes.FLOAT.value, '1.0', ("radiometricreportinterval", ConfigDataTypes.FLOAT.value, "1.0",
'', 'R2RI radio metric report interval (sec)'), "", "R2RI radio metric report interval (sec)"),
('neighbormetricdeletetime', ConfigDataTypes.FLOAT.value, '60.0', ("neighbormetricdeletetime", ConfigDataTypes.FLOAT.value, "60.0",
'', 'R2RI neighbor table inactivity time (sec)'), "", "R2RI neighbor table inactivity time (sec)"),
] ]
if emane.VERSION >= emane.EMANE091: if emane.VERSION >= emane.EMANE091:
_confmatrix_mac = _confmatrix_mac_base + _confmatrix_mac_091 _confmatrix_mac = _confmatrix_mac_base + _confmatrix_mac_091
@ -111,7 +111,7 @@ class EmaneRfPipeModel(EmaneModel):
# EMANE 0.7.4 support # EMANE 0.7.4 support
if emane.VERSION == emane.EMANE074: if emane.VERSION == emane.EMANE074:
# convert datarate from bps to kbps # convert datarate from bps to kbps
i = names.index('datarate') i = names.index("datarate")
values = list(values) values = list(values)
values[i] = self.emane074_fixup(values[i], 1000) values[i] = self.emane074_fixup(values[i], 1000)
# append MAC options to macdoc # append MAC options to macdoc

View file

@ -18,38 +18,38 @@ class EmaneTdmaModel(EmaneModel):
# model name # model name
name = "emane_tdma" name = "emane_tdma"
if emane.VERSION >= emane.EMANE101: if emane.VERSION >= emane.EMANE101:
xml_path = '/usr/share/emane/xml/models/mac/tdmaeventscheduler' xml_path = "/usr/share/emane/xml/models/mac/tdmaeventscheduler"
else: else:
raise Exception("EMANE TDMA requires EMANE 1.0.1 or greater") raise Exception("EMANE TDMA requires EMANE 1.0.1 or greater")
# MAC parameters # MAC parameters
_confmatrix_mac = [ _confmatrix_mac = [
("enablepromiscuousmode", ConfigDataTypes.BOOL.value, '0', ("enablepromiscuousmode", ConfigDataTypes.BOOL.value, "0",
'True,False', 'enable promiscuous mode'), "True,False", "enable promiscuous mode"),
("flowcontrolenable", ConfigDataTypes.BOOL.value, '0', ("flowcontrolenable", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable traffic flow control'), "On,Off", "enable traffic flow control"),
("flowcontroltokens", ConfigDataTypes.UINT16.value, '10', ("flowcontroltokens", ConfigDataTypes.UINT16.value, "10",
'', 'number of flow control tokens'), "", "number of flow control tokens"),
("fragmentcheckthreshold", ConfigDataTypes.UINT16.value, '2', ("fragmentcheckthreshold", ConfigDataTypes.UINT16.value, "2",
'', 'rate in seconds for check if fragment reassembly efforts should be abandoned'), "", "rate in seconds for check if fragment reassembly efforts should be abandoned"),
("fragmenttimeoutthreshold", ConfigDataTypes.UINT16.value, '5', ("fragmenttimeoutthreshold", ConfigDataTypes.UINT16.value, "5",
'', 'threshold in seconds to wait for another packet fragment for reassembly'), "", "threshold in seconds to wait for another packet fragment for reassembly"),
('neighbormetricdeletetime', ConfigDataTypes.FLOAT.value, '60.0', ("neighbormetricdeletetime", ConfigDataTypes.FLOAT.value, "60.0",
'', 'neighbor RF reception timeout for removal from neighbor table (sec)'), "", "neighbor RF reception timeout for removal from neighbor table (sec)"),
('neighbormetricupdateinterval', ConfigDataTypes.FLOAT.value, '1.0', ("neighbormetricupdateinterval", ConfigDataTypes.FLOAT.value, "1.0",
'', 'neighbor table update interval (sec)'), "", "neighbor table update interval (sec)"),
("pcrcurveuri", ConfigDataTypes.STRING.value, '%s/tdmabasemodelpcr.xml' % xml_path, ("pcrcurveuri", ConfigDataTypes.STRING.value, "%s/tdmabasemodelpcr.xml" % xml_path,
'', 'SINR/PCR curve file'), "", "SINR/PCR curve file"),
("queue.aggregationenable", ConfigDataTypes.BOOL.value, '1', ("queue.aggregationenable", ConfigDataTypes.BOOL.value, "1",
'On,Off', 'enable transmit packet aggregation'), "On,Off", "enable transmit packet aggregation"),
('queue.aggregationslotthreshold', ConfigDataTypes.FLOAT.value, '90.0', ("queue.aggregationslotthreshold", ConfigDataTypes.FLOAT.value, "90.0",
'', 'percentage of a slot that must be filled in order to conclude aggregation'), "", "percentage of a slot that must be filled in order to conclude aggregation"),
("queue.depth", ConfigDataTypes.UINT16.value, '256', ("queue.depth", ConfigDataTypes.UINT16.value, "256",
'', 'size of the per service class downstream packet queues (packets)'), "", "size of the per service class downstream packet queues (packets)"),
("queue.fragmentationenable", ConfigDataTypes.BOOL.value, '1', ("queue.fragmentationenable", ConfigDataTypes.BOOL.value, "1",
'On,Off', 'enable packet fragmentation (over multiple slots)'), "On,Off", "enable packet fragmentation (over multiple slots)"),
("queue.strictdequeueenable", ConfigDataTypes.BOOL.value, '0', ("queue.strictdequeueenable", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable strict dequeueing to specified queues only'), "On,Off", "enable strict dequeueing to specified queues only"),
] ]
# PHY parameters from Universal PHY # PHY parameters from Universal PHY

View file

@ -26,52 +26,52 @@ class EmaneUniversalModel(EmaneModel):
# universal PHY parameters # universal PHY parameters
_confmatrix_base = [ _confmatrix_base = [
("bandwidth", ConfigDataTypes.UINT64.value, '1M', ("bandwidth", ConfigDataTypes.UINT64.value, "1M",
'', 'rf bandwidth (hz)'), "", "rf bandwidth (hz)"),
("frequency", ConfigDataTypes.UINT64.value, '2.347G', ("frequency", ConfigDataTypes.UINT64.value, "2.347G",
'', 'frequency (Hz)'), "", "frequency (Hz)"),
("frequencyofinterest", ConfigDataTypes.UINT64.value, '2.347G', ("frequencyofinterest", ConfigDataTypes.UINT64.value, "2.347G",
'', 'frequency of interest (Hz)'), "", "frequency of interest (Hz)"),
("subid", ConfigDataTypes.UINT16.value, '1', ("subid", ConfigDataTypes.UINT16.value, "1",
'', 'subid'), "", "subid"),
("systemnoisefigure", ConfigDataTypes.FLOAT.value, '4.0', ("systemnoisefigure", ConfigDataTypes.FLOAT.value, "4.0",
'', 'system noise figure (dB)'), "", "system noise figure (dB)"),
("txpower", ConfigDataTypes.FLOAT.value, '0.0', ("txpower", ConfigDataTypes.FLOAT.value, "0.0",
'', 'transmit power (dBm)'), "", "transmit power (dBm)"),
] ]
_confmatrix_081 = [ _confmatrix_081 = [
("antennagain", ConfigDataTypes.FLOAT.value, '0.0', ("antennagain", ConfigDataTypes.FLOAT.value, "0.0",
'', 'antenna gain (dBi)'), "", "antenna gain (dBi)"),
("antennaazimuth", ConfigDataTypes.FLOAT.value, '0.0', ("antennaazimuth", ConfigDataTypes.FLOAT.value, "0.0",
'', 'antenna azimuth (deg)'), "", "antenna azimuth (deg)"),
("antennaelevation", ConfigDataTypes.FLOAT.value, '0.0', ("antennaelevation", ConfigDataTypes.FLOAT.value, "0.0",
'', 'antenna elevation (deg)'), "", "antenna elevation (deg)"),
("antennaprofileid", ConfigDataTypes.STRING.value, '1', ("antennaprofileid", ConfigDataTypes.STRING.value, "1",
'', 'antenna profile ID'), "", "antenna profile ID"),
("antennaprofilemanifesturi", ConfigDataTypes.STRING.value, '', ("antennaprofilemanifesturi", ConfigDataTypes.STRING.value, "",
'', 'antenna profile manifest URI'), "", "antenna profile manifest URI"),
("antennaprofileenable", ConfigDataTypes.BOOL.value, '0', ("antennaprofileenable", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'antenna profile mode'), "On,Off", "antenna profile mode"),
("defaultconnectivitymode", ConfigDataTypes.BOOL.value, '1', ("defaultconnectivitymode", ConfigDataTypes.BOOL.value, "1",
'On,Off', 'default connectivity'), "On,Off", "default connectivity"),
("frequencyofinterestfilterenable", ConfigDataTypes.BOOL.value, '1', ("frequencyofinterestfilterenable", ConfigDataTypes.BOOL.value, "1",
'On,Off', 'frequency of interest filter enable'), "On,Off", "frequency of interest filter enable"),
("noiseprocessingmode", ConfigDataTypes.BOOL.value, '0', ("noiseprocessingmode", ConfigDataTypes.BOOL.value, "0",
'On,Off', 'enable noise processing'), "On,Off", "enable noise processing"),
("pathlossmode", ConfigDataTypes.STRING.value, '2ray', ("pathlossmode", ConfigDataTypes.STRING.value, "2ray",
'pathloss,2ray,freespace', 'path loss mode'), "pathloss,2ray,freespace", "path loss mode"),
] ]
_confmatrix_091 = [ _confmatrix_091 = [
("fixedantennagain", ConfigDataTypes.FLOAT.value, '0.0', ("fixedantennagain", ConfigDataTypes.FLOAT.value, "0.0",
'', 'antenna gain (dBi)'), "", "antenna gain (dBi)"),
("fixedantennagainenable", ConfigDataTypes.BOOL.value, '1', ("fixedantennagainenable", ConfigDataTypes.BOOL.value, "1",
'On,Off', 'enable fixed antenna gain'), "On,Off", "enable fixed antenna gain"),
("noisemode", ConfigDataTypes.STRING.value, 'none', ("noisemode", ConfigDataTypes.STRING.value, "none",
'none,all,outofband', 'noise processing mode'), "none,all,outofband", "noise processing mode"),
("noisebinsize", ConfigDataTypes.UINT64.value, '20', ("noisebinsize", ConfigDataTypes.UINT64.value, "20",
'', 'noise bin size in microseconds'), "", "noise bin size in microseconds"),
("propagationmodel", ConfigDataTypes.STRING.value, '2ray', ("propagationmodel", ConfigDataTypes.STRING.value, "2ray",
'precomputed,2ray,freespace', 'path loss mode'), "precomputed,2ray,freespace", "path loss mode"),
] ]
if emane.VERSION >= emane.EMANE091: if emane.VERSION >= emane.EMANE091:
config_matrix = _confmatrix_base + _confmatrix_091 config_matrix = _confmatrix_base + _confmatrix_091
@ -80,12 +80,12 @@ class EmaneUniversalModel(EmaneModel):
# old parameters # old parameters
_confmatrix_ver074 = [ _confmatrix_ver074 = [
("antennaazimuthbeamwidth", ConfigDataTypes.FLOAT.value, '360.0', ("antennaazimuthbeamwidth", ConfigDataTypes.FLOAT.value, "360.0",
'', 'azimith beam width (deg)'), "", "azimith beam width (deg)"),
("antennaelevationbeamwidth", ConfigDataTypes.FLOAT.value, '180.0', ("antennaelevationbeamwidth", ConfigDataTypes.FLOAT.value, "180.0",
'', 'elevation beam width (deg)'), "", "elevation beam width (deg)"),
("antennatype", ConfigDataTypes.STRING.value, 'omnidirectional', ("antennatype", ConfigDataTypes.STRING.value, "omnidirectional",
'omnidirectional,unidirectional', 'antenna type'), "omnidirectional,unidirectional", "antenna type"),
] ]
# parameters that require unit conversion for 0.7.4 # parameters that require unit conversion for 0.7.4