def addremovectrlif(self, node, netidx=0,  remove=False, conf_reqd=True):
        ctrlnet = self.addremovectrlnet(netidx, remove, conf_reqd)
        if ctrlnet is None:
            return
        if node is None:
            return
        if node.netif(ctrlnet.CTRLIF_IDX_BASE + netidx):
            return  # ctrl# already exists
        ctrlip = node.objid
        try:
            addrlist = ["%s/%s" % (ctrlnet.prefix.addr(ctrlip),
                                   ctrlnet.prefix.prefixlen)]
        except ValueError:
            msg = "Control interface not added to node %s. " % node.objid
            msg += "Invalid control network prefix (%s). " % ctrlnet.prefix
            msg += "A longer prefix length may be required for this many nodes."
            node.exception(coreapi.CORE_EXCP_LEVEL_ERROR,
                           "Session.addremovectrlif()", msg)
            return
        ifi = node.newnetif(net = ctrlnet, ifindex = ctrlnet.CTRLIF_IDX_BASE + netidx,
                            ifname = "ctrl%d" % netidx, hwaddr = MacAddr.random(),
                            addrlist = addrlist)
        node.netif(ifi).control = True
Add a control interface to a node when a 'controlnet' prefix is
dataset/ETHPy150Open coreemu/core/daemon/core/session.py/Session.addremovectrlif