Commit Graph

28 Commits

Author SHA1 Message Date
Martin Mathieson 19ec126687 check_typed_item_calls.py - Find all (but 3) items from calls. 2022-01-29 15:54:19 +00:00
João Valverde a0d5bd67e6 GIF: Convert to old proto tree API
Related with #17774.
2021-12-09 10:31:55 +00:00
Evan Huus d6d7dd1e56 First pass pinfo->pool conversion
Automated find/replace of wmem_packet_scope() with pinfo->pool in all
files where it didn't cause a build failure.

I also tweaked a few of the docs which got caught up.
2021-07-21 05:38:29 +00:00
Guy Harris df53c21cab Move some variables inside the block where they're used.
They're not used outside a block, so move them inside the block.  Also,
they're set before they're used, so don't initialize them when they're
declared.

This should squelch some unreadVariable warnings from cppcheck.
2021-01-20 19:09:51 -08: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
Joerg Mayer b9e8b7cb24 When using the NEW_PROTO_TREE_API, the proto_tree_add... functions are
"redefined" to handle the same way as before.

In dissectors using the new API, add all currently used proto_tree_add_xxx
functions to the list of functions that take care of NEW_PROTO_TREE_API changes.

Modify the dissectors that worked around the missing change.

Change-Id: Ib6d6ec2c225d96c98c2a8f507648d7ad4bfb6c68
Reviewed-on: https://code.wireshark.org/review/28002
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-06-04 20:33:36 +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
Martin Kaiser c299afe0e3 gif: expert info for unknown data block type
Before this patch, the dissector would assume that any data block type
that is unknown must be the trailer byte. Check explicitly if we have a
trailer byte and bring up an expert info for unknown data block types.

Change-Id: I4c3087eb403e2e668a22628062edd0240309a2bc
Reviewed-on: https://code.wireshark.org/review/21790
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-29 23:58:02 +00:00
Martin Kaiser 0b060e6fcd gif: simplify the dissection code
Increment offset as we go through the file.

Add a function to dissect a sequence of data blocks. Call this function
for extension blocks and images.

Change-Id: If156cb9cd4fe4ba6fdd3780c93087f2dd2ae8bf5
Reviewed-on: https://code.wireshark.org/review/21547
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-13 14:04:55 +00:00
Martin Kaiser 0eaeb99f06 gif: make data block an FT_UINT_BYTES entry
The length byte is now highlighted along with the actual data.

Change-Id: I93ce25ad2cd7c790cc23668d354e32c4f5e195c6
Reviewed-on: https://code.wireshark.org/review/21610
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-12 12:08:15 +00:00
Martin Kaiser 2229665d48 gif: fix the version detection
tvb_strneql() returns 0 if the two strings are equal.
Thanks to Ahmad Fatoum for reporting this bug.

Change-Id: Id6cde56623e18fe0a28f37b108dc1848cc58e1c3
Reviewed-on: https://code.wireshark.org/review/21554
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07 21:02:57 +00:00
Martin Kaiser 6a040b525c gif: start cleaning up the dissection code
Remove the global if(tree). We should not throw exceptions under if
(tree). Buf we may get exceptions while parsing the gif file.

Process the version string once as we go through the file. (Ok, we
already had to look at it to figure out that we have a gif file.)

Use tvb_reported_length_remaining() in the main loop.

Change-Id: Ie00594eebffc715676ffd5df8cbf7d43034aa68d
Reviewed-on: https://code.wireshark.org/review/21545
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07 20:34:51 +00:00
Martin Kaiser d0e317d69e gif: refactor the detection of a gif file
Generally, we should not throw an exception before we know that this is
our file/packet. Use tvb_strneql() to get the version string. This
function does not throw an exception if there are fewer bytes left than
we requested.

(I know that we check for reported len < 20. However, for captured
length > 6 and reported length < 20, the current code does not work.)

Change-Id: I5214c5c9dc9da616a94ae96269ec1c9e6f412e8e
Reviewed-on: https://code.wireshark.org/review/21544
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07 18:18:26 +00:00
Martin Kaiser 8657646e0b gif: remove pointless coments, unused debug macro
Change-Id: Id4ac23a7e5164e40ddc0ee22ddb62f7121b74ad9
Reviewed-on: https://code.wireshark.org/review/21543
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07 15:34:23 +00:00
Martin Kaiser 47b1a98f09 gif: (trivial) fix a typo
The trailer byte is 0x3b, not 0xb3.

Change-Id: I9b2d21f369957fc0c4eb5ff376c4aa7fbdc28c9e
Reviewed-on: https://code.wireshark.org/review/21542
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07 15:34:06 +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 ff9f9fc431 Don't include "file.h" if you don't need it.
It ends up dragging in libwireshark headers, which programs not linking
with libwireshark shouldn't do.  In particular, including
<epan/address.h> causes some functions that refer to libwireshark
functions to be defined if the compiler doesn't handle "static inline"
the way GCC does, and you end up requiring libwireshark even though you
shouldn't require it.

Move plurality() to wsutil/str_util.h, so that non-libwireshark code can
get it without include epan/packet.h.  Fix includes as necessary.

Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3
Reviewed-on: https://code.wireshark.org/review/11545
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04 08:46:30 +00:00
Michael Mann 21e5a950ad Remove all preferences related to enabling/disabling heuristic dissectors.
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector.

Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled.

Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22
Reviewed-on: https://code.wireshark.org/review/9610
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17 17:12:22 +00:00
Michael Mann be7d295fbf Add "user presentable" and "unique string ids" to heuristic table entries.
This allows better presentation of heuristic dissectors to the end user.

Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6
Reviewed-on: https://code.wireshark.org/review/9602
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12 03:14:38 +00:00
Martin Mathieson 596669f921 First batch of unincludes. Last attempt...
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9
Reviewed-on: https://code.wireshark.org/review/5997
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-22 21:03:13 +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 e2bdfa101b Reformat hfi entries; Add editor modelines; Adjust whitespace.
Change-Id: Iead53f92cc847d04c32f4a307d45f9748c49a69c
Reviewed-on: https://code.wireshark.org/review/4483
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-05 20:18:30 +00:00
Pascal Quantin 214b127d1e GIF: add a missing hf registration
Change-Id: Ib90054ef8a87f40249f644e8c7065b755419a11c
Reviewed-on: https://code.wireshark.org/review/4396
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-01 05:56:35 +00:00
Michael Mann 6fad7d19e7 Eliminate proto_tree_add_text from some dissectors.
Some other related cleanup.

Change-Id: I45f54032aa8318858f4ee784945b6f2ed163b6ea
Reviewed-on: https://code.wireshark.org/review/4328
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-09-27 15:44:53 +00:00
Michael Mann f5e2b4293d convert to proto_tree_add_subtree[_format]
Change-Id: I358bfaa4e5d40cd01b766f614f8bd0dbaf611dd0
Reviewed-on: https://code.wireshark.org/review/2508
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 14:34:17 +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
Martin Kaiser 622d259afc the gif version string is 7bit ASCII
Change-Id: I1e827ad4d2cf64411c5a87f4710235dc4d6efc35
Reviewed-on: https://code.wireshark.org/review/250
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-02-18 22:35:25 +00:00
Michal Labedzki 2c28c5d93f MIME: Rename image dissectors to file dissectors.
Change-Id: Ie160733ceeed23ff96ddccfbf0ca2e7694789ff8
2014-01-29 23:17:33 +01:00