def detach(self, netif: CoreInterface) -> None: """ Detach network interface. :param netif: network interface to detach :return: nothing """ del self._netif[netif.netifi] netif.netifi = None with self._linked_lock: del self._linked[netif]
def attach(self, netif: CoreInterface) -> None: """ Attach network interface. :param netif: network interface to attach :return: nothing """ i = self.newifindex() self._netif[i] = netif netif.netifi = i with self._linked_lock: self._linked[netif] = {}