Commit Graph

42 Commits

Author SHA1 Message Date
Guy Harris 8195bdd340 Rename a bunch of things with "conversation".
A conversation in Wireshark might have two endpoints or might have no
endpoints; few if any have one endpoint.  Distinguish between
conversations and endpoints.
2022-08-25 20:02:20 -07:00
Alexis La Goutte 39ca9db96a aeron: Fix cppcheck warning about unread Variable 2022-07-31 06:59:49 +00:00
Alexis La Goutte 6b35ff22de aeron: Fix Clang Warnings
packet-aeron.c:652:18: warning: Array access (from variable 'addr_data') results in a null pointer dereference [core.NullDereference]
packet-aeron.c:658:17: warning: Array access (from variable 'addr_data') results in a null pointer dereference [core.NullDereference]
2022-07-31 06:59:49 +00:00
João Valverde 8efad466c4 Tools: Fix fix-encoding-args.pl ASCII string validation
Do not require a useless ENC_NA parameter for string encodings.
FT_STRING and FT_STRINGZ types don't have any ndianness.

Follow-up to 6ec429622c.
2022-02-15 11:38:16 +00:00
João Valverde 22ee2764a7 Replace g_snprintf() with snprintf() (dissectors)
Use macros from inttypes.h with format strings.
2021-12-19 20:25:11 +00:00
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
Guy Harris b446e36471 aeron: the Error String in an Error Header is not null-terminated.
The Aeron specification says nothing about it being null-terminated, and
in at least some captures, it's not null terminated.

Make it an FT_STRING, rather than an FT_STRINGZ.

Clean up a comment so that more of the URL is visible in a narrower
window.
2020-09-10 11:02:22 +00:00
Anders Broman ebf3d6dbf1 Try to fix -Wpointer-sign warnings.
Change-Id: I7ff23aeee13b8f42a2fa2e68db11fcfff9b0816e
Reviewed-on: https://code.wireshark.org/review/38141
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-12 12:12:25 +00:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +00: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
Jaap Keuter 8494ef903a AERON: Properly handle heartbeat frame length
The aeron hartbeat frame is a data frame with zero length. The rounded
length is used to report back consumed bytes. Set that to the real
length of a heartbeat frame, being 24.

Sample captures show trailing zero bytes after a heartbeat frame. Make
sure trailing zero bytes are not tested for additional frames.

CID 1439592

Change-Id: I99580179830b6de0886a1d57f994f4a9c5a1ae6d
Reviewed-on: https://code.wireshark.org/review/33243
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2019-05-25 13:28:06 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.

Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 04:03:38 +00:00
chaoyongzhou 0dafb2bf88 Aeron: Update disector on the latest aeron protocol specification
1, update frame fields and offset
2, shift heartbeat frame from data frame which is a special data frame
3, support rtt frame supported by aeron in java
4, revise data/pad frame length alignment to 32 bytes but not 8 bytes
5, remove frame length alignment from setup,nak,err,and rtt frame
6, fix rtt frame length
Bug: 15111
Change-Id: Ic627a9773850fa6bceacd313ddeba521487815e2
Reviewed-on: https://code.wireshark.org/review/29407
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-09-15 07:18:53 +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
Pascal Quantin 78ee8c419f Do not register proto_reg_handoff_XXX callback when not required
None of those protocols need to be notified of a preference change and
their proto_reg_handoff_XXX functions do not differentiate the initial
call from susequent ones, leading to an assert

Bug: 14157
Change-Id: Iac4d88ebef7688bced8daae857eb5c836a6babd6
Reviewed-on: https://code.wireshark.org/review/24211
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-02 14:57:50 +00:00
Michael Mann abfb644117 Add conversation endpoint type
For the moment this mirrors the port_type enumeration (PT_XXX), but the
intent is to move away from using "port types", eliminating most (if not
all)

Added conversation_pt_to_endpoint_type() so that conversations deal with the
correct enumeration.  This is for dissector that use pinfo->ptype as input
to conversation APIs.  Explicit use of port types are converted to using
ENDPOINT_XXX type.

Change-Id: Ia0bf553a3943b702c921f185407e03ce93ebf0ef
Reviewed-on: https://code.wireshark.org/review/24166
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-29 16:53:57 +00:00
João Valverde 90644c8372 Remove inet_aton() usage everywhere
Including where it says not to in comments. Use IPv4 dotted-decimal
notation.

Change-Id: Iafe1f6fbd2bd5867c41642dc27411f47dff8ce6a
Reviewed-on: https://code.wireshark.org/review/24044
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-25 19:10:57 +00:00
Michael Mann 577d21e35c GHashtable -> wmem_map conversions
Many of the register_init_routine/register_cleanup_routine functions
are for initializing and cleaning up a GHashtable.
wmem_map_new_autoreset can do that automatically, so convert many
of the simple cases.

Change-Id: I93e1f435845fd5a5e5286487e9f0092fae052f3e
Reviewed-on: https://code.wireshark.org/review/19912
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-02 13:46:03 +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
Jaap Keuter 1f90eab9c5 Expand before multiply (CID-1355683 and CID-1355684)
Cast the value before multiplication to prevent overflow.

Change-Id: I673e9e3e869e326ba3d23c3a2100e274e9dc7566
Reviewed-on: https://code.wireshark.org/review/14823
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2016-04-07 05:59:25 +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 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
João Valverde 2e85975fee Just #include wsutil/inet_aton.h
No need for platform-specific system header boilerplate.

Change-Id: I5387a0005ddb0d7aab3c5b9f28d6282053c1b0fd
Reviewed-on: https://code.wireshark.org/review/13865
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-13 23:51:53 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Martin Kaiser 8cabf5be59 [aeron] don't THROW() an exception from a dissector
in the functions that dissect specific messages, we can just return 0

add a return value to aeron_frame_stream_analysis_setup() and
pass it on to the callers to allow for a clean exit

Change-Id: Iab4dee38112e32ca36822abc49d27dfe9e4c9ef7
Reviewed-on: https://code.wireshark.org/review/13147
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-01-12 11:59:23 +00:00
Martin Kaiser 2a801b4829 [aeron] simplify aeron_frame_info_setup()
exit straight away if the packet was already processed or if we're
missing some data
avoid nested if clauses that make the code hard to read

Change-Id: Ied6d575f9498ab98623cd862a9d4b9dd8ad7e0b4
Reviewed-on: https://code.wireshark.org/review/13146
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-01-09 15:01:55 +00:00
Guy Harris 31956f98d0 Don't throw away constness.
Change-Id: Ia0b014c3d9e4fcaa6f81cdb23dc76f9d384b782b
Reviewed-on: https://code.wireshark.org/review/12963
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-31 20:55:39 +00:00
Guy Harris 1ea011b891 Use wmem_memdup() instead of wmem_alloc() followed by memcpy().
Change-Id: Ia937fe15a371a3109178ba619dbdb3a6db3897ee
Reviewed-on: https://code.wireshark.org/review/12962
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-31 20:52:24 +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
Matthieu Coudron c2afc9edec Change prototype of callbacks passed to wmem_tree_foreach so that they
accept the node key as a first parameter.

wmem_tree accepts all sort of keys (strings, integers, soon ranges),
thus it is of interest for various purposes (testing, greedy search) to
know the key of the node.

Change-Id: Ie748b917bef91f0b1ba8cce15bd1b471922641dc
Reviewed-on: https://code.wireshark.org/review/11683
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-11 00:22:37 +00:00
João Valverde 3df2333155 Remaining ADDRESS macro to address function conversions
Change-Id: I8bc9af431e70243b05f4f0ce8c2b8ee451383788
Reviewed-on: https://code.wireshark.org/review/11463
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-11-03 12:20:34 +00:00
Martin Kaiser 3ea14493e7 [aeron] a new-style dissector should return 0 (not -1) to reject a packet
we shouldn't throw an exception before we know that the packet
contains our protocol

Change-Id: Ic58cb985775766a18e9086fe52096e3290674515
Reviewed-on: https://code.wireshark.org/review/11248
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-10-24 23:59:33 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.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>
2015-10-22 11:45:56 +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
Guy Harris 80efc53b05 Quick and dirty overflow checking.
We really need a better way to handle packet offset overflows.

Change-Id: I6e476f7bc6ddac2c5515c4e09192d88f528ea091
Reviewed-on: https://code.wireshark.org/review/9194
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-27 22:30:12 +00:00
Bill Meier 2391fe5731 [aeron] Remove unneeded initializers
Change-Id: Ifa129c221b5df9120a0c475edc2109775f84ae35
Reviewed-on: https://code.wireshark.org/review/8974
Petri-Dish: Bill Meier <wmeier@newsguy.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-06-18 13:32:06 +00:00
David Ameiss 905506fd98 Cleanup and hardening for the Aeron dissector.
Change-Id: Iee544315401784b097ab05e6de5e5c950b622c80
Reviewed-on: https://code.wireshark.org/review/8877
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-12 20:36:07 +00:00
Evan Huus 0f36b1c394 aeron: fix infinite loop
`dissected_length` can come from the packet in some paths, meaning it can be 0
or negative and we need to check for underflows and other such problems

Bug: 11255
Change-Id: Iba55ec1824a391ec1c717bfea5b65cc6610fc081
Reviewed-on: https://code.wireshark.org/review/8839
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
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: Evan Huus <eapache@gmail.com>
2015-06-08 18:32:30 +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
David Ameiss 509eb46981 Add dissector for the Aeron protocol.
Bug: 11164

Change-Id: I7ed6a3fd18aaadfc9b7b9619b1035206e86f46d6
Reviewed-on: https://code.wireshark.org/review/8240
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-05 05:28:27 +00:00