witness: FIX for tvb_get_unicode_string -> tvb_get_string_enc
[metze/wireshark/wip.git] / capture_opts.h
index df8c622794e5f8ee17e92896b858f50123b694cd..06e81698992967e0d3b67801390f8bf2ca87d9dd 100644 (file)
 extern "C" {
 #endif /* __cplusplus */
 
+/* Attention:
+   for tshark, we're using a leading - in the optstring to prevent getopt()
+   from permuting the argv[] entries, in this case, unknown argv[] entries
+   will be returned as parameters to a dummy-option 1
+   in short: we must not use 1 here */
+
+/* this does not clash with tshark's -2 option which returns '2' */
+#define LONGOPT_NUM_CAP_COMMENT 2
+
+
 #ifdef HAVE_PCAP_REMOTE
 /* Type of capture source */
 typedef enum {
@@ -165,7 +175,26 @@ typedef struct capture_options_tag {
                                          Currently only used by dumpcap. */
     GArray   *all_ifaces;
     guint    num_selected;
+
+    /*
+     * Options to be applied to all interfaces.
+     *
+     * Some of these can be set from the GUI, others can't; setting
+     * the link-layer header type, for example, doesn't necessarily
+     * make sense, as different interfaces may support different sets
+     * of link-layer header types.
+     *
+     * Some that can't be set from the GUI can be set from the command
+     * line, by specifying them before any interface is specified.
+     * This includes the link-layer header type, so if somebody asks
+     * for a link-layer header type that an interface on which they're
+     * capturing doesn't support, we should report an error and fail
+     * to capture.
+     *
+     * These can be overridden per-interface.
+     */
     interface_options default_options;
+
     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 */
@@ -176,6 +205,7 @@ typedef struct capture_options_tag {
     gboolean show_info;             /**< show the info dialog */
     gboolean quit_after_cap;        /**< Makes a "capture only mode". Implies -k */
     gboolean restart;               /**< restart after closing is done */
+    gchar    *orig_save_file;       /**< the original capture file name (saved for a restart) */
 
     /* multiple files (and ringbuffer) */
     gboolean multi_files_on;        /**< TRUE if ring buffer in use */
@@ -195,17 +225,17 @@ typedef struct capture_options_tag {
     int autostop_packets;           /**< Maximum packet count */
     gboolean has_autostop_filesize; /**< TRUE if maximum capture file size
                                          is specified */
-    gint32 autostop_filesize;       /**< Maximum capture file size */
+    guint32 autostop_filesize;      /**< Maximum capture file size */
     gboolean has_autostop_duration; /**< TRUE if maximum capture duration
                                          is specified */
     gint32 autostop_duration;       /**< Maximum capture duration */
 
     gchar *capture_comment;         /** capture comment to write to the
                                         output file */
+
     /* internally used (don't touch from outside) */
     gboolean output_to_pipe;        /**< save_file is a pipe (named or stdout) */
-       gboolean capture_child;         /**< hidden option: Wireshark child mode */
+    gboolean capture_child;         /**< hidden option: Wireshark child mode */
 } capture_options;
 
 /* initialize the capture_options with some reasonable values */