예제 #1
0
    def info(self):
        debugmsg(2, "qemu_lib.py: UDPConnection::info()")
        (remote_device, remote_adapter, remote_port) = get_reverse_udp_nio(self)
        from dynagen_vbox_lib import VBox, VBoxDevice, AnyVBoxEmuDevice
        if isinstance(remote_device, AnyEmuDevice):
            return ' is connected to emulated device ' + remote_device.name + ' Ethernet' + str(remote_port) + '\n'
        elif isinstance(remote_device, AnyVBoxEmuDevice):
            return ' is connected to virtualized device ' + remote_device.name + ' Ethernet' + str(remote_port) + '\n'
        elif isinstance(remote_device, Router):
            (rem_int_name, rem_dynagen_port) = remote_adapter.interfaces_mips2dyn[remote_port]
            if remote_device.model_string in ['1710', '1720', '1721', '1750']:
                if rem_int_name == 'e':
                    rem_int_full_name = 'Ethernet'
                elif rem_int_name == 'f':
                    rem_int_full_name = 'FastEthernet'    
                return ' is connected to router ' + remote_device.name + " " + rem_int_full_name + str(rem_dynagen_port)
            
            return ' is connected to router ' + remote_device.name + " " + remote_adapter.interface_name + str(remote_adapter.slot) + \
                "/" + str(rem_dynagen_port)            

        elif isinstance(remote_device, FRSW):
            return ' is connected to frame-relay switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
        elif isinstance(remote_device, ATMSW):
            return ' is connected to ATM switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
        elif isinstance(remote_device, ETHSW):
            return ' is connected to ethernet switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
        elif remote_device == 'nothing':  #if this is only UDP NIO without the other side...used in dynamips <-> UDP for example
            return ' is connected to UDP NIO, with source port ' + str(self.sport) + ' and remote port ' + str(self.dport) + ' on ' + self.daddr + '\n'
        else:
            return ' is connected to unknown device ' + remote_device.name + '\n'
예제 #2
0
 def slot_info(self):        
     #gather information about interfaces and connections
     #debugmsg(2, "AnyEmuDevice::slot_info()")
     from dynagen_vbox_lib import VBox, VBoxDevice, AnyVBoxEmuDevice
     slot_info = '   Slot 0 hardware is ' + self._netcard + ' with ' + str(self._nics) + ' Ethernet interfaces\n'
     for port in self.nios:
         slot_info = slot_info + "      Ethernet" + str(port)
         if self.nios[port] != None:
             (remote_device, remote_adapter, remote_port) = get_reverse_udp_nio(self.nios[port])
             if isinstance(remote_device, AnyVBoxEmuDevice):
                 slot_info = slot_info + ' is connected to virtualized device ' + remote_device.name + ' Ethernet' + str(remote_port) + '\n'
             elif isinstance(remote_device, AnyEmuDevice):
                 slot_info = slot_info + ' is connected to emulated device ' + remote_device.name + ' Ethernet' + str(remote_port) + '\n'
             elif isinstance(remote_device, Router):
                 slot_info = slot_info + ' is connected to router ' + remote_device.name + " " + remote_adapter.interface_name + str(remote_adapter.slot) + "/" + str(remote_port) + '\n'
             elif isinstance(remote_device, FRSW):
                 slot_info = slot_info + ' is connected to frame-relay switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif isinstance(remote_device, ATMSW):
                 slot_info = slot_info + ' is connected to ATM switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif isinstance(remote_device, ETHSW):
                 slot_info = slot_info + ' is connected to ethernet switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif remote_device == 'nothing':  #if this is only UDP NIO without the other side...used in dynamips <-> UDP for example
                 slot_info = slot_info + ' is connected to UDP NIO, with source port ' + str(self.nios[port].sport) + ' and remote port  ' + str(self.nios[port].dport) + ' on ' + self.nios[port].daddr + '\n'
             else:
                 slot_info = slot_info + ' is connected to unknown device ' + remote_device.name + '\n'
         else:  #no NIO on this port, so it must be empty
             slot_info = slot_info + ' is empty\n'
     debugmsg(3, "AnyEmuDevice::slot_info(), returns %s" % str(slot_info))
     return slot_info
예제 #3
0
 def slot_info(self):
     #gather information about interfaces and connections
     #debugmsg(2, "AnyVBoxEmuDevice::slot_info()")
     from qemu_lib import AnyEmuDevice
     # hide vbox internal interface (self._nics - 1)
     slot_info = '   Slot 0 hardware is ' + self._netcard + ' with ' + str(
         self._nics) + ' Ethernet interfaces\n'
     ignore_ports = []
     if self._first_nic_managed:
         slot_info = slot_info + "      Ethernet0 is the VirtualBox management interface\n"
         ignore_ports.append(
             0)  # port 0 is the VirtualBox management interface
     for port in self.nios:
         if port in ignore_ports:
             continue
         slot_info = slot_info + "      Ethernet" + str(port)
         if self.nios[port] != None:
             (remote_device, remote_adapter,
              remote_port) = get_reverse_udp_nio(self.nios[port])
             if isinstance(remote_device, AnyVBoxEmuDevice):
                 slot_info = slot_info + ' is connected to virtualized device ' + remote_device.name + ' Ethernet' + str(
                     remote_port) + '\n'
             elif isinstance(remote_device, AnyEmuDevice):
                 slot_info = slot_info + ' is connected to emulated device ' + remote_device.name + ' Ethernet' + str(
                     remote_port) + '\n'
             elif isinstance(remote_device, Router):
                 slot_info = slot_info + ' is connected to router ' + remote_device.name + " " + remote_adapter.interface_name + str(
                     remote_adapter.slot) + "/" + str(remote_port) + '\n'
             elif isinstance(remote_device, FRSW):
                 slot_info = slot_info + ' is connected to frame-relay switch ' + remote_device.name + ' port ' + str(
                     remote_port) + '\n'
             elif isinstance(remote_device, ATMSW):
                 slot_info = slot_info + ' is connected to ATM switch ' + remote_device.name + ' port ' + str(
                     remote_port) + '\n'
             elif isinstance(remote_device, ETHSW):
                 slot_info = slot_info + ' is connected to Ethernet switch ' + remote_device.name + ' port ' + str(
                     remote_port) + '\n'
             elif isinstance(remote_device, Hub):
                 slot_info = slot_info + ' is connected to Ethernet hub ' + remote_device.name + ' port ' + str(
                     remote_port) + '\n'
             elif remote_device == 'nothing':  #if this is only UDP NIO without the other side...used in dynamips <-> UDP for example
                 slot_info = slot_info + ' is connected to UDP NIO, with source port ' + str(
                     self.nios[port].sport) + ' and remote port  ' + str(
                         self.nios[port].dport
                     ) + ' on ' + self.nios[port].daddr + '\n'
             else:
                 slot_info = slot_info + ' is connected to unknown device ' + remote_device.name + '\n'
             # Get network stats and guest IP addresses
             # slot_info = self.slot_info_niostat(slot_info, port) #FIXME: apparently this slow things down, for instance when moving a node. Also, the counters don't seem to get updated.
         else:  #no NIO on this port, so it must be empty
             slot_info = slot_info + ' is empty\n'
     debugmsg(
         3,
         "AnyVBoxEmuDevice::slot_info(), returns %s" % unicode(slot_info))
     return slot_info
예제 #4
0
 def slot_info(self):
     #gather information about interfaces and connections
     #debugmsg(2, "AnyVBoxEmuDevice::slot_info()")
     from qemu_lib import AnyEmuDevice
     # hide vbox internal interface (self._nics - 1)
     slot_info = '   Slot 0 hardware is ' + self._netcard + ' with ' + str(self._nics) + ' Ethernet interfaces\n'
     ignore_ports = []
     if self._first_nic_managed:
         slot_info = slot_info + "      Ethernet0 is the VirtualBox management interface\n"
         ignore_ports.append(0) # port 0 is the VirtualBox management interface
     for port in self.nios:
         if port in ignore_ports:
             continue
         slot_info = slot_info + "      Ethernet" + str(port)
         if self.nios[port] != None:
             (remote_device, remote_adapter, remote_port) = get_reverse_udp_nio(self.nios[port])
             if isinstance(remote_device, AnyVBoxEmuDevice):
                 slot_info = slot_info + ' is connected to virtualized device ' + remote_device.name + ' Ethernet' + str(remote_port) + '\n'
             elif isinstance(remote_device, AnyEmuDevice):
                 slot_info = slot_info + ' is connected to emulated device ' + remote_device.name + ' Ethernet' + str(remote_port) + '\n'
             elif isinstance(remote_device, Router):
                 slot_info = slot_info + ' is connected to router ' + remote_device.name + " " + remote_adapter.interface_name + str(remote_adapter.slot) + "/" + str(remote_port) + '\n'
             elif isinstance(remote_device, FRSW):
                 slot_info = slot_info + ' is connected to frame-relay switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif isinstance(remote_device, ATMSW):
                 slot_info = slot_info + ' is connected to ATM switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif isinstance(remote_device, ETHSW):
                 slot_info = slot_info + ' is connected to Ethernet switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif isinstance(remote_device, Hub):
                 slot_info = slot_info + ' is connected to Ethernet hub ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif remote_device == 'nothing':  #if this is only UDP NIO without the other side...used in dynamips <-> UDP for example
                 slot_info = slot_info + ' is connected to UDP NIO, with source port ' + str(self.nios[port].sport) + ' and remote port  ' + str(self.nios[port].dport) + ' on ' + self.nios[port].daddr + '\n'
             else:
                 slot_info = slot_info + ' is connected to unknown device ' + remote_device.name + '\n'
             # Get network stats and guest IP addresses
             # slot_info = self.slot_info_niostat(slot_info, port) #FIXME: apparently this slow things down, for instance when moving a node. Also, the counters don't seem to get updated.
         else:  #no NIO on this port, so it must be empty
             slot_info = slot_info + ' is empty\n'
     debugmsg(3, "AnyVBoxEmuDevice::slot_info(), returns %s" % unicode(slot_info))
     return slot_info
예제 #5
0
 def slot_info(self):
     #gather information about interfaces and connections
     slot_info = '   Slot 0 hardware is Intel 82559 with 6 Ethernet interfaces\n'
     for port in self.nios:
         slot_info = slot_info + "      Ethernet" + str(port)
         if self.nios[port] != None:
             (remote_device, remote_adapter, remote_port) = get_reverse_udp_nio(self.nios[port])
             if isinstance(remote_device, FW):
                 slot_info = slot_info + ' is connected to firewall ' + remote_device.name + ' Ethernet' + str(remote_port) + '\n'
             elif isinstance(remote_device, Router):
                 slot_info = slot_info + ' is connected to router ' + remote_device.name + " " + remote_adapter.interface_name + str(remote_adapter.slot) + "/" + str(remote_port) + '\n'
             elif isinstance(remote_device, FRSW):
                 slot_info = slot_info + ' is connected to frame-relay switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif isinstance(remote_device, ATMSW):
                 slot_info = slot_info + ' is connected to ATM switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif isinstance(remote_device, ETHSW):
                 slot_info = slot_info + ' is connected to ethernet switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
             elif remote_device == 'nothing':  #if this is only UDP NIO without the other side...used in dynamips <-> UDP for example
                 slot_info = slot_info + ' is connected to UDP NIO, with source port ' + str(self.nios[port].sport) + ' and remote port  ' + str(self.nios[port].dport) + ' on ' + self.nios[port].daddr + '\n'
         else:  #no NIO on this port, so it must be empty
             slot_info = slot_info + ' is empty\n'
     return slot_info
예제 #6
0
    def info(self):
        (remote_device, remote_adapter, remote_port) = get_reverse_udp_nio(self)
        if isinstance(remote_device, FW):
            return ' is connected to firewall ' + remote_device.name + ' Ethernet' + str(remote_port) + '\n'
        elif isinstance(remote_device, Router):
            (rem_int_name, rem_dynagen_port) = remote_adapter.interfaces_mips2dyn[remote_port]
            if remote_device.model_string in ['1710', '1720', '1721', '1750']:
                if rem_int_name == 'e':
                    rem_int_full_name = 'Ethernet'
                elif rem_int_name == 'f':
                    rem_int_full_name = 'FastEthernet'    
                return ' is connected to router ' + remote_device.name + " " + rem_int_full_name + str(rem_dynagen_port)
            
            return ' is connected to router ' + remote_device.name + " " + remote_adapter.interface_name + str(remote_adapter.slot) + \
                "/" + str(rem_dynagen_port)            

        elif isinstance(remote_device, FRSW):
            return ' is connected to frame-relay switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
        elif isinstance(remote_device, ATMSW):
            return ' is connected to ATM switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
        elif isinstance(remote_device, ETHSW):
            return ' is connected to ethernet switch ' + remote_device.name + ' port ' + str(remote_port) + '\n'
        elif remote_device == 'nothing':  #if this is only UDP NIO without the other side...used in dynamips <-> UDP for example
            return ' is connected to UDP NIO, with source port ' + str(self.sport) + ' and remote port ' + str(self.dport) + ' on ' + self.daddr + '\n'