Added thread-safe tasks that will be run by the trema thread.
Added missing header files for Tasks feature.
Set protocol capabilities at HELLO

For example MULTIPART_REQUEST GROUP sent just after HELLO failes
if capabilities was not set. So it should be done at HELLO instead
of FEATURE_REQUEST.
Create multiple parts multipart message if payload is big enough.

For example, if you have 2000+ groups, then OFMP_GROUP to
OFPG_ALL returns a big reply, and the message length
overflows uint16_t, where we really need multiple messages.

Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
fix memory leak in calloc_packet_info

memory leak would happen when multiple parse_packet
was called on the same buffer.
rework push action for memory reallocation

just fixed the FIXME section.
fix packet_in handling caused by packet_out

OFPT_PACKET_OUT with OFPAT_ACTION_OUTPUT to OFPP_CONTROLLER
requres controller handle OFPT_PACKET_IN within the same
protocol thread.
Check OFPPC_NO_PACKET_IN only when table_miss happened
Add processing OFPP_TABLE in action_output

OFPP_TABLE forward the packet into table match.
rework push action for memory reallocation

just fixed the FIXME section.
Merge branch 'action_push' of https://github.com/iHiroakiKawai/trema-edge into action_push
fix memory leak in calloc_packet_info

memory leak would happen when multiple parse_packet
was called on the same buffer.
Merge branch 'packet_info_memleak' of https://github.com/iHiroakiKawai/trema-edge into packet_info_memleak
fix segfault when fetching a packet by buffer_id

In save_packet(), we store the buffer in packet_in_buffers,
duplicate_buffer() does memory copy for us. Unfortunately,
the content of user_data is a set of pointers which points to
buffer address. So copying the address will point to old buffer,
which will be freed. Fetching by buffer_id and access to
user_data causes segmentation fault.
set packet_info->l2_vlan_header

packet_info->l2_vlan_header is referenced by set_vlan_vid(),
set_vlan_pcp() and execute_action_pop_vlan() but it is not set in
parse_ether()
add copy packet_info that holds packet_parse() result

Instead of discarding invalid data, copy_packet_info() copies
buffer->user_data with fixing the pointer address to new one.
reset_buffer() should reset associated user_data
always reset_buffer() before reusing device recieve buffer.

buffers fetched from device->recv_queue were not reset.
refetch the packet_info address

push_vlan_tag might change the packet_info address, so
we must refetch the address.
fix typo