"autostop_filesize" and "autostop_duration" don't need to be in the
[obnox/wireshark/wip.git] / capture.h
index 747948c3bd21ed9f9aabd9ead76a8663b7ff45bb..d3eb6e853c550529f855440f2b1521060f754309 100644 (file)
--- a/capture.h
+++ b/capture.h
@@ -1,7 +1,7 @@
 /* capture.h
  * Definitions for packet capture windows
  *
- * $Id: capture.h,v 1.4 1999/02/09 00:35:35 guy Exp $
+ * $Id: capture.h,v 1.30 2002/02/24 03:33:04 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 #ifndef __CAPTURE_H__
 #define __CAPTURE_H__
 
-typedef struct _loop_data {
-  gint           go;
-  gint           max;
-  gint           linktype;
-  packet_counts  counts;
-  pcap_dumper_t *pdh;
-} loop_data;
-
-GList *get_interface_list();
-void   capture_prep_cb(GtkWidget *, gpointer);
-void   capture_prep_file_cb(GtkWidget *, gpointer);
-void   cap_prep_fs_ok_cb(GtkWidget *, gpointer);
-void   cap_prep_fs_cancel_cb(GtkWidget *, gpointer);
-void   capture_prep_ok_cb(GtkWidget *, gpointer);
-void   capture_prep_close_cb(GtkWidget *, gpointer);
-void   capture(gint);
-float  pct(gint, gint);
-void   capture_stop_cb(GtkWidget *, gpointer);
-void   capture_pcap_cb(u_char *, const struct pcap_pkthdr *, const u_char *);
+#ifdef HAVE_LIBPCAP
 
+/* Name we give to the child process when doing a "-S" capture. */
+#define        CHILD_NAME      "ethereal-capture"
+
+extern gboolean has_snaplen;  /* TRUE if maximum capture packet length is specified */
+extern int snaplen; /* Maximum captured packet length */
+extern int promisc_mode; /* capture in promiscuous mode */
+extern int sync_mode;  /* fork a child to do the capture, and sync between them */
+extern gboolean has_autostop_count;
+extern int autostop_count;
+extern gboolean has_autostop_filesize; /* TRUE if maximum capture file size is specified */
+extern gint32 autostop_filesize; /* Maximum capture file size */
+extern gboolean has_autostop_duration; /* TRUE if maximum capture duration is specified */
+extern gint32 autostop_duration; /* Maximum capture duration */
+
+extern int sync_pipe[2]; /* used to sync father */
+extern int quit_after_cap; /* Makes a "capture only mode". Implies -k */
+extern gboolean capture_child; /* if this is the child for "-S" */
+
+/* Open a specified file, or create a temporary file, and start a capture
+   to the file in question. */
+void   do_capture(char *capfile_name);
+
+/* Do the low-level work of a capture. */
+int    capture(gboolean *stats_known, struct pcap_stat *stats);
+
+/* Stop a capture from a menu item. */
+void   capture_stop(void);
+
+/* Terminate the capture child cleanly when exiting. */
+void   kill_capture_child(void);
+
+#endif /* HAVE_LIBPCAP */
+
+#define EMPTY_FILTER ""
 #endif /* capture.h */