Commit Graph

29 Commits

Author SHA1 Message Date
Evan Huus 8ee8808876 First pass pinfo->pool conversion, part 2
Automated find/replace of wmem_packet_scope() with pinfo->pool in all
files where it didn't cause a build failure.
2021-07-21 09:54:57 -04:00
Guy Harris 25a254823f wsutil: add a header that defines some "round to power of 2" macros.
Add macros to round to multiples of 2, 4, 8, 16, and 32.

Use them instead of independently defined macros.

(We don't define a general "round to a power of 2" macro to avoid the
risk of somebody passing something other than a power of 2 to it.)
2021-06-16 02:01:23 -07:00
Martin Mathieson 4a4e50992a More spelling fixes, start of second pass of dissectors.
Now easier to find errors due to script improvements and more complete
dictionary file.
2020-08-30 22:34:34 +01:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Peter Wu 7dfaec969e alljoyn: fix signature length adjustments
Ensure that the signature pointer and length always matches, otherwise a
buffer overrun (read) is possible.

Tested with the original captures from bug 12953, the PDML output is
still the same while the fuzzed capture does not crash anymore.

Bug: 12953
Change-Id: I8843a5daf98a79fb19906e824326cdf619164484
Reviewed-on: https://code.wireshark.org/review/18347
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-10-22 11:06:37 +00:00
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
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-10-13 02:51:18 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for
a (TCP) port, but the underlying data is actually part of Decode As functionality.
For now the APIs are intentionally separate from the regular APIs that register a
dissector within a dissector table.  It may be possible to eventually combine the
two so that all dissectors that register with a dissector table have an opportunity
to "automatically" have a preference to adjust the "table value" through the
preferences dialog.

The tcp.port dissector table was used as the guinea pig.  This will eventually be
expanded to other dissector tables as well (most notably UDP ports).  Some
dissectors that "shared" a TCP/UDP port preference were also converted. It also
removed the need for some preference callback functions (mostly when the callback
function was the proto_reg_handoff function) so there is cleanup around that.

Dissectors that has a port preference whose default was 0 were switched to using
the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference

Also added comments for TCP ports used that aren't IANA registered.

Change-Id: I99604f95d426ad345f4b494598d94178b886eb67
Reviewed-on: https://code.wireshark.org/review/17724
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08 02:44:53 +00:00
Guy Harris d7fe514fc0 Improve support for single-character fields and filter expressions.
Add an FT_CHAR type, which is like FT_UINT8 except that the value is
displayed as a C-style character constant.

Allow use of C-style character constants in filter expressions; they can
be used in comparisons with all integral types, and in "contains"
operators.

Use that type for some fields that appear (based on the way they're
displayed, or on the use of C-style character constants in their
value_string tables) to be 1-byte characters rather than 8-bit numbers.

Change-Id: I39a9f0dda0bd7f4fa02a9ca8373216206f4d7135
Reviewed-on: https://code.wireshark.org/review/17787
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-19 02:51:13 +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
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
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: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +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
Pascal Quantin 40caff2d1f AllJoyn: prevent an infinite loop
Display an expert error when the argument is empty

Bug: 11607
Change-Id: I8682eab8fe1822f784e848220ff90de4eb5e13ff
Reviewed-on: https://code.wireshark.org/review/11132
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>
2015-10-19 03:03:54 +00:00
Evan Huus 9c2b593dc8 alljoyn: more robust signature handling
There were two bugs in the handling of all-joyn struct signatures:
 - we were advancing the pointer without decrementing the length remaining
 - we were not checking for the string's null-terminator (which is only
   necessary if the string is malformed, but that's entirely possible)

Bug: 11028
Change-Id: I38b98cf3f43681f709846e3cb9068d20c4fdce82
Reviewed-on: https://code.wireshark.org/review/7552
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: Michael Mann <mmann78@netscape.net>
2015-03-06 12:15:27 +00:00
Gerald Combs 3f765b3ef9 Add a CF_FUNC macro for casting BASE_CUSTOM functions.
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid
the following warning:

    warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic]

We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be
more consistent with the other macros in proto.h. Update each instance
of BASE_CUSTOM to use CF_FUNC.

Adjust a dummy variable name generated by asn2wrs.py that was triggering
an invalid error in checkhf.pl.

Fix an encoding arguement in packet-elasticsearch.c found by
fix-encoding-args.pl.

Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22
Reviewed-on: https://code.wireshark.org/review/7150
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-18 00:05:38 +00:00
Joseph Huffman 0f426d6f01 Improved handling of ARDP fragmented packets.
With the AllJoyn Reliable Datagram Protocol large packets are fragmented in
a way that Wireshark doesn't desegment. The AllJoyn dissector now detects
this situation and reports things to the user in a manner which indicates
things are behaving normally rather than an error condition.

Change-Id: I1f2aa722b6e0d1ed3572ff332b4dd8c0e5c5a765
Signed-off-by: Joseph Huffman <jhuffman@codeaurora.org>
Reviewed-on: https://code.wireshark.org/review/6344
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>
2015-01-07 02:50:36 +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 d643325d28 alljoyn: Rename some filters; Fix some filter types.
Details:
 - Rename various "alljoyn.header..." display filter
    names releated to the alljoyn "message header"
    to "alljoyn.mess_header..." to distinguish
    the fields from actual alljoyn "header" fields.
    This also fixes the duplicate use of the display
    filter name "alljoyn.header".
 - Don't use FT_PROTOCOL for a field type.

Change-Id: Id4e78f36716cf6064638aecd5faf561bcbc88b46
Reviewed-on: https://code.wireshark.org/review/5561
Petri-Dish: Bill Meier <wmeier@newsguy.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Joe Huffman <jhuffman@codeaurora.org>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-02 02:27:00 +00:00
Alexis La Goutte 2418d063ef AllJoyn: fix warning: no previous prototype for 'add_padding_item' [-Wmissing-prototypes]
Change-Id: Id18ac125390efa22638845083f7d0d5eaf71cb97
Reviewed-on: https://code.wireshark.org/review/4955
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-10-28 01:25:36 +00:00
Joseph Huffman 6e5784d88a Added support for AllJoyn Reliable Datagram Protocol.
Change-Id: I3ec37d7aec0c51f9bd0791c8fa0c5ef3dabc9fbf
Signed-off-by: Joseph Huffman <jhuffman@qce.qualcomm.com>
Reviewed-on: https://code.wireshark.org/review/4414
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: Michael Mann <mmann78@netscape.net>
2014-10-26 00:20:26 +00:00
Joseph Huffman 8cc7b0d6cf Fixed missing padding. Fixed ENC_NA/ENC_BIG_ENDIAN errors.
There was no tree items for padding in the many instances where there were
bytes added to make certain data types align on even boundaries of 2, 4, or
8 bytes. These instances now show up as "Padding" in the display.

There were many instances where ENC_NA was used for fields of more than one
byte. This wasn't noticed before because ENC_NA was ENC_BIG_ENDIAN for
historical reasons and all these fields are big endian fields.

Change-Id: Iabadd46eacc9ceb8ca85f4a5ba42b6583375c5f0
Signed-off-by: Joseph Huffman <jhuffman@codeaurora.org>
Reviewed-on: https://code.wireshark.org/review/4413
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-13 10:37:09 +00:00
Bill Meier 18d72987cb Do encoding-arg changes (all benign)
For:
- FT_BYTES: Always use just ENC_NA
- integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN

Also:
- FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...)
- Change one case of incorrect '||' to '|'

Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0
Reviewed-on: https://code.wireshark.org/review/4184
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-19 01:38:08 +00:00
Joseph Huffman 84629f43cb AJTOOLS-4 Data field not being parsed properly by WireShark plugin if two or more AllJoyn Messages are combined in single TCP packet.
Fixed bugs where multiple messages are combined in a single packet.
Fixed bugs where a single message is distributed across multiple packets.
Fixed bug where arrays of zero length were not dissected properly.

Change-Id: Icfb83e73519d8217d6c477edf531ba6d3f3dcd48
Reviewed-on: https://code.wireshark.org/review/4159
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-18 04:21:19 +00:00
Bill Meier 72527a49b1 Define a function as 'static' (Fixes [-Wmissing-prototypes] warning).
Change-Id: Ia0a5c05c953053691837c5795c8204e2144d8067
Reviewed-on: https://code.wireshark.org/review/1241
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-21 18:04:11 +00:00
Bill Meier 48c77d8710 Fix some bugs; Do more cleanup;
Bugs fixed:
- DISSECTOR_BUG (reported by proto.c) when displaying "Parameters"
   (Apparently introduced in I8de7a19 (gc538b44))
- Incorrect byte pane highlighting for ARG_ARRAY container type
   (In dissector code as originally committed)
- "uint32uint32" should be "uint32" in packet details.
   (In dissector code as originally committed)

Cleanup:
- Remove unneeded #includes;
- Simplify some code;
- Remove unneeded initializers;
- Fix: "warning: no previous prototype...[-Wmissing-prototypes]"
- Reformat hf[] array entries;
- Fix some spelling;
- Do indentation, whitespace & formatting style changes.

Change-Id: If1f488f10ba83b27f75a1f71cf4bce7d5279e87c
Reviewed-on: https://code.wireshark.org/review/1238
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-04-21 16:47:24 +00:00
Martin Kaiser da055b8f52 remove unused variable 'tree'
Change-Id: Icd39b32aa61fd9fc39c7a15d22134350582b9de6
Reviewed-on: https://code.wireshark.org/review/1160
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-15 21:22:12 +00:00
Michael Mann c538b4498b Cleanup Alljoyn dissector.
Change-Id: I8de7a196ad068506f8e7312021879d20be4063d2
Reviewed-on: https://code.wireshark.org/review/1156
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Joe Huffman <jhuffman@codeaurora.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-15 21:16:28 +00:00
Michael Mann 1279068c1d Fix check*.pl errors
Change-Id: Id0526cd9b6b724a8f125574507f9ce6302db540d
Reviewed-on: https://code.wireshark.org/review/1129
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-15 18:44:09 +00:00
Joseph Huffman fad0aa0382 Addition of AllJoyn packet dissector. Bug 9361
Change-Id: Ia582732ee27ce9c1e4280afef5a6b3e3be959d23
Reviewed-on: https://code.wireshark.org/review/1127
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-14 17:57:02 +00:00