Пример #1
0
def gettable(switch):
    id = switch.props['dpid']
    (vendor, role, location, id) = decodeDPID(id)
    if vendor == 1:
        # OVS
        return '0'
    if vendor == 2:
        # Corsa
        return '2'
Пример #2
0
def gettable(switch):
    id = switch.props['dpid']
    (vendor,role,location,id) = decodeDPID(id)
    if vendor == 1:
        # OVS
        return '0'
    if vendor == 2:
        # Corsa
        return '2'
Пример #3
0
     sw = getswitch(name=argv[2])
     if sw == None:
         print "unknown switch"
         sys.exit(0)
     flow_id = argv[3]
     in_port = argv[4]
     in_dst = argv[5]
     in_vlan = argv[6]
     out_port = argv[7]
     out_dst = argv[8]
     out_vlan = argv[9]
     meter = None
     if len(argv) > 10:
         meter = argv[10]
     id = sw.props['dpid']
     (vendor, role, location, id) = decodeDPID(id)
     if vendor == 2:
         # Corsa
         corsaforward(sw, flow_id, in_port, in_dst, in_vlan, out_port,
                      out_dst, out_vlan, meter)
 elif cmd == "add-broadcast":
     sw = getswitch(name=argv[2])
     if sw == None:
         print "unknown switch"
         sys.exit(0)
     flow_id = argv[3]
     in_port = argv[4]
     in_vlan = argv[5]
     out = iter(argv[6:])
     datapaths = []
     for port in out:
Пример #4
0
     sw = getswitch(name=argv[2])
     if sw == None:
         print "unknown switch"
         sys.exit(0)
     flow_id = argv[3]
     in_port = argv[4]
     in_dst = argv[5]
     in_vlan = argv[6]
     out_port = argv[7]
     out_dst = argv[8]
     out_vlan = argv[9]
     meter = None
     if len(argv) > 10:
         meter = argv[10]
     id = sw.props['dpid']
     (vendor,role,location,id) = decodeDPID(id)
     if vendor == 2:
         # Corsa
         corsaforward(sw,flow_id,in_port,in_dst,in_vlan,out_port,out_dst,out_vlan,meter)
 elif cmd == "add-broadcast":
     sw = getswitch(name=argv[2])
     if sw == None:
         print "unknown switch"
         sys.exit(0)
     flow_id = argv[3]
     in_port = argv[4]
     in_vlan = argv[5]
     out =iter(argv[6:])
     datapaths = []
     for port in out:
         vlan = next(out)