-#ifdef HAVE_LIBZ
-#include "zlib.h"
-#define FILE_T gzFile
-#define file_open gzopen
-#define filed_open gzdopen
-#define file_close gzclose
-#else /* No zLib */
-#define FILE_T FILE *
-#define file_open fopen
-#define filed_open fdopen
-#define file_close fclose
-#endif /* HAVE_LIBZ */
-
-typedef struct bpf_program bpf_prog;
-
-/* Current state of file. */
-typedef enum {
- FILE_CLOSED, /* No file open */
- FILE_READ_IN_PROGRESS, /* Reading a file we've opened */
- FILE_READ_ABORTED, /* Read aborted by user */
- FILE_READ_DONE /* Read completed */
-} file_state;
-
-typedef struct _capture_file {
- file_state state; /* Current state of capture file */
- int filed; /* File descriptor of capture file */
- gchar *filename; /* Name of capture file */
- gboolean is_tempfile; /* Is capture file a temporary file? */
- gboolean user_saved;/* If capture file is temporary, has it been saved by user yet? */
- long f_len; /* Length of capture file */
- guint16 cd_t; /* File type of capture file */
- int lnk_t; /* Link-layer type with which to save capture */
- guint32 vers; /* Version. For tcpdump minor is appended to major */
- guint32 count; /* Packet count */
- guint32 drops; /* Dropped packets */
- guint32 esec; /* Elapsed seconds */
- guint32 eusec; /* Elapsed microseconds */
- guint32 snap; /* Captured packet length */
- long progbar_quantum; /* Number of bytes read per progress bar update */
- long progbar_nextstep; /* Next point at which to update progress bar */
- gchar *iface; /* Interface */
- gchar *save_file; /* File that user saved capture to */
- int save_file_fd; /* File descriptor for saved file */
- wtap *wth; /* Wiretap session */
- dfilter *rfcode; /* Compiled read filter program */
- gchar *dfilter; /* Display filter string */
- colfilter *colors; /* Colors for colorizing packet window */
- dfilter *dfcode; /* Compiled display filter program */
-#ifdef HAVE_LIBPCAP
- gchar *cfilter; /* Capture filter string */
- bpf_prog fcode; /* Compiled capture filter program */
-#endif
- gchar *sfilter; /* Search filter string */
- gboolean sbackward; /* TRUE if search is backward, FALSE if forward */
- union wtap_pseudo_header pseudo_header; /* Packet pseudo_header */
- guint8 pd[WTAP_MAX_PACKET_SIZE]; /* Packet data */
- GMemChunk *plist_chunk; /* Memory chunk for frame_data structures */
- frame_data *plist; /* Packet list */
- frame_data *plist_end; /* Last packet in list */
- frame_data *first_displayed; /* First frame displayed */
- frame_data *last_displayed; /* Last frame displayed */
- column_info cinfo; /* Column formatting information */
- frame_data *current_frame; /* Frame data for current frame */
- proto_tree *protocol_tree; /* Protocol tree for currently selected packet */
- FILE *print_fh; /* File we're printing to */
-} capture_file;
-
-/* Return values from "read_cap_file()", "continue_tail_cap_file()",
- and "finish_tail_cap_file()". */