/* If all files have the same frame type, then use that. Otherwise select WTAP_ENCAP_PER_PACKET. If the selected output file type doesn't support per packet frame types, then the wtap_dump_open call will fail with a reasonable error condition. */
static int merge_select_frame_type(int in_file_count, merge_in_file_t in_files[])
/* If all files have the same frame type, then use that. Otherwise select WTAP_ENCAP_PER_PACKET. If the selected output file type doesn't support per packet frame types, then the wtap_dump_open call will fail with a reasonable error condition. */
static int merge_select_frame_type(int in_file_count, merge_in_file_t in_files[])
{
    int i;
    int selected_frame_type;
    selected_frame_type = wtap_file_encap(in_files[0].wth);
    for (i = 1; i < in_file_count; i++) {
        int this_frame_type = wtap_file_encap(in_files[i].wth);
        if (selected_frame_type != this_frame_type) {
            selected_frame_type = WTAP_ENCAP_PER_PACKET;
            break;
        }
    }
    return selected_frame_type;
}