Free the string you "g_strdup()"ed, rather than handing "g_free()" the
[obnox/wireshark/wip.git] / capture.h
index fd675769e4208bd3ad78d62d9cd5450fa0bece23..b755dc285ac6a9d15768fc2816238c99e871d816 100644 (file)
--- a/capture.h
+++ b/capture.h
@@ -1,7 +1,7 @@
 /* capture.h
  * Definitions for packet capture windows
  *
- * $Id: capture.h,v 1.2 1998/09/16 03:21:52 gerald Exp $
+ * $Id: capture.h,v 1.26 2001/04/13 14:59:28 jfoster Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 #ifndef __CAPTURE_H__
 #define __CAPTURE_H__
 
-typedef struct _loop_data {
-  gint           go;
-  gint           count;
-  gint           max;
-  gint           tcp;
-  gint           udp;
-  gint           other;
-  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 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);
+
+#endif /* HAVE_LIBPCAP */
+
+#define EMPTY_FILTER ""
 #endif /* capture.h */