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


Python Node.config方法代码示例

本文整理汇总了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
开发者ID:USC-NSL,项目名称:miniNExT,代码行数:28,代码来源:node.py

示例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
开发者ID:alvyC,项目名称:mini-ndn,代码行数:10,代码来源:ndn_host.py

示例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
开发者ID:ndncomm,项目名称:mini-ndn,代码行数:11,代码来源:ndn_host.py

示例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
开发者ID:fredericoschardong,项目名称:escape,代码行数:8,代码来源:CustomNetworkElements.py


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