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


Python moduledeps.pathCheck函数代码示例

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


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

示例1: __init__

 def __init__(self, name, sw_path = None, json_path = None,
              thrift_port = None,
              pcap_dump = False,
              log_console = False,
              verbose = False,
              device_id = None,
              enable_debugger = False,
              **kwargs):
     Switch.__init__(self, name, **kwargs)
     assert(sw_path)
     assert(json_path)
     # make sure that the provided sw_path is valid
     pathCheck(sw_path)
     # make sure that the provided JSON file exists
     if not os.path.isfile(json_path):
         error("Invalid JSON file.\n")
         exit(1)
     self.sw_path = sw_path
     self.json_path = json_path
     self.verbose = verbose
     logfile = "/tmp/p4s.{}.log".format(self.name)
     self.output = open(logfile, 'w')
     self.thrift_port = thrift_port
     self.pcap_dump = pcap_dump
     self.enable_debugger = enable_debugger
     self.log_console = log_console
     if device_id is not None:
         self.device_id = device_id
         P4Switch.device_id = max(P4Switch.device_id, device_id)
     else:
         self.device_id = P4Switch.device_id
         P4Switch.device_id += 1
     self.nanomsg = "ipc:///tmp/bm-{}-log.ipc".format(self.device_id)
开发者ID:wysamuel,项目名称:behavioral-model,代码行数:33,代码来源:p4_mininet.py

示例2: __init__

 def __init__( self, name, dpopts='--no-slicing', **kwargs ):
     """Init.
        name: name for the switch
        dpopts: additional arguments to ofdatapath (--no-slicing)"""
     Switch.__init__( self, name, **kwargs )
     pathCheck('switch', moduleName='the Fluid library example switch' +
                           '(CPqD)' )
开发者ID:David-B55,项目名称:libfluid,代码行数:7,代码来源:node.py

示例3: __init__

 def __init__(self, name, **kwargs):
     """Init.
        name: name for the switch"""
     Switch.__init__(self, name, **kwargs)
     pathCheck("ofdatapath", "ofprotocol", moduleName="the OpenFlow reference user switch" + "(openflow.org)")
     if self.listenPort:
         self.opts += " --listen=ptcp:%i " % self.listenPort
开发者ID:sjas,项目名称:mininet,代码行数:7,代码来源:node.py

示例4: start

 def start(self):
     """Start <controller> <args> on controller.
         Log to /tmp/cN.log"""
     pathCheck(self.command)
     cout = "/tmp/" + self.name + ".log"
     if self.cdir is not None:
         self.cmd("cd " + self.cdir)
     self.cmd(self.command, self.cargs % self.port, ">&", cout, "&")
开发者ID:stonary,项目名称:nat,代码行数:8,代码来源:lab5.py

示例5: __init__

 def __init__( self, name, **kwargs ):
     """Init.
        name: name for the switch"""
     Switch.__init__( self, name, **kwargs )
     pathCheck( 'ofdatapath', 'ofprotocol',
         moduleName='the OpenFlow reference user switch (openflow.org)' )
     self.cmd( 'kill %ofdatapath' )
     self.cmd( 'kill %ofprotocol' )
开发者ID:sandeephebbani,项目名称:mininet,代码行数:8,代码来源:node.py

示例6: start

 def start( self ):
     """Start <controller> <args> on controller.
         Log to /tmp/cN.log"""
     pathCheck( self.command )
     cout = '/tmp/' + self.name + '.log'
     if self.cdir is not None:
         self.cmd( 'cd ' + self.cdir )
     self.cmd( self.command, self.cargs % self.port, '>&', cout, '&' )
开发者ID:petergrabowski,项目名称:networks,代码行数:8,代码来源:lab3.py

示例7: start

 def start(self):
     pathCheck(self.command)
     cout = '/tmp/' + self.name + '.log'
     command = self.command + ' ' + (self.cargs % self.port)
     print command
     self.fout = open(cout, 'w')
     self.controller_popen = self.popen(command.split(' '),
                                        stdout=self.fout,
                                        stderr=self.fout)
开发者ID:BenjaminUJun,项目名称:ryuo,代码行数:9,代码来源:node.py

示例8: setup

 def setup( cls ):
     "Check dependencies and warn about firewalling"
     pathCheck( 'brctl', moduleName='bridge-utils' )
     # Disable Linux bridge firewalling so that traffic can flow!
     for table in 'arp', 'ip', 'ip6':
         cmd = 'sysctl net.bridge.bridge-nf-call-%stables' % table
         out = quietRun( cmd ).strip()
         if out.endswith( '1' ):
             warn( 'Warning: Linux bridge may not work with', out, '\n' )
开发者ID:Guzeping,项目名称:Mininet,代码行数:9,代码来源:nodelib.py

示例9: setup

 def setup():
     pathCheck('brctl')
     brlist = quietRun('brctl show')
     for line in brlist.split("\n"):
         line = line.rstrip()
         m = re.match('^lxbr-(\w+)', line)
         if (m):
             print "Cleaning old bridge lxbr-%s" % m.group(1)
             self.cmd ('brctl', 'delbr', 'lxbr-%s' % m.group(1))
开发者ID:meiyangbigswitch,项目名称:mininet,代码行数:9,代码来源:node.py

示例10: start

 def start(self):
     """Start <controller> <args> on controller.
        Log to /tmp/cN.log"""
     pathCheck(self.command)
     cout = "/tmp/" + self.name + ".log"
     if self.cdir is not None:
         self.cmd("cd " + self.cdir)
     self.cmd(self.command + " " + self.cargs % self.port + " 1>" + cout + " 2>" + cout + "&")
     self.execed = False
开发者ID:sjas,项目名称:mininet,代码行数:9,代码来源:node.py

示例11: setup

 def setup(cls):
     "Check dependencies and warn about firewalling"
     pathCheck("brctl", moduleName="bridge-utils")
     # Disable Linux bridge firewalling so that traffic can flow!
     for table in "arp", "ip", "ip6":
         cmd = "sysctl net.bridge.bridge-nf-call-%stables" % table
         out = quietRun(cmd).strip()
         if out.endswith("1"):
             warn("Warning: Linux bridge may not work with", out, "\n")
开发者ID:basus,项目名称:mininet,代码行数:9,代码来源:nodelib.py

示例12: __init__

 def __init__( self, name, **kwargs ):
     """Init.
        name: name for the switch"""
     Switch.__init__( self, name, **kwargs )
     pathCheck( 'ofdatapath', 'ofprotocol',
                moduleName='the OpenFlow reference user switch' +
                           '(openflow.org)' )
     if self.listenPort:
         self.opts += ' --listen=ptcp:%i ' % self.listenPort
开发者ID:RimHaw,项目名称:mn-ccnx,代码行数:9,代码来源:node.py

示例13: start

 def start(self):
     """Start <controller> <args> on controller.
        Log to /tmp/cN.log"""
     log.info('Starting controller...\n')
     pathCheck(self.command)
     cout = '/tmp/' + self.name + '.log'
     chdir(self.fl_root_dir)
     self.cmd(self.command + ' ' + self.cargs +
              ' 1>' + cout + ' 2>' + cout + '&')
     self.execed = False
开发者ID:OpenFlow-Clemson,项目名称:EAGERProject,代码行数:10,代码来源:floodlight.py

示例14: __init__

 def __init__( self, name, bw=100000000, **kwargs ): #100mbps
     """Init.
        name: name for the switch
        bw: interface maximum bandwidth"""
     
     Switch.__init__( self, name, **kwargs )
     self.bandwidth = bw
     pathCheck( 'ofdatapath', 'ofprotocol', moduleName='QoSFlow 0.1 datapath')
     if self.listenPort: # dpctl
         self.opts += ' --listen=ptcp:%i ' % self.listenPort
开发者ID:josecastillolema,项目名称:smart-OF-controller,代码行数:10,代码来源:qosflownet.py

示例15: start

 def start( self ):
     """Start <controller> <args> on controller.
        Log to /tmp/cN.log"""
     pathCheck( self.command )
     cout = '/tmp/' + self.name + '.log'
     if self.cdir is not None:
         self.cmd( 'cd ' + self.cdir )
     self.cmd( self.command + ' ' + self.cargs % self.port +
               ' 1>' + cout + ' 2>' + cout + '&' )
     self.execed = False
开发者ID:RimHaw,项目名称:mn-ccnx,代码行数:10,代码来源:node.py


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