From W. Borgert:
[obnox/wireshark/wip.git] / capture.h
1 /* capture.h
2  * Definitions for packet capture windows
3  *
4  * $Id$
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
8  * Copyright 1998 Gerald Combs
9  *
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.
14  *
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.
19  *
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.
23  */
24
25 /* This file should only be included if libpcap is present */
26
27 #ifndef __CAPTURE_H__
28 #define __CAPTURE_H__
29
30 /** @file
31  *  Capture related things.
32  */
33
34 #include "capture_opts.h"
35
36 /** 
37  * Start a capture session.
38  *
39  * @param capture_opts the numerous capture options
40  * @return TRUE if the capture starts successfully, FALSE otherwise.
41  */
42 extern gboolean capture_start(capture_options *capture_opts);
43
44 /** Stop a capture session (usually from a menu item). */
45 extern void capture_stop(capture_options *capture_opts);
46
47 /** Restart the current captured packets and start again. */
48 extern void capture_restart(capture_options *capture_opts);
49
50 /** Terminate the capture child cleanly when exiting. */
51 extern void capture_kill_child(capture_options *capture_opts);
52
53 /**
54  * Capture child told us we have a new (or the first) capture file.
55  */
56 extern gboolean capture_input_new_file(capture_options *capture_opts, gchar *new_file);
57
58 /**
59  * Capture child told us we have new packets to read.
60  */
61 extern void capture_input_new_packets(capture_options *capture_opts, int to_read);
62
63 /**
64  * Capture child told us how many dropped packets it counted.
65  */
66 extern void capture_input_drops(capture_options *capture_opts, int dropped);
67
68 /**
69  * Capture child told us that an error has occurred while starting the capture.
70  */
71 extern void capture_input_error_message(capture_options *capture_opts, char *error_message, char *secondary_error_msg);
72
73 /**
74  * Capture child told us that an error has occurred while parsing a
75  * capture filter when starting/running the capture.
76  */
77 extern void capture_input_cfilter_error_message(capture_options *capture_opts, char *error_message);
78
79 /**
80  * Capture child closed its side of the pipe, do the required cleanup.
81  */
82 extern void capture_input_closed(capture_options *capture_opts);
83
84
85 #endif /* capture.h */