Set ENABLE_CHECK_FILTER to 1 for get list of display filter with conflict...
Ping-Bug:2402
Change-Id: I8d56b1573120d1a29d437aae1088be242e15e9a3
Reviewed-on: https://code.wireshark.org/review/13644
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
endif()
endif()
+if(ENABLE_CHECKHF_CONFLICT)
+ set(ENABLE_CHECK_FILTER 1)
+endif()
+
message(STATUS "C-Flags: ${CMAKE_C_FLAGS}")
message(STATUS "CXX-Flags: ${CMAKE_CXX_FLAGS}")
message(STATUS "Warnings as errors: ${WERROR_COMMON_FLAGS}")
option(ENABLE_EXTRA_COMPILER_WARNINGS "Do additional compiler warnings (disables -Werror)" OFF)
option(ENABLE_CODE_ANALYSIS "Enable the compiler's static analyzer if possible" OFF)
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (May be slow down)" OFF)
+option(ENABLE_CHECKHF_CONFLICT "Enable Check hf conflict for debugging (May be slow start)" OFF)
#
# Leave GTK2 the default on Windows, looks better than GTK3
/* Define to 1 if we want to enable plugins */
#cmakedefine HAVE_PLUGINS 1
+/* Define to 1 if we check hf conflict */
+#cmakedefine ENABLE_CHECK_FILTER 1
+
/* Link plugins statically into Wireshark */
#cmakedefine ENABLE_STATIC 1
],)
+# Add check hf conflict..
+#
+AC_ARG_ENABLE(checkhf-conflict,
+ AC_HELP_STRING( [--enable-checkhf-conflict],
+ [Enable Check hf conflict for debugging (May be slow start)@<:@default=no@:>@]),
+[
+ AC_DEFINE(ENABLE_CHECK_FILTER, 1, [Enable check hf conflict])
+],)
#
# The following are for C and C++
/* XXX - This should probably be a preference */
#define MAX_TREE_ITEMS (1 * 1000 * 1000)
-
typedef struct __subtree_lvl {
gint cursor_offset;
proto_item *it;
}
}
+#ifdef ENABLE_CHECK_FILTER
+static enum ftenum
+_ftype_common(enum ftenum type)
+{
+ switch (type) {
+ case FT_INT8:
+ case FT_INT16:
+ case FT_INT24:
+ case FT_INT32:
+ return FT_INT32;
+
+ case FT_UINT8:
+ case FT_UINT16:
+ case FT_UINT24:
+ case FT_UINT32:
+ case FT_IPXNET:
+ case FT_FRAMENUM:
+ return FT_UINT32;
+
+ case FT_UINT64:
+ case FT_EUI64:
+ return FT_UINT64;
+
+ case FT_STRING:
+ case FT_STRINGZ:
+ case FT_UINT_STRING:
+ return FT_STRING;
+
+ case FT_FLOAT:
+ case FT_DOUBLE:
+ return FT_DOUBLE;
+
+ case FT_BYTES:
+ case FT_UINT_BYTES:
+ case FT_ETHER:
+ case FT_OID:
+ return FT_BYTES;
+
+ case FT_ABSOLUTE_TIME:
+ case FT_RELATIVE_TIME:
+ return FT_ABSOLUTE_TIME;
+
+ default:
+ return type;
+ }
+}
+#endif
+
static void
register_type_length_mismatch(void)
{
same_name_hfinfo->same_name_next = hfinfo;
hfinfo->same_name_prev_id = same_name_hfinfo->id;
+#ifdef ENABLE_CHECK_FILTER
+ while (same_name_hfinfo) {
+ if (_ftype_common(hfinfo->type) != _ftype_common(same_name_hfinfo->type))
+ fprintf(stderr, "'%s' exists multiple times with NOT compatible types: %s and %s\n", hfinfo->abbrev, ftype_name(hfinfo->type), ftype_name(same_name_hfinfo->type));
+ same_name_hfinfo = same_name_hfinfo->same_name_next;
+ }
+#endif
}
}