Example #1
0
    def attach(self, netif):
        """
        Attach a network interface, but limit attachment to two interfaces.

        :param core.coreobj.PyCoreNetIf netif: network interface
        :return: nothing
        """
        if len(self._netif) >= 2:
            raise ValueError("Point-to-point links support at most 2 network interfaces")
        LxBrNet.attach(self, netif)
Example #2
0
File: nodes.py Project: gsomlo/core
    def attach(self, netif):
        """
        Attach a network interface, but limit attachment to two interfaces.

        :param core.netns.vif.VEth netif: network interface
        :return: nothing
        """
        if len(self._netif) >= 2:
            raise ValueError("Point-to-point links support at most 2 network interfaces")

        LxBrNet.attach(self, netif)
Example #3
0
    def attach(self, netif):
        """
        Attach a network interface.

        :param core.coreobj.PyCoreNetIf netif: network interface
        :return: nothing
        """
        LxBrNet.attach(self, 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)
Example #4
0
File: nodes.py Project: gsomlo/core
    def attach(self, netif):
        """
        Attach a network interface.

        :param core.netns.vif.VEth netif: network interface
        :return: nothing
        """
        LxBrNet.attach(self, 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)