Commit Graph

14 Commits

Author SHA1 Message Date
Guy Harris a4c8ebc18b Don't do any Decode As stuff for dissector tables not used with Decode As.
Have all dissector tables have a "supports Decode As" flag, which
defaults to FALSE, and which is set to TRUE if a register_decode_as()
refers to it.

When adding a dissector to a dissector table with a given key, only add
it for Decode As if the dissector table supports it.

For non-FT_STRING dissector tables, always check for multiple entries
for the same protocol with different dissectors, and report an error if
we found them.

This means there's no need for the creator of a dissector table to
specify whether duplicates of that sort should be allowed - we always do
the check when registering something for "Decode As" (in a non-FT_STRING
dissector table), and just don't bother registering anything for "Decode
As" if the dissector table doesn't support "Decode As", so there's no
check done for those dissector tables.

Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed
Reviewed-on: https://code.wireshark.org/review/17402
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-31 00:08:01 +00:00
Michael Mann 9bcac48403 Manually add protocol dependencies derived from find_dissector.
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector.  Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector.
"data" dissector was not considered to be a dependency.

Change-Id: I15d0d77301306587ef8e7af5876e74231816890d
Reviewed-on: https://code.wireshark.org/review/14509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 12:48:48 +00:00
Michael Mann e37275bfde Associate dissector tables and heuristic subdissector lists with a protocol.
This will make it easier to determine protocol dependencies.

Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used)

Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d
Reviewed-on: https://code.wireshark.org/review/14446
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17 00:05:17 +00:00
Michael Mann d1f5b376fa Resolve hf_ field name conflicts with protocol strings.
Change-Id: Ie719e2f14c6eaf536035ab30dcb40e91c431c6e4
Reviewed-on: https://code.wireshark.org/review/14061
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-22 13:32:01 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Michael Mann 74541a9596 Don't allow multiple registrations of a protocol in dissector tables.
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing.

The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not.  It's just ENFORCED for Decode As.

Bug: 3949
Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127
Reviewed-on: https://code.wireshark.org/review/11405
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04 12:39:40 +00:00
Bill Meier d3c7d6ed41 [c15ch] Trivial: Remove unneeded #include
Change-Id: I07db4f6e7dda81f3be1b828d42c08c385b6e8e27
Reviewed-on: https://code.wireshark.org/review/8968
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-06-18 00:49:23 +00:00
Bill Meier f95db69aa1 Add editor-modelines; Don't use tabwidth=4; Adjust whitespace.
Change-Id: I7c287b176002c48dee6ae44334ee9fad221b4cd3
Reviewed-on: https://code.wireshark.org/review/8816
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-08 04:47:48 +00:00
Alexis La Goutte 0437280a20 C15ch: fix o previous prototype for function [-Wmissing-prototypes]
Change-Id: Iaa3c12ca435bf628343216d2d951f50cc0ff2231
Reviewed-on: https://code.wireshark.org/review/8194
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-26 06:50:07 +00:00
Alexis La Goutte d5e932f99f C15CH: fix unused (const) variable found by Clang
packet-c15ch.c:1523:22: warning: unused variable 'MIN_PM_VAL' [-Wunused-const-variable]
packet-c15ch.c:1611:22: warning: unused variable 'MIN_DIG_CKT_TEST_TRKPM_VAL' [-Wunused-const-variable]
packet-c15ch.c:3006:21: warning: unused variable 'FIRST_TASK_TYPE_INDEX' [-Wunused-const-variable]

Change-Id: I09ba83acc4515fe9818cd43f9ac2ec7fe7196bae
Reviewed-on: https://code.wireshark.org/review/8193
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-26 06:46:17 +00:00
Evan Huus e3ee6818eb c15ch: check packet sanity before allocating
The 'num_digits' parameter to add_digits_string_info_col can come straight from
the packet. Verify it is sane (e.g. the number of bytes required are actually
present) as otherwise we can try and allocate enourmous quantities of memory for
no reason.

Also clean up the routine; fix indenting, and simplify the loop variables.

Bug: 11148
Change-Id: I11052652f8d42fa2bb31f37e3c74523842bb3096
Reviewed-on: https://code.wireshark.org/review/8195
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-04-25 23:50:23 +00:00
Guy Harris 49fbb788fc Use BASE_EXT_STRING for *all* value_string_exts.
Change-Id: Id78735d3b6205a143dd6af0926483f04429a4cd4
Reviewed-on: https://code.wireshark.org/review/8180
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-23 18:57:15 +00:00
Alexis La Goutte cc6c6db5e4 C15ch: try to make buildbot Happy
packet-c15ch.c:5798: warning: comparison of unsigned expression >= 0 is always true
packet-c15ch.c:5809: warning: comparison of unsigned expression < 0 is always false
packet-c15ch.c:5841: warning: comparison of unsigned expression < 0 is always false
packet-c15ch.c:5859: warning: comparison of unsigned expression < 0 is always false
packet-c15ch.c:5917: warning: comparison is always false due to limited range of data type

Change-Id: Ia12f83c070bc1b794581cd37e330c38b0bad0516
Reviewed-on: https://code.wireshark.org/review/8174
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-04-23 14:39:11 +00:00
Michael Mann 2665578aba Add C15 Call History Protocol dissection (C15ch) dissector
Bug: 11063
Change-Id: I3daa9e6a75e52df1587678bd78f42e4e46fe4509
Reviewed-on: https://code.wireshark.org/review/7557
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-23 11:45:01 +00:00