当前位置: 首页>>代码示例>>Python>>正文


Python node.Controller类代码示例

本文整理汇总了Python中mininet.node.Controller的典型用法代码示例。如果您正苦于以下问题:Python Controller类的具体用法?Python Controller怎么用?Python Controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Controller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, name,
                 command='java -jar ' + fl_root_dir + 'target/floodlight.jar',
                 cargs='',
                 ip='127.0.0.1',
                 **kwargs):
        # Check to make sure Floodlight is installed before moving forward.
        installFloodlight()

        # Increment the number of controller instances for naming purposes.
        Floodlight.controller_number += 1

        # Initialize attributes
        self.name = name
        self.properties_path = ''
        self.properties_file = ''

        self.createUniqueFloodlightPropertiesFile()

        # Create the command that will start Floodlight, including the path to the unique properties file.
        self.command = command + ' -cf ' + self.properties_path + self.properties_file

        # Initialize the parent class.
        Controller.__init__(self, name, cdir=self.fl_root_dir,
                            command=self.command,
                            cargs=cargs, ip=ip, **kwargs)
开发者ID:OpenFlow-Clemson,项目名称:EAGERProject,代码行数:25,代码来源:floodlight.py

示例2: __init__

 def __init__( self, name, n=1, reactive=True, runAsRoot=False, **params):
     """n: number of ONOS instances to run (1)
        reactive: run in reactive mode (True)
        runAsRoot: run ONOS as root (False)"""
     self.check()
     self.count = n
     self.reactive = reactive
     self.runAsRoot = runAsRoot
     self.ids = range( 0, self.count )
     Controller.__init__( self, name, **params )
     self.proxies = []
     # We don't need to run as root, and it can interfere
     # with starting Zookeeper manually
     self.user = None
     if not self.runAsRoot:
         try:
             self.user = quietRun( 'who am i' ).split()[ 0 ]
             self.sendCmd( 'su', self.user )
             self.waiting = False
         except:
             warn( '__init__: failed to drop privileges\n' )
     self.cmd( 'mkdir -p', self.logDir )
     # Need to run commands from ONOS dir
     self.cmd( 'cd', self.onosDir )
     self.cmd( 'export PATH=$PATH:%s' % self.onosDir )
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:25,代码来源:onos.py

示例3: __init__

 def __init__( self, name, ip=CONTROLLER_IP, port=6633, **kwargs):
     """Init.
        name: name to give controller
        ip: the IP address where the remote controller is
        listening
        port: the port where the remote controller is listening"""
     Controller.__init__( self, name, ip=ip, port=port, **kwargs )
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:7,代码来源:fat_tree.py

示例4: __init__

 def __init__(self, name, cdir=FAUCET_DIR,
              command='ryu-manager faucet.py',
              cargs='--ofp-tcp-listen-port=%s --verbose --use-stderr',
              **kwargs):
     Controller.__init__(self, name, cdir=cdir,
                         command=command,
                         cargs=cargs, **kwargs)
开发者ID:KitL,项目名称:faucet,代码行数:7,代码来源:faucet_mininet_test.py

示例5: emptyNet

def emptyNet():

    net = Mininet(topo=None, build=False)
    c0 = Controller('c0', inNamespace=False)

    h1 = Host('h1')
    h2 = Host('h2')
    #intf1 = Intf("h1-eth1")
    #intf2 = Intf("h2-eth1")
    s1 = OVSSwitch('br0', inNamespace=False)    

    Link(h1, s1)
    Link(h2, s1)


    c0.start()
    s1.start([c0])

    net.start()    
    #s1.cmd('ovs-vsctl set bridge br0 protocols=OpenFlow13')
    CLI(net)

    net.stop()
    h1.stop()
    h2.stop()
    s1.stop()
    c0.stop()
开发者ID:exuuwen,项目名称:study,代码行数:27,代码来源:mininet_basic.py

示例6: __init__

    def __init__(self, name, cdir=POXDIR, command='python pox.py',
                 cargs='openflow.of_01 --port=%s', **kwargs):
        if 'script' in kwargs:
            cargs += ' ' + kwargs['script']
        else:
            cargs += ' forwarding.l2_learning'

        Controller.__init__(self, name, cdir=cdir, command=command, cargs=cargs, **kwargs)
开发者ID:bolek117,项目名称:mininet_sdn,代码行数:8,代码来源:pox.py

示例7: __init__

 def __init__( self, name, **kwargs ):
     "alertAction: exception|ignore|warn|exit (exception)"
     kwargs.update( inNamespace=True )
     self.alertAction = kwargs.pop( 'alertAction', 'exception' )
     Controller.__init__( self, name, **kwargs )
     self.dir = '/tmp/%s' % self.name
     self.client = self.dir + '/karaf/bin/client'
     self.ONOS_HOME = '/tmp'
开发者ID:maheshraju-Huawei,项目名称:actn,代码行数:8,代码来源:onos.py

示例8: __init__

 def __init__( self, name, cdir=MAPLEDIR,
               command='/home/vagrant/.maple/lib/maple',
               cargs=( '-u /vagrant/classes -l %s SP '),
               **kwargs):
     Controller.__init__( self, name, cdir=cdir,
                          command=command,
                          cargs=cargs, **kwargs )
     print command, cargs
开发者ID:snlab,项目名称:utilities,代码行数:8,代码来源:ysn_8.py

示例9: __init__

 def __init__(self, name, cdir = POXDIR,
              command = 'python pox-debug.py',
              # cargs = ('openflow.of_01 --port=%s forwarding.l2_learning'),
              cargs = 'forwarding.l2_learning openflow.of_01 --port=%s',
              **kwargs):
     Controller.__init__(self, name, cdir = cdir,
                         command = command,
                         cargs = cargs, **kwargs)
开发者ID:netixx,项目名称:mininet-NetProbes,代码行数:8,代码来源:builder.py

示例10: __init__

 def __init__(self, name, cdir=FLDIR,
              command='java -jar target/floodlight.jar',
              cargs='',
              ip='127.0.0.1',
              port=6653,
              **kwargs):
     Controller.__init__(self, name, cdir=cdir,
                         command=command,
                         cargs=cargs, ip=ip, port=port, **kwargs)
开发者ID:cbarrin,项目名称:MininetScripts,代码行数:9,代码来源:floodlight.py

示例11: __init__

    def __init__( self, name, cdir=POXDIR,
                  command='python pox.py',
			  
                  cargs=( 'openflow.of_01 --port=%s '
			  'tests.controller' ),
                  **kwargs ):
        Controller.__init__( self, name, cdir=cdir,
                             command=command,
                             cargs=cargs, **kwargs )
开发者ID:rakeshgn31,项目名称:SDN_Project,代码行数:9,代码来源:custcontroller.py

示例12: __init__

 def __init__( self, name, inNamespace=False, command='controller',
              cargs='-v ptcp:%d', cdir=None, ip="127.0.0.1",
              port=6633, **params ):
     """command: controller command name
        cargs: controller command arguments
        cdir: director to cd to before running controller
        ip: IP address for controller
        port: port for controller to listen at
        params: other params passed to Node.__init__()"""
     Controller.__init__( self, name, ip=ip, port=port, **params)
开发者ID:petergrabowski,项目名称:networks,代码行数:10,代码来源:lab3.py

示例13: __init__

 def __init__(
     self,
     name,
     cdir=faucet_mininet_test_util.FAUCET_DIR,
     command="timeout 180s ryu-manager gauge.py",
     cargs="--ofp-tcp-listen-port=%s --verbose --use-stderr",
     **kwargs
 ):
     name = "gauge-%u" % os.getpid()
     Controller.__init__(self, name, cdir=cdir, command=command, cargs=cargs, **kwargs)
开发者ID:REANNZ,项目名称:faucet,代码行数:10,代码来源:faucet_mininet_test_base.py

示例14: __init__

 def __init__(self,
              name,
              cdir=CURRENT_DIR,
              command='./pox-wrapper.py',
              cargs=('controller.loop_discovery --port=%s --file=pox.log'),
              **kwargs):
     Controller.__init__(self,
                         name,
                         cdir=cdir,
                         command=command,
                         cargs=cargs,
                         **kwargs)
开发者ID:butjar,项目名称:pox-playground,代码行数:12,代码来源:ring.py

示例15: __init__

 def __init__(self,
              name,
              command='ryu-manager {0}/faucet.py test_api.py'.format(
                 faucet_mininet_test_util.FAUCET_DIR),
              cargs='--ofp-tcp-listen-port=%s --verbose --use-stderr',
              **kwargs):
     name = 'faucet-api-%u' % os.getpid()
     Controller.__init__(
         self,
         name,
         command=command,
         cargs=cargs,
         **kwargs)
开发者ID:Baloc,项目名称:faucet,代码行数:13,代码来源:faucet_mininet_test_base.py


注:本文中的mininet.node.Controller类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。