diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-03-05 05:58:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-03-05 05:58:41 +0000 |
commit | e300f4db52ddfcdfbf8a53d69d88e037365cb7a3 (patch) | |
tree | edc94f3db1aa4b8d5dfc6192d153023fb32d9a0d /proto_hier_stats.c | |
parent | a7553a55864b398593c9e3c922d91ae804e0d732 (diff) |
Have "wtap_seek_read()" return 0 on success and -1 on failure, and take
an "err" argument that points to an "int" into which to put an error
code if it fails.
Check for errors in one call to it, and note that we should do so in
other places.
In the "wtap_seek_read()" call in the TCP graphing code, don't overwrite
"cfile.pseudo_header", and make the buffer into which we read the data
WTAP_MAX_PACKET_SIZE bytes, as it should be.
In some of the file readers for text files, check for errors from the
"parse the record header" and "parse the hex dump" routines when reading
sequentially.
In "csids_seek_read()", fix some calls to "file_error()" to check the
error on the random stream (that being what we're reading).
svn path=/trunk/; revision=4874
Diffstat (limited to 'proto_hier_stats.c')
-rw-r--r-- | proto_hier_stats.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/proto_hier_stats.c b/proto_hier_stats.c index 8493949d43..4153f884d8 100644 --- a/proto_hier_stats.c +++ b/proto_hier_stats.c @@ -1,7 +1,7 @@ /* proto_hier_stats.c * Routines for calculating statistics based on protocol. * - * $Id: proto_hier_stats.c,v 1.11 2002/01/21 07:36:48 guy Exp $ + * $Id: proto_hier_stats.c,v 1.12 2002/03/05 05:58:28 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -22,7 +22,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -127,14 +126,16 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps) epan_dissect_t *edt; union wtap_pseudo_header phdr; guint8 pd[WTAP_MAX_PACKET_SIZE]; + int err; /* Load the frame from the capture file */ + /* XX - do something with "err" */ wtap_seek_read(cfile.wth, frame->file_off, &phdr, - pd, frame->cap_len); + pd, frame->cap_len, &err); /* Dissect the frame */ edt = epan_dissect_new(TRUE, FALSE); - epan_dissect_run(edt, &phdr, pd, frame, cinfo); + epan_dissect_run(edt, &phdr, pd, frame, cinfo); /* Get stats from this protocol tree */ process_tree(edt->tree, ps, frame->pkt_len); |