diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-08-11 07:28:12 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-08-11 07:28:12 +0000 |
commit | 4df46758e3ca576a7a52571edc9425b307d946df (patch) | |
tree | 20f2f854a92802eab45991beb88fadc296148a59 /wiretap/wtap-int.h | |
parent | fa7f38180a79328d875ddadca9d0758ff0e8f2e8 (diff) | |
download | wireshark-4df46758e3ca576a7a52571edc9425b307d946df.tar.gz wireshark-4df46758e3ca576a7a52571edc9425b307d946df.tar.bz2 wireshark-4df46758e3ca576a7a52571edc9425b307d946df.zip |
If we have a random stream open for a compressed Sniffer file, have the
sequential pass through the file build a list of information about the
compressed blobs, with the starting offset in the compressed file and in
the uncompressed byte stream for each blob.
When seeking on the random stream, check whether the target location is
within the uncompressed buffer we currently have; if not, use that list
to figure out which blob contains the target location, and read that
blob into the buffer. Then, as we now know that the target location is
within the uncompressed buffer we currently have, just move the current
pointer into that buffer to the target location.
This means we don't have to read forwards through any uninteresting
blobs in order to seek forwards, and don't have to go all the way back
to the beginning and seek forwards in order to seek backwards.
svn path=/trunk/; revision=2251
Diffstat (limited to 'wiretap/wtap-int.h')
-rw-r--r-- | wiretap/wtap-int.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h index 6eae87b903..e0f04de195 100644 --- a/wiretap/wtap-int.h +++ b/wiretap/wtap-int.h @@ -1,6 +1,6 @@ /* wtap-int.h * - * $Id: wtap-int.h,v 1.4 2000/08/08 22:16:42 mhall Exp $ + * $Id: wtap-int.h,v 1.5 2000/08/11 07:28:12 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -49,10 +49,11 @@ /* Information for a compressed Sniffer data stream. */ typedef struct { - unsigned char *file_outbuf; - unsigned char *nextout; - size_t outbuf_nbytes; - long offset; + unsigned char *buf; /* buffer into which we uncompress data */ + size_t nbytes; /* number of bytes of data in that buffer */ + int nextout; /* offset in that buffer of stream's current position */ + long comp_offset; /* current offset in compressed data stream */ + long uncomp_offset; /* current offset in uncompressed data stream */ } ngsniffer_comp_stream_t; typedef struct { @@ -61,7 +62,9 @@ typedef struct { int is_atm; ngsniffer_comp_stream_t seq; /* sequential access */ ngsniffer_comp_stream_t rand; /* random access */ - long data_offset; /* start of possibly-compressed stuff */ + GList *first_blob; /* list element for first blob */ + GList *last_blob; /* list element for last blob */ + GList *current_blob; /* list element for current blob */ } ngsniffer_t; typedef struct { |