send_openflow_packet()'s API is kind of broken due to changes made since earlier versions of OpenFlow, and is very, very likely to be removed altogether in the next major release of NOX. There are other ways to do the same thing. If you look at the source of send_openflow_packet(), you'll see that it just calls some other functions to do all the work, which should give you an idea of other ways you might do it, but I don't remember a super easy way off the top of my head.
BUT, I think you can basically just take a buffer full of actions, cast it to an array of ofp_action_header, and it'll work fine with send_openflow_packet() (though it's pretty ugly). To get a buffer full of actions from an ofp_action_list, use myactionlist.mem_size() to allocate a buffer of the correct size (use this number for the actions_len argument to send_openflow_packet() too), and then use myactionlist.pack(mybuffer) to fill the buffer with the actions. For help creating a Buffer, look in include/buffer.hh. There are at least a couple subclasses, but Array_buffer is probably a safe choice. Should be as easy as new Array_buffer(your_data, your_data_length). -- Murphy On Thursday, May 26, 2011 02:11:12 PM Gopinath Palani wrote: > Hello , > > Please let me know how to use > send_openflow_packet(const datapathid&, const Buffer& packet, const > ofp_action_header actions[],unit16_t actions_len,unit16_t in_port,bool > block); my requirement is to create udp packet and send it to a particular > tp_dst and port, It will be helpful if someone guide me in > creating a Buffer, > and I'm able to create ofp_action_list with actions for OFPAT_SET_TP_DST > and OFPAT_OUTPUT but don't know how to convert ofp_action_list to > ofp_action_header type. > > Thanks > Gopinath _______________________________________________ nox-dev mailing list [email protected] http://noxrepo.org/mailman/listinfo/nox-dev
