Use "gfloat" and "gdouble", rather than "float" and "double", as the
[obnox/wireshark/wip.git] / file.h
diff --git a/file.h b/file.h
index 0aa56c23879183331d56746c87d424b43688ec82..3212096b022fd364d0afa76f3dc4d2a461effaf7 100644 (file)
--- a/file.h
+++ b/file.h
@@ -1,12 +1,11 @@
 /* file.h
  * Definitions for file structures and routines
  *
- * $Id: file.h,v 1.77 2000/10/06 10:10:48 gram Exp $
+ * $Id: file.h,v 1.92 2002/02/24 09:25:34 guy Exp $
  *
  * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
- *
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
 #endif
 
 #include "wiretap/wtap.h"
-
-#ifdef HAVE_LIBPCAP
-#include <pcap.h>
-#endif
-
-#include "dfilter.h"
-#include "gtk/colors.h"                /* XXX */
+#include <epan/dfilter/dfilter.h>
 #include "print.h"
-
 #include <errno.h>
-
-#include <epan.h>
-
-#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;
+#include <epan/epan.h>
 
 /* Current state of file. */
 typedef enum {
@@ -77,24 +53,26 @@ typedef struct _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 */
+  int          count;     /* Total number of frames */
+  int          marked_count; /* Number of marked frames */
+  gboolean     drops_known; /* TRUE if we know how many packets were dropped */
   guint32      drops;     /* Dropped packets */
   guint32      esec;      /* Elapsed seconds */
   guint32      eusec;     /* Elapsed microseconds */
-  guint32      snap;      /* Captured packet length */
+  gboolean     has_snap;  /* TRUE if maximum capture packet length is known */
+  int          snap;      /* Maximum 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 */ 
+  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 */
@@ -107,7 +85,6 @@ typedef struct _capture_file {
   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 */
   epan_dissect_t *edt; /* Protocol dissection fo rcurrently selected packet */
   FILE        *print_fh;  /* File we're printing to */
 } capture_file;
@@ -121,7 +98,7 @@ typedef enum {
 } read_status_t;
 
 int  open_cap_file(char *, gboolean, capture_file *);
-void close_cap_file(capture_file *, void *);
+void close_cap_file(capture_file *);
 read_status_t read_cap_file(capture_file *, int *);
 int  start_tail_cap_file(char *, gboolean, capture_file *);
 read_status_t continue_tail_cap_file(capture_file *, int, int *);
@@ -134,7 +111,7 @@ 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 */
@@ -146,6 +123,18 @@ goto_result_t goto_frame(capture_file *cf, guint fnumber);
 void select_packet(capture_file *, int);
 void unselect_packet(capture_file *);
 
+void unselect_field(void);
+
+/*
+ * Mark a particular frame in a particular capture.
+ */
+void mark_frame(capture_file *, frame_data *);
+
+/*
+ * Unmark a particular frame in a particular capture.
+ */
+void unmark_frame(capture_file *, frame_data *);
+
 /* Moves or copies a file. Returns 0 on failure, 1 on success */
 int file_mv(char *from, char *to);