Added two new arguments to epan_init() and proto_init() to
[obnox/wireshark/wip.git] / file.h
diff --git a/file.h b/file.h
index 72b6c87bd26fd93536d751f6ba3dab946610445e..a71c7e556a2e3ee449c8033034a2d24d11ddf243 100644 (file)
--- a/file.h
+++ b/file.h
@@ -1,7 +1,7 @@
 /* file.h
  * Definitions for file structures and routines
  *
- * $Id: file.h,v 1.71 2000/07/09 03:29:27 guy Exp $
+ * $Id: file.h,v 1.81 2001/02/11 09:28:15 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 #include <sys/types.h>
 #endif
 
-#ifndef __WTAP_H__
 #include "wiretap/wtap.h"
-#endif
-
-#ifdef HAVE_LIBPCAP
-#ifndef lib_pcap_h
-#include <pcap.h>
-#endif
-#endif
-
-#ifndef __DFILTER_H__
-#include "dfilter.h"
-#endif
-
-#ifndef __COLORS_H__
-#include "gtk/colors.h"                /* XXX */
-#endif
-
-#ifndef __PRINT_H__
+#include "dfilter/dfilter.h"
 #include "print.h"
-#endif
-
 #include <errno.h>
+#include <epan.h>
 
 #ifdef HAVE_LIBZ
 #include "zlib.h"
@@ -67,8 +49,6 @@
 #define file_close fclose
 #endif /* HAVE_LIBZ */
 
-typedef struct bpf_program bpf_prog;
-
 /* Current state of file. */
 typedef enum {
        FILE_CLOSED,            /* No file open */
@@ -88,6 +68,7 @@ typedef struct _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 */
+  gboolean     drops_known; /* TRUE if we know how many packets were dropped */
   guint32      drops;     /* Dropped packets */
   guint32      esec;      /* Elapsed seconds */
   guint32      eusec;     /* Elapsed microseconds */
@@ -98,13 +79,12 @@ typedef struct _capture_file {
   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 */ 
+  dfilter_t   *rfcode;    /* Compiled read filter program */ 
   gchar       *dfilter;   /* Display filter string */
-  colfilter   *colors;   /* Colors for colorizing packet window */
-  dfilter     *dfcode;    /* Compiled display filter program */ 
+  struct _colfilter   *colors;   /* Colors for colorizing packet window */
+  dfilter_t   *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 */
@@ -118,6 +98,7 @@ typedef struct _capture_file {
   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 */
+  epan_dissect_t *edt; /* Protocol dissection fo rcurrently selected packet */
   FILE        *print_fh;  /* File we're printing to */
 } capture_file;
 
@@ -136,14 +117,14 @@ int  start_tail_cap_file(char *, gboolean, capture_file *);
 read_status_t continue_tail_cap_file(capture_file *, int, int *);
 read_status_t finish_tail_cap_file(capture_file *, int *);
 /* size_t read_frame_header(capture_file *); */
-int  save_cap_file(char *, capture_file *, gboolean, guint);
+int  save_cap_file(char *, capture_file *, gboolean, gboolean, guint);
 
 int filter_packets(capture_file *cf, gchar *dfilter);
 void colorize_packets(capture_file *);
 void redissect_packets(capture_file *cf);
 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 find_packet(capture_file *cf, dfilter_t *sfcode);
 
 typedef enum {
   FOUND_FRAME,         /* found the frame */
@@ -161,7 +142,7 @@ int file_mv(char *from, char *to);
 /* Copies a file. Returns 0 on failure, 1 on success */
 int file_cp(char *from, char *to);
 
-char *file_open_error_message(int, int);
+char *file_open_error_message(int, gboolean);
 char *file_read_error_message(int);
 char *file_write_error_message(int);