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


Python Host.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
	def __init__(self, name, loopback, CR, cluster_id, *args, **kwargs ):
		dirs = ['/var/log/', '/var/log/quagga', '/var/run', '/var/run/quagga', '/var/run/openvswitch', '/var/run/sshd']
		Host.__init__(self, name, privateDirs=dirs, *args, **kwargs )
		self.loopback = loopback

		if cluster_id == "default":
			cluster_id = "0"
		cluster_id = int(cluster_id)
		if CR:
			cluster_id = cluster_id + 128	
	
		extrainfo = '%02x000000' % cluster_id

		self.dpid = self.loopbackDpid(self.loopback, extrainfo)
		self.mac = self.loopbackMac(self.loopback,"0200")
		self.path_ovs = "%s/%s/ovs" %(self.baseDIR, self.name)
		self.path_quagga =  "%s/%s/quagga" %(self.baseDIR, self.name)
		self.path_fpm = "%s/%s/fpm-of" %(self.baseDIR, self.name)
		if OSHI.checked == False:
			self.checkQuagga()
			if self.OF_V == "OpenFlow13":
				self.checkOVS()
			if OSHI.SR == True:
				self.checkSR()
			OSHI.checked = True
开发者ID:netgroup,项目名称:Dreamer-Mininet-Extensions,代码行数:27,代码来源:nodes.py

示例2: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
 def __init__(self, name, ips, ce_mac_address=None, gw=None, *args, **kwargs ):
   dirs = ['/var/log/', '/var/log/quagga', '/var/run', '/var/run/quagga']
   Host.__init__(self, name, privateDirs=dirs, *args, **kwargs )
   self.ips = ips
   self.ce_mac_address = ce_mac_address
   self.gw = gw
   self.path_quagga = "%s/%s/quagga" %(self.baseDIR, self.name)
开发者ID:santiagovidal,项目名称:P2015_44,代码行数:9,代码来源:rau_nodes.py

示例3: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
 def __init__(self, name, *args, **kwargs ):
     """privateDirs: list of private directories
        remounts: dirs to remount
        unmount: unmount dirs in cleanup? (True)
        Note: if unmount is False, you must call unmountAll()
        manually."""
     self.privateDirs = kwargs.pop( 'privateDirs', [] )
     self.remounts = kwargs.pop( 'remounts', [] )
     self.unmount = kwargs.pop( 'unmount', True )
     Host.__init__( self, name, *args, **kwargs )
     self.rundir = '%s/%s' % ( self.mnRunDir, name )
     self.root, self.private = None, None  # set in createBindMounts
     if self.privateDirs:
         self.privateDirs = [ realpath( d ) for d in self.privateDirs ]
         self.createBindMounts()
     # These should run in the namespace before we chroot,
     # in order to put the right entries in /etc/mtab
     # Eventually this will allow a local pid space
     # Now we chroot and cd to wherever we were before.
     pwd = self.cmd( 'pwd' ).strip()
     self.sendCmd( 'exec chroot', self.root, 'bash -ms mininet:'
                    + self.name )
     self.waiting = False
     self.cmd( 'cd', pwd )
     # In order for many utilities to work,
     # we need to remount /proc and /sys
     self.cmd( 'mount /proc' )
     self.cmd( 'mount /sys' )
开发者ID:09beeihaq,项目名称:Coursera-SDN-Assignments,代码行数:30,代码来源:bind.py

示例4: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, name, quaggaConfFile, zebraConfFile, intfDict, ARPDict, *args, **kwargs):
        Host.__init__(self, name, *args, **kwargs)

        self.quaggaConfFile = quaggaConfFile
        self.zebraConfFile = zebraConfFile
        self.intfDict = intfDict
        # TODO should be optional?
        self.ARPDict = ARPDict
开发者ID:piotrekz79,项目名称:demo_invitation,代码行数:10,代码来源:coco_multidomain_invitation.py

示例5: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
 def __init__( self, name, image='myace:v1', dargs=None, startString=None, **kwargs ):
     self.image = image
     self.dargs = dargs
     if startString is None:
         self.startString = "/bin/bash"
         self.dargs = "-ti"
     else:
         self.startString = startString
     Host.__init__( self, name, **kwargs )
开发者ID:thomasameisel,项目名称:cloud-computing,代码行数:11,代码来源:networking_application.py

示例6: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, name, **kwargs):

        Host.__init__(self, name, **kwargs)
        if not NdnHost.inited:
            NdnHostCommon.init()

        self.nfd = Nfd(self)
        self.nfd.start()

        self.peerList = {}
开发者ID:gitter-badger,项目名称:mini-ndn,代码行数:12,代码来源:ndn_host.py

示例7: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, name, **kwargs):
        privateDirs = [('/usr/local/etc/ndn', '/tmp/%(name)s/usr/local/etc/ndn'),  ]
        kwargs['privateDirs'] = privateDirs

        Host.__init__(self, name, **kwargs)
        if not NdnHost.inited:
            NdnHostCommon.init()

        self.nfd = Nfd(self)
        self.nfd.start()

        self.peerList = {}
开发者ID:ndncomm,项目名称:mini-ndn,代码行数:14,代码来源:ndn_host.py

示例8: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, name, ip=None, inNamespace=True,
                 root_dir=None, ssh_template=None,
                 auth_keys=None, **kwargs):

        self.name = name
        self.ssh_template = ssh_template
        self.auth_keys = auth_keys
        self.root_dir = root_dir
        self.ssh_pid_file = None
        self.mounted_dirs = []

        Host.__init__(self, name, inNamespace, **kwargs)
开发者ID:ericgarrigues,项目名称:minilab,代码行数:14,代码来源:minilab.py

示例9: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, name, **kwargs):

        Host.__init__(self, name, **kwargs)
        if not NdnHost.inited:
            NdnHostCommon.init()

        # Create home directory for a node
        self.homeFolder = "%s/%s" % (self.params['workdir'], self.name)
        self.cmd("mkdir -p %s" % self.homeFolder)
        self.cmd("cd %s" % self.homeFolder)

        self.nfd = Nfd(self)
        self.nfd.start()

        self.peerList = {}
开发者ID:alvyC,项目名称:mini-ndn,代码行数:17,代码来源:ndn_host.py

示例10: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, *opts, **params):
        """Construct NDN host.
           fw: forwarder constructor
           rout: routing constructor
           env: base environ for popen"""
        OVERRIDE_DIRS = ['/etc/ndn', '/var/log/ndn', '/var/run', '/root']
        privateDirs = params.get('privateDirs', [])
        privateDirs = [ pd for pd in privateDirs if pd[0] not in OVERRIDE_DIRS ]
        for d in OVERRIDE_DIRS:
            privateDirs.append((d, '/tmp/mnndn/%(name)s' + d))
        params['privateDirs'] = privateDirs

        Host.__init__(self, *opts, **params)
        self.cmd('export HOME=/root')

        from NfdForwarder import NfdForwarder
        from NlsrRouting import NlsrRouting
        self.fwCtor = params.pop('fw', NfdForwarder)
        self.routCtor = params.pop('rout', NlsrRouting)
        self.env = params.pop('env', {})

        self.fw = None
        self.rout = None
开发者ID:yoursunny,项目名称:mnndn,代码行数:25,代码来源:NdnHost.py

示例11: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, name, intfDict, *args, **kwargs):
        Host.__init__(self, name, *args, **kwargs)

        self.intfDict = intfDict
开发者ID:michaelph,项目名称:mininet-lab,代码行数:6,代码来源:wpgec2016.py

示例12: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, name, quaggaConfFile, zebraConfFile, intfDict, *args, **kwargs):
        Host.__init__(self, name, *args, **kwargs)

        self.quaggaConfFile = quaggaConfFile
        self.zebraConfFile = zebraConfFile
        self.intfDict = intfDict
开发者ID:Irishsmurf,项目名称:onos-1.4.0-custom-build,代码行数:8,代码来源:tutorial.py

示例13: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
    def __init__(self, name, ip, gw, *args, **kwargs):
        Host.__init__(self, name, ip=ip, *args, **kwargs)

        self.gw = gw
开发者ID:pichuang,项目名称:SDN-IP-Example-VM,代码行数:6,代码来源:sdnip_quagga.py

示例14: __init__

# 需要导入模块: from mininet.node import Host [as 别名]
# 或者: from mininet.node.Host import __init__ [as 别名]
 def __init__(self, name, inNamespace=True, **params):
     Host.__init__(self, name, inNamespace=inNamespace, **params)
     self.exectoken = "/tmp/mn-exec-token-host-%s" % name
     self.cmd("touch %s" % self.exectoken)
开发者ID:mengmoya,项目名称:onos,代码行数:6,代码来源:bmv2-demo.py


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