/* file.h
* Definitions for file structures and routines
*
- * $Id: file.h,v 1.54 1999/11/25 18:02:07 gerald Exp $
+ * $Id: file.h,v 1.61 1999/12/10 04:20:53 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include "colors.h"
#endif
+#ifndef __PRINT_H__
+#include "print.h"
+#endif
+
#include <errno.h>
#ifdef HAVE_LIBZ
typedef struct bpf_program bpf_prog;
typedef struct _capture_file {
- FILE_T fh; /* Capture file */
- int filed; /* Filedes of capture file */
- gchar *filename; /* filename */
- long f_len; /* File length */
- guint16 cd_t; /* Capture data type */
- const gchar *cd_t_desc; /* Description of that data type */
+ FILE_T fh; /* File handle for 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 */
gfloat unfiltered_count; /* used for dfilter progress bar */
gchar *iface; /* Interface */
gchar *save_file; /* File that user saved capture to */
int save_file_fd; /* File descriptor for saved file */
- gint user_saved;/* Was capture file saved by user yet? */
wtap *wth; /* Wiretap session */
dfilter *rfcode; /* Compiled read filter program */
gchar *dfilter; /* Display filter string */
FILE *print_fh; /* File we're printing to */
} capture_file;
-int open_cap_file(char *, capture_file *);
-void close_cap_file(capture_file *, void *, guint);
+int open_cap_file(char *, gboolean, capture_file *);
+void close_cap_file(capture_file *, void *);
int read_cap_file(capture_file *);
-int tail_cap_file(char *, capture_file *);
+int start_tail_cap_file(char *, gboolean, capture_file *);
+int continue_tail_cap_file(capture_file *, int);
+int finish_tail_cap_file(capture_file *);
/* size_t read_frame_header(capture_file *); */
+int save_cap_file(char *, capture_file *, gboolean, guint);
int filter_packets(capture_file *cf, gchar *dfilter);
void colorize_packets(capture_file *);
int print_packets(capture_file *cf, print_args_t *print_args);
void change_time_formats(capture_file *);
gboolean find_packet(capture_file *cf, dfilter *sfcode);
-gboolean goto_frame(capture_file *cf, guint fnumber);
+
+typedef enum {
+ FOUND_FRAME, /* found the frame */
+ NO_SUCH_FRAME, /* no frame with that number */
+ FRAME_NOT_DISPLAYED /* frame with that number isn't displayed */
+} goto_result_t;
+goto_result_t goto_frame(capture_file *cf, guint fnumber);
+
void select_packet(capture_file *, int);
void unselect_packet(capture_file *);