2 * Definitions for packet capture windows
4 * $Id: capture.h,v 1.36 2003/09/15 23:15:31 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 /* Name we give to the child process when doing a "-S" capture. */
31 #define CHILD_NAME "ethereal-capture"
34 gboolean has_snaplen; /* TRUE if maximum capture packet
35 length is specified */
36 int snaplen; /* Maximum captured packet length */
37 int promisc_mode; /* Capture in promiscuous mode */
38 int sync_mode; /* Fork a child to do the capture,
39 and sync between them */
40 gboolean has_autostop_count; /* TRUE if maximum packet count is
42 int autostop_count; /* Maximum packet count */
43 gboolean has_autostop_duration; /* TRUE if maximum capture duration
45 gint32 autostop_duration; /* Maximum capture duration */
46 gboolean has_autostop_filesize; /* TRUE if maximum capture file size
48 gint32 autostop_filesize; /* Maximum capture file size */
49 gboolean ringbuffer_on; /* TRUE if ring buffer in use */
50 guint32 ringbuffer_num_files; /* Number of ring buffer files */
51 gboolean has_ring_duration; /* TRUE if ring duration specified */
52 gint32 ringbuffer_duration; /* Switch file after n seconds */
55 extern capture_options capture_opts;
57 extern int quit_after_cap; /* Makes a "capture only mode". Implies -k */
58 extern gboolean capture_child; /* if this is the child for "-S" */
60 /* Open a specified file, or create a temporary file, and start a capture
61 to the file in question. Returns TRUE if the capture starts
62 successfully, FALSE otherwise. */
63 gboolean do_capture(const char *save_file);
65 /* Do the low-level work of a capture. */
66 int capture(gboolean *stats_known, struct pcap_stat *stats);
68 /* Stop a capture from a menu item. */
69 void capture_stop(void);
71 /* Terminate the capture child cleanly when exiting. */
72 void kill_capture_child(void);
74 #endif /* HAVE_LIBPCAP */
76 #define EMPTY_FILTER ""
77 #endif /* capture.h */