path: root/randpkt.c
diff options
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 /randpkt.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 'randpkt.c')
1 files changed, 7 insertions, 5 deletions
diff --git a/randpkt.c b/randpkt.c
index d10c5d6e03..fa711b917f 100644
--- a/randpkt.c
+++ b/randpkt.c
@@ -38,7 +38,7 @@
#include <wsutil/plugins.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <getopt.h>
@@ -54,10 +54,11 @@
#define CLOSE_ERROR 2
- * General errors are reported with an console message in randpkt.
+ * General errors and warnings are reported with an console message
+ * in randpkt.
static void
-failure_message(const char *msg_format, va_list ap)
+failure_warning_message(const char *msg_format, va_list ap)
fprintf(stderr, "randpkt: ");
vfprintf(stderr, msg_format, ap);
@@ -148,7 +149,7 @@ main(int argc, char **argv)
- cmdarg_err_init(failure_message, failure_message_cont);
+ cmdarg_err_init(failure_warning_message, failure_message_cont);
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
@@ -157,7 +158,8 @@ main(int argc, char **argv)
/* Register wiretap plugins */
- init_report_err(failure_message,NULL,NULL,NULL);
+ init_report_message(failure_warning_message, failure_warning_message,
/* Scan for plugins. This does *not* call their registration routines;
that's done later.