本文整理汇总了Python中mininet.node.Node.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Node.__init__方法的具体用法?Python Node.__init__怎么用?Python Node.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.node.Node
的用法示例。
在下文中一共展示了Node.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
def __init__(self, name, inMountNamespace=False, inPIDNamespace=False,
inUTSNamespace=False, **params):
"""name: name of node
inNamespace: in network namespace?
inMountNamespace: has private mountspace?
inPIDNamespace: has private PID namespace?
params: Node parameters (see config() for details)"""
# PID and Mount Namespace handling
self.inPIDNamespace = inPIDNamespace
self.inUTSNamespace = inUTSNamespace
self.inMountNamespace = inMountNamespace
# Private config monitoring
self.hasPrivateLogs = False
self.hasPrivateRun = False
# Sanity check on namespace config
if self.inPIDNamespace is True and self.inMountNamespace is False:
raise Exception('PID namespaces require mount namespace for /proc')
# Stash extended configuration information
self.services = {} # dict of services and parameters for this node
self.privateMounts = {} # dict of private mounts for this node
# Network information
self.loIntfs = {}
# Request initialization of the BaseNode
BaseNode.__init__(self, name, **params)
示例2: __init__
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
def __init__(self, name, image=None, port_map=None, fs_map=None, **kwargs):
if image is None:
raise UnboundLocalError('Docker image is not specified')
img_id = subprocess.check_output(['docker', 'images', '-q', image])
if not img_id:
raise ValueError('Docker image "%s" does not exist' % image)
self.docker_image = image
self.port_map = port_map
self.fs_map = fs_map
kwargs['inNamespace'] = True
Node.__init__(self, name, **kwargs)
示例3: __init__
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
def __init__( self, name, sw_path = "dc_full",
dpid=None,
opts='',
thrift_port = None,
pcap_dump = False,
verbose = False, **kwargs ):
Node.__init__( self, name, **kwargs )
self.dpid = self.defaultDpid(dpid)
self.opts = opts
self.sw_path = sw_path
self.verbose = verbose
logfile = '/tmp/p4ns.%s.log' % self.name
self.output = open(logfile, 'w')
self.thrift_port = thrift_port
self.pcap_dump = pcap_dump
示例4: __init__
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
def __init__(self, name, *args, **kwargs ):
Node.__init__( self, name, inNamespace=False, *args, **kwargs )
self.brname = "br-dreamer"
self.OF_V = "OpenFlow13"
示例5: __init__
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
def __init__(self, name, inNamespace=True, **params):
Node.__init__(self, name, inNamespace, **params)