diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-11-19 20:18:01 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-11-19 20:18:01 +0000 |
commit | 2929c93ea276766076aed8bf617befba65d32eb4 (patch) | |
tree | 23f6e64eaa570e79fd24e3dd413e77eed56f9737 /merge.h | |
parent | 4b2aa811e14412e3731714e4e54c344e967173c1 (diff) | |
download | wireshark-2929c93ea276766076aed8bf617befba65d32eb4.tar.gz wireshark-2929c93ea276766076aed8bf617befba65d32eb4.tar.bz2 wireshark-2929c93ea276766076aed8bf617befba65d32eb4.zip |
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
Diffstat (limited to 'merge.h')
-rw-r--r-- | merge.h | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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); |