summaryrefslogtreecommitdiff
path: root/capture.h
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-02-06 21:20:35 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-02-06 21:20:35 +0000
commit3a63719e389bd9fd1f27a1a467501c8d7fe3eb69 (patch)
tree0ed850112dc342fd11812f8dba14fa2cb1a08b33 /capture.h
parenta6694a746ff0ff2402e3989dfb3cf135122cf821 (diff)
downloadwireshark-3a63719e389bd9fd1f27a1a467501c8d7fe3eb69.tar.gz
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. svn path=/trunk/; revision=13320
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);