From 2c44a7f930967335b442e899c17e1eb46831e3c1 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 8 Apr 2017 12:45:19 -0700 Subject: 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 --- ui/dissect_opts.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ui/dissect_opts.h') diff --git a/ui/dissect_opts.h b/ui/dissect_opts.h index 227ebfc291..9ed08a7529 100644 --- a/ui/dissect_opts.h +++ b/ui/dissect_opts.h @@ -93,6 +93,16 @@ dissect_opts_init(void); extern gboolean dissect_opts_handle_opt(int opt, char *optarg_str_p); +/* + * Set up disabled protocols and enabled/disabled heuristic protocols + * as per specified command-line options. + * + * Returns TRUE if all specified heuristic protocols exist, FALSE + * otherwise. + */ +extern gboolean +setup_enabled_and_disabled_protocols(void); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3