Пример #1
0
        "        Group Name : \"%s\"" % (group_type.strip('group-').upper(),
                                         group_id, group_name))
 print ("        Buckets    :")
 print ("                     [0] actions: Output (%s)") % out_port1
 print ("                     [1] actions: Output (%s)") % out_port2
 print ("                     [2] actions: Output (%s)") % out_port3
 time.sleep(rundelay)
 
 # Allocate a placeholder for the group entry
 group_entry = GroupEntry(group_id, group_type)
 group_entry.set_group_name(group_name)
 
 # Fill in group entry with action buckets
 # ---------
 bucket_id = 0
 bucket1 = GroupBucket(bucket_id)
 action = OutputAction(order = 0, port = out_port1)
 bucket1.add_action(action)
 group_entry.add_bucket(bucket1)
 
 # ---------
 bucket_id += 1
 bucket2 = GroupBucket(bucket_id)
 action = OutputAction(order = 0, port = out_port2)
 bucket2.add_action(action)
 group_entry.add_bucket(bucket2)
 
 # ---------
 bucket_id += 1
 bucket3 = GroupBucket(bucket_id)
 action = OutputAction(order = 0, port = out_port3)
Пример #2
0
    print ("                         actions: Output (%s)" %
           out_port2)
    print ("                     [2] watch-port: %s" %
           watch_port3)
    print ("                         actions: Output (%s)" %
           out_port3)
    time.sleep(rundelay)

    # Allocate a placeholder for the group entry
    group_entry = GroupEntry(group_id, group_type)
    group_entry.set_group_name(group_name)

    # Fill in group entry with action buckets
    # ---------
    bucket_id = 0
    bucket1 = GroupBucket(bucket_id)
    bucket1.set_watch_port(watch_port1)
    action = OutputAction(order=0, port=out_port1)
    bucket1.add_action(action)
    group_entry.add_bucket(bucket1)

    # ---------
    bucket_id += 1
    bucket2 = GroupBucket(bucket_id)
    bucket2.set_watch_port(watch_port2)
    action = OutputAction(order=0, port=out_port2)
    bucket2.add_action(action)
    group_entry.add_bucket(bucket2)

    # ---------
    bucket_id += 1
Пример #3
0
        "        Group Name : \"%s\"" %
        (group_type.strip('group-').upper(), group_id, group_name))
    print("        Buckets    :")
    print("                     [0] actions: Output (%s)") % out_port1
    print("                     [1] actions: Output (%s)") % out_port2
    print("                     [2] actions: Output (%s)") % out_port3
    time.sleep(rundelay)

    # Allocate a placeholder for the group entry
    group_entry = GroupEntry(group_id, group_type)
    group_entry.set_group_name(group_name)

    # Fill in group entry with action buckets
    # ---------
    bucket_id = 0
    bucket1 = GroupBucket(bucket_id)
    action = OutputAction(order=0, port=out_port1)
    bucket1.add_action(action)
    group_entry.add_bucket(bucket1)

    # ---------
    bucket_id += 1
    bucket2 = GroupBucket(bucket_id)
    action = OutputAction(order=0, port=out_port2)
    bucket2.add_action(action)
    group_entry.add_bucket(bucket2)

    # ---------
    bucket_id += 1
    bucket3 = GroupBucket(bucket_id)
    action = OutputAction(order=0, port=out_port3)
Пример #4
0
    print ("                         actions: Output (%s)" %
           out_port2)
    print ("                     [2] weight : %s" %
           weight3)
    print ("                         actions: Output (%s)" %
           out_port3)
    time.sleep(rundelay)

    # Allocate a placeholder for the group entry
    group_entry = GroupEntry(group_id, group_type)
    group_entry.set_group_name(group_name)

    # Fill in group entry with action buckets
    # ---------
    bucket_id = 0
    bucket1 = GroupBucket(bucket_id)
    bucket1.set_weight(weight1)
    action = OutputAction(order=0, port=out_port1)
    bucket1.add_action(action)
    group_entry.add_bucket(bucket1)

    # ---------
    bucket_id += 1
    bucket2 = GroupBucket(bucket_id)
    bucket2.set_weight(weight2)
    action = OutputAction(order=0, port=out_port2)
    bucket2.add_action(action)
    group_entry.add_bucket(bucket2)

    # ---------
    bucket_id += 1
Пример #5
0
           "        Group Name : \"%s\"" %
           (group_type.strip('group-').upper(),
            group_id, group_name))
    print ("        Buckets    :")
    print ("                     [0] actions : Pop VLAN")
    print ("                                   Output (%s)" %
           (out_port))
    time.sleep(rundelay)

    # Allocate a placeholder for the group entry
    group_entry = GroupEntry(group_id, group_type)
    group_entry.set_group_name(group_name)

    # Fill actions bucket with the set of actions
    bucket_id = 0
    bucket = GroupBucket(bucket_id)

    action_order = 0
    action1 = PopVlanHeaderAction(action_order)
    bucket.add_action(action1)

    action_order += 1
    action2 = OutputAction(action_order)
    action2.set_outport(out_port)
    bucket.add_action(action2)

    # Add actions bucket to the group entry
    group_entry.add_bucket(bucket)

    # Request Controller to create the group
    print "\n".strip()
Пример #6
0
    print("                     [0] weight : %s") % weight1
    print("                         actions: Output (%s)") % out_port1
    print("                     [1] weight : %s") % weight2
    print("                         actions: Output (%s)") % out_port2
    print("                     [2] weight : %s") % weight3
    print("                         actions: Output (%s)") % out_port3
    time.sleep(rundelay)

    # Allocate a placeholder for the group entry
    group_entry = GroupEntry(group_id, group_type)
    group_entry.set_group_name(group_name)

    # Fill in group entry with action buckets
    # ---------
    bucket_id = 0
    bucket1 = GroupBucket(bucket_id)
    bucket1.set_weight(weight1)
    action = OutputAction(order=0, port=out_port1)
    bucket1.add_action(action)
    group_entry.add_bucket(bucket1)

    # ---------
    bucket_id += 1
    bucket2 = GroupBucket(bucket_id)
    bucket2.set_weight(weight2)
    action = OutputAction(order=0, port=out_port2)
    bucket2.add_action(action)
    group_entry.add_bucket(bucket2)

    # ---------
    bucket_id += 1