From 2929c93ea276766076aed8bf617befba65d32eb4 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 19 Nov 2011 20:18:01 +0000 Subject: When reporting "sorry, *this* packet can't be written to a file of that type" when writing out a capture file (i.e., writing a per-packet-encapsulation capture to a file type that supports it but doesn't support one of the packet's encapsulations), report the packet number and, when doing this in a merge operation, report the file from which it came. When reporting "sorry, that file can't be written to a file of that type, period", show the file type rather than the input file link-layer type that causes the problem. (We could show both. We could be *really* ambitious and iterate through all possible file types and show the ones that will or at least might work....) file_write_error_message() is documented as handling only UNIX-style errnos, and libwireshark should be usable without libwiretap, so leave it up to its callers to handle Wiretap errors such as WTAP_ERR_SHORT_WRITE. Clean up indentation. svn path=/trunk/; revision=39949 --- merge.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'merge.h') diff --git a/merge.h b/merge.h index 2a0a1bbd9a..afa28bdedf 100644 --- a/merge.h +++ b/merge.h @@ -44,6 +44,7 @@ typedef struct merge_in_file_s { wtap *wth; gint64 data_offset; in_file_state_e state; + guint32 packet_num; /* current packet number */ gint64 size; /* file size */ } merge_in_file_t; @@ -95,10 +96,10 @@ merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]); * @param in_files input file array * @param err wiretap error, if failed * @param err_info wiretap error string, if failed - * @return pointer to wtap for file from which that packet came, or NULL on - * error or EOF + * @return pointer to merge_in_file_t for file from which that packet + * came, or NULL on error or EOF */ -extern wtap * +extern merge_in_file_t * merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err, gchar **err_info); @@ -110,10 +111,10 @@ merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err, * @param in_files input file array * @param err wiretap error, if failed * @param err_info wiretap error string, if failed - * @return pointer to wtap for file from which that packet came, or NULL on - * error or EOF + * @return pointer to merge_in_file_t for file from which that packet + * came, or NULL on error or EOF */ -extern wtap * +extern merge_in_file_t * merge_append_read_packet(int in_file_count, merge_in_file_t in_files[], int *err, gchar **err_info); -- cgit v1.2.3