Commit Graph

16 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
João Valverde b054f9aee6 ASN1: Convert I/O from GLib to stdio.h 2021-12-17 19:34:54 +00:00
Evan Huus 6caf24e966 tvblist: explicitly scope memory
Allocate the root node in the same pool as the list itself, and make
that pool explicit so we can pass the pinfo scope instead of using the
global packet pool.
2021-09-08 01:37:07 +00:00
Evan Huus eda26f9e5f wmem: convert more asn1 dissectors to pinfo->pool
We prefer pinfo->pool over the global wmem_packet_scope() now. Convert a
few more asn1 dissectors. After this commit, just three asn1 dissectors
remain.
2021-08-19 15:07:44 +00:00
Evan Huus e69446aa55 asn1: convert most dissectors to pinfo->pool
Part 1/2 as the commits were too big for CI.

Largely find/replace, with a few manual tweaks. Then regenerate the asn1
dissector sources and make sure everything still builds. There are a
handful of cases I skipped as too complex, but this covers most of the
asn1 dissectors.
2021-07-26 15:30:11 +00:00
Guy Harris 57a1514ac7 Cast away the return value of g_strlcpy() and g_strlcat().
Most of the time, the return value tells us nothing useful, as we've
already decided that we're perfectly willing to live with string
truncation.  Hopefully this keeps Coverity from whining that those
routines could return an error code (NARRATOR: They don't) and thus that
we're ignoring the possibility of failure (as indicated, we've already
decided that we can live with string truncation, so truncation is *NOT*
a failure).
2021-04-30 03:19:19 -07:00
Anders Broman 4735eddfef Fix duplicated filter names 2020-12-16 12:58:38 +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
Guy Harris 7eb3e47fa4 Try to squeeze some bytes out of the frame_data structure.
Make the time stamp precision a 4-bit bitfield, so, when combined with
the other bitfields, we have 32 bits.  That means we put the flags at
the same structure level as the time stamp precision, so they can be
combined; that gets rid of an extra "flags." for references to the flags.

Put the two pointers next to each other, and after a multiple of 8 bytes
worth of other fields, so that there's no padding before or between them.

It's still not down to 64 bytes, which is the next lower power of 2, so
there's more work to do.

Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe
Reviewed-on: https://code.wireshark.org/review/31213
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-27 04:34:29 +00:00
Gerald Combs d0d15ef5df Avoid ASN.1 frame.protocols duplication.
Some of the ASN.1 dissectors process their data indirectly through
dissector tables. Add dissector_try_string_new so that they can do so
without appending duplicate entries to frame.protocols.

Change-Id: If9e12d81f9d0cc5b3bf19816e675a0fb79d904a6
Reviewed-on: https://code.wireshark.org/review/24886
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-19 21:03:04 +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
Guy Harris 7cd6906056 Rename tvb_new_subset() to tvb_new_subset_length_caplen().
This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-10 06:19:37 +00:00
Pascal Quantin 22257e8cf5 p_XXX_proto_data: only allow the use of pinfo and file scopes
Those are the only ones meaningful. Let's convert the buggy dissectors
and add an assert to avoid the misuse of the pool parameter in the future

Change-Id: I65f470b757f163f11a25cd352ffe168d1f8a86d3
Reviewed-on: https://code.wireshark.org/review/17748
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-09-17 15:46:36 +00:00
Guy Harris 6d8261994b Don't snprintf() into a string with one of the arguments being the same string.
That doesn't work - you could be writing into the string from which
you're reading.

Bug: 12700
Change-Id: I70f3ce6048dea582ec5e08c24c99e9a553b352df
Reviewed-on: https://code.wireshark.org/review/16850
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-03 03:29:51 +00:00
Michael Mann 21007dc546 H225: Replace globals that track packet data with p_add_proto_data/p_get_proto_data.
Change-Id: I0380151fb0f45063b81bc55dd5b8dc4add99ad30
Reviewed-on: https://code.wireshark.org/review/15794
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-06-12 01:15:07 +00:00
João Valverde 54a520d4a1 Move /asn1 to /epan/dissectors
Change-Id: I1208fe3c2ba428995526f561e8f792b8d871e9a9
Reviewed-on: https://code.wireshark.org/review/14388
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: João Valverde <j@v6e.pt>
2016-03-13 21:30:24 +00:00