Hi, I want to add multiple action to a flow using c++. Below source code work well.
/* Action list */ ofp_action_list actions; ofp_action *act1 = new ofp_action(); act1->set_action_nw_addr(OFPAT_SET_NW_DST, (i->client_ip)); actions.action_list.push_back(*act1); ofp_action *act2 = new ofp_action(); act2->set_action_dl_addr(OFPAT_SET_DL_DST, it->mac); actions.action_list.push_back(*act2); ofp_action *act3 = new ofp_action(); // set_action_output (uint16_t port, uint16_t max_len) act3->set_action_output(output_port, 0); actions.action_list.push_back(*act3); ofp_action *act4 = new ofp_action(); act4->set_action_nw_addr(OFPAT_SET_NW_SRC, i->switch_ip); actions.action_list.push_back(*act4); /* OFP_FLOW_MOD : I'll skip this part */ ofm.pack((ofp_flow_mod*) openflow_pack::get_pointer(of_raw)); actions.pack(openflow_pack::get_pointer(of_raw,sizeof(ofp_flow_mod))); send_openflow_command(pi.datapath_id, of_raw, false); //////////////////////////////////////////////////// And I want to add another action aboce source that change the packet's destination port. It use ofp_action_tp_port class like below. ofp_action_tp_port *tp_dst = (ofp_action_tp_port *)malloc(sizeof(ofp_action_tp_port)); tp_dst->type = htons(OFPAT_SET_TP_DST); tp_dst->len = htons(sizeof(ofp_action_tp_port)); tp_dst->tp_port = i->port; But How I combine these two sources? Has anyone tried changing the port using multiple actions? If you have, can you post an example in c++. Thank you. Regrads Hyogi
_______________________________________________ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev