aboutsummaryrefslogtreecommitdiffstats
path: root/capture.h
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-02-06 21:20:35 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-02-06 21:20:35 +0000
commit96fabeeccd641f39fd111449dfcae39911179510 (patch)
tree0ed850112dc342fd11812f8dba14fa2cb1a08b33 /capture.h
parent52cf3bd14b0efec832eed195520e6e83f9fd292d (diff)
another two steps towards privilege seperation:
move another two capture related fields (iface and cfilter) from cfile to capture_opts also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13320 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture.h')
-rw-r--r--capture.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/capture.h b/capture.h
index fb847104e8..21aa8cedda 100644
--- a/capture.h
+++ b/capture.h
@@ -38,6 +38,9 @@
typedef struct capture_options_tag {
/* general */
void *cf; /**< handle to cfile (note: untyped handle) */
+ gchar *cfilter; /**< Capture filter string */
+ gchar *iface; /**< the network interface to capture from */
+
#ifdef _WIN32
int buffer_size; /**< the capture buffer size (MB) */
#endif
@@ -48,7 +51,7 @@ typedef struct capture_options_tag {
int linktype; /**< Data link type to use, or -1 for
"use default" */
gboolean capture_child; /**< True if this is the child for "-S" */
- gchar *save_file; /**< File the capture was saved in */
+ gchar *save_file; /**< the capture file name */
int save_file_fd; /**< File descriptor for saved file */
/* GUI related */
@@ -89,15 +92,17 @@ typedef struct capture_options_tag {
extern void
capture_opts_init(capture_options *capture_opts, void *cfile);
+extern void
+capture_opt_add(capture_options *capture_opts, int opt, const char *optarg, gboolean *start_capture);
+
/**
* Open a specified file, or create a temporary file, and start a capture
* to the file in question.
*
* @param capture_opts the numerous capture options
- * @param save_file the name of the capture file, or NULL for a temporary file
* @return TRUE if the capture starts successfully, FALSE otherwise.
*/
-extern gboolean do_capture(capture_options *capture_opts, const char *save_file);
+extern gboolean do_capture(capture_options *capture_opts);
/** Do the low-level work of a capture (start the capture child). */
extern int capture_start(capture_options *capture_opts, gboolean *stats_known, struct pcap_stat *stats);