aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2011-06-27 00:09:03 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2011-06-27 00:09:03 +0000
commit421dafd2def6a7a3b4187c22c936f86ec80d32d8 (patch)
treebb643894194a390b834607109790faa403b74982 /tshark.c
parentd374df09c0c2baf86b1054c75f8e0d47822991df (diff)
Get rid of old non-interface specific settings which are now interface
specifc. This finalizes the change of the infrastructure. This patch is based on work by Irene Ruengeler. svn path=/trunk/; revision=37794
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/tshark.c b/tshark.c
index 6ef57c63f9..97f168af08 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1392,12 +1392,12 @@ main(int argc, char *argv[])
rfilter = get_args_as_string(argc, argv, optind);
} else {
#ifdef HAVE_LIBPCAP
- if (global_capture_opts.cfilter) {
- cmdarg_err("Capture filters were specified both with \"-f\""
+ if (global_capture_opts.default_options.cfilter) {
+ cmdarg_err("A default capture filter was specified both with \"-f\""
" and with additional command-line arguments");
return 1;
}
- global_capture_opts.cfilter = get_args_as_string(argc, argv, optind);
+ global_capture_opts.default_options.cfilter = get_args_as_string(argc, argv, optind);
#else
capture_option_specified = TRUE;
#endif
@@ -1443,7 +1443,7 @@ main(int argc, char *argv[])
support in capture files we read). */
#ifdef HAVE_LIBPCAP
if (cf_name != NULL) {
- if (global_capture_opts.cfilter) {
+ if (global_capture_opts.default_options.cfilter) {
cmdarg_err("Only read filters, not capture filters, "
"can be specified when reading a capture file.");
return 1;
@@ -2149,14 +2149,17 @@ capture_input_error_message(capture_options *capture_opts _U_, char *error_msg,
/* capture child detected an capture filter related error */
void
-capture_input_cfilter_error_message(capture_options *capture_opts, char *error_message)
+capture_input_cfilter_error_message(capture_options *capture_opts, guint i, char *error_message)
{
dfilter_t *rfcode = NULL;
+ interface_options interface_opts;
+ g_assert(i < capture_opts->ifaces->len);
+ interface_opts = g_array_index(capture_opts->ifaces, interface_options, i);
- if (dfilter_compile(capture_opts->cfilter, &rfcode) && rfcode != NULL) {
+ if (dfilter_compile(interface_opts.cfilter, &rfcode) && rfcode != NULL) {
cmdarg_err(
- "Invalid capture filter: \"%s\"!\n"
+ "Invalid capture filter: \"%s\" for interface %s!\n"
"\n"
"That string looks like a valid display filter; however, it isn't a valid\n"
"capture filter (%s).\n"
@@ -2165,15 +2168,15 @@ capture_input_cfilter_error_message(capture_options *capture_opts, char *error_m
"so you can't use most display filter expressions as capture filters.\n"
"\n"
"See the User's Guide for a description of the capture filter syntax.",
- capture_opts->cfilter, error_message);
+ interface_opts.cfilter, interface_opts.name, error_message);
dfilter_free(rfcode);
} else {
cmdarg_err(
- "Invalid capture filter: \"%s\"!\n"
+ "Invalid capture filter: \"%s\" for interface %s!\n"
"\n"
"That string isn't a valid capture filter (%s).\n"
"See the User's Guide for a description of the capture filter syntax.",
- capture_opts->cfilter, error_message);
+ interface_opts.cfilter, interface_opts.name, error_message);
}
}