Commit Graph

174 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 2ab4155794 tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_string
Also some other tricks to remove unnecessary tvb_get_string_enc calls.

Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914
Reviewed-on: https://code.wireshark.org/review/16158
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-27 15:20:06 +00:00
Pascal Quantin 36dd5da5d4 3GPP 23.038 7-bit GSM alphabet contains non ASCII characters
It should be displayed with the STR_UNICODE field display parameter

Bug: 12337
Change-Id: I6204909977218f5e19b5eb309595be1d6666ac9a
Reviewed-on: https://code.wireshark.org/review/14896
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-13 02:59:49 +00:00
Michael Mann 1e60d63c8c Create call_data_dissector() to call data dissector.
This saves many dissectors the need to find the data dissector and store a handle to it.

There were also some that were finding it, but not using it.
For others this was the only reason for their handoff function, so it could be eliminated.

Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b
Reviewed-on: https://code.wireshark.org/review/14530
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 17:38:03 +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
Alexis La Goutte 79ead47bb4 802.11: fix typo on RM enabled length
Change-Id: If30aae4b9b7fb6129efc6d90770b18a0ea78faf3
Reviewed-on: https://code.wireshark.org/review/14303
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-02 20:43:56 +00:00
Rustam S ae0f62f5dc Typo in packet-gsm_a_dtap.c
Bug: 12186
Change-Id: Ib73ee78ba732f5ed88f596a72146a75efa47cebd
Reviewed-on: https://code.wireshark.org/review/14198
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-02-28 09:08:40 +00:00
Pascal Quantin 5f5f16021e GSM A DTAP: fix display of calling/called party BCD number in parent tree
Change-Id: I0a492d1c304c285b831f553158777843ad195c2d
Reviewed-on: https://code.wireshark.org/review/13481
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-01-22 18:44:28 +00:00
Pascal Quantin 7d6d893da3 GSM A DTAP: get rid of a global buffer
Change-Id: Icdd58960ca2673ea19b1005c47f3b06f1165caa2
Reviewed-on: https://code.wireshark.org/review/13482
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-22 18:26:08 +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
Guy Harris 1d1a893b61 Add a separate expert info for "not a valid digit".
That should be used in for errors in the BCD strings where only 0
through 9 ar valid.

Fix comments to reflect that the two checks for '?' in the output of
tvb_bcd_dig_to_wmem_packet_str() are doing different checks - one is
checking for end-of-string padding, the other is checking for anything
that's not a digit.

Change-Id: I615587b34883ed5bfdc57827451c6e00e213fa5f
Reviewed-on: https://code.wireshark.org/review/12358
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-02 01:43:17 +00:00
Michael Mann f777d68bd6 Fix Ubuntu compile error.
Should be using the dgt_set_t variables provided in packet-ansi_a.c and packet-gsm_a_dtap.c

Change-Id: I5bd95a2d31d4419faae0943ae0ab524e796d7d92
Reviewed-on: https://code.wireshark.org/review/12274
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-29 03:30:11 +00:00
Michael Mann cfc47c15c2 Replace my_dgt_tbcd_unpack with the safer tvb_bcd_dig_to_wmem_packet_str.
Bug: 11797
Change-Id: I07fdf3f7564424eac053f4c17de17f0d96597cca
Reviewed-on: https://code.wireshark.org/review/12239
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-29 00:02:49 +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
Alexis La Goutte df62a1b1e9 [GSM DTAP]: fix indent (use 4 spaces)
Change-Id: I07fd87b4e72ac7309e320deab963017c96ba2c60
Reviewed-on: https://code.wireshark.org/review/9215
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-29 14:05:46 +00:00
Anders 60ef92b9a5 [GSM DTAP] Add Sequence number for Non call related SS messages.
Change-Id: Iec97801e1eb6803c4168c2e302f84a7732654ecf
Reviewed-on: https://code.wireshark.org/review/9214
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-29 12:42:33 +00:00
Bill Meier 4c3677ef3b Replace tabs in files with editor modeline "expandtab"
Change-Id: I4667fd4091c510a4c798f79dae333a07dc42dad6
Reviewed-on: https://code.wireshark.org/review/8880
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-06-11 02:15:35 +00:00
Michael Mann e74cb413b4 Remove proto_tree_add_text from GSM dissectors.
Change-Id: I72a7c1a44bda7755d8b1376dd5e57c46f137ff31
Reviewed-on: https://code.wireshark.org/review/7870
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>
2015-04-01 04:40:38 +00:00
Mikhail Koreshkov 4db7c2d435 GSM_A: dissector table for User-To-User signalling
Add User-To-User (UUS) dissector table to be able further data processing.

Change-Id: I44cc32441072c643d19af53849cf5b53909b4889
Reviewed-on: https://code.wireshark.org/review/7857
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-31 04:09:00 +00:00
Mikhail Koreshkov df164dfc62 GSM_A-BCC: dissector for BCC Protocol
Added dissector for Broadcast call control protocol
(3GPP TS 44.069 version 11.0.0 Release 11)

Change-Id: I179801d30fc2d32d8c4187a92dd0b1c9709711c7
Reviewed-on: https://code.wireshark.org/review/7627
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-12 16:36:14 +00:00
Mikhail Koreshkov 1864deb0fa GSM_A-GCC: dissector for GCC Protocol
Added dissector for GSM-A GCC (Group Call Control) Protocol (GSM 04.68)

Change-Id: I46fafc3fd3eba674202f2c34932edf83a6d1d096
Reviewed-on: https://code.wireshark.org/review/7338
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-03 11:32:08 +00:00
Bill Meier 9c866ff971 Replace tabs by spaces when editor modelines has "expandtab"
Change-Id: If7a6f2697be732ae4f94ed8b845fd293c32510f7
Also: tabs-stops should be 8
Reviewed-on: https://code.wireshark.org/review/7100
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-13 17:34:53 +00:00
Michael Mann d1d5bf121e Replace proto_tree_add_text in dissector header files where it was used in a macro that should be expert info.
Change-Id: I045368a0a91586231fc4b1e2700c2275088b76af
Reviewed-on: https://code.wireshark.org/review/6244
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-02 22:11:34 +00:00
Martin Mathieson 48db2548a9 Deleting unneccessary #includes from dissectors.
Second batch (packet-eth.c -> packet-icmpv6.d).

Will look at cleaning up and committing script afterwards.

Change-Id: I14295758b81a59115d8c88899f166cc3d5d17594
Reviewed-on: https://code.wireshark.org/review/6013
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-23 12:22:54 +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
Bill Meier f412c9a01a Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...
(for some dissectors which fetch all other integral fields using
   ENC_BIG_ENDIAN).

Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56
Reviewed-on: https://code.wireshark.org/review/5748
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13 18:45:56 +00:00
Michael Mann a2c2f872f4 Remove the use of pinfo->private_data from dissectors that just save it to restore it.
Change-Id: I13197cc48068bb35ee12a7023cfe5f76bbc4e264
Reviewed-on: https://code.wireshark.org/review/5486
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-26 16:20:59 +00:00
Michael Mann ab8cad2816 Remove sccp_info member from packet_info structure.
sccp_msg_info_t* is now passed from SCCP dissector to its subdissectors through dissector data parameter.

Change-Id: Iab4aae58f8995e844f72e02e9f2de36e83589fc0
Reviewed-on: https://code.wireshark.org/review/5442
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-26 09:20:44 +00:00
Alexis La Goutte 232879a151 gsm a dtap: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ifbe59a51e5fa6158f9073402f1a1ab63df2dfa42
Reviewed-on: https://code.wireshark.org/review/5071
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-02 16:45:41 +00:00
AndersBroman d93be95fc0 Clean up handling of BDC coded numbers a bit.
Change-Id: Ic3d523664e3c78b4ed289b7e5acf3f53614c6d54
Reviewed-on: https://code.wireshark.org/review/5027
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-31 14:15:00 +00:00
Michael Mann f5ed47dbbc Eliminate proto_tree_add_text from packet-q933.c
Change-Id: If5b85609d3daaf66cbcc15e3127af4e7f5736e52
Reviewed-on: https://code.wireshark.org/review/4995
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-30 20:53:52 +00:00
Michael Mann 371e4ae1c7 Eliminate some proto_tree_add_text from GSM dissectors (so now there are no dissectors with 100+ proto_tree_add_text calls).
Add tfs_allocated_by_receiver_sender to tfs.h because it seems "popular" enough.

Change-Id: I478461d9b951a2c3e3aec6aaf996d95ba2c0feee
Reviewed-on: https://code.wireshark.org/review/4708
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-10-15 19:16:37 +00:00
Michael Mann a9e6c2c917 Overhaul the filterability of packet-ansi_683.c
It's (ab)use of proto_tree_add_text was "hidden" behind a single FT_NONE hf item, that effectively had the same behavior of proto_tree_add_text, but wouldn't show up in checkAPIs.pl.  Replaced the (over 200+) proto_tree_add_none_format calls with proto_tree_add_text and then ran convert_proto_tree_add_text.pl on the dissector.  That started the cleanup, and I did more while in the neighborhood.

Change-Id: I89e09cf23e8998bcc9197f9a4043e1fc2850fc8c
Reviewed-on: https://code.wireshark.org/review/4521
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-07 21:14:28 +00:00
Bill Meier facb76ad8f packet-gsm_a_dtap.c: various changes (mostly indentation/whitespace/formatting);
- Remove #include <epan/prefs.h> (no prefs);
- tvb_length() --> tvb_reported_length()
- Use '4 space' indentation;
- Use consistent whitespace formatting;
- Reformat hf[] entries for readability;

Change-Id: I4fd7e860efa795256972d6a31155f0502fb7dcfd
Reviewed-on: https://code.wireshark.org/review/3612
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-15 14:43:44 +00:00
Michael Mann fe4b7ee625 convert to proto_tree_add_subtree[_format]
Change-Id: If110de1e0555637264f86f1508858d569871a9c7
Reviewed-on: https://code.wireshark.org/review/2675
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29 13:10:02 +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 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
Evan Huus de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
Michael Mann 4e5424af52 packet-q931.c: proto_tree_add_text -> something filterable.
Change-Id: I576f8d7fcf01a4c1dc6e486f7dd0a5b46edce502
Reviewed-on: https://code.wireshark.org/review/1935
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-04 04:21:29 +00:00
Bill Meier 4fbcfc1289 (Benign) Don't use "address-of" operator on arg of VALS() (not that it makes any actual difference)..
Change-Id: I0766d0f130648aaa5a58d9f4062fa24e898cbdc3
Reviewed-on: https://code.wireshark.org/review/545
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-07 05:03:41 +00:00
Bill Meier 93fe4d53e2 Remove trailing whitespace.
Change-Id: Ia03a1cd4590aceda30ead4aa93ad413d90c6aea6
Reviewed-on: https://code.wireshark.org/review/372
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 16:36:38 +00:00
Pascal Quantin a8676c2fd7 Fix dissection of BCD numbers
Do not use of tvb_get_string(): what we really want is the byte string, not an ASCII string

Change-Id: I8b9a8b7ccacbdaf6d9525771ff8ed883ba01ad34
Reviewed-on: https://code.wireshark.org/review/329
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-02-23 22:41:45 +00:00
Pascal Quantin 6ebc058f47 Add proto_tree_add_ts_23_038_7bits_item() / tvb_get_ts_23_038_7bits_string() functions and update dissectors to use it.
Remove gsm_sms_char_7bit_unpack() / gsm_sms_chars_to_utf8() functions.
Update documentation a bit.

svn path=/trunk/; revision=54534
2014-01-01 14:33:19 +00:00
Alexis La Goutte 09e10bb331 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
svn path=/trunk/; revision=54415
2013-12-23 20:13:17 +00:00
Pascal Quantin f48dde1444 Fix a "'str' may be used uninitialized in this function" error
svn path=/trunk/; revision=54285
2013-12-20 08:33:18 +00:00
Pascal Quantin f390e381e7 Fix time dissection broken in r54274
svn path=/trunk/; revision=54282
2013-12-20 06:55:56 +00:00
Pascal Quantin 56fa8467cd Try to please Clang-Code-Analysis buildbot
svn path=/trunk/; revision=54278
2013-12-19 22:55:16 +00:00
Michael Mann 959a290961 proto_tree_add_text -> proto_tree_add_xxx conversion.
svn path=/trunk/; revision=54274
2013-12-19 21:51:09 +00:00