aboutsummaryrefslogtreecommitdiffstats
path: root/mergecap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-08 12:45:19 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-08 20:40:08 +0000
commit2c44a7f930967335b442e899c17e1eb46831e3c1 (patch)
tree7ce2db4007feccf638308dc205f509ec385436a3 /mergecap.c
parentf1751ef22fc9877e59fad3b1c60826bff8569d94 (diff)
Clean up handling of enabled/disabled protocols/heuristic dissectors.
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'mergecap.c')
-rw-r--r--mergecap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/mergecap.c b/mergecap.c
index 50362186d0..daddbda1fb 100644
--- a/mergecap.c
+++ b/mergecap.c
@@ -55,7 +55,7 @@
#include <wsutil/plugins.h>
#endif
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wiretap/merge.h>
@@ -129,10 +129,11 @@ string_elem_print(gpointer data, gpointer not_used _U_)
#ifdef HAVE_PLUGINS
/*
- * General errors are reported with an console message in mergecap.
+ * General errors and warnings are reported with an console message
+ * in mergecap.
*/
static void
-failure_message(const char *msg_format, va_list ap)
+failure_warning_message(const char *msg_format, va_list ap)
{
fprintf(stderr, "mergecap: ");
vfprintf(stderr, msg_format, ap);
@@ -310,7 +311,8 @@ main(int argc, char *argv[])
wtap_init();
#ifdef HAVE_PLUGINS
- init_report_err(failure_message,NULL,NULL,NULL);
+ init_report_message(failure_warning_message, failure_warning_message,
+ NULL, NULL, NULL);
/* Scan for plugins. This does *not* call their registration routines;
that's done later.