diff --git a/daemon/core/emane/emane.py b/daemon/core/emane/emane.py index 9f019d47..5a6ea186 100644 --- a/daemon/core/emane/emane.py +++ b/daemon/core/emane/emane.py @@ -347,7 +347,7 @@ class Emane(ConfigurableManager): def poststartup(self): ''' Retransmit location events now that all NEMs are active. ''' - if self.doeventmonitor(): + if not self.genlocationevents(): return with self._objslock: for n in sorted(self._objs.keys()): @@ -999,6 +999,16 @@ class Emane(ConfigurableManager): # generate the EMANE events when nodes are moved return self.session.getcfgitembool('emane_event_monitor', False) + def genlocationevents(self): + ''' Returns boolean whether or not EMANE events will be generated. + ''' + # By default, CORE generates EMANE location events when nodes + # are moved; this can be explicitly disabled in core.conf + tmp = self.session.getcfgitembool('emane_event_generate') + if tmp is None: + tmp = not self.doeventmonitor() + return tmp + def starteventmonitor(self): ''' Start monitoring EMANE location events if configured to do so. ''' diff --git a/daemon/core/emane/nodes.py b/daemon/core/emane/nodes.py index bdf08df1..e240e913 100644 --- a/daemon/core/emane/nodes.py +++ b/daemon/core/emane/nodes.py @@ -207,7 +207,7 @@ class EmaneNode(EmaneNet): EMANE daemons have been started, because that is their only chance to bind to the TAPs. ''' - if not self.session.emane.doeventmonitor() and \ + if self.session.emane.genlocationevents() and \ self.session.emane.service is None: warntxt = "unable to publish EMANE events because the eventservice " warntxt += "Python bindings failed to load" @@ -218,8 +218,7 @@ class EmaneNode(EmaneNet): if do_netns and "virtual" in netif.transport_type.lower(): netif.install() netif.setaddrs() - # if we are listening for EMANE events, don't generate them - if self.session.emane.doeventmonitor(): + if not self.session.emane.genlocationevents(): netif.poshook = None continue # at this point we register location handlers for generating diff --git a/daemon/data/core.conf b/daemon/data/core.conf index 921c92ce..2479eda7 100644 --- a/daemon/data/core.conf +++ b/daemon/data/core.conf @@ -55,6 +55,7 @@ quagga_sbin_search = "/usr/local/sbin /usr/sbin /usr/lib/quagga" # EMANE configuration emane_platform_port = 8101 emane_transform_port = 8201 +emane_event_generate = True emane_event_monitor = False emane_models = RfPipe, Ieee80211abg, CommEffect, Bypass # EMANE log level range [0,4] default: 2