diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-04-21 09:41:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-04-21 09:41:52 +0000 |
commit | 6cbf6ce16c45c4855ebddd3516465885e3c476d5 (patch) | |
tree | 299ce4fc08cb26cc0c0712c6b54de9c76893e7ca /wiretap/ipfix.c | |
parent | 0315e063e4267b97fc7716301350af07dd0f2bea (diff) |
Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code. Have it also supply a err_info string, and
report it. Have file_error() supply an err_info string.
Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to
suggest a decompression error - into the rawshark and tshark errors,
along the lines of what other programs print.
Fix a case in the Netscaler code where we weren't fetching the error
code on a read failure.
svn path=/trunk/; revision=36748
Diffstat (limited to 'wiretap/ipfix.c')
-rw-r--r-- | wiretap/ipfix.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wiretap/ipfix.c b/wiretap/ipfix.c index 2d586f8bb1..b7009de4b5 100644 --- a/wiretap/ipfix.c +++ b/wiretap/ipfix.c @@ -128,7 +128,7 @@ typedef struct ipfix_set_header_s { static gboolean ipfix_read_message_header(ipfix_message_header_t *pfx_hdr, FILE_T fh, int *err, gchar **err_info) { - wtap_file_read_expected_bytes(pfx_hdr, IPFIX_MSG_HDR_SIZE, fh, err); /* macro which does a return if read fails */ + wtap_file_read_expected_bytes(pfx_hdr, IPFIX_MSG_HDR_SIZE, fh, err, err_info); /* macro which does a return if read fails */ /* fix endianess, because IPFIX files are always big-endian */ pfx_hdr->version = g_ntohs(pfx_hdr->version); @@ -218,7 +218,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info) /* check each Set in IPFIX Message for sanity */ while (checked_len < msg_hdr.message_length) { - wtap_file_read_expected_bytes(&set_hdr, IPFIX_SET_HDR_SIZE, wth->fh, err); + wtap_file_read_expected_bytes(&set_hdr, IPFIX_SET_HDR_SIZE, wth->fh, err, err_info); set_hdr.set_length = g_ntohs(set_hdr.set_length); if ((set_hdr.set_length < IPFIX_SET_HDR_SIZE) || ((set_hdr.set_length + checked_len) > msg_hdr.message_length)) { @@ -273,7 +273,7 @@ ipfix_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset) buffer_assure_space(wth->frame_buffer, msg_hdr.message_length); wtap_file_read_expected_bytes(buffer_start_ptr(wth->frame_buffer), - msg_hdr.message_length, wth->fh, err); + msg_hdr.message_length, wth->fh, err, err_info); wth->phdr.len = msg_hdr.message_length; wth->phdr.caplen = msg_hdr.message_length; @@ -320,7 +320,7 @@ ipfix_seek_read(wtap *wth, gint64 seek_off, return FALSE; } - wtap_file_read_expected_bytes(pd, length, wth->random_fh, err); + wtap_file_read_expected_bytes(pd, length, wth->random_fh, err, err_info); return TRUE; } |