Example #1
0
 def install_iface(self, iface: CoreInterface, config: Dict[str,
                                                            str]) -> None:
     external = config.get("external", "0")
     if isinstance(iface, TunTap) and external == "0":
         iface.set_ips()
     # at this point we register location handlers for generating
     # EMANE location events
     if self.genlocationevents():
         iface.poshook = self.set_nem_position
         iface.setposition()
Example #2
0
 def install_iface(self, emane_net: EmaneNet, iface: CoreInterface) -> None:
     config = self.get_iface_config(emane_net, iface)
     external = config.get("external", "0")
     if isinstance(iface, TunTap) and external == "0":
         iface.set_ips()
     # at this point we register location handlers for generating
     # EMANE location events
     if self.genlocationevents():
         iface.poshook = emane_net.setnemposition
         iface.setposition()
Example #3
0
 def install_iface(self, iface: CoreInterface) -> None:
     emane_net = iface.net
     if not isinstance(emane_net, EmaneNet):
         raise CoreError(
             f"emane interface not connected to emane net: {emane_net.name}"
         )
     config = self.get_iface_config(emane_net, iface)
     external = config.get("external", "0")
     if isinstance(iface, TunTap) and external == "0":
         iface.set_ips()
     # at this point we register location handlers for generating
     # EMANE location events
     if self.genlocationevents():
         iface.poshook = emane_net.setnemposition
         iface.setposition()