本文整理汇总了Python中mininet.node.Node.config方法的典型用法代码示例。如果您正苦于以下问题:Python Node.config方法的具体用法?Python Node.config怎么用?Python Node.config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.node.Node
的用法示例。
在下文中一共展示了Node.config方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: config
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import config [as 别名]
def config(self, privateLogDir=None, privateRunDir=None,
privateMounts=None, services=None, hostname=None,
loIntfs=None, **_params):
"""Configure Node according to (optional) parameters:
mac: MAC address for default interface
ip: IP address for default interface
defaultRoute: default route for all traffic
privateLogDir = boolean or path to dir to bind over /var/log
privateRunDir = boolean or path to dir to bind over /run
privateMounts = mount / path properties objects
loopbackIntfs = list of loopback interfaces and parameters
services = service objects for service manager"""
r = BaseNode.config(self, **_params)
# Process private mounts and services in this order:
# (1) - privateLogDir (/var/log), privateRunDir (/run) if requested
# (2) - user private mounts
# (3) - services and service mounts
# (4) - setup hostname, loopback adapters, and other network components
self.setParam(r, 'setupPrivateLogs', privateLogDir=privateLogDir)
self.setParam(r, 'setupPrivateRun', privateRunDir=privateRunDir)
self.setParam(r, 'setupPrivateMounts', privateMounts=privateMounts)
self.setParam(r, 'setupServices', services=services)
self.setParam(r, 'setupHostname', hostname=hostname)
self.setParam(r, 'setupLoopbacks', loIntfs=loIntfs)
return r
示例2: config
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import config [as 别名]
def config(self, app=None, cache=None, **params):
r = Node.config(self, **params)
self.setParam(r, 'app', app=app)
self.setParam(r, 'cache', cache=cache)
return r
示例3: config
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import config [as 别名]
def config(self, fib=None, app=None, cache=None, **params):
r = Node.config(self, **params)
self.setParam(r, 'app', fib=fib) # why is this not app=app, to be investigated
self.setParam(r, 'fib', app=app) # and this fib=fib
self.setParam(r, 'cache', cache=cache)
return r
示例4: config
# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import config [as 别名]
def config(self, **_params):
if self.intfs:
self.setParam(_params, 'setIP', ip='0.0.0.0')
r = Node.config(self, **_params)
self.cmd('sysctl -w net.ipv4.ip_forward=1')
return r