def install_group_mod(self, device_id): action1 = pof.ofp_action_output(port_id=0x2) bucket1 = pof.ofp_bucket() bucket1.action_list.append(action1) bucket1.action_num = len(bucket1.action_list) bucket1.watch_slot_id = 0 bucket1.watch_port = 0x2 bucket1.watch_group = 8 action2 = pof.ofp_action_output(port_id=0x3) bucket2 = pof.ofp_bucket() bucket2.action_list.append(action2) bucket2.action_num = len(bucket2.action_list) bucket2.watch_slot_id = 0 bucket2.watch_port = 0x3 bucket2.watch_group = 8 group_msg = pof.ofp_group_mod() group_msg.command = pof.OFPGC_ADD group_msg.group_type = pof.OFPGT_FF group_msg.group_id = 1 group_msg.slot_id = 0 group_msg.counter_id = 3 group_msg.bucket_list.append(bucket1) group_msg.bucket_list.append(bucket2) group_msg.bucket_num = len(group_msg.bucket_list) print group_msg.show() core.PofManager.write_of(device_id, group_msg)
def add_ff_group_table(dpid, group_id, bucket_list): group = pof.ofp_group_mod() group.command = pof.OFPGC_ADD group.group_type = pof.OFPGT_FF group.group_id = group_id group.slot_id = 0 group.counter_id = 0 group.bucket_list = bucket_list group.bucket_num = len(bucket_list) core.PofManager.write_of(dpid, group)
def install_group_mod_e(self, device_id): group_msg = pof.ofp_group_mod() core.PofManager.write_of(device_id, group_msg)