aboutsummaryrefslogtreecommitdiffstats
path: root/epan
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 /epan
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 'epan')
-rw-r--r--epan/addr_resolv.c2
-rw-r--r--epan/disabled_protos.c231
-rw-r--r--epan/disabled_protos.h81
-rw-r--r--epan/dissectors/packet-diameter.c2
-rw-r--r--epan/dissectors/packet-etch.c2
-rw-r--r--epan/dissectors/packet-giop.c2
-rw-r--r--epan/dissectors/packet-radius.c2
-rw-r--r--epan/dissectors/packet-smb-sidsnooping.c2
-rw-r--r--epan/dissectors/packet-snort.c2
-rw-r--r--epan/dissectors/packet-ssl-utils.c2
-rw-r--r--epan/dissectors/packet-tpncp.c2
-rw-r--r--epan/dissectors/packet-uasip.c2
-rw-r--r--epan/dissectors/packet-uaudp.c2
-rw-r--r--epan/dissectors/packet-xml.c2
-rw-r--r--epan/epan.c4
-rw-r--r--epan/geoip_db.c2
-rw-r--r--epan/oids.c2
-rw-r--r--epan/proto.c2
-rw-r--r--epan/proto.h9
-rw-r--r--epan/uat.c2
-rw-r--r--epan/wslua/wslua.h2
21 files changed, 190 insertions, 169 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index d174944154..96e2dc4c12 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -100,7 +100,7 @@
#include "addr_resolv.h"
#include "wsutil/filesystem.h"
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wsutil/file_util.h>
#include <wsutil/pint.h>
#include "wsutil/inet_aton.h"
diff --git a/epan/disabled_protos.c b/epan/disabled_protos.c
index b38ad425a0..b6e57cbd9f 100644
--- a/epan/disabled_protos.c
+++ b/epan/disabled_protos.c
@@ -36,6 +36,7 @@
#include "disabled_protos.h"
#include <wsutil/file_util.h>
#include <wsutil/ws_printf.h> /* ws_g_warning */
+#include <wsutil/report_message.h>
#define ENABLED_PROTOCOLS_FILE_NAME "enabled_protos"
#define DISABLED_PROTOCOLS_FILE_NAME "disabled_protos"
@@ -268,8 +269,7 @@ save_protos_list(char **pref_path_return, int *errno_return, const char* filenam
}
static int
-read_protos_list_file(const char *ff_path, FILE *ff,
- GList **flp)
+read_protos_list_file(const char *ff_path, FILE *ff, GList **flp)
{
protocol_def *prot;
int c;
@@ -285,8 +285,8 @@ read_protos_list_file(const char *ff_path, FILE *ff,
prot_name = (char *)g_malloc(prot_name_len + 1);
for (line = 1; ; line++) {
- /* Lines in a disabled protocol file contain the "filter name" of
- a protocol to be disabled. */
+ /* Lines in a protocol file contain the "filter name" of a protocol
+ to be enabled or disabled. */
/* Skip over leading white space, if any. */
while ((c = ws_getc_unlocked(ff)) != EOF && g_ascii_isspace(c)) {
@@ -381,20 +381,27 @@ error:
}
/*
- * Read in a list of protocols.
+ * Read in global and personal versions of a list of protocols.
*
- * On success, "*pref_path_return" is set to NULL.
- * On error, "*pref_path_return" is set to point to the pathname of
- * the file we tried to read - it should be freed by our caller -
- * and "*open_errno_return" is set to the error if an open failed
- * or "*read_errno_return" is set to the error if a read failed.
+ * If we can open and read the global version, *gpath_return is set to
+ * NULL. Otherwise, *gpath_return is set to point to the pathname of
+ * the file we tried to read - it should be freed by our caller - and
+ * *gopen_errno_return is set to the error if an open failed or
+ * *gread_errno_return is set to the error if a read failed.
+ *
+ * If we can open and read the personal version, *path_return is set to
+ * NULL. Otherwise, *path_return is set to point to the pathname of
+ * the file we tried to read - it should be freed by our caller - and
+ * *open_errno_return is set to the error if an open failed or
+ * *read_errno_return is set to the error if a read failed.
*/
static void
read_protos_list(char **gpath_return, int *gopen_errno_return,
- int *gread_errno_return,
- char **path_return, int *open_errno_return,
- int *read_errno_return, const char* filename,
- GList **protos_list, GList **global_protos_list)
+ int *gread_errno_return,
+ char **path_return, int *open_errno_return,
+ int *read_errno_return,
+ const char* filename,
+ GList **global_protos_list, GList **protos_list)
{
int err;
char *gff_path, *ff_path;
@@ -410,8 +417,7 @@ read_protos_list(char **gpath_return, int *gopen_errno_return,
*gpath_return = NULL;
if ((ff = ws_fopen(gff_path, "r")) != NULL) {
/* We succeeded in opening it; read it. */
- err = read_protos_list_file(gff_path, ff,
- global_protos_list);
+ err = read_protos_list_file(gff_path, ff, global_protos_list);
if (err != 0) {
/* We had an error reading the file; return the errno and the
pathname, so our caller can report the error. */
@@ -471,29 +477,6 @@ read_protos_list(char **gpath_return, int *gopen_errno_return,
************************************************************************/
/*
- * Read in a list of disabled protocols.
- */
-void
-read_disabled_protos_list(char **gpath_return, int *gopen_errno_return,
- int *gread_errno_return,
- char **path_return, int *open_errno_return,
- int *read_errno_return)
-{
- read_protos_list(gpath_return, gopen_errno_return, gread_errno_return,
- path_return, open_errno_return, read_errno_return,
- DISABLED_PROTOCOLS_FILE_NAME, &disabled_protos, &global_disabled_protos);
-}
-
-/*
- * Disable protocols as per the stored configuration
- */
-void
-set_disabled_protos_list(void)
-{
- set_protos_list(disabled_protos, global_disabled_protos, FALSE);
-}
-
-/*
* Disable a particular protocol by name
*/
void
@@ -531,12 +514,6 @@ save_disabled_protos_list(char **pref_path_return, int *errno_return)
/************************************************************************
* Enabling dissectors (that are disabled by default)
************************************************************************/
-void
-set_enabled_protos_list(void)
-{
- set_protos_list(enabled_protos, global_enabled_protos, TRUE);
-}
-
WS_DLL_PUBLIC void
proto_enable_proto_by_name(const char *name)
@@ -573,27 +550,13 @@ save_enabled_protos_list(char **pref_path_return, int *errno_return)
enable_proto_list_check);
}
-/*
- * Read in a list of enabled protocols (that are disabled by default).
- */
-void
-read_enabled_protos_list(char **gpath_return, int *gopen_errno_return,
- int *gread_errno_return,
- char **path_return, int *open_errno_return,
- int *read_errno_return)
-{
- read_protos_list(gpath_return, gopen_errno_return, gread_errno_return,
- path_return, open_errno_return, read_errno_return,
- ENABLED_PROTOCOLS_FILE_NAME, &enabled_protos, &global_enabled_protos);
-}
-
/************************************************************************
* Heuristic dissectors
************************************************************************/
-void
+static void
set_disabled_heur_dissector_list(void)
{
GList *fl_ent;
@@ -634,8 +597,7 @@ skip:
}
static int
-read_disabled_heur_dissector_list_file(const char *ff_path, FILE *ff,
- GList **flp)
+read_heur_dissector_list_file(const char *ff_path, FILE *ff, GList **flp)
{
heur_protocol_def *heur;
int c;
@@ -737,7 +699,7 @@ read_disabled_heur_dissector_list_file(const char *ff_path, FILE *ff,
}
heuristic_name[name_index] = '\0';
- /* Add the new protocol to the list of disabled protocols */
+ /* Add the new protocol to the list of protocols */
heur = (heur_protocol_def *) g_malloc(sizeof(heur_protocol_def));
heur->name = g_strdup(heuristic_name);
heur->enabled = enabled;
@@ -751,28 +713,28 @@ error:
return errno;
}
-void
-read_disabled_heur_dissector_list(char **gpath_return, int *gopen_errno_return,
- int *gread_errno_return,
- char **path_return, int *open_errno_return,
- int *read_errno_return)
+static void
+read_heur_dissector_list(char **gpath_return, int *gopen_errno_return,
+ int *gread_errno_return,
+ char **path_return, int *open_errno_return,
+ int *read_errno_return)
{
int err;
char *gff_path, *ff_path;
FILE *ff;
- /* Construct the pathname of the global disabled heuristic dissectors file. */
- gff_path = get_datafile_path(HEURISTICS_FILE_NAME);
-
/* If we already have a list of protocols, discard it. */
heur_discard_existing_list(&global_disabled_heuristics);
+ /* Construct the pathname of the global disabled heuristic dissectors file. */
+ gff_path = get_datafile_path(HEURISTICS_FILE_NAME);
+
/* Read the global disabled protocols file, if it exists. */
*gpath_return = NULL;
if ((ff = ws_fopen(gff_path, "r")) != NULL) {
/* We succeeded in opening it; read it. */
- err = read_disabled_heur_dissector_list_file(gff_path, ff,
- &global_disabled_heuristics);
+ err = read_heur_dissector_list_file(gff_path, ff,
+ &global_disabled_heuristics);
if (err != 0) {
/* We had an error reading the file; return the errno and the
pathname, so our caller can report the error. */
@@ -804,7 +766,7 @@ read_disabled_heur_dissector_list(char **gpath_return, int *gopen_errno_return,
*path_return = NULL;
if ((ff = ws_fopen(ff_path, "r")) != NULL) {
/* We succeeded in opening it; read it. */
- err = read_disabled_heur_dissector_list_file(ff_path, ff, &disabled_heuristics);
+ err = read_heur_dissector_list_file(ff_path, ff, &disabled_heuristics);
if (err != 0) {
/* We had an error reading the file; return the errno and the
pathname, so our caller can report the error. */
@@ -933,12 +895,15 @@ save_disabled_heur_dissector_list(char **pref_path_return, int *errno_return)
g_free(ff_path);
}
-void
+gboolean
proto_enable_heuristic_by_name(const char *name, gboolean enable)
{
heur_dtbl_entry_t* heur = find_heur_dissector_by_unique_short_name(name);
if (heur != NULL) {
heur->enabled = enable;
+ return TRUE;
+ } else {
+ return FALSE;
}
}
@@ -950,8 +915,122 @@ disabled_protos_free(gpointer p, gpointer user_data _U_)
g_free(p);
}
+/*
+ * Read the files that enable and disable protocols and heuristic
+ * dissectors. Report errors through the UI.
+ */
+void
+read_enabled_and_disabled_protos(void)
+{
+ char *gpath, *path;
+ int gopen_errno, gread_errno;
+ int open_errno, read_errno;
+
+ /*
+ * Read the global and personal disabled protocols files.
+ */
+ read_protos_list(&gpath, &gopen_errno, &gread_errno,
+ &path, &open_errno, &read_errno,
+ DISABLED_PROTOCOLS_FILE_NAME,
+ &global_disabled_protos, &disabled_protos);
+ if (gpath != NULL) {
+ if (gopen_errno != 0) {
+ report_warning("Could not open global disabled protocols file\n\"%s\": %s.",
+ gpath, g_strerror(gopen_errno));
+ }
+ if (gread_errno != 0) {
+ report_warning("I/O error reading global disabled protocols file\n\"%s\": %s.",
+ gpath, g_strerror(gread_errno));
+ }
+ g_free(gpath);
+ gpath = NULL;
+ }
+ if (path != NULL) {
+ if (open_errno != 0) {
+ report_warning("Could not open your disabled protocols file\n\"%s\": %s.",
+ path, g_strerror(open_errno));
+ }
+ if (read_errno != 0) {
+ report_warning("I/O error reading your disabled protocols file\n\"%s\": %s.",
+ path, g_strerror(read_errno));
+ }
+ g_free(path);
+ path = NULL;
+ }
+
+ /*
+ * Read the global and personal enabled protocols files.
+ */
+ read_protos_list(&gpath, &gopen_errno, &gread_errno,
+ &path, &open_errno, &read_errno,
+ ENABLED_PROTOCOLS_FILE_NAME,
+ &global_enabled_protos, &enabled_protos);
+ if (gpath != NULL) {
+ if (gopen_errno != 0) {
+ report_warning("Could not open global enabled protocols file\n\"%s\": %s.",
+ gpath, g_strerror(gopen_errno));
+ }
+ if (gread_errno != 0) {
+ report_warning("I/O error reading global enabled protocols file\n\"%s\": %s.",
+ gpath, g_strerror(gread_errno));
+ }
+ g_free(gpath);
+ gpath = NULL;
+ }
+ if (path != NULL) {
+ if (open_errno != 0) {
+ report_warning("Could not open your enabled protocols file\n\"%s\": %s.",
+ path, g_strerror(open_errno));
+ }
+ if (read_errno != 0) {
+ report_warning("I/O error reading your enabled protocols file\n\"%s\": %s.",
+ path, g_strerror(read_errno));
+ }
+ g_free(path);
+ path = NULL;
+ }
+
+ /*
+ * Read the global and personal heuristic dissector list files.
+ */
+ read_heur_dissector_list(&gpath, &gopen_errno, &gread_errno,
+ &path, &open_errno, &read_errno);
+ if (gpath != NULL) {
+ if (gopen_errno != 0) {
+ report_warning("Could not open global heuristic dissectors file\n\"%s\": %s.",
+ gpath, g_strerror(gopen_errno));
+ }
+ if (gread_errno != 0) {
+ report_warning("I/O error reading global heuristic dissectors file\n\"%s\": %s.",
+ gpath, g_strerror(gread_errno));
+ }
+ g_free(gpath);
+ gpath = NULL;
+ }
+ if (path != NULL) {
+ if (open_errno != 0) {
+ report_warning("Could not open your heuristic dissectors file\n\"%s\": %s.",
+ path, g_strerror(open_errno));
+ }
+ if (read_errno != 0) {
+ report_warning("I/O error reading your heuristic dissectors file\n\"%s\": %s.",
+ path, g_strerror(read_errno));
+ }
+ g_free(path);
+ path = NULL;
+ }
+
+ /*
+ * Enable/disable protocols and heuristic dissectors as per the
+ * contents of the files we just read.
+ */
+ set_protos_list(disabled_protos, global_disabled_protos, FALSE);
+ set_protos_list(enabled_protos, global_enabled_protos, TRUE);
+ set_disabled_heur_dissector_list();
+}
+
void
-disabled_protos_cleanup(void)
+enabled_and_disabled_protos_cleanup(void)
{
g_list_foreach(global_disabled_heuristics, disabled_protos_free, NULL);
g_list_free(global_disabled_heuristics);
diff --git a/epan/disabled_protos.h b/epan/disabled_protos.h
index 52a791bfa7..f1f436464f 100644
--- a/epan/disabled_protos.h
+++ b/epan/disabled_protos.h
@@ -6,7 +6,6 @@
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -30,28 +29,6 @@ extern "C" {
#endif /* __cplusplus */
/*
- * Read in a list of disabled protocols.
- *
- * On success, "*pref_path_return" is set to NULL.
- * On error, "*pref_path_return" is set to point to the pathname of
- * the file we tried to read - it should be freed by our caller -
- * and "*open_errno_return" is set to the error if we couldn't open the file
- * or "*read_errno_return" is set to the error if we got an error reading
- * the file.
- */
-WS_DLL_PUBLIC void
-read_disabled_protos_list(char **gpath_return, int *gopen_errno_return,
- int *gread_errno_return,
- char **path_return, int *open_errno_return,
- int *read_errno_return);
-
-/*
- * Disable protocols as per the stored configuration
- */
-WS_DLL_PUBLIC void
-set_disabled_protos_list(void);
-
-/*
* Write out a list of disabled protocols.
*
* On success, "*pref_path_return" is set to NULL.
@@ -69,29 +46,6 @@ save_disabled_protos_list(char **pref_path_return, int *errno_return);
WS_DLL_PUBLIC void
proto_disable_proto_by_name(const char *name);
-
-/*
- * Read in a list of enabled protocols (who are disabled by default)
- *
- * On success, "*pref_path_return" is set to NULL.
- * On error, "*pref_path_return" is set to point to the pathname of
- * the file we tried to read - it should be freed by our caller -
- * and "*open_errno_return" is set to the error if we couldn't open the file
- * or "*read_errno_return" is set to the error if we got an error reading
- * the file.
- */
-WS_DLL_PUBLIC void
-read_enabled_protos_list(char **gpath_return, int *gopen_errno_return,
- int *gread_errno_return,
- char **path_return, int *open_errno_return,
- int *read_errno_return);
-
-/*
- * Enable protocols (that default to disabled) as per the stored configuration
- */
-WS_DLL_PUBLIC void
-set_enabled_protos_list(void);
-
/*
* Write out a list of enabled protocols (that default to being disabled)
*
@@ -112,28 +66,6 @@ WS_DLL_PUBLIC void
proto_enable_proto_by_name(const char *name);
/*
- * Read in a list of disabled protocols.
- *
- * On success, "*pref_path_return" is set to NULL.
- * On error, "*pref_path_return" is set to point to the pathname of
- * the file we tried to read - it should be freed by our caller -
- * and "*open_errno_return" is set to the error if we couldn't open the file
- * or "*read_errno_return" is set to the error if we got an error reading
- * the file.
- */
-WS_DLL_PUBLIC void
-read_disabled_heur_dissector_list(char **gpath_return, int *gopen_errno_return,
- int *gread_errno_return,
- char **path_return, int *open_errno_return,
- int *read_errno_return);
-
-/*
- * Disable protocols as per the stored configuration
- */
-WS_DLL_PUBLIC void
-set_disabled_heur_dissector_list(void);
-
-/*
* Write out a list of disabled heuristic dissectors.
*
* On success, "*pref_path_return" is set to NULL.
@@ -146,15 +78,24 @@ save_disabled_heur_dissector_list(char **pref_path_return, int *errno_return);
/*
* Enable/disable a particular heuristic dissector by name
+ * On success (found the protocol), return TRUE.
+ * On failure (didn't find the protocol), return FALSE.
*/
-WS_DLL_PUBLIC void
+WS_DLL_PUBLIC gboolean
proto_enable_heuristic_by_name(const char *name, gboolean enable);
/*
+ * Read the files that enable and disable protocols and heuristic
+ * dissectors. Report errors through the UI.
+ */
+WS_DLL_PUBLIC void
+read_enabled_and_disabled_protos(void);
+
+/*
* Free the internal structures
*/
extern void
-disabled_protos_cleanup(void);
+enabled_and_disabled_protos_cleanup(void);
#ifdef __cplusplus
}
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 061ed323ad..de5983a5dd 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -55,7 +55,7 @@
#include <epan/show_exception.h>
#include <epan/to_str.h>
#include <wsutil/filesystem.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include "packet-tcp.h"
#include "packet-diameter.h"
#include "packet-e212.h"
diff --git a/epan/dissectors/packet-etch.c b/epan/dissectors/packet-etch.c
index 3f23aa08a7..152875f758 100644
--- a/epan/dissectors/packet-etch.c
+++ b/epan/dissectors/packet-etch.c
@@ -33,7 +33,7 @@
#include <epan/packet.h>
#include <epan/prefs.h>
#include <wsutil/file_util.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include "packet-tcp.h"
void proto_register_etch(void);
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index e83a803335..22879043b0 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -293,7 +293,7 @@
#include <wsutil/file_util.h>
#include <wsutil/str_util.h>
#include <wsutil/pint.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wsutil/ws_printf.h> /* ws_debug_printf */
#include "packet-giop.h"
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index 0f1a4deb70..43f1149f94 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -67,7 +67,7 @@
#include <epan/rtd_table.h>
#include <epan/addr_resolv.h>
#include <wsutil/filesystem.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wsutil/wsgcrypt.h>
diff --git a/epan/dissectors/packet-smb-sidsnooping.c b/epan/dissectors/packet-smb-sidsnooping.c
index 3a2ff1628c..7253f00f14 100644
--- a/epan/dissectors/packet-smb-sidsnooping.c
+++ b/epan/dissectors/packet-smb-sidsnooping.c
@@ -26,7 +26,7 @@
#include <epan/packet.h>
#include <epan/epan_dissect.h>
#include <epan/tap.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include "packet-dcerpc.h"
#include "packet-dcerpc-nt.h"
#include "packet-smb.h"
diff --git a/epan/dissectors/packet-snort.c b/epan/dissectors/packet-snort.c
index fcc050c2cb..b45d9c206d 100644
--- a/epan/dissectors/packet-snort.c
+++ b/epan/dissectors/packet-snort.c
@@ -49,7 +49,7 @@
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/expert.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <epan/wmem/wmem.h>
#include <wiretap/wtap-int.h>
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index e3b97a7dd6..721705166e 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -46,7 +46,7 @@
#include <wsutil/filesystem.h>
#include <wsutil/file_util.h>
#include <wsutil/str_util.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wsutil/pint.h>
#include <wsutil/strtoi.h>
#include <ws_version_info.h>
diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c
index 055172df04..618b5c1a9c 100644
--- a/epan/dissectors/packet-tpncp.c
+++ b/epan/dissectors/packet-tpncp.c
@@ -32,7 +32,7 @@
#include <epan/to_str.h>
#include <wsutil/filesystem.h>
#include <wsutil/file_util.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wsutil/strtoi.h>
#include "packet-tcp.h"
diff --git a/epan/dissectors/packet-uasip.c b/epan/dissectors/packet-uasip.c
index e5fc4c19f5..e53647887d 100644
--- a/epan/dissectors/packet-uasip.c
+++ b/epan/dissectors/packet-uasip.c
@@ -29,7 +29,7 @@
#include <epan/tap.h>
#endif
#include <epan/addr_resolv.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include "packet-uaudp.h"
diff --git a/epan/dissectors/packet-uaudp.c b/epan/dissectors/packet-uaudp.c
index af173dff66..01e3810d50 100644
--- a/epan/dissectors/packet-uaudp.c
+++ b/epan/dissectors/packet-uaudp.c
@@ -25,7 +25,7 @@
#include "epan/packet.h"
#include "epan/prefs.h"
-#include "wsutil/report_err.h"
+#include "wsutil/report_message.h"
#include "wsutil/inet_addr.h"
#include "packet-uaudp.h"
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index 5df3573cc8..4e8863bdf8 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -39,7 +39,7 @@
#include <epan/expert.h>
#include <epan/garrayfix.h>
#include <wsutil/str_util.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include "packet-xml.h"
diff --git a/epan/epan.c b/epan/epan.c
index 0d1d257fed..936c27d55c 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -32,7 +32,7 @@
#include <glib.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <epan/exceptions.h>
@@ -223,7 +223,7 @@ epan_cleanup(void)
expert_cleanup();
capture_dissector_cleanup();
export_pdu_cleanup();
- disabled_protos_cleanup();
+ enabled_and_disabled_protos_cleanup();
stats_tree_cleanup();
dtd_location(NULL);
#ifdef HAVE_LUA
diff --git a/epan/geoip_db.c b/epan/geoip_db.c
index f89fd41781..ee5a3103b2 100644
--- a/epan/geoip_db.c
+++ b/epan/geoip_db.c
@@ -42,7 +42,7 @@
#include <epan/prefs.h>
#include <epan/value_string.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wsutil/file_util.h>
/* This needs to match NUM_GEOIP_COLS in hostlist_table.h */
diff --git a/epan/oids.c b/epan/oids.c
index f60476967c..ce409a595c 100644
--- a/epan/oids.c
+++ b/epan/oids.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <string.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include "wmem/wmem.h"
#include "uat.h"
diff --git a/epan/proto.c b/epan/proto.c
index 68d650dc90..17c787a906 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -6548,7 +6548,7 @@ proto_set_decoding(const int proto_id, const gboolean enabled)
}
void
-proto_enable_all(void)
+proto_reenable_all(void)
{
protocol_t *protocol;
GList *list_item = protocols;
diff --git a/epan/proto.h b/epan/proto.h
index 9ad0df609c..fca8b01cb8 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -2368,9 +2368,10 @@ WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers,
gboolean *is_ip, gboolean *is_tcp, gboolean *is_udp, gboolean *is_sctp,
gboolean *is_ssl, gboolean *is_rtp, gboolean *is_lte_rlc);
-/** Find a protocol by name in a layer list.
+/** Check whether a protocol, specified by name, is in a layer list.
* @param layers Protocol layer list
* @param proto_name Name of protocol to find
+ * @return TRUE if the protocol is found, FALSE if it isn't
*/
WS_DLL_PUBLIC gboolean proto_is_frame_protocol(const wmem_list_t *layers, const char* proto_name);
@@ -2383,8 +2384,8 @@ WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id);
@param enabled enable / disable the protocol */
WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const gboolean enabled);
-/** Enable all protocols */
-WS_DLL_PUBLIC void proto_enable_all(void);
+/** Re-enable all protocols that are not marked as disabled by default. */
+WS_DLL_PUBLIC void proto_reenable_all(void);
/** Disable disabling/enabling of protocol of the given item number.
@param proto_id protocol id (0-indexed) */
@@ -2401,7 +2402,7 @@ extern gboolean proto_check_for_protocol_or_field(const proto_tree* tree, const
tree. Only works with primed trees, and is fast.
@param tree tree of interest
@param hfindex primed hfindex
- @return GPtrArry pointer */
+ @return GPtrArray pointer */
WS_DLL_PUBLIC GPtrArray* proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex);
/** Return whether we're tracking any interesting fields.
diff --git a/epan/uat.c b/epan/uat.c
index 92fac8f12f..385779a7c5 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -36,7 +36,7 @@
#include <wsutil/file_util.h>
#include <wsutil/str_util.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wsutil/filesystem.h>
#include <epan/packet.h>
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h
index 0fa2c9a6bf..393e8e0a0c 100644
--- a/epan/wslua/wslua.h
+++ b/epan/wslua/wslua.h
@@ -40,7 +40,7 @@
#include <wiretap/wtap.h>
-#include <wsutil/report_err.h>
+#include <wsutil/report_message.h>
#include <wsutil/nstime.h>
#include <epan/packet.h>