2 * Definitions for packet capture windows
4 * $Id: capture.h,v 1.41 2004/02/28 16:21:10 ulfl 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 num_files; /* Number of multiple buffer files */
51 gboolean has_ring_duration; /* TRUE if ring duration specified */
52 gint32 ringbuffer_duration; /* Switch file after n seconds */
53 int linktype; /* Data link type to use, or -1 for
57 extern capture_options capture_opts;
59 extern gboolean quit_after_cap; /* Makes a "capture only mode". Implies -k */
60 extern gboolean capture_child; /* if this is the child for "-S" */
62 /* Open a specified file, or create a temporary file, and start a capture
63 to the file in question. Returns TRUE if the capture starts
64 successfully, FALSE otherwise. */
65 gboolean do_capture(const char *save_file);
67 /* Do the low-level work of a capture. */
68 int capture(gboolean *stats_known, struct pcap_stat *stats);
70 /* Stop a capture from a menu item. */
71 void capture_stop(void);
73 /* Terminate the capture child cleanly when exiting. */
74 void kill_capture_child(void);
77 /* XXX: improve this macro (put something like this into epan/packet.h?) */
78 #define CAPTURE_PACKET_COUNTS sizeof(packet_counts) / sizeof (gint)
82 gpointer callback_data; /* capture callback handle */
83 gpointer ui; /* user interfaces own handle */
86 packet_counts *counts; /* protocol specific counters */
87 time_t running_time; /* running time since last update */
88 gint new_packets; /* packets since last update */
92 /* create the capture info dialog */
93 extern void capture_info_create(
96 /* Update the capture info counters in the dialog */
97 extern void capture_info_update(
100 /* destroy the capture info dialog again */
101 extern void capture_info_destroy(
102 capture_info *cinfo);
105 #endif /* HAVE_LIBPCAP */
107 #define EMPTY_FILTER ""
108 #endif /* capture.h */