aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.h
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2011-05-12 16:54:16 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2011-05-12 16:54:16 +0000
commit2d6cd58f91af63a45eaaaddc648af3078e1a833f (patch)
treef6d4cdc0242a4cc3f6e964fdbbb523c18026f3b4 /capture_opts.h
parent12d8f46860af35b9ff708ad9d3bffbaa02c6b0d2 (diff)
Add support for handling multiple interfaces as command line
parameters. An array of interface specific data is handled in addition to the current way. This change should not have any effect right now, it will be used by dumpcap when supporting multiple interfaces (and tshark/wireshark... in the future). svn path=/trunk/; revision=37082
Diffstat (limited to 'capture_opts.h')
-rw-r--r--capture_opts.h53
1 files changed, 45 insertions, 8 deletions
diff --git a/capture_opts.h b/capture_opts.h
index 9cd688c32e..a6b980e0a2 100644
--- a/capture_opts.h
+++ b/capture_opts.h
@@ -73,21 +73,46 @@ typedef enum {
} capture_sampling;
#endif
+typedef struct interface_options_tag {
+ gchar *name;
+ gchar *descr;
+ gchar *cfilter;
+ int snaplen;
+ int linktype;
+ gboolean promisc_mode;
+#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
+ int buffer_size;
+#endif
+ gboolean monitor_mode;
+} interface_options;
+
/** Capture options coming from user interface */
typedef struct capture_options_tag {
/* general */
void *cf; /**< handle to cfile (note: untyped handle) */
gboolean has_cfilter; /**< TRUE if capture filter specified on command line */
- gchar *cfilter; /**< Capture filter string */
- gchar *iface; /**< the network interface to capture from */
+ gchar *cfilter; /**< Capture filter string
+ *< XXX: Can finally be be removed.
+ *< Replaced by interface_options.cfilter */
+ gchar *iface; /**< the network interface to capture from
+ *< XXX: Can finally be be removed.
+ *< Replaced by interface_options.name */
gchar *iface_descr; /**< A human readable description of iface.
*< NOTE: capture_opts.c is not able to
*< set this field because doing so
*< requires too many dependencies.
*< Readers of this field should use
*< get_iface_description() from
- *< "capture_ui_utils.h" to access it. */
+ *< "capture_ui_utils.h" to access it.
+ *< XXX: Can finally be be removed.
+ *< Replaced by interface_options.descr */
+ GArray *ifaces; /**< array of interfaces.
+ Currently only used by dumpcap. */
+ gint number_of_ifaces; /**< Curently only used by dumpcap. */
+ interface_options default_options;
#ifdef HAVE_PCAP_REMOTE
+ /**< XXX: Should this whole block moved to
+ *< interface_options ?*/
capture_source src_type; /**< Capturing on remote interface */
gchar *remote_host; /**< Host name or network address
*< for remote capturing */
@@ -102,19 +127,31 @@ typedef struct capture_options_tag {
gboolean nocap_local; /**< TODO: Whether to capture local traffic */
#endif
#ifdef HAVE_PCAP_SETSAMPLING
+ /**< XXX: Should this whole block moved to
+ *< interface_options ?*/
capture_sampling sampling_method; /**< PCAP packet sampling method */
int sampling_param; /**< PCAP packet sampling parameter */
#endif
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
- int buffer_size; /**< the capture buffer size (MB) */
+ int buffer_size; /**< the capture buffer size (MB)
+ *< XXX: Can finally be be removed.
+ *< Replaced by interface_options.buffer_size */
#endif
gboolean has_snaplen; /**< TRUE if maximum capture packet length
is specified */
- int snaplen; /**< Maximum captured packet length */
- gboolean promisc_mode; /**< Capture in promiscuous mode */
+ int snaplen; /**< Maximum captured packet length
+ *< XXX: Can finally be be removed.
+ *< Replaced by interface_options.snaplen */
+ gboolean promisc_mode; /**< Capture in promiscuous mode
+ *< XXX: Can finally be be removed.
+ *< Replaced by interface_options.promisc_mode */
int linktype; /**< Data link type to use, or -1 for
- "use default" */
- gboolean monitor_mode; /**< Capture in monitor mode, if available */
+ "use default"
+ *< XXX: Can finally be be removed.
+ *< Replaced by interface_options.linktype */
+ gboolean monitor_mode; /**< Capture in monitor mode, if available
+ *< XXX: Can finally be be removed.
+ *< Replaced by interface_options.monitor_mode */
gboolean saving_to_file; /**< TRUE if capture is writing to a file */
gchar *save_file; /**< the capture file name */
gboolean group_read_access; /**< TRUE is group read permission needs to be set */