Commit Graph

214 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 0ef1d941ea Allow control of individual columns to be (un)writable.
Most protocols just want to limit COL_INFO or COL_PROTOCOL
so give that level of granularity.

Bug: 12144
Bug: 5117
Bug: 11144
Change-Id: I8de9b7d2c69e90d3fbfc0a52c2bd78c3de58e2f8
Reviewed-on: https://code.wireshark.org/review/15894
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-15 06:03:57 +00:00
Lori Tribble de61fb1cfb BACAPP: event-time-stamps decode fix
event-time-stamps decode when array-index is 0.

Bug: 12422
Change-Id: I9f1f90e269352a49a8fc8a2ba2f64211f3cf7961
Reviewed-on: https://code.wireshark.org/review/15409
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-13 12:47:46 +00:00
Lori Tribble d05ad7f71b BACAPP: Added dissection for NotificationParameter
Case 19 - change-of-reliability and related enums

Bug: 11734
Change-Id: Ie40acc9d157adcf4d69b9cc57c6419daf8f6263d
Reviewed-on: https://code.wireshark.org/review/15350
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-12 14:33:18 +00:00
Joerg Mayer 0c471e782f Fix more -Wused-but-marked-unused warnings/errors.
Change-Id: Ieb3e70a23c1a55b7ba60b1b32f159341adfe65b7
Reviewed-on: https://code.wireshark.org/review/14682
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-28 19:06:13 +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 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Michael Mann 01f7356f85 register_dissector -> new_register_dissector
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: I3d5e576b796556ef070bb36d8b55da0b175dcba8
Reviewed-on: https://code.wireshark.org/review/11805
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-13 17:44:24 +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
Peter Wu 3182fbae51 bacapp: attempt to fix windows build
Reported by Graham:

    packet-bacapp.c(5299) : warning C4146: unary minus operator applied to unsigned type, result still unsigned

Regression in v1.99.10rc0-330-g71ec57a ("bacapp: fix
-Wshift-negative-value").

Change-Id: Ia3ea3acad3afdf7b8a449224c815ea45d7fdbc2b
Reviewed-on: https://code.wireshark.org/review/10785
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-10-05 00:25:05 +00:00
Peter Wu 71ec57ab8b bacapp: fix -Wshift-negative-value
Shifting a negative signed value is undefined. Found by Clang.

Change-Id: If58d7b82899859892d8c58d627e98a8a902dd7fd
Reviewed-on: https://code.wireshark.org/review/10780
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-10-04 13:43:46 +00:00
Michael Mann c41a833d03 Eliminate proto_tree_add_text from some dissectors.
Change-Id: If617016f588bbf940f37699e27559dc5c59cf508
Reviewed-on: https://code.wireshark.org/review/10349
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-02 05:14:17 +00:00
Michael Mann 2e2129a914 Conversion of random proto_tree_add_text calls.
Change-Id: I6505ce34de84bfe46d5bc7b4d6a3c6044f3fb4b5
Reviewed-on: https://code.wireshark.org/review/10041
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-16 02:32:12 +00:00
Peter Wu 80f7ee063d Call reassembly_table_destroy for some dissectors
This patch adds reassembly_table_destroy calls as cleanup function for
dissectors which have a simple init routine that just calls
reassembly_table_init (comments are ignored).

The changes were automatically generated using
https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4cc0aec05dc67a51926a045e1955b7a956757b5e
(with the if and assignment parsers disabled).

The only difference from the autogenerated output is that the XXX
comments from the init routines in smb-pipe and tds dissectors are kept.

Change-Id: I64aedf7189877247282b30b0e0f83757be6199e7
Reviewed-on: https://code.wireshark.org/review/9222
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:34:28 +00:00
Evan Huus 13df6e9d9d bacapp: cleanup and remove some add_text
Change-Id: I991269db9c2705a4ac41a576000a612aa6de2242
Reviewed-on: https://code.wireshark.org/review/9186
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-27 14:35:16 +00:00
AndersBroman 05c0152370 Replcae deprecated API tvb_length with tvb_reported_length or tvb_captured
length.

Change-Id: Id42f3409a32e202528d350f7afde7376e411fc51
Reviewed-on: https://code.wireshark.org/review/8076
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-15 15:22:42 +00:00
Guy Harris 050bc7d100 Update some comments to reflect reality.
Get rid of references to ep_ and se_ allocation in code that now uses
wmem allocation instead.

Fix API documentation of conversation_table.h routines to reflect that
as well - some APIs changed to pass wmem scopes.

Also, zbee_sec_key_hash() now takes the output buffer as an argument and
just returns it, and nobody actually uses the return value, so change it
to return void.

Change-Id: Ife1ec675a9322fd0f0be306a9d639ec17aad1c7a
Reviewed-on: https://code.wireshark.org/review/6636
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 21:02:40 +00:00
Michael Mann 64a7bac641 tvb_bytes_to_ep_str -> tvb_bytes_to_str
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4
Reviewed-on: https://code.wireshark.org/review/6371
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:16:23 +00:00
Alexis La Goutte fa0ebfcae0 BACAPP: fix empty paragraph passed to '@param' command [-Wdocumentation]
Change-Id: Ibef3cee6930dea08fc7a87635c48de609d3d4015
Reviewed-on: https://code.wireshark.org/review/6299
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-04 13:54:07 +00:00
Alexis La Goutte 5248c0df21 Fix unknown command tag name [-Wdocumentation-unknown-command]
Change-Id: I6c2564a86e13d9321001856ba1f51681a9f20976
Reviewed-on: https://code.wireshark.org/review/5979
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-22 15:24:28 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Steve Karg a919566091 BACnet: fix dissection of exception-schedule property.
The exception schedule special-event disection already used matched
open-close tags and only needed to check for an unmatched close tag
to exit when used with ReadPropertyMultiple service.

Bug: 10691
Change-Id: I54f2f6f3f470138a6a88f84c62fd15b07ea74c37
Reviewed-on: https://code.wireshark.org/review/5593
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>
2014-12-04 09:06:29 +00:00
desolat 7469faba5e BACAPP: fix dissection of event parameters for event notifications of Event_Type Change_of_Status_Flags
Implementation for this event parameter type was missing

Bug: 9626
Change-Id: Iea0bc819858bbf5660d97cfd0c418a963ac149fb
Reviewed-on: https://code.wireshark.org/review/5228
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-11 05:17:15 +00:00
desolat ae61a41e57 BACAPP: fix dissection of event parameters for event notifications of Event_Type Change_of_Characterstring
Implementation for this event parameter type was missing

Bug: 9625
Change-Id: I575d387ec4764fa1ecd365624d13e3f41e2473c6
Reviewed-on: https://code.wireshark.org/review/5189
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-11-08 20:52:22 +00:00
Anish Bhatt 1c51075376 [BACnet][trivial] change strings as per Bug 9640
Change-Id: I542b5a96bcff6c779359b80ddce513524852272c
Reviewed-on: https://code.wireshark.org/review/4572
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-09 07:49:55 +00:00
Anish Bhatt f31836dbaf [bacnet] update vendors list, fix whitespace issues, all generated via script
Change-Id: Ieb4b169dfcf5e89b7b2a2cb90b6572a3d973d744
Reviewed-on: https://code.wireshark.org/review/4519
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-08 02:51:54 +00:00
Anish Bhatt 04bca658f9 [bacnet] update vendor list
Change-Id: I6b7bd3b3a110b8d393cd849c12890fff17446e54
Reviewed-on: https://code.wireshark.org/review/4515
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-10-07 06:44:43 +00:00
Guy Harris 79fcc6a1a3 Squelch some compiler warnings.
Change-Id: Ie39c7b0c1fef8f862cec016a3a1a5bd1451a3df2
Reviewed-on: https://code.wireshark.org/review/2905
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 23:49:04 +00:00
Guy Harris 6896def6da Get rid of some unused variables.
Change-Id: I2a806af639e5f0519ba93b0048ec7a4624fa33fc
Reviewed-on: https://code.wireshark.org/review/2567
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-22 21:49:26 +00:00
Michael Mann 188aa9a80e convert to proto_tree_add_subtree[_format]
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df
Reviewed-on: https://code.wireshark.org/review/2560
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 21:07:16 +00:00
Guy Harris 46ecf18fbd Use address_to_str(NULL, ...) for strings allocated outside dissectors.
ep_address_to_str() doesn't crash if called outside packet scope, but
it's still not correct to use outside packet scope.  Use
address_to_str(NULL, ...) to allocate those strings, and then explicitly
free them when we're done; exceptions don't get thrown between the
allocate and free, so there's no risk of a leak.

Change-Id: Iea2af93b0757e648d399e2ba64249224eb7e9e3c
Reviewed-on: https://code.wireshark.org/review/2438
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-19 18:58:49 +00:00
Michael Mann b0bc4d5535 Revert "Fixup: ep_address_to_str -> address_to_str"
Most (all?) of these functions are being called within GUI, so they can't have packet_scope, which is why they weren't already converted (I made this mistake once already)

This reverts commit 7fea55a054.

Change-Id: I4bf29b206e5e1f5daefcec131309a8f6e78e1eb1
Reviewed-on: https://code.wireshark.org/review/2428
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:26:57 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 7fea55a054 Fixup: ep_address_to_str -> address_to_str
Change-Id: Id49ba07e32a71357b50b32de7cecfd80e412d508
Reviewed-on: https://code.wireshark.org/review/2379
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:22:02 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Pascal Quantin 828bb24226 Partly revert fdeed480bf
wmem_packet_scope() cannot be used outside of a packet treatment

Change-Id: I6e545bbb51f325b366288f17358f9d2347a7d7c4
Reviewed-on: https://code.wireshark.org/review/977
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-06 10:18:15 +00:00
Michael Mann fdeed480bf Convert ep_address_to_str -> address_to_str(wmem_packet_scope, ...) for all dissectors
Change-Id: I7489e2fb3a1f2630ca17b0a5fe1aa873992f1061
Reviewed-on: https://code.wireshark.org/review/975
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-06 01:31:28 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Alexis La Goutte aa65e8463e Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
svn path=/trunk/; revision=54416
2013-12-23 20:13:31 +00:00
Alexis La Goutte b3a584d8dc Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
svn path=/trunk/; revision=54412
2013-12-23 20:12:39 +00:00
Guy Harris a1c84e00de Get rid of a set-but-unused variable.
svn path=/trunk/; revision=54355
2013-12-22 11:15:35 +00:00
Guy Harris fc7a77189d Add UCS-4 support, and use it.
Shuffle the character ENC_ values around a bit, keeping the Unicode
encodings together, moving the Windows code pages (only one for now)
after the ISO 8859 encodings, and putting "I can't believe it's not
ASCII!" at the end.

Fix some comment typoes, and update another comment, while we're at it.

svn path=/trunk/; revision=54351
2013-12-22 08:45:57 +00:00
Evan Huus a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Evan Huus 24360c9951 Make sure all unused bits are 0 in bacapp, fixes uninitialized memory found by
valgrind.

svn path=/trunk/; revision=54077
2013-12-13 23:08:32 +00:00
Guy Harris 2d5c1c8689 Note that apparently some BACnet implementations misuse the "ANSI X3.4"
encoding for ISO 8859-1; this means that those strings won't be
correctly interpreted if they're interpreted as UTF-8.

svn path=/trunk/; revision=54069
2013-12-13 21:36:50 +00:00
Guy Harris e1c994f55f It's ISO 8859-1, not "ISO 18859-1", at least according to ANSI/ASHRAE
Standard 135-2004.

Use tvb_get_string_enc() wherever possible.

svn path=/trunk/; revision=53840
2013-12-08 01:28:00 +00:00
Evan Huus df1aec4a6b Remove old (2009) and no-longer-necessary compatibility macro.
svn path=/trunk/; revision=53527
2013-11-23 22:03:48 +00:00
Jakub Zawadzki 50aa247c72 Fix Bug #9457 Update BACnet vendor list
Based on attachment #12139 (diff for adding the table) by rtsking117,
but keep original formatting and encoding (ASCII).

svn path=/trunk/; revision=53457
2013-11-20 23:32:02 +00:00
Jakub Zawadzki 1899903f69 Include <epan/to_str.h> only when needed.
svn path=/trunk/; revision=53189
2013-11-09 13:41:10 +00:00