* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __CAPTURE_OPTS_H__
#define __CAPTURE_OPTS_H__
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h> /* for gid_t */
-#endif
+#include <sys/types.h> /* for gid_t */
#include <caputils/capture_ifinfo.h>
if_info_t if_info;
gboolean selected;
gboolean hidden;
-#ifdef HAVE_EXTCAP
/* External capture cached data */
GHashTable *external_cap_args_settings;
-#endif
gchar *timestamp_type;
} interface_t;
gint dlt;
} link_row;
-#ifdef _WIN32
-#define INVALID_EXTCAP_PID INVALID_HANDLE_VALUE
-#else
-#define INVALID_EXTCAP_PID (GPid)-1
-#endif
-
typedef struct interface_options_tag {
- gchar *name; /* the name of the interface provided to winpcap/libpcap to specify the interface */
- gchar *descr;
- gchar *console_display_name; /* the name displayed in the console, also the basis for autonamed pcap filenames */
+ gchar *name; /* the name of the interface supplied to libpcap/WinPcap/Npcap to specify the interface */
+ gchar *descr; /* a more user-friendly description of the interface; may be NULL if none */
+ gchar *display_name; /* the name displayed in the console and title bar */
gchar *cfilter;
gboolean has_snaplen;
int snaplen;
int linktype;
gboolean promisc_mode;
interface_type if_type;
-#ifdef HAVE_EXTCAP
gchar *extcap;
gchar *extcap_fifo;
GHashTable *extcap_args;
- GPid extcap_pid; /* pid of running process or INVALID_EXTCAP_PID */
- gpointer extcap_userdata;
+ GPid extcap_pid; /* pid of running process or WS_INVALID_PID */
+ gpointer extcap_pipedata;
guint extcap_child_watch;
#ifdef _WIN32
HANDLE extcap_pipe_h;
#endif
gchar *extcap_control_in;
gchar *extcap_control_out;
-#endif
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
int buffer_size;
#endif
/* GUI related */
gboolean real_time_mode; /**< Update list of packets in real time */
- gboolean show_info; /**< show the info dialog. GTK+ only. */
+ gboolean show_info; /**< show the info dialog. */
gboolean restart; /**< restart after closing is done */
gchar *orig_save_file; /**< the original capture file name (saved for a restart) */
gboolean multi_files_on; /**< TRUE if ring buffer in use */
gboolean has_file_duration; /**< TRUE if ring duration specified */
- gint32 file_duration; /**< Switch file after n seconds */
+ gdouble file_duration; /**< Switch file after n seconds */
gboolean has_file_interval; /**< TRUE if ring interval specified */
gint32 file_interval; /**< Create time intervals of n seconds */
+ gboolean has_file_packets; /**< TRUE if ring packet count is
+ specified */
+ int file_packets; /**< Switch file after n packets */
gboolean has_ring_num_files; /**< TRUE if ring num_files specified */
guint32 ring_num_files; /**< Number of multiple buffer files */
/* autostop conditions */
gboolean has_autostop_files; /**< TRUE if maximum number of capture files
are specified */
- gint32 autostop_files; /**< Maximum number of capture files */
+ int autostop_files; /**< Maximum number of capture files */
gboolean has_autostop_packets; /**< TRUE if maximum packet count is
specified */
int autostop_packets; /**< Maximum packet count */
gboolean has_autostop_filesize; /**< TRUE if maximum capture file size
is specified */
- guint32 autostop_filesize; /**< Maximum capture file size */
+ guint32 autostop_filesize; /**< Maximum capture file size in kB */
gboolean has_autostop_duration; /**< TRUE if maximum capture duration
is specified */
- gint32 autostop_duration; /**< Maximum capture duration */
+ gdouble autostop_duration; /**< Maximum capture duration */
gchar *capture_comment; /** capture comment to write to the
output file */