aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-04-13 12:35:02 -0700
committerGuy Harris <gharris@sonic.net>2021-04-13 12:38:06 -0700
commit60e339bba4926cd3d299b142896a1d475d81e00d (patch)
tree377fd32095877343b142a0ca9d0eb9dd5ea6050c /tshark.c
parent6ab7435af8ed5f01ce6aaa903aee6ac2ecb06119 (diff)
Don't handle -k in capture_opts_add_opt().
It's not a generic capture option also supported by TShark and dumpcap, it's Wireshark-specific (dumpcap *always* starts a capture, and TShark starts one iff it's passed one or more interfaces on which to capture; only Wireshark needs it to start the capture immediately - that's a relic of the days when Wireshark *itself* did what dumpcap now does for Wireshark). Handle it in commandline_other_options(), rather than in capture_opts_add_opt(). That lets us get rid of an argument to capture_opts_add_opt(), and dummy variables in TShark and dumpcap used to work with that extra argument.
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tshark.c b/tshark.c
index 67822e6743..add186c6de 100644
--- a/tshark.c
+++ b/tshark.c
@@ -738,7 +738,6 @@ main(int argc, char *argv[])
volatile int exit_status = EXIT_SUCCESS;
#ifdef HAVE_LIBPCAP
int caps_queries = 0;
- gboolean start_capture = FALSE;
GList *if_list;
gchar *err_str, *err_str_secondary;
struct bpf_program fcode;
@@ -1147,7 +1146,7 @@ main(int argc, char *argv[])
case LONGOPT_COMPRESS_TYPE: /* compress type */
/* These are options only for packet capture. */
#ifdef HAVE_LIBPCAP
- exit_status = capture_opts_add_opt(&global_capture_opts, opt, optarg, &start_capture);
+ exit_status = capture_opts_add_opt(&global_capture_opts, opt, optarg);
if (exit_status != 0) {
goto clean_exit;
}
@@ -1158,7 +1157,7 @@ main(int argc, char *argv[])
break;
case 'c': /* Stop after x packets */
#ifdef HAVE_LIBPCAP
- exit_status = capture_opts_add_opt(&global_capture_opts, opt, optarg, &start_capture);
+ exit_status = capture_opts_add_opt(&global_capture_opts, opt, optarg);
if (exit_status != 0) {
goto clean_exit;
}
@@ -1169,7 +1168,7 @@ main(int argc, char *argv[])
case 'w': /* Write to file x */
output_file_name = g_strdup(optarg);
#ifdef HAVE_LIBPCAP
- exit_status = capture_opts_add_opt(&global_capture_opts, opt, optarg, &start_capture);
+ exit_status = capture_opts_add_opt(&global_capture_opts, opt, optarg);
if (exit_status != 0) {
goto clean_exit;
}