packets: Create new compose_packet() function.