Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
 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
Пример #4
0
 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
Пример #5
0
 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
Пример #7
0
    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)
Пример #8
0
 def __init__(self, msg="default"):
     Event.__init__(self)
     self.msg = msg
     log.info("P1 no alert: %s" % msg)
Пример #9
0
 def __init__(self, srcIP, dstIP, portSrc, portDst):
     Event.__init__(self)
     self.srcIP = srcIP
     self.dstIP = dstIP
     self.portSrc = portSrc
     self.portDst = portDst
Пример #10
0
 def __init__(self, attr="no_attr"):
     Event.__init__(self)
     self.attr1 = attr
Пример #11
0
 def __init__(self, attr="no_attr"):
     Event.__init__(self)
     print("packetInCome")
     self.attr1 = attr
Пример #12
0
 def __init__ (self, msg=None, userinfo_dict=None):
   Event.__init__(self)
   self.msg = msg
   self.userinfo_dict = userinfo_dict
Пример #13
0
 def __init__(self, data, addr):
     Event.__init__(self)
     self.data = data
     self.addr = addr
Пример #14
0
	def __init__(self, switch):
		Event.__init__(self)
		self.switch = switch
 def __init__ (self, dpid):
     Event.__init__(self)
     self.dpid = dpid
Пример #16
0
 def __init__(self, prev_path, match, adj):
     Event.__init__(self)
     self.match = match
     self.prev_path = prev_path
     self.adj = adj
Пример #17
0
 def __init__(self, connection, msg):
     Event.__init__(self)
     self.connection = connection
     self.addr = connection.addr
     self.msg = msg
Пример #18
0
 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
Пример #20
0
 def __init__ (self, connection, msg):
     Event.__init__(self)
     self.connection = connection
     self.msg = msg
Пример #21
0
 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
Пример #23
0
	def __init__(self, prev_path, match, adj):
		Event.__init__(self)
		self.match = match
		self.prev_path = prev_path
		self.adj = adj
Пример #24
0
 def __init__ (self, msg=None, info_dict=None):
   Event.__init__(self)
   self.msg = msg
   self.info_dict = info_dict
Пример #25
0
 def __init__(self, dpid, stats, unit):
     Event.__init__(self)
     self.dpid = dpid
     self.stats = stats
     self.unit = unit
Пример #26
0
 def __init__(self, switch):
     Event.__init__(self)
     self.switch = switch
Пример #27
0
 def __init__(self, command):
     Event.__init__(self)
     self.command = command