Esempio n. 1
0
    def __init__(self, renderer_normal, renderer_select):

        AbstractNode.__init__(self, renderer_normal, renderer_select)

        # assign a new hostname
        global atmsw_id

        # check if hostname has already been assigned
        for node in globals.GApp.topology.nodes.itervalues():
            if 'ATM' + str(atmsw_id) == node.hostname:
                atmsw_id = atmsw_id + 1
                break

        self.hostname = 'ATM' + str(atmsw_id)
        atmsw_id = atmsw_id + 1
        AbstractNode.setCustomToolTip(self)

        self.config = None
        self.dynagen = globals.GApp.dynagen
        self.a = 'ATMSW ' + self.hostname
        self.d = None
        self.hypervisor = None
        self.running_config = None
        self.atmsw = None
        self.dynagen.update_running_config()
Esempio n. 2
0
    def __init__(self, renderer_normal, renderer_select):

        AbstractNode.__init__(self, renderer_normal, renderer_select)

        # assign a new hostname
        global atmsw_id

        # check if hostname has already been assigned
        for node in globals.GApp.topology.nodes.itervalues():
            if 'ATM' + str(atmsw_id) == node.hostname:
                atmsw_id = atmsw_id + 1
                break

        self.hostname = 'ATM' + str(atmsw_id)
        atmsw_id = atmsw_id + 1
        AbstractNode.setCustomToolTip(self)

        self.config = None
        self.dynagen = globals.GApp.dynagen
        self.a= 'ATMSW ' + self.hostname
        self.d = None
        self.hypervisor = None
        self.running_config = None
        self.atmsw = None
        self.dynagen.update_running_config()
Esempio n. 3
0
    def setCustomToolTip(self):
        """ Set a custom tool tip
        """

        if self.emudev:
            self.setToolTip(self.emudev.info())
        else:
            AbstractNode.setCustomToolTip(self)
Esempio n. 4
0
    def setCustomToolTip(self):
        """ Set a custom tool tip
        """

        if self.emu_vboxdev:
            self.setToolTip(self.emu_vboxdev.info())
        else:
            AbstractNode.setCustomToolTip(self)
Esempio n. 5
0
    def setCustomToolTip(self):
        """ Set a custom tool tip
        """

        if self.router:
            try:
                self.setToolTip(self.router.info())
            except:
                AbstractNode.setCustomToolTip(self)
        else:
            AbstractNode.setCustomToolTip(self)
Esempio n. 6
0
    def setCustomToolTip(self):
        """ Set a custom tool tip
        """

        if self.atmsw:
            try:
                self.setToolTip(self.atmsw.info())
            except:
                AbstractNode.setCustomToolTip(self)
        else:
            AbstractNode.setCustomToolTip(self)
Esempio n. 7
0
    def setCustomToolTip(self):
        """ Set a custom tool tip
        """

        if self.config:
            info = translate("Cloud", "Cloud name: %s") % self.hostname
            for nio in self.config['nios']:
                info += "\n\n" + nio
                if sys.platform.startswith('win') and self.config['rpcap_mapping'].has_key(nio):
                    info += "\n    " + self.config['rpcap_mapping'][nio]
                neighbor = self.getConnectedNeighbor(nio)
                if neighbor:
                    (neighbor, ifname) = neighbor
                    info += " is connected to " + neighbor.hostname + " " + ifname
                else:
                    info += " is not connected"
            try:
                self.setToolTip(info)
            except:
                AbstractNode.setCustomToolTip(self)
        else:
            AbstractNode.setCustomToolTip(self)
Esempio n. 8
0
    def __init__(self, renderer_normal, renderer_select):

        AbstractNode.__init__(self, renderer_normal, renderer_select)
        AnyEmuDefaults.__init__(self)

        # assign a new hostname
        global emu_id
        if not emu_id:
            emu_id = 1

        # check if hostname has already been assigned
        for node in globals.GApp.topology.nodes.itervalues():
            if self.basehostname + str(emu_id) == node.hostname:
                emu_id = emu_id + 1
                break

        self.hostname = self.basehostname + str(emu_id)
        emu_id = emu_id + 1
        AbstractNode.setCustomToolTip(self)

        self.dynagen = globals.GApp.dynagen
        self.local_config = None
        self.f = '%s %s' %(self.basehostname, self.hostname)
        self.running_config = None
        self.defaults_config = None
        self.emudev = None

        self.emudev_options = [
            'ram',
            'image',
            'nics',
            'usermod',
            'netcard',
            'flavor',
            'kvm',
            'monitor',
            'options',
            ]
Esempio n. 9
0
    def __init__(self, renderer_normal, renderer_select):
        #print "AnyVBoxEmuDevice::__init__()"
        AbstractNode.__init__(self, renderer_normal, renderer_select)
        AnyVBoxEmuDefaults.__init__(self)

        # assign a new hostname
        global vbox_emu_id
        if not vbox_emu_id:
            vbox_emu_id = 1

        # check if hostname has already been assigned
        for node in globals.GApp.topology.nodes.itervalues():
            if self.basehostname + str(vbox_emu_id) == node.hostname:
                vbox_emu_id = vbox_emu_id + 1
                break

        self.hostname = self.basehostname + str(vbox_emu_id)
        vbox_emu_id = vbox_emu_id + 1
        AbstractNode.setCustomToolTip(self)

        self.dynagen = globals.GApp.dynagen
        self.local_config = None
        self.f = '%s %s' % (self.basehostname, self.hostname)
        self.running_config = None
        self.defaults_config = None
        self.emu_vboxdev = None

        self.emu_vboxdev_options = [
            'image',
            'nics',
            'netcard',
            'guestcontrol_user',
            'guestcontrol_password',
            'first_nic_managed',
            'headless_mode',
            'console_support',
            'console_telnet_server',
        ]
Esempio n. 10
0
    def __init__(self, renderer_normal, renderer_select):
        #print "AnyVBoxEmuDevice::__init__()"
        AbstractNode.__init__(self, renderer_normal, renderer_select)
        AnyVBoxEmuDefaults.__init__(self)

        # assign a new hostname
        global vbox_emu_id
        if not vbox_emu_id:
            vbox_emu_id = 1

        # check if hostname has already been assigned
        for node in globals.GApp.topology.nodes.itervalues():
            if self.basehostname + str(vbox_emu_id) == node.hostname:
                vbox_emu_id = vbox_emu_id + 1
                break

        self.hostname = self.basehostname + str(vbox_emu_id)
        vbox_emu_id = vbox_emu_id + 1
        AbstractNode.setCustomToolTip(self)

        self.dynagen = globals.GApp.dynagen
        self.local_config = None
        self.f = '%s %s' %(self.basehostname, self.hostname)
        self.running_config = None
        self.defaults_config = None
        self.emu_vboxdev = None

        self.emu_vboxdev_options = [
            'image',
            'nics',
            'netcard',
            'guestcontrol_user',
            'guestcontrol_password',
            'first_nic_managed',
            'headless_mode',
            'console_support',
            'console_telnet_server',
            ]
Esempio n. 11
0
    def __init__(self, renderer_normal, renderer_select):

        AbstractNode.__init__(self, renderer_normal, renderer_select)
        AnyEmuDefaults.__init__(self)

        # assign a new hostname
        global emu_id
        if not emu_id:
            emu_id = 1

        # check if hostname has already been assigned
        for node in globals.GApp.topology.nodes.itervalues():
            if self.basehostname + str(emu_id) == node.hostname:
                emu_id = emu_id + 1
                break

        self.hostname = self.basehostname + str(emu_id)
        emu_id = emu_id + 1
        AbstractNode.setCustomToolTip(self)

        self.dynagen = globals.GApp.dynagen
        self.local_config = None
        self.f = '%s %s' % (self.basehostname, self.hostname)
        self.running_config = None
        self.defaults_config = None
        self.emudev = None

        self.emudev_options = [
            'ram',
            'image',
            'nics',
            'usermod',
            'netcard',
            'flavor',
            'kvm',
            'monitor',
            'options',
        ]
Esempio n. 12
0
    def setCustomToolTip(self):
        """ Set a custom tool tip
        """

        if self.config:
            info = translate("Cloud", "Cloud name: %s") % self.hostname
            for nio in self.config['nios']:
                info += "\n\n" + nio
                if sys.platform.startswith(
                        'win') and self.config['rpcap_mapping'].has_key(nio):
                    info += "\n    " + self.config['rpcap_mapping'][nio]
                neighbor = self.getConnectedNeighbor(nio)
                if neighbor:
                    (neighbor, ifname) = neighbor
                    info += " is connected to " + neighbor.hostname + " " + ifname
                else:
                    info += " is not connected"
            try:
                self.setToolTip(info)
            except:
                AbstractNode.setCustomToolTip(self)
        else:
            AbstractNode.setCustomToolTip(self)
Esempio n. 13
0
    def __init__(self, renderer_normal, renderer_select):

        AbstractNode.__init__(self, renderer_normal, renderer_select)

        # assign a new hostname
        global router_id
        if not router_id:
            router_id = 1

        # check if hostname has already been assigned
        for node in globals.GApp.topology.nodes.itervalues():
            if 'R' + str(router_id) == node.hostname:
                router_id = router_id + 1
                break

        self.hostname = 'R' + str(router_id)
        router_id = router_id + 1
        AbstractNode.setCustomToolTip(self)

        self.dynagen = globals.GApp.dynagen
        self.r = 'ROUTER ' + self.hostname
        self.running_config = None
        self.defaults_config = None
        self.router = None
        self.local_config = None

        self.routerInstanceMap = {
            '1710': lib.C1700,
            '1720': lib.C1700,
            '1721': lib.C1700,
            '1750': lib.C1700,
            '1751': lib.C1700,
            '1760': lib.C1700,
            '2691': lib.C2691,
            '3620': lib.C3600,
            '3640': lib.C3600,
            '3660': lib.C3600,
            '3725': lib.C3725,
            '3745': lib.C3745,
            '7200': lib.C7200,
            '2610': lib.C2600,
            '2611': lib.C2600,
            '2620': lib.C2600,
            '2621': lib.C2600,
            '2610XM': lib.C2600,
            '2611XM': lib.C2600,
            '2620XM': lib.C2600,
            '2621XM': lib.C2600,
            '2650XM': lib.C2600,
            '2651XM': lib.C2600,
            }

        self.router_options = [
            'ram',
            'nvram',
            'disk0',
            'disk1',
            'confreg',
            'idlepc',
            'exec_area',
            'idlemax',
            'idlesleep',
            'image',
            'mac',
            'iomem',
            'npe',
            'midplane', 
            ]
Esempio n. 14
0
    def __init__(self, renderer_normal, renderer_select):

        AbstractNode.__init__(self, renderer_normal, renderer_select)

        # assign a new hostname
        global router_id
        if not router_id:
            router_id = 1

        # check if hostname has already been assigned
        for node in globals.GApp.topology.nodes.itervalues():
            if 'R' + str(router_id) == node.hostname:
                router_id = router_id + 1
                break

        self.hostname = 'R' + str(router_id)
        router_id = router_id + 1
        AbstractNode.setCustomToolTip(self)

        self.dynagen = globals.GApp.dynagen
        self.r = 'ROUTER ' + self.hostname
        self.running_config = None
        self.defaults_config = None
        self.router = None
        self.local_config = None

        self.routerInstanceMap = {
            '1710': lib.C1700,
            '1720': lib.C1700,
            '1721': lib.C1700,
            '1750': lib.C1700,
            '1751': lib.C1700,
            '1760': lib.C1700,
            '2691': lib.C2691,
            '3620': lib.C3600,
            '3640': lib.C3600,
            '3660': lib.C3600,
            '3725': lib.C3725,
            '3745': lib.C3745,
            '7200': lib.C7200,
            '2610': lib.C2600,
            '2611': lib.C2600,
            '2620': lib.C2600,
            '2621': lib.C2600,
            '2610XM': lib.C2600,
            '2611XM': lib.C2600,
            '2620XM': lib.C2600,
            '2621XM': lib.C2600,
            '2650XM': lib.C2600,
            '2651XM': lib.C2600,
        }

        self.router_options = [
            'ram',
            'nvram',
            'disk0',
            'disk1',
            'confreg',
            'idlepc',
            'exec_area',
            'idlemax',
            'idlesleep',
            'image',
            'mac',
            'iomem',
            'npe',
            'midplane',
        ]