summaryrefslogtreecommitdiff
path: root/wiretap/csids.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-21 09:41:52 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-21 09:41:52 +0000
commit6cbf6ce16c45c4855ebddd3516465885e3c476d5 (patch)
tree299ce4fc08cb26cc0c0712c6b54de9c76893e7ca /wiretap/csids.c
parent0315e063e4267b97fc7716301350af07dd0f2bea (diff)
downloadwireshark-6cbf6ce16c45c4855ebddd3516465885e3c476d5.tar.gz
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/csids.c')
-rw-r--r--wiretap/csids.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/wiretap/csids.c b/wiretap/csids.c
index 542062ea15..2b5226e402 100644
--- a/wiretap/csids.c
+++ b/wiretap/csids.c
@@ -61,7 +61,7 @@ typedef struct {
} csids_t;
/* XXX - return -1 on I/O error and actually do something with 'err'. */
-int csids_open(wtap *wth, int *err, gchar **err_info _U_)
+int csids_open(wtap *wth, int *err, gchar **err_info)
{
/* There is no file header. There is only a header for each packet
* so we read a packet header and compare the caplen with iplen. They
@@ -80,7 +80,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_)
/* check the file to make sure it is a csids file. */
bytesRead = file_read( &hdr, sizeof( struct csids_header), wth->fh );
if( bytesRead != sizeof( struct csids_header) ) {
- *err = file_error( wth->fh );
+ *err = file_error( wth->fh, err_info );
if( *err != 0 ) {
return -1;
} else {
@@ -94,7 +94,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_)
hdr.caplen = pntohs( &hdr.caplen );
bytesRead = file_read( &tmp, 2, wth->fh );
if( bytesRead != 2 ) {
- *err = file_error( wth->fh );
+ *err = file_error( wth->fh, err_info );
if( *err != 0 ) {
return -1;
} else {
@@ -103,7 +103,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_)
}
bytesRead = file_read( &iplen, 2, wth->fh );
if( bytesRead != 2 ) {
- *err = file_error( wth->fh );
+ *err = file_error( wth->fh, err_info );
if( *err != 0 ) {
return -1;
} else {
@@ -151,7 +151,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_)
}
/* Find the next packet and parse it; called from wtap_read(). */
-static gboolean csids_read(wtap *wth, int *err, gchar **err_info _U_,
+static gboolean csids_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset)
{
csids_t *csids = (csids_t *)wth->priv;
@@ -163,7 +163,7 @@ static gboolean csids_read(wtap *wth, int *err, gchar **err_info _U_,
bytesRead = file_read( &hdr, sizeof( struct csids_header) , wth->fh );
if( bytesRead != sizeof( struct csids_header) ) {
- *err = file_error( wth->fh );
+ *err = file_error( wth->fh, err_info );
if (*err == 0 && bytesRead != 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
@@ -179,7 +179,7 @@ static gboolean csids_read(wtap *wth, int *err, gchar **err_info _U_,
bytesRead = file_read( buf, hdr.caplen, wth->fh );
if( bytesRead != hdr.caplen ) {
- *err = file_error( wth->fh );
+ *err = file_error( wth->fh, err_info );
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
@@ -220,7 +220,7 @@ csids_seek_read (wtap *wth,
bytesRead = file_read( &hdr, sizeof( struct csids_header), wth->random_fh );
if( bytesRead != sizeof( struct csids_header) ) {
- *err = file_error( wth->random_fh );
+ *err = file_error( wth->random_fh, err_info );
if( *err == 0 ) {
*err = WTAP_ERR_SHORT_READ;
}
@@ -238,7 +238,7 @@ csids_seek_read (wtap *wth,
bytesRead = file_read( pd, hdr.caplen, wth->random_fh );
if( bytesRead != hdr.caplen ) {
- *err = file_error( wth->random_fh );
+ *err = file_error( wth->random_fh, err_info );
if( *err == 0 ) {
*err = WTAP_ERR_SHORT_READ;
}