示例#1
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()
示例#2
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()
示例#3
0
    def attach(self, iface: CoreInterface) -> None:
        """
        Attach a network interface.

        :param iface: network interface
        :return: nothing
        """
        super().attach(iface)
        if self.model:
            iface.poshook = self.model.position_callback
            iface.setposition()
示例#4
0
    def attach(self, netif: CoreInterface) -> None:
        """
        Attach a network interface.

        :param netif: network interface
        :return: nothing
        """
        super().attach(netif)
        if self.model:
            netif.poshook = self.model.position_callback
            netif.setposition()
示例#5
0
    def attach(self, netif: CoreInterface) -> None:
        """
        Attach a network interface.

        :param netif: network interface
        :return: nothing
        """
        super().attach(netif)
        if self.model:
            netif.poshook = self.model.position_callback
            if netif.node is None:
                return
            x, y, z = netif.node.position.get()
            # invokes any netif.poshook
            netif.setposition(x, y, z)
示例#6
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()