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


Python Mininet.items方法代码示例

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


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

示例1: main

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import items [as 别名]
def main():
    topo = AttackTopo()
    info( '*** Creating network\n' )
    net = Mininet(topo=topo)
    net.start()

    # Print the elements of the network
    for item in net.items():
        print item

    h1, h2, attacker, s1 = net.get('h1', 'h2', 'h3', 's1')
    # Start a ssh server on host 2
    start_telnet(h2)
    CLI(net)
    stop_telnet(h2)
    net.stop()
开发者ID:yo2seol,项目名称:mininet_tcp_hijacking,代码行数:18,代码来源:tcp_hijacking.py

示例2: main

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import items [as 别名]
def main():
    topo = AttackTopo()
    info( '*** Creating network\n' )
    net = Mininet(topo=topo)
    net.start()

    # Print the elements of the network
    for item in net.items():
        print item

    print "Encoded log file at %s" % LOG_FILE_PATH 
    print "Decoded log file at %s" % DECODED_LOG_FILE_PATH 
    h1, h2, attacker, s1 = net.get('h1', 'h2', 'h3', 's1')
    # Start a ssh server on host 2
    start_sshd(h2)
    create_attack_log(attacker)
    CLI(net)
    stop_sshd()
    delete_attack_log(attacker)
    net.stop()
开发者ID:yo2seol,项目名称:mininet_sshmitm,代码行数:22,代码来源:sshmitm.py

示例3: fwd

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import items [as 别名]
            partial_policy = (
                            (match(switch = i) >> fwd(2)) 
                            + (match(switch = left_con_num) >> fwd(i)) 
                            + (match(switch = right_con_num) >> fwd(m + 1))
                            + ( (~match(switch = i) & ~match(switch = left_con_num) & ~match(switch = right_con_num)) >> fwd(1) )
                            )
            policy += match(dstip = ip_prefix+str(i)) >> partial_policy
       
        for k in range(1, m + 1):
            i = k + n
            partial_policy = (
                            (match(switch = i) >> fwd(2)) 
                            + (match(switch = left_con_num) >> fwd(n + 1)) 
                            + (match(switch = right_con_num) >> fwd(k))
                            + ( (~match(switch = i) & ~match(switch = left_con_num) & ~match(switch = right_con_num)) >> fwd(1) )
                            )
            policy += match(dstip = ip_prefix+str(i)) >> partial_policy

        return policy




if __name__ == "__main__":
    topo = TestTopo(2,3)
    net = Mininet(topo=topo, host=CPULimitedHost, controller=RemoteController,
                  listenPort=6634)
    net.start()
    print net.items()
    net.stop()
开发者ID:15ramky,项目名称:pyretic,代码行数:32,代码来源:SingleLinkTopo.py


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