def __init__(self, nc_type, **kw): """ event structure: @self.type - node type (not used yed) @self.intf - interface list e.g: {'sap1-eth0': {'ip': '10.0.0.6', 'mac': '00:00:00:00:00:06', 'port': 0} } {'lo': {'ip': '127.0.0.1', 'mac': None, 'port': 0 }, 's3-eth4': {'ip': None, 'mac': '32:13:3f:c1:7c:e4', 'port': 4 }, ... } @self.name - name of the node in mininet @self.dpid - dpid number if type = TYPE_SWITCH, None otherwise """ Event.__init__(self) self.type = nc_type self.intf = kw['intf'] self.name = kw['name'] self.dpid = kw.get('dpid', None)
def __init__(self, node1, node2, intf1, intf2, delete=False): Event.__init__(self) self.node1 = node1 self.node2 = node2 self.intf1 = intf1 self.intf2 = intf2 self.delete = delete
def __init__(self, **kw): Event.__init__(self) #we need the information to locate the monitor host. self.hw = kw.get('hw') self.ip = kw.get('ip') self.dpid = kw.get('dpid') self.switch_port = kw.get('switch_port') self.match = kw.get('match')
def __init__ (self, vm_id, time, cpu, ram, disk, network, request_type, timeout) : Event.__init__(self) self.vm_id = vm_id self.time = time self.cpu = cpu self.ram = ram self.disk = disk self.network = network self.request_type = request_type self.timeout = timeout
def __init__(self, switch_dpid, host_id): Event.__init__(self) self.switch_dpid = switch_dpid self.host_id = host_id imp.acquire_lock() now_time = datetime.datetime.now().strftime('%H:%M:%S.%f') imp.release_lock() log.info("P1 alert: %s " % now_time) with open(r"/home/sy/P1_delay.txt", 'a+') as f: # 考虑启线程写 f.write("P1 alert: %s \n" % now_time)
def __init__(self, msg="default"): Event.__init__(self) self.msg = msg log.info("P1 no alert: %s" % msg)
def __init__(self, srcIP, dstIP, portSrc, portDst): Event.__init__(self) self.srcIP = srcIP self.dstIP = dstIP self.portSrc = portSrc self.portDst = portDst
def __init__(self, attr="no_attr"): Event.__init__(self) self.attr1 = attr
def __init__(self, attr="no_attr"): Event.__init__(self) print("packetInCome") self.attr1 = attr
def __init__ (self, msg=None, userinfo_dict=None): Event.__init__(self) self.msg = msg self.userinfo_dict = userinfo_dict
def __init__(self, data, addr): Event.__init__(self) self.data = data self.addr = addr
def __init__(self, switch): Event.__init__(self) self.switch = switch
def __init__ (self, dpid): Event.__init__(self) self.dpid = dpid
def __init__(self, prev_path, match, adj): Event.__init__(self) self.match = match self.prev_path = prev_path self.adj = adj
def __init__(self, connection, msg): Event.__init__(self) self.connection = connection self.addr = connection.addr self.msg = msg
def __init__(self, prev_path, match, rev_match): Event.__init__(self) self.match = match self.prev_path = prev_path self.rev_match = rev_match
def __init__ (self, dpid, connection): Event.__init__(self) self.dpid = dpid self.connection = connection
def __init__ (self, connection, msg): Event.__init__(self) self.connection = connection self.msg = msg
def __init__(self, data, addr, conn): Event.__init__(self) self.data = data self.addr = addr self.connection = conn
def __init__(self, inter_vm_id, vm_list): Event.__init__(self) self.inter_vm_id = inter_vm_id self.vm_list = vm_list
def __init__ (self, msg=None, info_dict=None): Event.__init__(self) self.msg = msg self.info_dict = info_dict
def __init__(self, dpid, stats, unit): Event.__init__(self) self.dpid = dpid self.stats = stats self.unit = unit
def __init__(self, command): Event.__init__(self) self.command = command